; LLVM IR from neondatabase-labs/pg_embedding :: hnswalg/Z23getNeighborsByHeuristicP12HnswMetadataRSt14priority_queueISt4pairIfjES_3502e8ce (07675a1f)

; 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::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.std::pair" = type { float, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23getNeighborsByHeuristicP12HnswMetadataRSt14priority_queueISt4pairIfjESt6vectorIS3_SaIS3_EESt4lessIS3_EEm(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(25) %1, i64 noundef %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::priority_queue", align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca float, align 4
  %14 = alloca i8, align 1
  %15 = alloca ptr, align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca float, align 4
  %23 = alloca ptr, align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %28)
  %30 = load i64, ptr %6, align 8, !tbaa !9
  %31 = icmp ult i64 %29, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %3
  br label %177

33:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #7
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  call void @_ZNSt6vectorISt4pairIfjESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  br label %34

34:                                               ; preds = %52, %33
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = invoke noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %35)
          to label %37 unwind label %53

37:                                               ; preds = %34
  %38 = icmp ugt i64 %36, 0
  br i1 %38, label %39, label %61

39:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %40)
          to label %42 unwind label %57

42:                                               ; preds = %39
  %43 = getelementptr inbounds %"struct.std::pair", ptr %41, i32 0, i32 0
  %44 = load float, ptr %43, align 4, !tbaa !11
  %45 = fneg float %44
  store float %45, ptr %11, align 4, !tbaa !15
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %46)
          to label %48 unwind label %57

48:                                               ; preds = %42
  %49 = getelementptr inbounds %"struct.std::pair", ptr %47, i32 0, i32 1
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJfRKjEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %7, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %49)
          to label %50 unwind label %57

50:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %51)
          to label %52 unwind label %53

52:                                               ; preds = %50
  br label %34, !llvm.loop !16

53:                                               ; preds = %62, %50, %34
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %9, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %10, align 4
  br label %178

57:                                               ; preds = %48, %42, %39
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %9, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %178

61:                                               ; preds = %37
  br label %62

62:                                               ; preds = %148, %61
  %63 = invoke noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
          to label %64 unwind label %53

64:                                               ; preds = %62
  %65 = icmp ne i64 %63, 0
  br i1 %65, label %66, label %152

66:                                               ; preds = %64
  %67 = call noundef i64 @_ZNKSt6vectorISt4pairIfjESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  %68 = load i64, ptr %6, align 8, !tbaa !9
  %69 = icmp uge i64 %67, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %66
  br label %152

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %72 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
          to label %73 unwind label %87

73:                                               ; preds = %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %72, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %74 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %75 = load float, ptr %74, align 4, !tbaa !11
  %76 = fneg float %75
  store float %76, ptr %13, align 4, !tbaa !15
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
          to label %77 unwind label %91

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  store i8 1, ptr %14, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store ptr %8, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = call ptr @_ZNSt6vectorISt4pairIfjESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %78) #7
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %79, ptr %80, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = call ptr @_ZNSt6vectorISt4pairIfjESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #7
  %83 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %82, ptr %83, align 8
  br label %84

84:                                               ; preds = %135, %77
  %85 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIfjESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br i1 %85, label %95, label %86

86:                                               ; preds = %84
  store i32 6, ptr %18, align 4
  br label %138

87:                                               ; preds = %71
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %9, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %10, align 4
  br label %151

91:                                               ; preds = %73
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %9, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %10, align 4
  br label %150

95:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfjESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %96, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !20
  %100 = invoke zeroext i1 @hnsw_begin_read(ptr noundef %97, i32 noundef %99, ptr noundef null, ptr noundef %21, ptr noundef null)
          to label %101 unwind label %120

101:                                              ; preds = %95
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 1
  %104 = load i32, ptr %103, align 4, !tbaa !20
  %105 = invoke zeroext i1 @hnsw_begin_read(ptr noundef %102, i32 noundef %104, ptr noundef null, ptr noundef %20, ptr noundef null)
          to label %106 unwind label %120

106:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = load ptr, ptr %21, align 8, !tbaa !5
  %109 = load ptr, ptr %20, align 8, !tbaa !5
  %110 = invoke noundef float @_Z14calc_dist_funcP12HnswMetadataPKfS2_(ptr noundef %107, ptr noundef %108, ptr noundef %109)
          to label %111 unwind label %124

111:                                              ; preds = %106
  store float %110, ptr %22, align 4, !tbaa !15
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @hnsw_end_read(ptr noundef %112)
          to label %113 unwind label %124

113:                                              ; preds = %111
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @hnsw_end_read(ptr noundef %114)
          to label %115 unwind label %124

115:                                              ; preds = %113
  %116 = load float, ptr %22, align 4, !tbaa !15
  %117 = load float, ptr %13, align 4, !tbaa !15
  %118 = fcmp olt float %116, %117
  br i1 %118, label %119, label %128

119:                                              ; preds = %115
  store i8 0, ptr %14, align 1, !tbaa !18
  store i32 6, ptr %18, align 4
  br label %129

120:                                              ; preds = %101, %95
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %9, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %10, align 4
  br label %137

124:                                              ; preds = %113, %111, %106
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %9, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %137

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

129:                                              ; preds = %128, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  %130 = load i32, ptr %18, align 4
  switch i32 %130, label %132 [
    i32 0, label %131
  ]

131:                                              ; preds = %129
  store i32 0, ptr %18, align 4
  br label %132

132:                                              ; preds = %131, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  %133 = load i32, ptr %18, align 4
  switch i32 %133, label %138 [
    i32 0, label %134
  ]

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIfjESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  br label %84

137:                                              ; preds = %124, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %149

138:                                              ; preds = %132, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %139

139:                                              ; preds = %138
  %140 = load i8, ptr %14, align 1, !tbaa !18, !range !21, !noundef !22
  %141 = trunc i8 %140 to i1
  br i1 %141, label %142, label %148

142:                                              ; preds = %139
  invoke void @_ZNSt6vectorISt4pairIfjESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %143 unwind label %144

143:                                              ; preds = %142
  br label %148

144:                                              ; preds = %142
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %9, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %10, align 4
  br label %149

148:                                              ; preds = %143, %139
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %62, !llvm.loop !23

149:                                              ; preds = %144, %137
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  br label %150

150:                                              ; preds = %149, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %151

151:                                              ; preds = %150, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %178

152:                                              ; preds = %70, %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store ptr %8, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %153 = load ptr, ptr %23, align 8, !tbaa !5
  %154 = call ptr @_ZNSt6vectorISt4pairIfjESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %153) #7
  %155 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %154, ptr %155, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %156 = load ptr, ptr %23, align 8, !tbaa !5
  %157 = call ptr @_ZNSt6vectorISt4pairIfjESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #7
  %158 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %157, ptr %158, align 8
  br label %159

159:                                              ; preds = %170, %152
  %160 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIfjESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  br i1 %160, label %162, label %161

161:                                              ; preds = %159
  store i32 8, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %176

162:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %163 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfjESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %163, i64 8, i1 false)
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %165 = getelementptr inbounds %"struct.std::pair", ptr %26, i32 0, i32 0
  %166 = load float, ptr %165, align 4, !tbaa !11
  %167 = fneg float %166
  store float %167, ptr %27, align 4, !tbaa !15
  %168 = getelementptr inbounds %"struct.std::pair", ptr %26, i32 0, i32 1
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJfRjEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %164, ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 4 dereferenceable(4) %168)
          to label %169 unwind label %172

169:                                              ; preds = %162
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %170

170:                                              ; preds = %169
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIfjESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #7
  br label %159

172:                                              ; preds = %162
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %9, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %178

176:                                              ; preds = %161
  call void @_ZNSt6vectorISt4pairIfjESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br label %177

177:                                              ; preds = %176, %32
  ret void

178:                                              ; preds = %172, %151, %57, %53
  call void @_ZNSt6vectorISt4pairIfjESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %9, align 8
  %181 = load i32, ptr %10, align 4
  %182 = insertvalue { ptr, i32 } poison, ptr %180, 0
  %183 = insertvalue { ptr, i32 } %182, i32 %181, 1
  resume { ptr, i32 } %183
}

; 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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJfRKjEEEvDpOT_(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 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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

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

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

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

declare void @hnsw_end_read(ptr noundef) #5

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

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

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIfjESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 #4 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { 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 #7 = { 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, !13, i64 0}
!12 = !{!"_ZTSSt4pairIfjE", !13, i64 0, !14, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!12, !14, i64 4}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !17}


; 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::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.std::pair" = type { float, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23getNeighborsByHeuristicP12HnswMetadataRSt14priority_queueISt4pairIfjESt6vectorIS3_SaIS3_EESt4lessIS3_EEm(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(25) %1, i64 noundef %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::priority_queue", align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca float, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca float, align 4
  %16 = tail call noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %17 = icmp ult i64 %16, %2
  br i1 %17, label %90, label %18

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorISt4pairIfjESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %19

19:                                               ; preds = %29, %18
  %20 = call noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %.not = icmp eq i64 %20, 0
  br i1 %.not, label %.preheader, label %23

.preheader:                                       ; preds = %19
  %21 = call noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  %.not3344 = icmp eq i64 %21, 0
  br i1 %.not3344, label %._crit_edge, label %.lr.ph45

.lr.ph45:                                         ; preds = %.preheader
  %22 = getelementptr inbounds i8, ptr %7, i64 4
  br label %34

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %25 = load float, ptr %24, align 4, !tbaa !5
  %26 = fneg float %25
  store float %26, ptr %6, align 4, !tbaa !11
  %27 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %28 = getelementptr inbounds i8, ptr %27, i64 4
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJfRKjEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %28)
          to label %29 unwind label %32

29:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
          to label %19 unwind label %30, !llvm.loop !12

30:                                               ; preds = %29
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %91

32:                                               ; preds = %23
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %91

34:                                               ; preds = %.lr.ph45, %72
  %35 = call noundef i64 @_ZNKSt6vectorISt4pairIfjESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %.not34 = icmp ult i64 %35, %2
  br i1 %.not34, label %36, label %._crit_edge

36:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %37 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  %38 = load i64, ptr %37, align 4
  store i64 %38, ptr %7, align 8
  %39 = trunc i64 %38 to i32
  %40 = bitcast i32 %39 to float
  %41 = fneg float %40
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %42 unwind label %46

42:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %43 = call ptr @_ZNSt6vectorISt4pairIfjESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  store ptr %43, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %44 = call ptr @_ZNSt6vectorISt4pairIfjESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  store ptr %44, ptr %9, align 8
  %45 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIfjESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %45, label %.lr.ph, label %.loopexit

46:                                               ; preds = %36
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %74

.lr.ph:                                           ; preds = %42, %65
  %48 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfjESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %48, i64 4
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %49 = invoke zeroext i1 @hnsw_begin_read(ptr noundef %0, i32 noundef %.sroa.4.0.copyload, ptr noundef null, ptr noundef nonnull %11, ptr noundef null)
          to label %50 unwind label %61

50:                                               ; preds = %.lr.ph
  %51 = load i32, ptr %22, align 4, !tbaa !14
  %52 = invoke zeroext i1 @hnsw_begin_read(ptr noundef %0, i32 noundef %51, ptr noundef null, ptr noundef nonnull %10, ptr noundef null)
          to label %53 unwind label %61

53:                                               ; preds = %50
  %54 = load ptr, ptr %11, align 8, !tbaa !15
  %55 = load ptr, ptr %10, align 8, !tbaa !15
  %56 = invoke noundef float @_Z14calc_dist_funcP12HnswMetadataPKfS2_(ptr noundef %0, ptr noundef %54, ptr noundef %55)
          to label %57 unwind label %63

57:                                               ; preds = %53
  invoke void @hnsw_end_read(ptr noundef %0)
          to label %58 unwind label %63

58:                                               ; preds = %57
  invoke void @hnsw_end_read(ptr noundef %0)
          to label %59 unwind label %63

59:                                               ; preds = %58
  %60 = fcmp uge float %56, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %60, label %65, label %69

61:                                               ; preds = %50, %.lr.ph
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %68

63:                                               ; preds = %58, %57, %53
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %68

65:                                               ; preds = %59
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIfjESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %67 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIfjESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %67, label %.lr.ph, label %.loopexit

68:                                               ; preds = %63, %61
  %.pn = phi { ptr, i32 } [ %64, %63 ], [ %62, %61 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %74

69:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %72

.loopexit:                                        ; preds = %65, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  invoke void @_ZNSt6vectorISt4pairIfjESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(8) %7)
          to label %72 unwind label %70

70:                                               ; preds = %.loopexit
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %74

72:                                               ; preds = %69, %.loopexit
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %73 = call noundef i64 @_ZNKSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  %.not33 = icmp eq i64 %73, 0
  br i1 %.not33, label %._crit_edge, label %34, !llvm.loop !17

74:                                               ; preds = %68, %70, %46
  %.pn36.pn = phi { ptr, i32 } [ %47, %46 ], [ %71, %70 ], [ %.pn, %68 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %91

._crit_edge:                                      ; preds = %72, %34, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %75 = call ptr @_ZNSt6vectorISt4pairIfjESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  store ptr %75, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %76 = call ptr @_ZNSt6vectorISt4pairIfjESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  store ptr %76, ptr %13, align 8
  %77 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIfjESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  br i1 %77, label %.lr.ph48, label %._crit_edge49

.lr.ph48:                                         ; preds = %._crit_edge
  %78 = getelementptr inbounds i8, ptr %14, i64 4
  br label %79

._crit_edge49:                                    ; preds = %85, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @_ZNSt6vectorISt4pairIfjESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  br label %90

79:                                               ; preds = %.lr.ph48, %85
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %80 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIfjESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %81 = load i64, ptr %80, align 4
  store i64 %81, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #6
  %82 = trunc i64 %81 to i32
  %83 = bitcast i32 %82 to float
  %84 = fneg float %83
  store float %84, ptr %15, align 4, !tbaa !11
  invoke void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJfRjEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %78)
          to label %85 unwind label %88

85:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIfjESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %87 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIfjESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  br i1 %87, label %79, label %._crit_edge49

88:                                               ; preds = %79
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  br label %91

90:                                               ; preds = %3, %._crit_edge49
  ret void

91:                                               ; preds = %88, %74, %32, %30
  %.pn39 = phi { ptr, i32 } [ %31, %30 ], [ %33, %32 ], [ %89, %88 ], [ %.pn36.pn, %74 ]
  call void @_ZNSt6vectorISt4pairIfjESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn39
}

; 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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIfjESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJfRKjEEEvDpOT_(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 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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIfjESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

declare void @hnsw_end_read(ptr noundef) local_unnamed_addr #4

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

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

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIfjESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 #3 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 = { 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 #4 = { "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 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 }

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

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


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