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

; 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.32" = type { %"struct.std::_Vector_base.33" }
%"struct.std::_Vector_base.33" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.34" = type { %"struct.std::_Vector_base.35" }
%"struct.std::_Vector_base.35" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"struct.std::pair.39" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.tw::UnionFind" = type { ptr, i64, i64 }
%"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 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 nounwind uwtable
declare dso_local ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3vot10ImageGraph9kargerCutERSt6vectorIS1_IiSaIiEESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::vector.32", align 8
  %6 = alloca %"class.std::vector.32", align 8
  %7 = alloca %"class.std::vector.34", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %11 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %12 = alloca %"struct.std::pair.39", align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.tw::UnionFind", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca [2 x %"class.std::vector.32"], align 16
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %31 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %32 = alloca %"struct.std::__detail::_Node_iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %33 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %76, %2
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = icmp slt i32 %35, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %34
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %79

40:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %41 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 2
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %43) #6
  %45 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %44) #6
  %46 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %10, i32 0, i32 0
  %47 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %46, i32 0, i32 0
  store ptr %45, ptr %47, align 8
  br label %48

48:                                               ; preds = %67, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %49 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 2
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %51) #6
  %53 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %52) #6
  %54 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %11, i32 0, i32 0
  %55 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %54, i32 0, i32 0
  store ptr %53, ptr %55, align 8
  %56 = 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) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br i1 %56, label %58, label %57

57:                                               ; preds = %48
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %75

58:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %59 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %60 = getelementptr inbounds %"struct.std::pair.30", ptr %59, i32 0, i32 2
  %61 = getelementptr inbounds %"struct.vot::LinkEdge", ptr %60, i32 0, i32 0
  %62 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %63 = getelementptr inbounds %"struct.std::pair.30", ptr %62, i32 0, i32 2
  %64 = getelementptr inbounds %"struct.vot::LinkEdge", ptr %63, i32 0, i32 1
  invoke void @_ZNSt4pairIiiEC2IRmS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull align 8 dereferenceable(8) %64)
          to label %65 unwind label %71

65:                                               ; preds = %58
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %66 unwind label %71

66:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %67

67:                                               ; preds = %66
  %68 = call ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEppEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #6
  %69 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %15, i32 0, i32 0
  %70 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %69, i32 0, i32 0
  store ptr %68, ptr %70, align 8
  br label %48, !llvm.loop !21

71:                                               ; preds = %65, %58
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %13, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %299

75:                                               ; preds = %57
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !9
  br label %34, !llvm.loop !23

79:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %80 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 0
  %81 = load i32, ptr %80, align 8, !tbaa !11
  %82 = sitofp i32 %81 to double
  %83 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !11
  %85 = sitofp i32 %84 to double
  %86 = call double @log(double noundef %85) #6
  %87 = fmul double %82, %86
  %88 = fptosi double %87 to i32
  store i32 %88, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %89 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %90 = trunc i64 %89 to i32
  store i32 %90, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %273, %79
  %92 = load i32, ptr %18, align 4, !tbaa !9
  %93 = load i32, ptr %16, align 4, !tbaa !9
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %288

96:                                               ; preds = %91
  %97 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %98 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %97, ptr %98, align 8
  %99 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %100 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %99, ptr %100, align 8
  %101 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8
  %103 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8
  invoke void @_ZSt14random_shuffleIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %102, ptr %104)
          to label %105 unwind label %143

105:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #6
  %106 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 0
  %107 = load i32, ptr %106, align 8, !tbaa !11
  %108 = sext i32 %107 to i64
  invoke void @_ZN2tw9UnionFindC1Em(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %108)
          to label %109 unwind label %147

109:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %110

110:                                              ; preds = %155, %109
  %111 = load i32, ptr %22, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  %113 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %114 = icmp ult i64 %112, %113
  br i1 %114, label %115, label %121

115:                                              ; preds = %110
  %116 = load i32, ptr %23, align 4, !tbaa !9
  %117 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 0
  %118 = load i32, ptr %117, align 8, !tbaa !11
  %119 = sub nsw i32 %118, 2
  %120 = icmp slt i32 %116, %119
  br label %121

121:                                              ; preds = %115, %110
  %122 = phi i1 [ false, %110 ], [ %120, %115 ]
  br i1 %122, label %123, label %158

123:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %124 = load i32, ptr %22, align 4, !tbaa !9
  %125 = zext i32 %124 to i64
  %126 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %125) #6
  %127 = getelementptr inbounds %"struct.std::pair.39", ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 4, !tbaa !24
  store i32 %128, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %129 = load i32, ptr %22, align 4, !tbaa !9
  %130 = zext i32 %129 to i64
  %131 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %130) #6
  %132 = getelementptr inbounds %"struct.std::pair.39", ptr %131, i32 0, i32 1
  %133 = load i32, ptr %132, align 4, !tbaa !26
  store i32 %133, ptr %25, align 4, !tbaa !9
  %134 = load i32, ptr %24, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = load i32, ptr %25, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = invoke noundef zeroext i1 @_ZN2tw9UnionFind8UnionSetEmm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %135, i64 noundef %137)
          to label %139 unwind label %151

139:                                              ; preds = %123
  br i1 %138, label %140, label %155

140:                                              ; preds = %139
  %141 = load i32, ptr %23, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %23, align 4, !tbaa !9
  br label %155

143:                                              ; preds = %96
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %13, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %14, align 4
  br label %287

147:                                              ; preds = %105
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %13, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %14, align 4
  br label %286

151:                                              ; preds = %123
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %13, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %285

155:                                              ; preds = %140, %139
  %156 = load i32, ptr %22, align 4, !tbaa !9
  %157 = add i32 %156, 1
  store i32 %157, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %110, !llvm.loop !27

158:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 48, ptr %26) #6
  %159 = getelementptr inbounds [2 x %"class.std::vector.32"], ptr %26, i32 0, i32 0
  %160 = getelementptr inbounds %"class.std::vector.32", ptr %159, i64 2
  br label %161

161:                                              ; preds = %161, %158
  %162 = phi ptr [ %159, %158 ], [ %163, %161 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %162) #6
  %163 = getelementptr inbounds %"class.std::vector.32", ptr %162, i64 1
  %164 = icmp eq ptr %163, %160
  br i1 %164, label %165, label %161

165:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %166

166:                                              ; preds = %191, %165
  %167 = load i32, ptr %27, align 4, !tbaa !9
  %168 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 0
  %169 = load i32, ptr %168, align 8, !tbaa !11
  %170 = icmp slt i32 %167, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %166
  store i32 13, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %194

172:                                              ; preds = %166
  %173 = load i32, ptr %27, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = invoke noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %174)
          to label %176 unwind label %183

176:                                              ; preds = %172
  %177 = invoke noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef 0)
          to label %178 unwind label %183

178:                                              ; preds = %176
  %179 = icmp eq i64 %175, %177
  br i1 %179, label %180, label %187

180:                                              ; preds = %178
  %181 = getelementptr inbounds [2 x %"class.std::vector.32"], ptr %26, i64 0, i64 0
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %181, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %182 unwind label %183

182:                                              ; preds = %180
  br label %190

183:                                              ; preds = %187, %180, %176, %172
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %13, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %277

187:                                              ; preds = %178
  %188 = getelementptr inbounds [2 x %"class.std::vector.32"], ptr %26, i64 0, i64 1
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %188, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %189 unwind label %183

189:                                              ; preds = %187
  br label %190

190:                                              ; preds = %189, %182
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %27, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %27, align 4, !tbaa !9
  br label %166, !llvm.loop !28

194:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 0, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %195

195:                                              ; preds = %246, %194
  %196 = load i32, ptr %29, align 4, !tbaa !9
  %197 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 0
  %198 = load i32, ptr %197, align 8, !tbaa !11
  %199 = icmp slt i32 %196, %198
  br i1 %199, label %201, label %200

200:                                              ; preds = %195
  store i32 16, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %249

201:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %202 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 2
  %203 = load i32, ptr %29, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %202, i64 noundef %204) #6
  %206 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %205) #6
  %207 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %30, i32 0, i32 0
  %208 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %207, i32 0, i32 0
  store ptr %206, ptr %208, align 8
  br label %209

209:                                              ; preds = %241, %201
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %210 = getelementptr inbounds %"class.vot::ImageGraph", ptr %33, i32 0, i32 2
  %211 = load i32, ptr %29, align 4, !tbaa !9
  %212 = sext i32 %211 to i64
  %213 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %210, i64 noundef %212) #6
  %214 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %213) #6
  %215 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %31, i32 0, i32 0
  %216 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %215, i32 0, i32 0
  store ptr %214, ptr %216, align 8
  %217 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKiN3vot8LinkEdgeEELb0EEES8_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  br i1 %217, label %219, label %218

218:                                              ; preds = %209
  store i32 19, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %245

219:                                              ; preds = %209
  %220 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #6
  %221 = getelementptr inbounds %"struct.std::pair.30", ptr %220, i32 0, i32 2
  %222 = getelementptr inbounds %"struct.vot::LinkEdge", ptr %221, i32 0, i32 0
  %223 = load i64, ptr %222, align 8, !tbaa !29
  %224 = invoke noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %223)
          to label %225 unwind label %236

225:                                              ; preds = %219
  %226 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #6
  %227 = getelementptr inbounds %"struct.std::pair.30", ptr %226, i32 0, i32 2
  %228 = getelementptr inbounds %"struct.vot::LinkEdge", ptr %227, i32 0, i32 1
  %229 = load i64, ptr %228, align 8, !tbaa !34
  %230 = invoke noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %229)
          to label %231 unwind label %236

231:                                              ; preds = %225
  %232 = icmp ne i64 %224, %230
  br i1 %232, label %233, label %240

233:                                              ; preds = %231
  %234 = load i32, ptr %28, align 4, !tbaa !9
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %28, align 4, !tbaa !9
  br label %240

236:                                              ; preds = %225, %219
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %13, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %276

240:                                              ; preds = %233, %231
  br label %241

241:                                              ; preds = %240
  %242 = call ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEppEi(ptr noundef nonnull align 8 dereferenceable(8) %30, i32 noundef 0) #6
  %243 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %32, i32 0, i32 0
  %244 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %243, i32 0, i32 0
  store ptr %242, ptr %244, align 8
  br label %209, !llvm.loop !35

245:                                              ; preds = %218
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %29, align 4, !tbaa !9
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %29, align 4, !tbaa !9
  br label %195, !llvm.loop !36

249:                                              ; preds = %200
  %250 = load i32, ptr %17, align 4, !tbaa !9
  %251 = load i32, ptr %28, align 4, !tbaa !9
  %252 = icmp sgt i32 %250, %251
  br i1 %252, label %253, label %265

253:                                              ; preds = %249
  %254 = load i32, ptr %28, align 4, !tbaa !9
  store i32 %254, ptr %17, align 4, !tbaa !9
  %255 = getelementptr inbounds [2 x %"class.std::vector.32"], ptr %26, i64 0, i64 0
  %256 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %255)
          to label %257 unwind label %261

257:                                              ; preds = %253
  %258 = getelementptr inbounds [2 x %"class.std::vector.32"], ptr %26, i64 0, i64 1
  %259 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %258)
          to label %260 unwind label %261

260:                                              ; preds = %257
  br label %265

261:                                              ; preds = %257, %253
  %262 = landingpad { ptr, i32 }
          cleanup
  %263 = extractvalue { ptr, i32 } %262, 0
  store ptr %263, ptr %13, align 8
  %264 = extractvalue { ptr, i32 } %262, 1
  store i32 %264, ptr %14, align 4
  br label %276

265:                                              ; preds = %260, %249
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  %266 = getelementptr inbounds [2 x %"class.std::vector.32"], ptr %26, i32 0, i32 0
  %267 = getelementptr inbounds %"class.std::vector.32", ptr %266, i64 2
  br label %268

268:                                              ; preds = %268, %265
  %269 = phi ptr [ %267, %265 ], [ %270, %268 ]
  %270 = getelementptr inbounds %"class.std::vector.32", ptr %269, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %270) #6
  %271 = icmp eq ptr %270, %266
  br i1 %271, label %272, label %268

272:                                              ; preds = %268
  call void @llvm.lifetime.end.p0(i64 48, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @_ZN2tw9UnionFindD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  br label %273

273:                                              ; preds = %272
  %274 = load i32, ptr %18, align 4, !tbaa !9
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %18, align 4, !tbaa !9
  br label %91, !llvm.loop !37

276:                                              ; preds = %261, %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %277

277:                                              ; preds = %276, %183
  %278 = getelementptr inbounds [2 x %"class.std::vector.32"], ptr %26, i32 0, i32 0
  %279 = getelementptr inbounds %"class.std::vector.32", ptr %278, i64 2
  br label %280

280:                                              ; preds = %280, %277
  %281 = phi ptr [ %279, %277 ], [ %282, %280 ]
  %282 = getelementptr inbounds %"class.std::vector.32", ptr %281, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %282) #6
  %283 = icmp eq ptr %282, %278
  br i1 %283, label %284, label %280

284:                                              ; preds = %280
  call void @llvm.lifetime.end.p0(i64 48, ptr %26) #6
  br label %285

285:                                              ; preds = %284, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @_ZN2tw9UnionFindD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  br label %286

286:                                              ; preds = %285, %147
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  br label %287

287:                                              ; preds = %286, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %298

288:                                              ; preds = %95
  %289 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %289) #6
  %290 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %290, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %291 unwind label %294

291:                                              ; preds = %288
  %292 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %292, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %293 unwind label %294

293:                                              ; preds = %291
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  ret i1 true

294:                                              ; preds = %291, %288
  %295 = landingpad { ptr, i32 }
          cleanup
  %296 = extractvalue { ptr, i32 } %295, 0
  store ptr %296, ptr %13, align 8
  %297 = extractvalue { ptr, i32 } %295, 1
  store i32 %297, ptr %14, align 4
  br label %298

298:                                              ; preds = %294, %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %299

299:                                              ; preds = %298, %71
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  br label %300

300:                                              ; preds = %299
  %301 = load ptr, ptr %13, align 8
  %302 = load i32, ptr %14, align 4
  %303 = insertvalue { ptr, i32 } poison, ptr %301, 0
  %304 = insertvalue { ptr, i32 } %303, i32 %302, 1
  resume { ptr, i32 } %304
}

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

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

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

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

; Function Attrs: nounwind
declare double @log(double noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt14random_shuffleIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #4

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

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

declare void @_ZN2tw9UnionFindC1Em(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) unnamed_addr #5

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

declare noundef zeroext i1 @_ZN2tw9UnionFind8UnionSetEmm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) #5

declare noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5

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

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

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

; Function Attrs: nounwind
declare void @_ZN2tw9UnionFindD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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, !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 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!25, !10, i64 0}
!25 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!26 = !{!25, !10, i64 4}
!27 = distinct !{!27, !22}
!28 = distinct !{!28, !22}
!29 = !{!30, !32, i64 8}
!30 = !{!"_ZTSSt4pairIKiN3vot8LinkEdgeEE", !10, i64 0, !31, i64 8}
!31 = !{!"_ZTSN3vot8LinkEdgeE", !32, i64 0, !32, i64 8, !33, i64 16, !10, i64 20, !10, i64 24}
!32 = !{!"long", !7, i64 0}
!33 = !{!"float", !7, i64 0}
!34 = !{!30, !32, i64 16}
!35 = distinct !{!35, !22}
!36 = distinct !{!36, !22}
!37 = distinct !{!37, !22}


; 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.32" = type { %"struct.std::_Vector_base.33" }
%"struct.std::_Vector_base.33" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.34" = type { %"struct.std::_Vector_base.35" }
%"struct.std::_Vector_base.35" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"struct.std::pair.39" = type { i32, i32 }
%"class.tw::UnionFind" = type { ptr, i64, i64 }

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 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 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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3vot10ImageGraph9kargerCutERSt6vectorIS1_IiSaIiEESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector.32", align 8
  %4 = alloca %"class.std::vector.32", align 8
  %5 = alloca %"class.std::vector.34", align 8
  %6 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %7 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %8 = alloca %"struct.std::pair.39", align 4
  %9 = alloca %"class.tw::UnionFind", align 8
  %10 = alloca [2 x %"class.std::vector.32"], align 16
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %13 = alloca %"struct.std::__detail::_Node_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %14 = load i32, ptr %0, align 8, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph75, label %._crit_edge76

.lr.ph75:                                         ; preds = %2
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  br label %27

._crit_edge76:                                    ; preds = %._crit_edge, %2
  %.lcssa71 = phi i32 [ %14, %2 ], [ %33, %._crit_edge ]
  %17 = sitofp i32 %.lcssa71 to double
  %18 = call double @log(double noundef %17) #7
  %19 = fmul double %18, %17
  %20 = fptosi double %19 to i32
  %21 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %22 = icmp sgt i32 %20, 0
  br i1 %22, label %.lr.ph99, label %._crit_edge100

.lr.ph99:                                         ; preds = %._crit_edge76
  %23 = trunc i64 %21 to i32
  %24 = getelementptr inbounds i8, ptr %10, i64 24
  %25 = getelementptr inbounds i8, ptr %0, i64 32
  %26 = getelementptr inbounds i8, ptr %10, i64 24
  br label %47

27:                                               ; preds = %.lr.ph75, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.lr.ph75 ], [ %indvars.iv.next, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %28 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %indvars.iv) #7
  %29 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %28) #7
  store ptr %29, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %30 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %indvars.iv) #7
  %31 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %30) #7
  store ptr %31, ptr %7, align 8
  %32 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKiN3vot8LinkEdgeEELb0EEES8_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br i1 %32, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %40, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i32, ptr %0, align 8, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv.next, %34
  br i1 %35, label %27, label %._crit_edge76, !llvm.loop !19

.lr.ph:                                           ; preds = %27, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %36 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  call void @_ZNSt4pairIiiEC2IRmS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %39)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %40 unwind label %45

40:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %41 = call ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %42 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %indvars.iv) #7
  %43 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %42) #7
  store ptr %43, ptr %7, align 8
  %44 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKiN3vot8LinkEdgeEELb0EEES8_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br i1 %44, label %.lr.ph, label %._crit_edge, !llvm.loop !21

45:                                               ; preds = %.lr.ph
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %137

._crit_edge100:                                   ; preds = %127, %._crit_edge76
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %133 unwind label %135

47:                                               ; preds = %.lr.ph99, %127
  %.04697 = phi i32 [ %23, %.lr.ph99 ], [ %.147, %127 ]
  %.04896 = phi i32 [ 0, %.lr.ph99 ], [ %128, %127 ]
  %48 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %49 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  invoke void @_ZSt14random_shuffleIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %48, ptr %49)
          to label %50 unwind label %73

50:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  %51 = load i32, ptr %0, align 8, !tbaa !5
  %52 = sext i32 %51 to i64
  invoke void @_ZN2tw9UnionFindC1Em(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %52)
          to label %.preheader unwind label %75

.preheader:                                       ; preds = %50
  %53 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %.not101 = icmp eq i64 %53, 0
  br i1 %.not101, label %.critedge, label %.lr.ph79

.lr.ph79:                                         ; preds = %.preheader, %67
  %54 = phi i64 [ %70, %67 ], [ 0, %.preheader ]
  %.03678 = phi i32 [ %spec.select, %67 ], [ 0, %.preheader ]
  %.03877 = phi i32 [ %69, %67 ], [ 0, %.preheader ]
  %55 = load i32, ptr %0, align 8, !tbaa !5
  %56 = add nsw i32 %55, -2
  %57 = icmp slt i32 %.03678, %56
  br i1 %57, label %58, label %.critedge

58:                                               ; preds = %.lr.ph79
  %59 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %54) #7
  %60 = load i32, ptr %59, align 4, !tbaa !22
  %61 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %54) #7
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  %63 = load i32, ptr %62, align 4, !tbaa !24
  %64 = sext i32 %60 to i64
  %65 = sext i32 %63 to i64
  %66 = invoke noundef zeroext i1 @_ZN2tw9UnionFind8UnionSetEmm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %64, i64 noundef %65)
          to label %67 unwind label %77

67:                                               ; preds = %58
  %68 = zext i1 %66 to i32
  %spec.select = add nuw nsw i32 %.03678, %68
  %69 = add i32 %.03877, 1
  %70 = zext i32 %69 to i64
  %71 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %72 = icmp ugt i64 %71, %70
  br i1 %72, label %.lr.ph79, label %.critedge, !llvm.loop !25

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

75:                                               ; preds = %50
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %132

77:                                               ; preds = %58
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %131

.critedge:                                        ; preds = %.lr.ph79, %67, %.preheader
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %10) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  store i32 0, ptr %11, align 4, !tbaa !26
  %79 = load i32, ptr %0, align 8, !tbaa !5
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph83, label %._crit_edge84.thread

._crit_edge84.thread:                             ; preds = %.critedge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %._crit_edge94

._crit_edge84:                                    ; preds = %90
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  %81 = icmp sgt i32 %93, 0
  br i1 %81, label %.lr.ph93, label %._crit_edge94

.lr.ph83:                                         ; preds = %.critedge, %90
  %storemerge81 = phi i32 [ %92, %90 ], [ 0, %.critedge ]
  %82 = sext i32 %storemerge81 to i64
  %83 = invoke noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %82)
          to label %84 unwind label %88

84:                                               ; preds = %.lr.ph83
  %85 = invoke noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 0)
          to label %.invoke unwind label %88

.invoke:                                          ; preds = %84
  %86 = icmp eq i64 %83, %85
  %87 = select i1 %86, ptr %10, ptr %24
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %87, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %90 unwind label %88

88:                                               ; preds = %.invoke, %84, %.lr.ph83
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %129

90:                                               ; preds = %.invoke
  %91 = load i32, ptr %11, align 4, !tbaa !26
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %11, align 4, !tbaa !26
  %93 = load i32, ptr %0, align 8, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %.lr.ph83, label %._crit_edge84, !llvm.loop !27

._crit_edge94:                                    ; preds = %._crit_edge88, %._crit_edge84.thread, %._crit_edge84
  %.032.lcssa = phi i32 [ 0, %._crit_edge84 ], [ 0, %._crit_edge84.thread ], [ %.1.lcssa, %._crit_edge88 ]
  %95 = icmp sgt i32 %.04697, %.032.lcssa
  br i1 %95, label %121, label %127

.lr.ph93:                                         ; preds = %._crit_edge84, %._crit_edge88
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %._crit_edge88 ], [ 0, %._crit_edge84 ]
  %.03290 = phi i32 [ %.1.lcssa, %._crit_edge88 ], [ 0, %._crit_edge84 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %96 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %indvars.iv103) #7
  %97 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %96) #7
  store ptr %97, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %98 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %indvars.iv103) #7
  %99 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %98) #7
  store ptr %99, ptr %13, align 8
  %100 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKiN3vot8LinkEdgeEELb0EEES8_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br i1 %100, label %.lr.ph87, label %._crit_edge88

._crit_edge88:                                    ; preds = %113, %.lr.ph93
  %.1.lcssa = phi i32 [ %.03290, %.lr.ph93 ], [ %spec.select66, %113 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %101 = load i32, ptr %0, align 8, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = icmp slt i64 %indvars.iv.next104, %102
  br i1 %103, label %.lr.ph93, label %._crit_edge94, !llvm.loop !28

.lr.ph87:                                         ; preds = %.lr.ph93, %113
  %.185 = phi i32 [ %spec.select66, %113 ], [ %.03290, %.lr.ph93 ]
  %104 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %105 = getelementptr inbounds i8, ptr %104, i64 8
  %106 = load i64, ptr %105, align 8, !tbaa !29
  %107 = invoke noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %106)
          to label %108 unwind label %119

108:                                              ; preds = %.lr.ph87
  %109 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %110 = getelementptr inbounds i8, ptr %109, i64 16
  %111 = load i64, ptr %110, align 8, !tbaa !34
  %112 = invoke noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %111)
          to label %113 unwind label %119

113:                                              ; preds = %108
  %.not = icmp ne i64 %107, %112
  %114 = zext i1 %.not to i32
  %spec.select66 = add nsw i32 %.185, %114
  %115 = call ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKiN3vot8LinkEdgeEELb0ELb0EEppEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %116 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorISt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS2_EEESaISB_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %indvars.iv103) #7
  %117 = call ptr @_ZNSt13unordered_mapIiN3vot8LinkEdgeESt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %116) #7
  store ptr %117, ptr %13, align 8
  %118 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKiN3vot8LinkEdgeEELb0EEES8_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br i1 %118, label %.lr.ph87, label %._crit_edge88, !llvm.loop !35

119:                                              ; preds = %108, %.lr.ph87
  %120 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  br label %129

121:                                              ; preds = %._crit_edge94
  %122 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %123 unwind label %125

123:                                              ; preds = %121
  %124 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %127 unwind label %125

125:                                              ; preds = %123, %121
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %129

127:                                              ; preds = %123, %._crit_edge94
  %.147 = phi i32 [ %.032.lcssa, %123 ], [ %.04697, %._crit_edge94 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #7
  call void @_ZN2tw9UnionFindD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  %128 = add nuw nsw i32 %.04896, 1
  %exitcond.not = icmp eq i32 %128, %20
  br i1 %exitcond.not, label %._crit_edge100, label %47, !llvm.loop !36

129:                                              ; preds = %119, %125, %88
  %.pn57 = phi { ptr, i32 } [ %89, %88 ], [ %120, %119 ], [ %126, %125 ]
  %130 = getelementptr inbounds i8, ptr %10, i64 24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %130) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #7
  br label %131

131:                                              ; preds = %129, %77
  %.pn59 = phi { ptr, i32 } [ %78, %77 ], [ %.pn57, %129 ]
  call void @_ZN2tw9UnionFindD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  br label %132

132:                                              ; preds = %131, %75
  %.pn59.pn = phi { ptr, i32 } [ %.pn59, %131 ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  br label %137

133:                                              ; preds = %._crit_edge100
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %134 unwind label %135

134:                                              ; preds = %133
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  ret i1 true

135:                                              ; preds = %133, %._crit_edge100
  %136 = landingpad { ptr, i32 }
          cleanup
  br label %137

137:                                              ; preds = %135, %132, %73, %45
  %.pn64 = phi { ptr, i32 } [ %46, %45 ], [ %136, %135 ], [ %.pn59.pn, %132 ], [ %74, %73 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn64
}

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt14random_shuffleIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #4

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

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

declare void @_ZN2tw9UnionFindC1Em(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) unnamed_addr #5

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

declare noundef zeroext i1 @_ZN2tw9UnionFind8UnionSetEmm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) local_unnamed_addr #5

declare noundef i64 @_ZN2tw9UnionFind4FindEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #5

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!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 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!23, !7, i64 0}
!23 = !{!"_ZTSSt4pairIiiE", !7, i64 0, !7, i64 4}
!24 = !{!23, !7, i64 4}
!25 = distinct !{!25, !20}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !20}
!28 = distinct !{!28, !20}
!29 = !{!30, !32, i64 8}
!30 = !{!"_ZTSSt4pairIKiN3vot8LinkEdgeEE", !7, i64 0, !31, i64 8}
!31 = !{!"_ZTSN3vot8LinkEdgeE", !32, i64 0, !32, i64 8, !33, i64 16, !7, i64 20, !7, i64 24}
!32 = !{!"long", !8, i64 0}
!33 = !{!"float", !8, i64 0}
!34 = !{!30, !32, i64 16}
!35 = distinct !{!35, !20}
!36 = distinct !{!36, !20}


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