; LLVM IR from kazunetakahashi/atcoder :: 2019/0921_AGC038/B2.ll (Z16connect_adjacentiiRKSt6vectorIiSaIiEER9UnionFind)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.0" = 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #0

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9UnionFind5mergeEii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #1 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16connect_adjacentiiRKSt6vectorIiSaIiEER9UnionFind(i32 noundef %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(32) %3) #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.std::vector.0", align 8
  %16 = alloca %"class.std::vector.0", align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"struct.std::_Bit_iterator", align 8
  %19 = alloca { ptr, i32 }, align 8
  %20 = alloca %"struct.std::_Bit_iterator", align 8
  %21 = alloca { ptr, i32 }, align 8
  %22 = alloca %"struct.std::_Bit_reference", align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"struct.std::_Bit_iterator", align 8
  %25 = alloca { ptr, i32 }, align 8
  %26 = alloca %"struct.std::_Bit_iterator", align 8
  %27 = alloca { ptr, i32 }, align 8
  %28 = alloca %"struct.std::_Bit_reference", align 8
  %29 = alloca i32, align 4
  %30 = alloca %"struct.std::_Bit_reference", align 8
  %31 = alloca %"struct.std::_Bit_reference", align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %32 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_Z3revRKSt6vectorIiSaIiEE(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %32)
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %33 unwind label %59

33:                                               ; preds = %4
  %34 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  %36 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  %38 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8
  %40 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %39, ptr %41)
          to label %42 unwind label %63

42:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #5
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_Z7is_miniiiRKSt6vectorIiSaIiEE(ptr dead_on_unwind writable sret(%"class.std::vector.0") align 8 %15, i32 noundef %43, i32 noundef %44, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %45 unwind label %67

45:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_Z7is_maxiiiRKSt6vectorIiSaIiEE(ptr dead_on_unwind writable sret(%"class.std::vector.0") align 8 %16, i32 noundef %46, i32 noundef %47, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %48 unwind label %71

48:                                               ; preds = %45
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.3)
          to label %50 unwind label %75

50:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr %15, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %51 = load ptr, ptr %17, align 8, !tbaa !9
  %52 = call { ptr, i32 } @_ZNSt6vectorIbSaIbEE5beginEv(ptr noundef nonnull align 8 dereferenceable(40) %51) #5
  store { ptr, i32 } %52, ptr %19, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %19, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #5
  %53 = load ptr, ptr %17, align 8, !tbaa !9
  %54 = call { ptr, i32 } @_ZNSt6vectorIbSaIbEE3endEv(ptr noundef nonnull align 8 dereferenceable(40) %53) #5
  store { ptr, i32 } %54, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %21, i64 12, i1 false)
  br label %55

55:                                               ; preds = %95, %50
  %56 = invoke noundef zeroext i1 @_ZStneRKSt18_Bit_iterator_baseS1_(ptr noundef nonnull align 8 dereferenceable(12) %18, ptr noundef nonnull align 8 dereferenceable(12) %20)
          to label %57 unwind label %79

57:                                               ; preds = %55
  br i1 %56, label %83, label %58

58:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %101

59:                                               ; preds = %4
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %11, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %12, align 4
  br label %200

63:                                               ; preds = %33
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %11, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %12, align 4
  br label %199

67:                                               ; preds = %42
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %11, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %12, align 4
  br label %198

71:                                               ; preds = %45
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %11, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %12, align 4
  br label %197

75:                                               ; preds = %136, %103, %101, %48
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %11, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %12, align 4
  br label %196

79:                                               ; preds = %93, %55
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %11, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %12, align 4
  br label %100

83:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #5
  %84 = invoke { ptr, i64 } @_ZNKSt13_Bit_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(12) %18)
          to label %85 unwind label %96

85:                                               ; preds = %83
  %86 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 0
  %87 = extractvalue { ptr, i64 } %84, 0
  store ptr %87, ptr %86, align 8
  %88 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 1
  %89 = extractvalue { ptr, i64 } %84, 1
  store i64 %89, ptr %88, align 8
  %90 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %22) #5
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i1 noundef zeroext %90)
          to label %92 unwind label %96

92:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  br label %93

93:                                               ; preds = %92
  %94 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt13_Bit_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(12) %18)
          to label %95 unwind label %79

95:                                               ; preds = %93
  br label %55

96:                                               ; preds = %85, %83
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %11, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  br label %100

100:                                              ; preds = %96, %79
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %196

101:                                              ; preds = %58
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %103 unwind label %75

103:                                              ; preds = %101
  %104 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.4)
          to label %105 unwind label %75

105:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  store ptr %16, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #5
  %106 = load ptr, ptr %23, align 8, !tbaa !9
  %107 = call { ptr, i32 } @_ZNSt6vectorIbSaIbEE5beginEv(ptr noundef nonnull align 8 dereferenceable(40) %106) #5
  store { ptr, i32 } %107, ptr %25, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %25, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #5
  %108 = load ptr, ptr %23, align 8, !tbaa !9
  %109 = call { ptr, i32 } @_ZNSt6vectorIbSaIbEE3endEv(ptr noundef nonnull align 8 dereferenceable(40) %108) #5
  store { ptr, i32 } %109, ptr %27, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %27, i64 12, i1 false)
  br label %110

110:                                              ; preds = %130, %105
  %111 = invoke noundef zeroext i1 @_ZStneRKSt18_Bit_iterator_baseS1_(ptr noundef nonnull align 8 dereferenceable(12) %24, ptr noundef nonnull align 8 dereferenceable(12) %26)
          to label %112 unwind label %114

112:                                              ; preds = %110
  br i1 %111, label %118, label %113

113:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %136

114:                                              ; preds = %128, %110
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %11, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %12, align 4
  br label %135

118:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #5
  %119 = invoke { ptr, i64 } @_ZNKSt13_Bit_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(12) %24)
          to label %120 unwind label %131

120:                                              ; preds = %118
  %121 = getelementptr inbounds { ptr, i64 }, ptr %28, i32 0, i32 0
  %122 = extractvalue { ptr, i64 } %119, 0
  store ptr %122, ptr %121, align 8
  %123 = getelementptr inbounds { ptr, i64 }, ptr %28, 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) %28) #5
  %126 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i1 noundef zeroext %125)
          to label %127 unwind label %131

127:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #5
  br label %128

128:                                              ; preds = %127
  %129 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt13_Bit_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(12) %24)
          to label %130 unwind label %114

130:                                              ; preds = %128
  br label %110

131:                                              ; preds = %120, %118
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %11, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #5
  br label %135

135:                                              ; preds = %131, %114
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %196

136:                                              ; preds = %113
  %137 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %138 unwind label %75

138:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %191, %138
  %140 = load i32, ptr %29, align 4, !tbaa !5
  %141 = load i32, ptr %5, align 4, !tbaa !5
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = sub nsw i32 %141, %142
  %144 = icmp slt i32 %140, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %195

146:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #5
  %147 = load i32, ptr %29, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #5
  %149 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %15, i64 noundef %148)
          to label %150 unwind label %177

150:                                              ; preds = %146
  %151 = getelementptr inbounds { ptr, i64 }, ptr %30, i32 0, i32 0
  %152 = extractvalue { ptr, i64 } %149, 0
  store ptr %152, ptr %151, align 8
  %153 = getelementptr inbounds { ptr, i64 }, ptr %30, i32 0, i32 1
  %154 = extractvalue { ptr, i64 } %149, 1
  store i64 %154, ptr %153, align 8
  %155 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %30) #5
  br i1 %155, label %156, label %168

156:                                              ; preds = %150
  %157 = load i32, ptr %29, align 4, !tbaa !5
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = add nsw i32 %157, %158
  %160 = sext i32 %159 to i64
  %161 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %16, i64 noundef %160)
          to label %162 unwind label %181

162:                                              ; preds = %156
  %163 = getelementptr inbounds { ptr, i64 }, ptr %31, i32 0, i32 0
  %164 = extractvalue { ptr, i64 } %161, 0
  store ptr %164, ptr %163, align 8
  %165 = getelementptr inbounds { ptr, i64 }, ptr %31, i32 0, i32 1
  %166 = extractvalue { ptr, i64 } %161, 1
  store i64 %166, ptr %165, align 8
  %167 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %31) #5
  br label %168

168:                                              ; preds = %162, %150
  %169 = phi i1 [ false, %150 ], [ %167, %162 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #5
  br i1 %169, label %170, label %190

170:                                              ; preds = %168
  %171 = load ptr, ptr %8, align 8, !tbaa !9
  %172 = load i32, ptr %29, align 4, !tbaa !5
  %173 = load i32, ptr %29, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  %175 = invoke noundef zeroext i1 @_ZN9UnionFind5mergeEii(ptr noundef nonnull align 8 dereferenceable(32) %171, i32 noundef %172, i32 noundef %174)
          to label %176 unwind label %186

176:                                              ; preds = %170
  br label %190

177:                                              ; preds = %146
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %11, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %12, align 4
  br label %185

181:                                              ; preds = %156
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %11, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #5
  br label %185

185:                                              ; preds = %181, %177
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #5
  br label %194

186:                                              ; preds = %170
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %11, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %12, align 4
  br label %194

190:                                              ; preds = %176, %168
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %29, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %29, align 4, !tbaa !5
  br label %139, !llvm.loop !11

194:                                              ; preds = %186, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %196

195:                                              ; preds = %145
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #5
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  ret void

196:                                              ; preds = %194, %135, %100, %75
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #5
  br label %197

197:                                              ; preds = %196, %71
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #5
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #5
  br label %198

198:                                              ; preds = %197, %67
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #5
  br label %199

199:                                              ; preds = %198, %63
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  br label %200

200:                                              ; preds = %199, %59
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br label %201

201:                                              ; preds = %200
  %202 = load ptr, ptr %11, align 8
  %203 = load i32, ptr %12, align 4
  %204 = insertvalue { ptr, i32 } poison, ptr %202, 0
  %205 = insertvalue { ptr, i32 } %204, i32 %203, 1
  resume { ptr, i32 } %205
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i32 } @_ZNSt6vectorIbSaIbEE5beginEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i32 } @_ZNSt6vectorIbSaIbEE3endEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

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

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.0" = 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 }>
%"struct.std::_Bit_reference" = type { ptr, i64 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #0

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16connect_adjacentiiRKSt6vectorIiSaIiEER9UnionFind(i32 noundef %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(32) %3) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.std::vector.0", align 8
  %8 = alloca %"class.std::vector.0", align 8
  %9 = alloca %"struct.std::_Bit_iterator", align 8
  %10 = alloca %"struct.std::_Bit_iterator", align 8
  %11 = alloca %"struct.std::_Bit_reference", align 8
  %12 = alloca %"struct.std::_Bit_iterator", align 8
  %13 = alloca %"struct.std::_Bit_iterator", align 8
  %14 = alloca %"struct.std::_Bit_reference", align 8
  %15 = alloca %"struct.std::_Bit_reference", align 8
  %16 = alloca %"struct.std::_Bit_reference", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  call void @_Z3revRKSt6vectorIiSaIiEE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %17 unwind label %33

17:                                               ; preds = %4
  %18 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %19 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %18, ptr %19)
          to label %20 unwind label %35

20:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #4
  invoke void @_Z7is_miniiiRKSt6vectorIiSaIiEE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.0") align 8 %7, i32 noundef %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %21 unwind label %37

21:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #4
  invoke void @_Z7is_maxiiiRKSt6vectorIiSaIiEE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.0") align 8 %8, i32 noundef %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %22 unwind label %39

22:                                               ; preds = %21
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.3)
          to label %24 unwind label %41

24:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #4
  %25 = call { ptr, i32 } @_ZNSt6vectorIbSaIbEE5beginEv(ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  %.fca.0.extract15 = extractvalue { ptr, i32 } %25, 0
  %.fca.1.extract16 = extractvalue { ptr, i32 } %25, 1
  store ptr %.fca.0.extract15, ptr %9, align 8
  %.sroa.218.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %.fca.1.extract16, ptr %.sroa.218.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  %26 = call { ptr, i32 } @_ZNSt6vectorIbSaIbEE3endEv(ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  %.fca.0.extract11 = extractvalue { ptr, i32 } %26, 0
  %.fca.1.extract12 = extractvalue { ptr, i32 } %26, 1
  store ptr %.fca.0.extract11, ptr %10, align 8
  %.sroa.214.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  store i32 %.fca.1.extract12, ptr %.sroa.214.0..sroa_idx, align 8
  %27 = getelementptr inbounds i8, ptr %11, i64 8
  br label %28

28:                                               ; preds = %52, %24
  %29 = invoke noundef zeroext i1 @_ZStneRKSt18_Bit_iterator_baseS1_(ptr noundef nonnull align 8 dereferenceable(12) %9, ptr noundef nonnull align 8 dereferenceable(12) %10)
          to label %30 unwind label %43

30:                                               ; preds = %28
  br i1 %29, label %45, label %31

31:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %57 unwind label %41

33:                                               ; preds = %4
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %115

35:                                               ; preds = %17
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %114

37:                                               ; preds = %20
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %113

39:                                               ; preds = %21
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %112

41:                                               ; preds = %66, %57, %31, %22
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %111

43:                                               ; preds = %52, %28
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %56

45:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #4
  %46 = invoke { ptr, i64 } @_ZNKSt13_Bit_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(12) %9)
          to label %47 unwind label %54

47:                                               ; preds = %45
  %48 = extractvalue { ptr, i64 } %46, 0
  store ptr %48, ptr %11, align 8
  %49 = extractvalue { ptr, i64 } %46, 1
  store i64 %49, ptr %27, align 8
  %50 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i1 noundef zeroext %50)
          to label %52 unwind label %54

52:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  %53 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt13_Bit_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(12) %9)
          to label %28 unwind label %43

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

56:                                               ; preds = %54, %43
  %.pn49 = phi { ptr, i32 } [ %44, %43 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  br label %111

57:                                               ; preds = %31
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.4)
          to label %59 unwind label %41

59:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #4
  %60 = call { ptr, i32 } @_ZNSt6vectorIbSaIbEE5beginEv(ptr noundef nonnull align 8 dereferenceable(40) %8) #4
  %.fca.0.extract6 = extractvalue { ptr, i32 } %60, 0
  %.fca.1.extract7 = extractvalue { ptr, i32 } %60, 1
  store ptr %.fca.0.extract6, ptr %12, align 8
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  store i32 %.fca.1.extract7, ptr %.sroa.29.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #4
  %61 = call { ptr, i32 } @_ZNSt6vectorIbSaIbEE3endEv(ptr noundef nonnull align 8 dereferenceable(40) %8) #4
  %.fca.0.extract = extractvalue { ptr, i32 } %61, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %61, 1
  store ptr %.fca.0.extract, ptr %13, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %62 = getelementptr inbounds i8, ptr %14, i64 8
  br label %63

63:                                               ; preds = %82, %59
  %64 = invoke noundef zeroext i1 @_ZStneRKSt18_Bit_iterator_baseS1_(ptr noundef nonnull align 8 dereferenceable(12) %12, ptr noundef nonnull align 8 dereferenceable(12) %13)
          to label %65 unwind label %73

65:                                               ; preds = %63
  br i1 %64, label %75, label %66

66:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader unwind label %41

.preheader:                                       ; preds = %66
  %68 = sub nsw i32 %0, %1
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %70 = getelementptr inbounds i8, ptr %15, i64 8
  %71 = getelementptr inbounds i8, ptr %16, i64 8
  %72 = sext i32 %1 to i64
  %wide.trip.count = zext nneg i32 %68 to i64
  br label %87

73:                                               ; preds = %82, %63
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %86

75:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #4
  %76 = invoke { ptr, i64 } @_ZNKSt13_Bit_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(12) %12)
          to label %77 unwind label %84

77:                                               ; preds = %75
  %78 = extractvalue { ptr, i64 } %76, 0
  store ptr %78, ptr %14, align 8
  %79 = extractvalue { ptr, i64 } %76, 1
  store i64 %79, ptr %62, align 8
  %80 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i1 noundef zeroext %80)
          to label %82 unwind label %84

82:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #4
  %83 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt13_Bit_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(12) %12)
          to label %63 unwind label %73

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

86:                                               ; preds = %84, %73
  %.pn47 = phi { ptr, i32 } [ %74, %73 ], [ %85, %84 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  br label %111

._crit_edge:                                      ; preds = %110, %.preheader
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  ret void

87:                                               ; preds = %.lr.ph, %110
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %110 ]
  %indvars57 = trunc i64 %indvars.iv to i32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #4
  %88 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %7, i64 noundef %indvars.iv)
          to label %89 unwind label %103

89:                                               ; preds = %87
  %90 = extractvalue { ptr, i64 } %88, 0
  store ptr %90, ptr %15, align 8
  %91 = extractvalue { ptr, i64 } %88, 1
  store i64 %91, ptr %70, align 8
  %92 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  br i1 %92, label %93, label %.critedge

93:                                               ; preds = %89
  %94 = add nsw i64 %indvars.iv, %72
  %95 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %94)
          to label %96 unwind label %105

96:                                               ; preds = %93
  %97 = extractvalue { ptr, i64 } %95, 0
  store ptr %97, ptr %16, align 8
  %98 = extractvalue { ptr, i64 } %95, 1
  store i64 %98, ptr %71, align 8
  %99 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #4
  br i1 %99, label %100, label %110

100:                                              ; preds = %96
  %101 = add nuw nsw i32 %indvars57, 1
  %102 = invoke noundef zeroext i1 @_ZN9UnionFind5mergeEii(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %indvars57, i32 noundef %101)
          to label %110 unwind label %108

103:                                              ; preds = %87
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %107

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

107:                                              ; preds = %105, %103
  %.pn = phi { ptr, i32 } [ %106, %105 ], [ %104, %103 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #4
  br label %111

108:                                              ; preds = %100
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %111

.critedge:                                        ; preds = %89
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #4
  br label %110

110:                                              ; preds = %96, %.critedge, %100
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %87, !llvm.loop !5

111:                                              ; preds = %107, %108, %86, %56, %41
  %.pn49.pn = phi { ptr, i32 } [ %.pn49, %56 ], [ %.pn47, %86 ], [ %42, %41 ], [ %109, %108 ], [ %.pn, %107 ]
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #4
  br label %112

112:                                              ; preds = %111, %39
  %.pn49.pn.pn = phi { ptr, i32 } [ %.pn49.pn, %111 ], [ %40, %39 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  br label %113

113:                                              ; preds = %112, %37
  %.pn49.pn.pn.pn = phi { ptr, i32 } [ %.pn49.pn.pn, %112 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #4
  br label %114

114:                                              ; preds = %113, %35
  %.pn49.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn49.pn.pn.pn, %113 ], [ %36, %35 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  br label %115

115:                                              ; preds = %114, %33
  %.pn49.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn49.pn.pn.pn.pn, %114 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  resume { ptr, i32 } %.pn49.pn.pn.pn.pn.pn
}

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) local_unnamed_addr #1 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 #3 align 2

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

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


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