; LLVM IR from hlzz/libvot :: src/graph/image_graph.ll (ZN3vot10ImageGraph22numConnectedComponentsEi)

; 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.20" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.24" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"class.vot::ImageGraph" = type { i32, %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vot::ImageNode, std::allocator<vot::ImageNode>>::_Vector_impl" }
%"struct.std::_Vector_base<vot::ImageNode, std::allocator<vot::ImageNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<vot::ImageNode, std::allocator<vot::ImageNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vot::ImageNode, std::allocator<vot::ImageNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::unordered_map<int, vot::LinkEdge>, std::allocator<std::unordered_map<int, vot::LinkEdge>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unordered_map<int, vot::LinkEdge>, std::allocator<std::unordered_map<int, vot::LinkEdge>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unordered_map<int, vot::LinkEdge>, std::allocator<std::unordered_map<int, vot::LinkEdge>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unordered_map<int, vot::LinkEdge>, std::allocator<std::unordered_map<int, vot::LinkEdge>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.30" = type { i32, [4 x i8], %"struct.vot::LinkEdge" }
%"struct.vot::LinkEdge" = type <{ i64, i64, float, i32, i32, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3vot10ImageGraph22numConnectedComponentsEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector.20", align 8
  %6 = alloca i8, align 1
  %7 = alloca %"class.std::allocator.24", align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_Bit_reference", align 8
  %14 = alloca %"class.std::queue", align 8
  %15 = alloca %"struct.std::_Bit_reference", align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %19 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %20 = alloca %"struct.std::_Bit_reference", align 8
  %21 = alloca %"struct.std::_Bit_reference", align 8
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::__detail::_Node_iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %24 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %5) #4
  %25 = getelementptr inbounds %"class.vot::ImageGraph", ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = sext i32 %26 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #4
  store i8 0, ptr %6, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #4
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #4
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %27, ptr noundef nonnull align 1 dereferenceable(1) %6, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %28 unwind label %35

28:                                               ; preds = %2
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %182, %28
  %30 = load i32, ptr %11, align 4, !tbaa !9
  %31 = getelementptr inbounds %"class.vot::ImageGraph", ptr %24, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !11
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %39, label %34

34:                                               ; preds = %29
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %186

35:                                               ; preds = %2
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %8, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  br label %189

39:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %41)
          to label %43 unwind label %90

43:                                               ; preds = %39
  %44 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %45 = extractvalue { ptr, i64 } %42, 0
  store ptr %45, ptr %44, align 8
  %46 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %47 = extractvalue { ptr, i64 } %42, 1
  store i64 %47, ptr %46, align 8
  %48 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  %49 = xor i1 %48, true
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  br i1 %49, label %50, label %181

50:                                               ; preds = %43
  %51 = load i64, ptr %10, align 8, !tbaa !23
  %52 = add i64 %51, 1
  store i64 %52, ptr %10, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 80, ptr %14) #4
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %53 unwind label %94

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %55)
          to label %57 unwind label %98

57:                                               ; preds = %53
  %58 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 0
  %59 = extractvalue { ptr, i64 } %56, 0
  store ptr %59, ptr %58, align 8
  %60 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 1
  %61 = extractvalue { ptr, i64 } %56, 1
  store i64 %61, ptr %60, align 8
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %15, i1 noundef zeroext true) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %63 unwind label %102

63:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %165, %63
  %65 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %66 unwind label %106

66:                                               ; preds = %64
  %67 = xor i1 %65, true
  br i1 %67, label %68, label %167

68:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %69 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %70 unwind label %110

70:                                               ; preds = %68
  %71 = load i32, ptr %69, align 4, !tbaa !9
  store i32 %71, ptr %17, align 4, !tbaa !9
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %72 unwind label %110

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %73 = getelementptr inbounds %"class.vot::ImageGraph", ptr %24, i32 0, i32 2
  %74 = load i32, ptr %17, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %75) #4
  %77 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %76) #4
  %78 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %18, i32 0, i32 0
  %79 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %78, i32 0, i32 0
  store ptr %77, ptr %79, align 8
  br label %80

80:                                               ; preds = %160, %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %81 = getelementptr inbounds %"class.vot::ImageGraph", ptr %24, i32 0, i32 2
  %82 = load i32, ptr %17, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %83) #4
  %85 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %84) #4
  %86 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %19, i32 0, i32 0
  %87 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %86, i32 0, i32 0
  store ptr %85, ptr %87, align 8
  %88 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKiN3vot8LinkEdgeEELb0EEES8_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br i1 %88, label %114, label %89

89:                                               ; preds = %80
  store i32 7, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %165

90:                                               ; preds = %39
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %8, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  br label %185

94:                                               ; preds = %50
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %8, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %9, align 4
  br label %180

98:                                               ; preds = %53
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %8, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  br label %179

102:                                              ; preds = %57
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %8, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %9, align 4
  br label %179

106:                                              ; preds = %64
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %8, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %9, align 4
  br label %178

110:                                              ; preds = %70, %68
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %8, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %9, align 4
  br label %166

114:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #4
  %115 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  %116 = getelementptr inbounds %"struct.std::pair.30", ptr %115, i32 0, i32 2
  %117 = getelementptr inbounds %"struct.vot::LinkEdge", ptr %116, i32 0, i32 1
  %118 = load i64, ptr %117, align 8, !tbaa !25
  %119 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %118)
          to label %120 unwind label %147

120:                                              ; preds = %114
  %121 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 0
  %122 = extractvalue { ptr, i64 } %119, 0
  store ptr %122, ptr %121, align 8
  %123 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 1
  %124 = extractvalue { ptr, i64 } %119, 1
  store i64 %124, ptr %123, align 8
  %125 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %20) #4
  %126 = xor i1 %125, true
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #4
  br i1 %126, label %127, label %159

127:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #4
  %128 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  %129 = getelementptr inbounds %"struct.std::pair.30", ptr %128, i32 0, i32 2
  %130 = getelementptr inbounds %"struct.vot::LinkEdge", ptr %129, i32 0, i32 1
  %131 = load i64, ptr %130, align 8, !tbaa !25
  %132 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %131)
          to label %133 unwind label %151

133:                                              ; preds = %127
  %134 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 0
  %135 = extractvalue { ptr, i64 } %132, 0
  store ptr %135, ptr %134, align 8
  %136 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 1
  %137 = extractvalue { ptr, i64 } %132, 1
  store i64 %137, ptr %136, align 8
  %138 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %21, i1 noundef zeroext true) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #4
  %139 = load i32, ptr %16, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %141 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  %142 = getelementptr inbounds %"struct.std::pair.30", ptr %141, i32 0, i32 2
  %143 = getelementptr inbounds %"struct.vot::LinkEdge", ptr %142, i32 0, i32 1
  %144 = load i64, ptr %143, align 8, !tbaa !25
  %145 = trunc i64 %144 to i32
  store i32 %145, ptr %22, align 4, !tbaa !9
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %146 unwind label %155

146:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %159

147:                                              ; preds = %114
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %8, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #4
  br label %164

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

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

159:                                              ; preds = %146, %120
  br label %160

160:                                              ; preds = %159
  %161 = call ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEppEi(ptr noundef nonnull align 8 dereferenceable(8) %18, i32 noundef 0) #4
  %162 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %23, i32 0, i32 0
  %163 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %162, i32 0, i32 0
  store ptr %161, ptr %163, align 8
  br label %80, !llvm.loop !29

164:                                              ; preds = %155, %151, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %166

165:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %64, !llvm.loop !31

166:                                              ; preds = %164, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %178

167:                                              ; preds = %66
  %168 = load i32, ptr %16, align 4, !tbaa !9
  %169 = load i32, ptr %4, align 4, !tbaa !9
  %170 = icmp slt i32 %168, %169
  br i1 %170, label %171, label %177

171:                                              ; preds = %167
  %172 = load i32, ptr %4, align 4, !tbaa !9
  %173 = icmp ne i32 %172, 0
  br i1 %173, label %174, label %177

174:                                              ; preds = %171
  %175 = load i64, ptr %10, align 8, !tbaa !23
  %176 = add i64 %175, -1
  store i64 %176, ptr %10, align 8, !tbaa !23
  br label %177

177:                                              ; preds = %174, %171, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #4
  br label %181

178:                                              ; preds = %166, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %179

179:                                              ; preds = %178, %102, %98
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #4
  br label %180

180:                                              ; preds = %179, %94
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #4
  br label %185

181:                                              ; preds = %177, %43
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %11, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %11, align 4, !tbaa !9
  br label %29, !llvm.loop !32

185:                                              ; preds = %180, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #4
  br label %189

186:                                              ; preds = %34
  %187 = load i64, ptr %10, align 8, !tbaa !23
  %188 = trunc i64 %187 to i32
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #4
  ret i32 %188

189:                                              ; preds = %185, %35
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #4
  br label %190

190:                                              ; preds = %189
  %191 = load ptr, ptr %8, align 8
  %192 = load i32, ptr %9, align 4
  %193 = insertvalue { ptr, i32 } poison, ptr %191, 0
  %194 = insertvalue { ptr, i32 } %193, i32 %192, 1
  resume { ptr, i32 } %194
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN3vot10ImageGraphE", !10, i64 0, !13, i64 8, !17, i64 32}
!13 = !{!"_ZTSSt6vectorIN3vot9ImageNodeESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN3vot9ImageNodeESaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN3vot9ImageNodeESaIS1_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN3vot9ImageNodeESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!22, !22, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = !{!26, !24, i64 16}
!26 = !{!"_ZTSSt4pairIKiN3vot8LinkEdgeEE", !10, i64 0, !27, i64 8}
!27 = !{!"_ZTSN3vot8LinkEdgeE", !24, i64 0, !24, i64 8, !28, i64 16, !10, i64 20, !10, i64 24}
!28 = !{!"float", !7, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = distinct !{!32, !30}


; 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.20" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.24" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3vot10ImageGraph22numConnectedComponentsEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector.20", align 8
  %4 = alloca i8, align 1
  %5 = alloca %"class.std::allocator.24", align 1
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_Bit_reference", align 8
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca %"struct.std::_Bit_reference", align 8
  %10 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %11 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %12 = alloca %"struct.std::_Bit_reference", align 8
  %13 = alloca %"struct.std::_Bit_reference", align 8
  %14 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #4
  %15 = load i32, ptr %0, align 8, !tbaa !5
  %16 = sext i32 %15 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #4
  store i8 0, ptr %4, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #4
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %16, ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %17 unwind label %26

17:                                               ; preds = %2
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !21
  %18 = load i32, ptr %0, align 8, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph50, label %._crit_edge51

.lr.ph50:                                         ; preds = %17
  %20 = getelementptr inbounds i8, ptr %7, i64 8
  %21 = getelementptr inbounds i8, ptr %9, i64 8
  %22 = getelementptr inbounds i8, ptr %0, i64 32
  %23 = getelementptr inbounds i8, ptr %12, i64 8
  %24 = getelementptr inbounds i8, ptr %13, i64 8
  %25 = icmp eq i32 %1, 0
  br label %28

._crit_edge51:                                    ; preds = %101, %17
  %.020.lcssa = phi i32 [ 0, %17 ], [ %.222, %101 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #4
  ret i32 %.020.lcssa

26:                                               ; preds = %2
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #4
  br label %107

28:                                               ; preds = %.lr.ph50, %101
  %.02048 = phi i32 [ 0, %.lr.ph50 ], [ %.222, %101 ]
  %storemerge47 = phi i32 [ 0, %.lr.ph50 ], [ %103, %101 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %29 = sext i32 %storemerge47 to i64
  %30 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %29)
          to label %31 unwind label %54

31:                                               ; preds = %28
  %32 = extractvalue { ptr, i64 } %30, 0
  store ptr %32, ptr %7, align 8
  %33 = extractvalue { ptr, i64 } %30, 1
  store i64 %33, ptr %20, align 8
  %34 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br i1 %34, label %101, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #4
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %36 unwind label %56

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #4
  %37 = load i32, ptr %6, align 4, !tbaa !21
  %38 = sext i32 %37 to i64
  %39 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %38)
          to label %40 unwind label %58

40:                                               ; preds = %36
  %41 = extractvalue { ptr, i64 } %39, 0
  store ptr %41, ptr %9, align 8
  %42 = extractvalue { ptr, i64 } %39, 1
  store i64 %42, ptr %21, align 8
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %9, i1 noundef zeroext true) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %.preheader unwind label %60

.preheader:                                       ; preds = %40
  %44 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  br i1 %44, label %._crit_edge45, label %.lr.ph44

.lr.ph44:                                         ; preds = %.preheader, %._crit_edge
  %.01743 = phi i32 [ %.118.lcssa, %._crit_edge ], [ 1, %.preheader ]
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %46 = load i32, ptr %45, align 4, !tbaa !21
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %47) #4
  %49 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %48) #4
  store ptr %49, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %50 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %47) #4
  %51 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %50) #4
  store ptr %51, ptr %11, align 8
  %52 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKiN3vot8LinkEdgeEELb0EEES8_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br i1 %52, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %91, %.lr.ph44
  %.118.lcssa = phi i32 [ %.01743, %.lr.ph44 ], [ %.219, %91 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  %53 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  br i1 %53, label %._crit_edge45, label %.lr.ph44, !llvm.loop !22

54:                                               ; preds = %28
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %106

56:                                               ; preds = %35
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %100

58:                                               ; preds = %36
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  br label %99

60:                                               ; preds = %40
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %99

.lr.ph:                                           ; preds = %.lr.ph44, %91
  %.11842 = phi i32 [ %.219, %91 ], [ %.01743, %.lr.ph44 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #4
  %62 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  %64 = load i64, ptr %63, align 8, !tbaa !24
  %65 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %64)
          to label %66 unwind label %85

66:                                               ; preds = %.lr.ph
  %67 = extractvalue { ptr, i64 } %65, 0
  store ptr %67, ptr %12, align 8
  %68 = extractvalue { ptr, i64 } %65, 1
  store i64 %68, ptr %23, align 8
  %69 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  br i1 %69, label %91, label %70

70:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #4
  %71 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %72 = getelementptr inbounds i8, ptr %71, i64 16
  %73 = load i64, ptr %72, align 8, !tbaa !24
  %74 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %73)
          to label %75 unwind label %87

75:                                               ; preds = %70
  %76 = extractvalue { ptr, i64 } %74, 0
  store ptr %76, ptr %13, align 8
  %77 = extractvalue { ptr, i64 } %74, 1
  store i64 %77, ptr %24, align 8
  %78 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %13, i1 noundef zeroext true) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #4
  %79 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  %81 = load i64, ptr %80, align 8, !tbaa !24
  %82 = trunc i64 %81 to i32
  store i32 %82, ptr %14, align 4, !tbaa !21
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %83 unwind label %89

83:                                               ; preds = %75
  %84 = add nsw i32 %.11842, 1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #4
  br label %91

85:                                               ; preds = %.lr.ph
  %86 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  br label %96

87:                                               ; preds = %70
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  br label %96

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

91:                                               ; preds = %66, %83
  %.219 = phi i32 [ %84, %83 ], [ %.11842, %66 ]
  %92 = call ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEppEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %93 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %47) #4
  %94 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %93) #4
  store ptr %94, ptr %11, align 8
  %95 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKiN3vot8LinkEdgeEELb0EEES8_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br i1 %95, label %.lr.ph, label %._crit_edge, !llvm.loop !29

96:                                               ; preds = %89, %87, %85
  %.pn = phi { ptr, i32 } [ %90, %89 ], [ %88, %87 ], [ %86, %85 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %99

._crit_edge45:                                    ; preds = %._crit_edge, %.preheader
  %.017.lcssa = phi i32 [ 1, %.preheader ], [ %.118.lcssa, %._crit_edge ]
  %97 = icmp sge i32 %.017.lcssa, %1
  %or.cond.not = or i1 %25, %97
  %98 = zext i1 %or.cond.not to i32
  %spec.select = add i32 %.02048, %98
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #4
  br label %101

99:                                               ; preds = %96, %60, %58
  %.pn.pn = phi { ptr, i32 } [ %.pn, %96 ], [ %61, %60 ], [ %59, %58 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  br label %100

100:                                              ; preds = %99, %56
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %99 ], [ %57, %56 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #4
  br label %106

101:                                              ; preds = %31, %._crit_edge45
  %.222 = phi i32 [ %spec.select, %._crit_edge45 ], [ %.02048, %31 ]
  %102 = load i32, ptr %6, align 4, !tbaa !21
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %6, align 4, !tbaa !21
  %104 = load i32, ptr %0, align 8, !tbaa !5
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %28, label %._crit_edge51, !llvm.loop !30

106:                                              ; preds = %100, %54
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %100 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #4
  br label %107

107:                                              ; preds = %106, %26
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %106 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn.pn.pn.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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 = { 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 = !{!"_ZTSN3vot10ImageGraphE", !7, i64 0, !10, i64 8, !15, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIN3vot9ImageNodeESaIS1_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIN3vot9ImageNodeESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIN3vot9ImageNodeESaIS1_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN3vot9ImageNodeESaIS1_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"_ZTSSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !8, i64 0}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !27, i64 16}
!25 = !{!"_ZTSSt4pairIKiN3vot8LinkEdgeEE", !7, i64 0, !26, i64 8}
!26 = !{!"_ZTSN3vot8LinkEdgeE", !27, i64 0, !27, i64 8, !28, i64 16, !7, i64 20, !7, i64 24}
!27 = !{!"long", !8, i64 0}
!28 = !{!"float", !8, i64 0}
!29 = distinct !{!29, !23}
!30 = distinct !{!30, !23}


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