; LLVM IR from kazunetakahashi/atcoder :: 2020/0530_nomura2020 (D)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"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::allocator" = type { i8 }
%class.UnionFind = type { i32, %"class.std::vector" }
%"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.std::allocator.4" = type { i8 }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<Town, std::allocator<Town>>::_Vector_impl" }
%"struct.std::_Vector_base<Town, std::allocator<Town>>::_Vector_impl" = type { %"struct.std::_Vector_base<Town, std::allocator<Town>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Town, std::allocator<Town>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.17" = type { ptr }
%struct.Town = type { i64, i64 }
%class.Mint = type { i64 }
%"class.__gnu_cxx::__normal_iterator.18" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = 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 norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %class.UnionFind, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector.0", align 8
  %11 = alloca i8, align 1
  %12 = alloca %"class.std::allocator.4", align 1
  %13 = alloca %"class.std::vector.7", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::_Bit_reference", align 8
  %17 = alloca %"struct.std::_Bit_reference", align 8
  %18 = alloca %"class.std::vector", align 8
  %19 = alloca %"class.std::initializer_list", align 8
  %20 = alloca [1 x i32], align 4
  %21 = alloca %"class.std::allocator", align 1
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::_Bit_reference", align 8
  %24 = alloca %"struct.std::_Bit_reference", align 8
  %25 = alloca %"class.std::vector.12", align 8
  %26 = alloca i64, align 8
  %27 = alloca ptr, align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca ptr, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca ptr, align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator.17", align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator.17", align 8
  %36 = alloca i32, align 4
  %37 = alloca %struct.Town, align 8
  %38 = alloca %class.Mint, align 8
  %39 = alloca %class.Mint, align 8
  %40 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %41 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %42 = alloca %class.Mint, align 8
  %43 = alloca %class.Mint, align 8
  %44 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %45 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %46 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %47 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %48 = alloca %class.Mint, align 8
  %49 = alloca %class.Mint, align 8
  %50 = alloca %class.Mint, align 8
  %51 = alloca %class.Mint, align 8
  %52 = alloca %class.Mint, align 8
  %53 = alloca %class.Mint, align 8
  %54 = alloca %class.Mint, align 8
  %55 = alloca %class.Mint, align 8
  %56 = alloca %class.Mint, align 8
  %57 = alloca %class.Mint, align 8
  %58 = alloca %class.Mint, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  %60 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %60, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %61 unwind label %68

61:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %94, %61
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = load i64, ptr %2, align 8, !tbaa !5
  %66 = icmp slt i64 %64, %65
  br i1 %66, label %72, label %67

67:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %97

68:                                               ; preds = %0
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %5, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  br label %470

72:                                               ; preds = %62
  %73 = load i32, ptr %7, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %74) #7
  %76 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %75)
          to label %77 unwind label %89

77:                                               ; preds = %72
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %79) #7
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %93

83:                                               ; preds = %77
  %84 = load i32, ptr %7, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %85) #7
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = add nsw i32 %87, -1
  store i32 %88, ptr %86, align 4, !tbaa !9
  br label %93

89:                                               ; preds = %72
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %5, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %469

93:                                               ; preds = %83, %77
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %7, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %7, align 4, !tbaa !9
  br label %62, !llvm.loop !11

97:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #7
  %98 = load i64, ptr %2, align 8, !tbaa !5
  %99 = trunc i64 %98 to i32
  invoke void @_ZN9UnionFindC2Ei(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %99)
          to label %100 unwind label %107

100:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %130, %100
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = load i64, ptr %2, align 8, !tbaa !5
  %105 = icmp slt i64 %103, %104
  br i1 %105, label %111, label %106

106:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %133

107:                                              ; preds = %97
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %5, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %6, align 4
  br label %468

111:                                              ; preds = %101
  %112 = load i32, ptr %9, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %113) #7
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = icmp sge i32 %115, 0
  br i1 %116, label %117, label %129

117:                                              ; preds = %111
  %118 = load i32, ptr %9, align 4, !tbaa !9
  %119 = load i32, ptr %9, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %120) #7
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = invoke noundef zeroext i1 @_ZN9UnionFind5mergeEii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %118, i32 noundef %122)
          to label %124 unwind label %125

124:                                              ; preds = %117
  br label %129

125:                                              ; preds = %117
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %5, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %467

129:                                              ; preds = %124, %111
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %9, align 4, !tbaa !9
  br label %101, !llvm.loop !13

133:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #7
  %134 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #7
  store i8 0, ptr %11, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #7
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #7
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %10, i64 noundef %134, ptr noundef nonnull align 1 dereferenceable(1) %11, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %135 unwind label %142

135:                                              ; preds = %133
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %242, %135
  %137 = load i32, ptr %14, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = load i64, ptr %2, align 8, !tbaa !5
  %140 = icmp slt i64 %138, %139
  br i1 %140, label %146, label %141

141:                                              ; preds = %136
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %252

142:                                              ; preds = %133
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %5, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  br label %466

146:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  %147 = load i32, ptr %14, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %10, i64 noundef %148)
          to label %150 unwind label %157

150:                                              ; preds = %146
  %151 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 0
  %152 = extractvalue { ptr, i64 } %149, 0
  store ptr %152, ptr %151, align 8
  %153 = getelementptr inbounds { ptr, i64 }, ptr %16, 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) %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  br i1 %155, label %156, label %161

156:                                              ; preds = %150
  br label %242

157:                                              ; preds = %146
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %5, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  br label %251

161:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  %162 = load i32, ptr %14, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %10, i64 noundef %163)
          to label %165 unwind label %187

165:                                              ; preds = %161
  %166 = getelementptr inbounds { ptr, i64 }, ptr %17, i32 0, i32 0
  %167 = extractvalue { ptr, i64 } %164, 0
  store ptr %167, ptr %166, align 8
  %168 = getelementptr inbounds { ptr, i64 }, ptr %17, i32 0, i32 1
  %169 = extractvalue { ptr, i64 } %164, 1
  store i64 %169, ptr %168, align 8
  %170 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %17, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %171 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %171, ptr %20, align 4, !tbaa !9
  %172 = getelementptr inbounds %"class.std::initializer_list", ptr %19, i32 0, i32 0
  store ptr %20, ptr %172, align 8, !tbaa !16
  %173 = getelementptr inbounds %"class.std::initializer_list", ptr %19, i32 0, i32 1
  store i64 1, ptr %173, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  %174 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8
  %176 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 1
  %177 = load i64, ptr %176, align 8
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr %175, i64 %177, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %178 unwind label %191

178:                                              ; preds = %165
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %179 = load i32, ptr %14, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %22, align 4, !tbaa !9
  br label %181

181:                                              ; preds = %236, %178
  %182 = load i32, ptr %22, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = load i64, ptr %2, align 8, !tbaa !5
  %185 = icmp slt i64 %183, %184
  br i1 %185, label %195, label %186

186:                                              ; preds = %181
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %240

187:                                              ; preds = %161
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %5, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  br label %251

191:                                              ; preds = %165
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %5, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %250

195:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  %196 = load i32, ptr %22, align 4, !tbaa !9
  %197 = sext i32 %196 to i64
  %198 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %10, i64 noundef %197)
          to label %199 unwind label %223

199:                                              ; preds = %195
  %200 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 0
  %201 = extractvalue { ptr, i64 } %198, 0
  store ptr %201, ptr %200, align 8
  %202 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 1
  %203 = extractvalue { ptr, i64 } %198, 1
  store i64 %203, ptr %202, align 8
  %204 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %23) #7
  br i1 %204, label %210, label %205

205:                                              ; preds = %199
  %206 = load i32, ptr %14, align 4, !tbaa !9
  %207 = load i32, ptr %22, align 4, !tbaa !9
  %208 = invoke noundef zeroext i1 @_ZN9UnionFind7is_sameEii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %206, i32 noundef %207)
          to label %209 unwind label %223

209:                                              ; preds = %205
  br label %210

210:                                              ; preds = %209, %199
  %211 = phi i1 [ false, %199 ], [ %208, %209 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  br i1 %211, label %212, label %235

212:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %213 = load i32, ptr %22, align 4, !tbaa !9
  %214 = sext i32 %213 to i64
  %215 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %10, i64 noundef %214)
          to label %216 unwind label %227

216:                                              ; preds = %212
  %217 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 0
  %218 = extractvalue { ptr, i64 } %215, 0
  store ptr %218, ptr %217, align 8
  %219 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 1
  %220 = extractvalue { ptr, i64 } %215, 1
  store i64 %220, ptr %219, align 8
  %221 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %24, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %222 unwind label %231

222:                                              ; preds = %216
  br label %235

223:                                              ; preds = %205, %195
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %5, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  br label %239

227:                                              ; preds = %212
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %5, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  br label %239

231:                                              ; preds = %216
  %232 = landingpad { ptr, i32 }
          cleanup
  %233 = extractvalue { ptr, i32 } %232, 0
  store ptr %233, ptr %5, align 8
  %234 = extractvalue { ptr, i32 } %232, 1
  store i32 %234, ptr %6, align 4
  br label %239

235:                                              ; preds = %222, %210
  br label %236

236:                                              ; preds = %235
  %237 = load i32, ptr %22, align 4, !tbaa !9
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %22, align 4, !tbaa !9
  br label %181, !llvm.loop !21

239:                                              ; preds = %231, %227, %223
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %249

240:                                              ; preds = %186
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %241 unwind label %245

241:                                              ; preds = %240
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  br label %242

242:                                              ; preds = %241, %156
  %243 = load i32, ptr %14, align 4, !tbaa !9
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %14, align 4, !tbaa !9
  br label %136, !llvm.loop !22

245:                                              ; preds = %240
  %246 = landingpad { ptr, i32 }
          cleanup
  %247 = extractvalue { ptr, i32 } %246, 0
  store ptr %247, ptr %5, align 8
  %248 = extractvalue { ptr, i32 } %246, 1
  store i32 %248, ptr %6, align 4
  br label %249

249:                                              ; preds = %245, %239
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  br label %250

250:                                              ; preds = %249, %191
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  br label %251

251:                                              ; preds = %250, %187, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %465

252:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #7
  call void @_ZNSt6vectorI4TownSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  store i64 0, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  store ptr %13, ptr %27, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %253 = load ptr, ptr %27, align 8, !tbaa !23
  %254 = call ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %253) #7
  %255 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %254, ptr %255, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %256 = load ptr, ptr %27, align 8, !tbaa !23
  %257 = call ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %256) #7
  %258 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %257, ptr %258, align 8
  br label %259

259:                                              ; preds = %311, %252
  %260 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt6vectorIiSaIiEES1_IS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  br i1 %260, label %262, label %261

261:                                              ; preds = %259
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %322

262:                                              ; preds = %259
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %263 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt6vectorIiSaIiEES1_IS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #7
  store ptr %263, ptr %30, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %264 = load ptr, ptr %30, align 8, !tbaa !23
  %265 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %264) #7
  store i64 %265, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  store i64 0, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %266 = load ptr, ptr %30, align 8, !tbaa !23
  store ptr %266, ptr %33, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %267 = load ptr, ptr %33, align 8, !tbaa !23
  %268 = call ptr @_ZNKSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %267) #7
  %269 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.17", ptr %34, i32 0, i32 0
  store ptr %268, ptr %269, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %270 = load ptr, ptr %33, align 8, !tbaa !23
  %271 = call ptr @_ZNKSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %270) #7
  %272 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.17", ptr %35, i32 0, i32 0
  store ptr %271, ptr %272, align 8
  br label %273

273:                                              ; preds = %288, %262
  %274 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35) #7
  br i1 %274, label %276, label %275

275:                                              ; preds = %273
  store i32 16, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br label %290

276:                                              ; preds = %273
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  %277 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #7
  %278 = load i32, ptr %277, align 4, !tbaa !9
  store i32 %278, ptr %36, align 4, !tbaa !9
  %279 = load i32, ptr %36, align 4, !tbaa !9
  %280 = sext i32 %279 to i64
  %281 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %280) #7
  %282 = load i32, ptr %281, align 4, !tbaa !9
  %283 = icmp eq i32 %282, -1
  br i1 %283, label %284, label %287

284:                                              ; preds = %276
  %285 = load i64, ptr %32, align 8, !tbaa !5
  %286 = add nsw i64 %285, 1
  store i64 %286, ptr %32, align 8, !tbaa !5
  br label %287

287:                                              ; preds = %284, %276
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %288

288:                                              ; preds = %287
  %289 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #7
  br label %273

290:                                              ; preds = %275
  call void @llvm.lifetime.start.p0(i64 16, ptr %37) #7
  %291 = getelementptr inbounds %struct.Town, ptr %37, i32 0, i32 0
  %292 = load i64, ptr %31, align 8, !tbaa !5
  store i64 %292, ptr %291, align 8, !tbaa !24
  %293 = getelementptr inbounds %struct.Town, ptr %37, i32 0, i32 1
  %294 = load i64, ptr %32, align 8, !tbaa !5
  store i64 %294, ptr %293, align 8, !tbaa !26
  invoke void @_ZNSt6vectorI4TownSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(16) %37)
          to label %295 unwind label %313

295:                                              ; preds = %290
  call void @llvm.lifetime.end.p0(i64 16, ptr %37) #7
  %296 = load i64, ptr %32, align 8, !tbaa !5
  %297 = load i64, ptr %26, align 8, !tbaa !5
  %298 = add nsw i64 %297, %296
  store i64 %298, ptr %26, align 8, !tbaa !5
  %299 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.2)
          to label %300 unwind label %317

300:                                              ; preds = %295
  %301 = load i64, ptr %31, align 8, !tbaa !5
  %302 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %299, i64 noundef %301)
          to label %303 unwind label %317

303:                                              ; preds = %300
  %304 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %302, ptr noundef @.str.3)
          to label %305 unwind label %317

305:                                              ; preds = %303
  %306 = load i64, ptr %32, align 8, !tbaa !5
  %307 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %304, i64 noundef %306)
          to label %308 unwind label %317

308:                                              ; preds = %305
  %309 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %307, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %310 unwind label %317

310:                                              ; preds = %308
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %311

311:                                              ; preds = %310
  %312 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt6vectorIiSaIiEES1_IS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #7
  br label %259

313:                                              ; preds = %290
  %314 = landingpad { ptr, i32 }
          cleanup
  %315 = extractvalue { ptr, i32 } %314, 0
  store ptr %315, ptr %5, align 8
  %316 = extractvalue { ptr, i32 } %314, 1
  store i32 %316, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %37) #7
  br label %321

317:                                              ; preds = %308, %305, %303, %300, %295
  %318 = landingpad { ptr, i32 }
          cleanup
  %319 = extractvalue { ptr, i32 } %318, 0
  store ptr %319, ptr %5, align 8
  %320 = extractvalue { ptr, i32 } %318, 1
  store i32 %320, ptr %6, align 4
  br label %321

321:                                              ; preds = %317, %313
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %464

322:                                              ; preds = %261
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  invoke void @_ZN4MintILx1000000007EEC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %38, i64 noundef 0)
          to label %323 unwind label %334

323:                                              ; preds = %322
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  %324 = load i64, ptr %2, align 8, !tbaa !5
  %325 = sub nsw i64 %324, 1
  invoke void @_ZN4MintILx1000000007EEC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %39, i64 noundef %325)
          to label %326 unwind label %338

326:                                              ; preds = %323
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  %327 = call ptr @_ZNSt6vectorI4TownSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  %328 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %40, i32 0, i32 0
  store ptr %327, ptr %328, align 8
  br label %329

329:                                              ; preds = %356, %326
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #7
  %330 = call ptr @_ZNSt6vectorI4TownSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  %331 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %41, i32 0, i32 0
  store ptr %330, ptr %331, align 8
  %332 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TownSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull align 8 dereferenceable(8) %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #7
  br i1 %332, label %342, label %333

333:                                              ; preds = %329
  store i32 18, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  br label %362

334:                                              ; preds = %322
  %335 = landingpad { ptr, i32 }
          cleanup
  %336 = extractvalue { ptr, i32 } %335, 0
  store ptr %336, ptr %5, align 8
  %337 = extractvalue { ptr, i32 } %335, 1
  store i32 %337, ptr %6, align 4
  br label %463

338:                                              ; preds = %458, %456, %323
  %339 = landingpad { ptr, i32 }
          cleanup
  %340 = extractvalue { ptr, i32 } %339, 0
  store ptr %340, ptr %5, align 8
  %341 = extractvalue { ptr, i32 } %339, 1
  store i32 %341, ptr %6, align 4
  br label %462

342:                                              ; preds = %329
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #7
  %343 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %40) #7
  %344 = getelementptr inbounds %struct.Town, ptr %343, i32 0, i32 0
  %345 = load i64, ptr %344, align 8, !tbaa !24
  %346 = sub nsw i64 %345, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #7
  %347 = load i64, ptr %26, align 8, !tbaa !5
  %348 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %39, i64 noundef %347)
          to label %349 unwind label %358

349:                                              ; preds = %342
  %350 = getelementptr inbounds %class.Mint, ptr %43, i32 0, i32 0
  store i64 %348, ptr %350, align 8
  %351 = invoke i64 @_ZmlILx1000000007EE4MintIXT_EExRKS1_(i64 noundef %346, ptr noundef nonnull align 8 dereferenceable(8) %43)
          to label %352 unwind label %358

352:                                              ; preds = %349
  %353 = getelementptr inbounds %class.Mint, ptr %42, i32 0, i32 0
  store i64 %351, ptr %353, align 8
  %354 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4MintILx1000000007EEpLERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(8) %42)
          to label %355 unwind label %358

355:                                              ; preds = %352
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #7
  br label %356

356:                                              ; preds = %355
  %357 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %40) #7
  br label %329, !llvm.loop !27

358:                                              ; preds = %352, %349, %342
  %359 = landingpad { ptr, i32 }
          cleanup
  %360 = extractvalue { ptr, i32 } %359, 0
  store ptr %360, ptr %5, align 8
  %361 = extractvalue { ptr, i32 } %359, 1
  store i32 %361, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  br label %462

362:                                              ; preds = %333
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #7
  %363 = call ptr @_ZNSt6vectorI4TownSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  %364 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %44, i32 0, i32 0
  store ptr %363, ptr %364, align 8
  br label %365

365:                                              ; preds = %454, %362
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #7
  %366 = call ptr @_ZNSt6vectorI4TownSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  %367 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %45, i32 0, i32 0
  store ptr %366, ptr %367, align 8
  %368 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TownSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull align 8 dereferenceable(8) %45) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #7
  br i1 %368, label %370, label %369

369:                                              ; preds = %365
  store i32 21, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #7
  br label %456

370:                                              ; preds = %365
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #7
  %371 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %44, i64 noundef 1) #7
  %372 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %46, i32 0, i32 0
  store ptr %371, ptr %372, align 8
  br label %373

373:                                              ; preds = %432, %370
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #7
  %374 = call ptr @_ZNSt6vectorI4TownSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  %375 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %47, i32 0, i32 0
  store ptr %374, ptr %375, align 8
  %376 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TownSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %47) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #7
  br i1 %376, label %378, label %377

377:                                              ; preds = %373
  store i32 24, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  br label %453

378:                                              ; preds = %373
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #7
  %379 = load i64, ptr %26, align 8, !tbaa !5
  %380 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %39, i64 noundef %379)
          to label %381 unwind label %434

381:                                              ; preds = %378
  %382 = getelementptr inbounds %class.Mint, ptr %49, i32 0, i32 0
  store i64 %380, ptr %382, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #7
  %383 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #7
  %384 = getelementptr inbounds %struct.Town, ptr %383, i32 0, i32 0
  %385 = load i64, ptr %384, align 8, !tbaa !24
  invoke void @_ZN4MintILx1000000007EEC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %54, i64 noundef %385)
          to label %386 unwind label %438

386:                                              ; preds = %381
  %387 = invoke i64 @_ZNK4MintILx1000000007EEmiERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %54)
          to label %388 unwind label %438

388:                                              ; preds = %386
  %389 = getelementptr inbounds %class.Mint, ptr %53, i32 0, i32 0
  store i64 %387, ptr %389, align 8
  %390 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %44) #7
  %391 = getelementptr inbounds %struct.Town, ptr %390, i32 0, i32 1
  %392 = load i64, ptr %391, align 8, !tbaa !26
  %393 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %53, i64 noundef %392)
          to label %394 unwind label %438

394:                                              ; preds = %388
  %395 = getelementptr inbounds %class.Mint, ptr %52, i32 0, i32 0
  store i64 %393, ptr %395, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %55) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %57) #7
  %396 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %44) #7
  %397 = getelementptr inbounds %struct.Town, ptr %396, i32 0, i32 0
  %398 = load i64, ptr %397, align 8, !tbaa !24
  invoke void @_ZN4MintILx1000000007EEC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %57, i64 noundef %398)
          to label %399 unwind label %442

399:                                              ; preds = %394
  %400 = invoke i64 @_ZNK4MintILx1000000007EEmiERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %57)
          to label %401 unwind label %442

401:                                              ; preds = %399
  %402 = getelementptr inbounds %class.Mint, ptr %56, i32 0, i32 0
  store i64 %400, ptr %402, align 8
  %403 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #7
  %404 = getelementptr inbounds %struct.Town, ptr %403, i32 0, i32 1
  %405 = load i64, ptr %404, align 8, !tbaa !26
  %406 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %56, i64 noundef %405)
          to label %407 unwind label %442

407:                                              ; preds = %401
  %408 = getelementptr inbounds %class.Mint, ptr %55, i32 0, i32 0
  store i64 %406, ptr %408, align 8
  %409 = invoke i64 @_ZNK4MintILx1000000007EEmlERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull align 8 dereferenceable(8) %55)
          to label %410 unwind label %442

410:                                              ; preds = %407
  %411 = getelementptr inbounds %class.Mint, ptr %51, i32 0, i32 0
  store i64 %409, ptr %411, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %58) #7
  %412 = load i64, ptr %26, align 8, !tbaa !5
  %413 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %44) #7
  %414 = getelementptr inbounds %struct.Town, ptr %413, i32 0, i32 1
  %415 = load i64, ptr %414, align 8, !tbaa !26
  %416 = sub nsw i64 %412, %415
  %417 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #7
  %418 = getelementptr inbounds %struct.Town, ptr %417, i32 0, i32 1
  %419 = load i64, ptr %418, align 8, !tbaa !26
  %420 = sub nsw i64 %416, %419
  %421 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %39, i64 noundef %420)
          to label %422 unwind label %446

422:                                              ; preds = %410
  %423 = getelementptr inbounds %class.Mint, ptr %58, i32 0, i32 0
  store i64 %421, ptr %423, align 8
  %424 = invoke i64 @_ZNK4MintILx1000000007EEmlERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull align 8 dereferenceable(8) %58)
          to label %425 unwind label %446

425:                                              ; preds = %422
  %426 = getelementptr inbounds %class.Mint, ptr %50, i32 0, i32 0
  store i64 %424, ptr %426, align 8
  %427 = invoke i64 @_ZNK4MintILx1000000007EEmiERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull align 8 dereferenceable(8) %50)
          to label %428 unwind label %446

428:                                              ; preds = %425
  %429 = getelementptr inbounds %class.Mint, ptr %48, i32 0, i32 0
  store i64 %427, ptr %429, align 8
  %430 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4MintILx1000000007EEpLERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(8) %48)
          to label %431 unwind label %446

431:                                              ; preds = %428
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %55) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #7
  br label %432

432:                                              ; preds = %431
  %433 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #7
  br label %373, !llvm.loop !28

434:                                              ; preds = %378
  %435 = landingpad { ptr, i32 }
          cleanup
  %436 = extractvalue { ptr, i32 } %435, 0
  store ptr %436, ptr %5, align 8
  %437 = extractvalue { ptr, i32 } %435, 1
  store i32 %437, ptr %6, align 4
  br label %452

438:                                              ; preds = %388, %386, %381
  %439 = landingpad { ptr, i32 }
          cleanup
  %440 = extractvalue { ptr, i32 } %439, 0
  store ptr %440, ptr %5, align 8
  %441 = extractvalue { ptr, i32 } %439, 1
  store i32 %441, ptr %6, align 4
  br label %451

442:                                              ; preds = %407, %401, %399, %394
  %443 = landingpad { ptr, i32 }
          cleanup
  %444 = extractvalue { ptr, i32 } %443, 0
  store ptr %444, ptr %5, align 8
  %445 = extractvalue { ptr, i32 } %443, 1
  store i32 %445, ptr %6, align 4
  br label %450

446:                                              ; preds = %428, %425, %422, %410
  %447 = landingpad { ptr, i32 }
          cleanup
  %448 = extractvalue { ptr, i32 } %447, 0
  store ptr %448, ptr %5, align 8
  %449 = extractvalue { ptr, i32 } %447, 1
  store i32 %449, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #7
  br label %450

450:                                              ; preds = %446, %442
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %55) #7
  br label %451

451:                                              ; preds = %450, %438
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #7
  br label %452

452:                                              ; preds = %451, %434
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #7
  br label %462

453:                                              ; preds = %377
  br label %454

454:                                              ; preds = %453
  %455 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %44) #7
  br label %365, !llvm.loop !29

456:                                              ; preds = %369
  %457 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZlsILx1000000007EERSoS0_RK4MintIXT_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %458 unwind label %338

458:                                              ; preds = %456
  %459 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %457, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %460 unwind label %338

460:                                              ; preds = %458
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @_ZNSt6vectorI4TownSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #7
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #7
  call void @_ZN9UnionFindD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %461 = load i32, ptr %1, align 4
  ret i32 %461

462:                                              ; preds = %452, %358, %338
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  br label %463

463:                                              ; preds = %462, %334
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  br label %464

464:                                              ; preds = %463, %321
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @_ZNSt6vectorI4TownSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #7
  br label %465

465:                                              ; preds = %464, %251
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #7
  br label %466

466:                                              ; preds = %465, %142
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #7
  br label %467

467:                                              ; preds = %466, %125
  call void @_ZN9UnionFindD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  br label %468

468:                                              ; preds = %467, %107
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  br label %469

469:                                              ; preds = %468, %89
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br label %470

470:                                              ; preds = %469, %68
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %471

471:                                              ; preds = %470
  %472 = load ptr, ptr %5, align 8
  %473 = load i32, ptr %6, align 4
  %474 = insertvalue { ptr, i32 } poison, ptr %472, 0
  %475 = insertvalue { ptr, i32 } %474, i32 %473, 1
  resume { ptr, i32 } %475
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9UnionFindC2Ei(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #1 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 nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

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

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

; 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 noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #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)) #1 align 2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZmlILx1000000007EE4MintIXT_EExRKS1_(i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

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

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

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

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

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

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

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

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

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

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

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

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


; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"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::allocator" = type { i8 }
%class.UnionFind = type { i32, %"class.std::vector" }
%"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.std::allocator.4" = type { i8 }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<Town, std::allocator<Town>>::_Vector_impl" }
%"struct.std::_Vector_base<Town, std::allocator<Town>>::_Vector_impl" = type { %"struct.std::_Vector_base<Town, std::allocator<Town>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Town, std::allocator<Town>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.17" = type { ptr }
%struct.Town = type { i64, i64 }
%class.Mint = type { i64 }
%"class.__gnu_cxx::__normal_iterator.18" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca %class.UnionFind, align 8
  %5 = alloca %"class.std::vector.0", align 8
  %6 = alloca i8, align 1
  %7 = alloca %"class.std::allocator.4", align 1
  %8 = alloca %"class.std::vector.7", align 8
  %9 = alloca %"struct.std::_Bit_reference", align 8
  %10 = alloca %"struct.std::_Bit_reference", align 8
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca [1 x i32], align 4
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::_Bit_reference", align 8
  %16 = alloca %"struct.std::_Bit_reference", align 8
  %17 = alloca %"class.std::vector.12", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator.17", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.17", align 8
  %22 = alloca %struct.Town, align 8
  %23 = alloca %class.Mint, align 8
  %24 = alloca %class.Mint, align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %27 = alloca %class.Mint, align 8
  %28 = alloca %class.Mint, align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %31 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %32 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %33 = alloca %class.Mint, align 8
  %34 = alloca %class.Mint, align 8
  %35 = alloca %class.Mint, align 8
  %36 = alloca %class.Mint, align 8
  %37 = alloca %class.Mint, align 8
  %38 = alloca %class.Mint, align 8
  %39 = alloca %class.Mint, align 8
  %40 = alloca %class.Mint, align 8
  %41 = alloca %class.Mint, align 8
  %42 = alloca %class.Mint, align 8
  %43 = alloca %class.Mint, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  %45 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %45, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %46 unwind label %52

46:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  %47 = load i64, ptr %1, align 8, !tbaa !5
  %48 = icmp sgt i64 %47, 0
  br i1 %48, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %66, %46
  %.lcssa87 = phi i64 [ %47, %46 ], [ %67, %66 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  %49 = trunc i64 %.lcssa87 to i32
  invoke void @_ZN9UnionFindC2Ei(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %49)
          to label %.preheader unwind label %69

.preheader:                                       ; preds = %._crit_edge
  %50 = load i64, ptr %1, align 8, !tbaa !5
  %51 = icmp sgt i64 %50, 0
  br i1 %51, label %.lr.ph91, label %._crit_edge92

52:                                               ; preds = %0
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  br label %284

.lr.ph:                                           ; preds = %46, %66
  %indvars.iv = phi i64 [ %indvars.iv.next, %66 ], [ 0, %46 ]
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #7
  %55 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %54)
          to label %56 unwind label %64

56:                                               ; preds = %.lr.ph
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #7
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %60, label %66

60:                                               ; preds = %56
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #7
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %61, align 4, !tbaa !9
  br label %66

64:                                               ; preds = %.lr.ph
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %283

66:                                               ; preds = %56, %60
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %67 = load i64, ptr %1, align 8, !tbaa !5
  %68 = icmp sgt i64 %67, %indvars.iv.next
  br i1 %68, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge92:                                    ; preds = %81, %.preheader
  %.lcssa = phi i64 [ %50, %.preheader ], [ %82, %81 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  store i8 0, ptr %6, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #7
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %.lcssa, ptr noundef nonnull align 1 dereferenceable(1) %6, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %84 unwind label %95

69:                                               ; preds = %._crit_edge
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %282

.lr.ph91:                                         ; preds = %.preheader, %81
  %indvars.iv127 = phi i64 [ %indvars.iv.next128, %81 ], [ 0, %.preheader ]
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv127) #7
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = icmp sgt i32 %72, -1
  br i1 %73, label %74, label %81

74:                                               ; preds = %.lr.ph91
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv127) #7
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = trunc nuw nsw i64 %indvars.iv127 to i32
  %78 = invoke noundef zeroext i1 @_ZN9UnionFind5mergeEii(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %77, i32 noundef %76)
          to label %81 unwind label %79

79:                                               ; preds = %74
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %281

81:                                               ; preds = %.lr.ph91, %74
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %82 = load i64, ptr %1, align 8, !tbaa !5
  %83 = icmp sgt i64 %82, %indvars.iv.next128
  br i1 %83, label %.lr.ph91, label %._crit_edge92, !llvm.loop !15

84:                                               ; preds = %._crit_edge92
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  %85 = load i64, ptr %1, align 8, !tbaa !5
  %86 = icmp sgt i64 %85, 0
  br i1 %86, label %.lr.ph101, label %._crit_edge102

.lr.ph101:                                        ; preds = %84
  %87 = getelementptr inbounds i8, ptr %9, i64 8
  %88 = getelementptr inbounds i8, ptr %10, i64 8
  %89 = getelementptr inbounds i8, ptr %15, i64 8
  %90 = getelementptr inbounds i8, ptr %16, i64 8
  br label %97

._crit_edge102:                                   ; preds = %152, %84
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #7
  call void @_ZNSt6vectorI4TownSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  %91 = call ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  store ptr %91, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #7
  %92 = call ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  store ptr %92, ptr %19, align 8
  %93 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt6vectorIiSaIiEES1_IS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br i1 %93, label %.lr.ph110, label %._crit_edge111

.lr.ph110:                                        ; preds = %._crit_edge102
  %94 = getelementptr inbounds i8, ptr %22, i64 8
  br label %164

95:                                               ; preds = %._crit_edge92
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  br label %280

97:                                               ; preds = %.lr.ph101, %152
  %indvars.iv130 = phi i64 [ 0, %.lr.ph101 ], [ %indvars.iv.next131.pre-phi, %152 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  %98 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %indvars.iv130)
          to label %99 unwind label %103

99:                                               ; preds = %97
  %100 = extractvalue { ptr, i64 } %98, 0
  store ptr %100, ptr %9, align 8
  %101 = extractvalue { ptr, i64 } %98, 1
  store i64 %101, ptr %87, align 8
  %102 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  br i1 %102, label %._crit_edge134, label %105

._crit_edge134:                                   ; preds = %99
  %.pre = add nuw nsw i64 %indvars.iv130, 1
  br label %152

103:                                              ; preds = %97
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  br label %279

105:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #7
  %106 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %indvars.iv130)
          to label %107 unwind label %117

107:                                              ; preds = %105
  %108 = extractvalue { ptr, i64 } %106, 0
  store ptr %108, ptr %10, align 8
  %109 = extractvalue { ptr, i64 } %106, 1
  store i64 %109, ptr %88, align 8
  %110 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %10, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %111 = trunc nuw nsw i64 %indvars.iv130 to i32
  store i32 %111, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr nonnull %12, i64 1, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %112 unwind label %119

112:                                              ; preds = %107
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  %113 = add nuw nsw i64 %indvars.iv130, 1
  %114 = trunc nsw i64 %113 to i32
  store i32 %114, ptr %14, align 4, !tbaa !9
  %115 = load i64, ptr %1, align 8, !tbaa !5
  %116 = icmp sgt i64 %115, %113
  br i1 %116, label %.lr.ph96, label %._crit_edge97

._crit_edge97:                                    ; preds = %145, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %151 unwind label %155

117:                                              ; preds = %105
  %118 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  br label %279

119:                                              ; preds = %107
  %120 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  br label %158

.lr.ph96:                                         ; preds = %112, %145
  %121 = phi i64 [ %147, %145 ], [ %113, %112 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #7
  %122 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %121)
          to label %123 unwind label %139

123:                                              ; preds = %.lr.ph96
  %124 = extractvalue { ptr, i64 } %122, 0
  store ptr %124, ptr %15, align 8
  %125 = extractvalue { ptr, i64 } %122, 1
  store i64 %125, ptr %89, align 8
  %126 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #7
  br i1 %126, label %.critedge, label %127

127:                                              ; preds = %123
  %128 = load i32, ptr %14, align 4, !tbaa !9
  %129 = invoke noundef zeroext i1 @_ZN9UnionFind7is_sameEii(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %111, i32 noundef %128)
          to label %130 unwind label %139

130:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  br i1 %129, label %131, label %145

131:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #7
  %132 = load i32, ptr %14, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %133)
          to label %135 unwind label %141

135:                                              ; preds = %131
  %136 = extractvalue { ptr, i64 } %134, 0
  store ptr %136, ptr %16, align 8
  %137 = extractvalue { ptr, i64 } %134, 1
  store i64 %137, ptr %90, align 8
  %138 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %16, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #7
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %145 unwind label %143

139:                                              ; preds = %127, %.lr.ph96
  %140 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  br label %150

141:                                              ; preds = %131
  %142 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #7
  br label %150

143:                                              ; preds = %135
  %144 = landingpad { ptr, i32 }
          cleanup
  br label %150

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

145:                                              ; preds = %130, %.critedge, %135
  %146 = load i32, ptr %14, align 4, !tbaa !9
  %storemerge = add nsw i32 %146, 1
  store i32 %storemerge, ptr %14, align 4, !tbaa !9
  %147 = sext i32 %storemerge to i64
  %148 = load i64, ptr %1, align 8, !tbaa !5
  %149 = icmp sgt i64 %148, %147
  br i1 %149, label %.lr.ph96, label %._crit_edge97, !llvm.loop !16

150:                                              ; preds = %143, %141, %139
  %.pn69 = phi { ptr, i32 } [ %144, %143 ], [ %142, %141 ], [ %140, %139 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %157

151:                                              ; preds = %._crit_edge97
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  br label %152

152:                                              ; preds = %._crit_edge134, %151
  %indvars.iv.next131.pre-phi = phi i64 [ %.pre, %._crit_edge134 ], [ %113, %151 ]
  %153 = load i64, ptr %1, align 8, !tbaa !5
  %154 = icmp sgt i64 %153, %indvars.iv.next131.pre-phi
  br i1 %154, label %97, label %._crit_edge102, !llvm.loop !17

155:                                              ; preds = %._crit_edge97
  %156 = landingpad { ptr, i32 }
          cleanup
  br label %157

157:                                              ; preds = %155, %150
  %.pn69.pn = phi { ptr, i32 } [ %.pn69, %150 ], [ %156, %155 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  br label %158

158:                                              ; preds = %157, %119
  %.pn69.pn.pn = phi { ptr, i32 } [ %.pn69.pn, %157 ], [ %120, %119 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  br label %279

._crit_edge111:                                   ; preds = %190, %._crit_edge102
  %.057.lcssa = phi i64 [ 0, %._crit_edge102 ], [ %180, %190 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #7
  call void @_ZN4MintILx1000000007EEC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %23, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #7
  %159 = load i64, ptr %1, align 8, !tbaa !5
  %160 = add nsw i64 %159, -1
  call void @_ZN4MintILx1000000007EEC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %24, i64 noundef %160)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #7
  %161 = call ptr @_ZNSt6vectorI4TownSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %161, ptr %25, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #7
  %162 = call ptr @_ZNSt6vectorI4TownSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %162, ptr %26, align 8
  %163 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TownSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #7
  br i1 %163, label %.lr.ph114, label %._crit_edge115

164:                                              ; preds = %.lr.ph110, %190
  %.057108 = phi i64 [ 0, %.lr.ph110 ], [ %180, %190 ]
  %165 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt6vectorIiSaIiEES1_IS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %166 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %165) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #7
  %167 = call ptr @_ZNKSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %165) #7
  store ptr %167, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #7
  %168 = call ptr @_ZNKSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %165) #7
  store ptr %168, ptr %21, align 8
  %169 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br i1 %169, label %.lr.ph105, label %._crit_edge106

._crit_edge106:                                   ; preds = %.lr.ph105, %164
  %.052.lcssa = phi i64 [ 0, %164 ], [ %spec.select, %.lr.ph105 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %22) #7
  store i64 %166, ptr %22, align 8, !tbaa !18
  store i64 %.052.lcssa, ptr %94, align 8, !tbaa !20
  invoke void @_ZNSt6vectorI4TownSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %179 unwind label %193

.lr.ph105:                                        ; preds = %164, %.lr.ph105
  %.052103 = phi i64 [ %spec.select, %.lr.ph105 ], [ 0, %164 ]
  %170 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %171 = load i32, ptr %170, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %172) #7
  %174 = load i32, ptr %173, align 4, !tbaa !9
  %175 = icmp eq i32 %174, -1
  %176 = zext i1 %175 to i64
  %spec.select = add nuw nsw i64 %.052103, %176
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %178 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br i1 %178, label %.lr.ph105, label %._crit_edge106

179:                                              ; preds = %._crit_edge106
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #7
  %180 = add nsw i64 %.052.lcssa, %.057108
  %181 = 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.2)
          to label %182 unwind label %195

182:                                              ; preds = %179
  %183 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %181, i64 noundef %166)
          to label %184 unwind label %195

184:                                              ; preds = %182
  %185 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %183, ptr noundef nonnull @.str.3)
          to label %186 unwind label %195

186:                                              ; preds = %184
  %187 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %185, i64 noundef %.052.lcssa)
          to label %188 unwind label %195

188:                                              ; preds = %186
  %189 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %187, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %190 unwind label %195

190:                                              ; preds = %188
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt6vectorIiSaIiEES1_IS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %192 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt6vectorIiSaIiEES1_IS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br i1 %192, label %164, label %._crit_edge111

193:                                              ; preds = %._crit_edge106
  %194 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #7
  br label %197

195:                                              ; preds = %188, %186, %184, %182, %179
  %196 = landingpad { ptr, i32 }
          cleanup
  br label %197

197:                                              ; preds = %195, %193
  %.pn66 = phi { ptr, i32 } [ %196, %195 ], [ %194, %193 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  br label %278

._crit_edge115:                                   ; preds = %209, %._crit_edge111
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %29) #7
  %198 = call ptr @_ZNSt6vectorI4TownSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %198, ptr %29, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %30) #7
  %199 = call ptr @_ZNSt6vectorI4TownSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %199, ptr %30, align 8
  %200 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TownSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #7
  br i1 %200, label %.lr.ph120, label %._crit_edge121

201:                                              ; preds = %274, %._crit_edge121
  %202 = landingpad { ptr, i32 }
          cleanup
  br label %277

.lr.ph114:                                        ; preds = %._crit_edge111, %209
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %27) #7
  %203 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  %204 = load i64, ptr %203, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #7
  %205 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %24, i64 noundef %.057.lcssa)
          to label %206 unwind label %214

206:                                              ; preds = %.lr.ph114
  %207 = add nsw i64 %204, -1
  store i64 %205, ptr %28, align 8
  %208 = invoke i64 @_ZmlILx1000000007EE4MintIXT_EExRKS1_(i64 noundef %207, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %209 unwind label %214

209:                                              ; preds = %206
  store i64 %208, ptr %27, align 8
  %210 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4MintILx1000000007EEpLERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %27)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #7
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #7
  %212 = call ptr @_ZNSt6vectorI4TownSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %212, ptr %26, align 8
  %213 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TownSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #7
  br i1 %213, label %.lr.ph114, label %._crit_edge115, !llvm.loop !21

214:                                              ; preds = %206, %.lr.ph114
  %215 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #7
  br label %277

._crit_edge121:                                   ; preds = %._crit_edge118, %._crit_edge115
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %29) #7
  %216 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZlsILx1000000007EERSoS0_RK4MintIXT_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %274 unwind label %201

.lr.ph120:                                        ; preds = %._crit_edge115, %._crit_edge118
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %31) #7
  %217 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %29, i64 noundef 1) #7
  store ptr %217, ptr %31, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %32) #7
  %218 = call ptr @_ZNSt6vectorI4TownSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %218, ptr %32, align 8
  %219 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TownSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %32) #7
  br i1 %219, label %.lr.ph117, label %._crit_edge118

._crit_edge118:                                   ; preds = %258, %.lr.ph120
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #7
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %30) #7
  %221 = call ptr @_ZNSt6vectorI4TownSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %221, ptr %30, align 8
  %222 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TownSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #7
  br i1 %222, label %.lr.ph120, label %._crit_edge121, !llvm.loop !22

.lr.ph117:                                        ; preds = %.lr.ph120, %258
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %33) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %34) #7
  %223 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %24, i64 noundef %.057.lcssa)
          to label %224 unwind label %263

224:                                              ; preds = %.lr.ph117
  store i64 %223, ptr %34, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %35) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %36) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %37) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %38) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %39) #7
  %225 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #7
  %226 = load i64, ptr %225, align 8, !tbaa !18
  call void @_ZN4MintILx1000000007EEC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %39, i64 noundef %226)
  %227 = invoke i64 @_ZNK4MintILx1000000007EEmiERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %39)
          to label %228 unwind label %265

228:                                              ; preds = %224
  store i64 %227, ptr %38, align 8
  %229 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  %230 = getelementptr inbounds i8, ptr %229, i64 8
  %231 = load i64, ptr %230, align 8, !tbaa !20
  %232 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %38, i64 noundef %231)
          to label %233 unwind label %265

233:                                              ; preds = %228
  store i64 %232, ptr %37, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %40) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %41) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %42) #7
  %234 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  %235 = load i64, ptr %234, align 8, !tbaa !18
  call void @_ZN4MintILx1000000007EEC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %42, i64 noundef %235)
  %236 = invoke i64 @_ZNK4MintILx1000000007EEmiERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %42)
          to label %237 unwind label %267

237:                                              ; preds = %233
  store i64 %236, ptr %41, align 8
  %238 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #7
  %239 = getelementptr inbounds i8, ptr %238, i64 8
  %240 = load i64, ptr %239, align 8, !tbaa !20
  %241 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %41, i64 noundef %240)
          to label %242 unwind label %267

242:                                              ; preds = %237
  store i64 %241, ptr %40, align 8
  %243 = invoke i64 @_ZNK4MintILx1000000007EEmlERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %40)
          to label %244 unwind label %267

244:                                              ; preds = %242
  store i64 %243, ptr %36, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %43) #7
  %245 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  %246 = getelementptr inbounds i8, ptr %245, i64 8
  %247 = load i64, ptr %246, align 8, !tbaa !20
  %248 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #7
  %249 = getelementptr inbounds i8, ptr %248, i64 8
  %250 = load i64, ptr %249, align 8, !tbaa !20
  %251 = add i64 %247, %250
  %252 = sub i64 %.057.lcssa, %251
  %253 = invoke i64 @_ZN4MintILx1000000007EE5powerEx(ptr noundef nonnull align 8 dereferenceable(8) %24, i64 noundef %252)
          to label %254 unwind label %269

254:                                              ; preds = %244
  store i64 %253, ptr %43, align 8
  %255 = invoke i64 @_ZNK4MintILx1000000007EEmlERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull align 8 dereferenceable(8) %43)
          to label %256 unwind label %269

256:                                              ; preds = %254
  store i64 %255, ptr %35, align 8
  %257 = invoke i64 @_ZNK4MintILx1000000007EEmiERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %258 unwind label %269

258:                                              ; preds = %256
  store i64 %257, ptr %33, align 8
  %259 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4MintILx1000000007EEpLERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %33)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %43) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %42) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %40) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %39) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %37) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %35) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %33) #7
  %260 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TownSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %32) #7
  %261 = call ptr @_ZNSt6vectorI4TownSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %261, ptr %32, align 8
  %262 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TownSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %32) #7
  br i1 %262, label %.lr.ph117, label %._crit_edge118, !llvm.loop !23

263:                                              ; preds = %.lr.ph117
  %264 = landingpad { ptr, i32 }
          cleanup
  br label %273

265:                                              ; preds = %228, %224
  %266 = landingpad { ptr, i32 }
          cleanup
  br label %272

267:                                              ; preds = %242, %237, %233
  %268 = landingpad { ptr, i32 }
          cleanup
  br label %271

269:                                              ; preds = %256, %254, %244
  %270 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %43) #7
  br label %271

271:                                              ; preds = %269, %267
  %.pn = phi { ptr, i32 } [ %270, %269 ], [ %268, %267 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %42) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %40) #7
  br label %272

272:                                              ; preds = %271, %265
  %.pn.pn = phi { ptr, i32 } [ %.pn, %271 ], [ %266, %265 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %39) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %37) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %35) #7
  br label %273

273:                                              ; preds = %272, %263
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %272 ], [ %264, %263 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %29) #7
  br label %277

274:                                              ; preds = %._crit_edge121
  %275 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %216, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %276 unwind label %201

276:                                              ; preds = %274
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #7
  call void @_ZNSt6vectorI4TownSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #7
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  call void @_ZN9UnionFindD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

277:                                              ; preds = %273, %214, %201
  %.pn64 = phi { ptr, i32 } [ %215, %214 ], [ %.pn.pn.pn, %273 ], [ %202, %201 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #7
  br label %278

278:                                              ; preds = %277, %197
  %.pn66.pn = phi { ptr, i32 } [ %.pn66, %197 ], [ %.pn64, %277 ]
  call void @_ZNSt6vectorI4TownSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #7
  br label %279

279:                                              ; preds = %103, %117, %158, %278
  %.pn69.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn66.pn, %278 ], [ %.pn69.pn.pn, %158 ], [ %118, %117 ], [ %104, %103 ]
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #7
  br label %280

280:                                              ; preds = %279, %95
  %.pn69.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn69.pn.pn.pn.pn, %279 ], [ %96, %95 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  br label %281

281:                                              ; preds = %280, %79
  %.pn76 = phi { ptr, i32 } [ %80, %79 ], [ %.pn69.pn.pn.pn.pn.pn, %280 ]
  call void @_ZN9UnionFindD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  br label %282

282:                                              ; preds = %281, %69
  %.pn76.pn = phi { ptr, i32 } [ %.pn76, %281 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %283

283:                                              ; preds = %282, %64
  %.pn79 = phi { ptr, i32 } [ %65, %64 ], [ %.pn76.pn, %282 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  br label %284

284:                                              ; preds = %283, %52
  %.pn79.pn = phi { ptr, i32 } [ %.pn79, %283 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn79.pn
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9UnionFindC2Ei(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #1 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 nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

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

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

; 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 noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9UnionFind7is_sameEii(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 @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) 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 #1 align 2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZlsILx1000000007EERSoS0_RK4MintIXT_EE(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 void @_ZNSt6vectorI4TownSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

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

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

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

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

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


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