; LLVM IR from kazunetakahashi/atcoder :: 2019/0921_AGC038 (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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::tuple<int, int>, std::tuple<int, int>, std::_Identity<std::tuple<int, int>>, std::less<std::tuple<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::tuple<int, int>, std::tuple<int, int>, std::_Identity<std::tuple<int, int>>, std::less<std::tuple<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.1" = type { i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%class.UnionFind = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@A = external dso_local global [100010 x i32], align 16
@B = external dso_local global [100010 x i32], align 16
@C = external dso_local global [100010 x i32], align 16
@S = external dso_local global [2 x %"class.std::set"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; 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)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3Yesv() #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2Nov() #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::tuple", align 4
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %class.UnionFind, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %47, %0
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = load i64, ptr @Q, align 8, !tbaa !9
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %50

34:                                               ; preds = %28
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %37)
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %40
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 4 dereferenceable(4) %45)
  br label %47

47:                                               ; preds = %34
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %2, align 4, !tbaa !5
  br label %28, !llvm.loop !11

50:                                               ; preds = %33
  %51 = load i64, ptr @M, align 8, !tbaa !9
  %52 = load i64, ptr @N, align 8, !tbaa !9
  %53 = sub nsw i64 %52, 1
  %54 = icmp eq i64 %51, %53
  br i1 %54, label %55, label %74

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %70, %55
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = load i64, ptr @Q, align 8, !tbaa !9
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %73

62:                                               ; preds = %56
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp eq i32 %66, 1
  br i1 %67, label %68, label %69

68:                                               ; preds = %62
  call void @_Z2Nov()
  br label %69

69:                                               ; preds = %68, %62
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %3, align 4, !tbaa !5
  br label %56, !llvm.loop !13

73:                                               ; preds = %61
  call void @_Z3Yesv()
  br label %74

74:                                               ; preds = %73, %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %137, %74
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = load i64, ptr @Q, align 8, !tbaa !9
  %79 = icmp slt i64 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %140

81:                                               ; preds = %75
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = icmp sgt i32 %85, %89
  br i1 %90, label %91, label %98

91:                                               ; preds = %81
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %93
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %96
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %94, ptr noundef nonnull align 4 dereferenceable(4) %97) #7
  br label %98

98:                                               ; preds = %91, %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %100
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %103
  call void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %101, ptr noundef nonnull align 4 dereferenceable(4) %104) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sub nsw i32 1, %108
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [2 x %"class.std::set"], ptr @S, i64 0, i64 %110
  %112 = call ptr @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %111, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %113 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %6, i32 0, i32 0
  store ptr %112, ptr %113, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sub nsw i32 1, %117
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [2 x %"class.std::set"], ptr @S, i64 0, i64 %119
  %121 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %120) #7
  %122 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %7, i32 0, i32 0
  store ptr %121, ptr %122, align 8
  %123 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br i1 %123, label %124, label %125

124:                                              ; preds = %98
  call void @_Z2Nov()
  br label %125

125:                                              ; preds = %124, %98
  %126 = load i32, ptr %4, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [2 x %"class.std::set"], ptr @S, i64 0, i64 %130
  %132 = call { ptr, i8 } @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %131, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %133 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 0
  %134 = extractvalue { ptr, i8 } %132, 0
  store ptr %134, ptr %133, align 8
  %135 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 1
  %136 = extractvalue { ptr, i8 } %132, 1
  store i8 %136, ptr %135, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %137

137:                                              ; preds = %125
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %4, align 4, !tbaa !5
  br label %75, !llvm.loop !14

140:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #7
  %141 = load i64, ptr @N, align 8, !tbaa !9
  %142 = trunc i64 %141 to i32
  call void @_ZN9UnionFindC2Ei(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %142)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr @S, ptr %10, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %143 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  %144 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %143, ptr %144, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %145 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  %146 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %12, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  br label %147

147:                                              ; preds = %160, %140
  %148 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br i1 %148, label %150, label %149

149:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %166

150:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %151 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  store ptr %151, ptr %13, align 8, !tbaa !15
  %152 = load ptr, ptr %13, align 8, !tbaa !15
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 4 dereferenceable(8) %152) #7
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = load ptr, ptr %13, align 8, !tbaa !15
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 4 dereferenceable(8) %155) #7
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = invoke noundef zeroext i1 @_ZN9UnionFind5mergeEii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %154, i32 noundef %157)
          to label %159 unwind label %162

159:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %160

160:                                              ; preds = %159
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br label %147

162:                                              ; preds = %150
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %14, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %265

166:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store ptr getelementptr (i8, ptr @S, i64 48), ptr %16, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %167 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr (i8, ptr @S, i64 48)) #7
  %168 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %17, i32 0, i32 0
  store ptr %167, ptr %168, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %169 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr (i8, ptr @S, i64 48)) #7
  %170 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %169, ptr %170, align 8
  br label %171

171:                                              ; preds = %191, %166
  %172 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br i1 %172, label %174, label %173

173:                                              ; preds = %171
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %193

174:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %175 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  store ptr %175, ptr %19, align 8, !tbaa !15
  %176 = load ptr, ptr %19, align 8, !tbaa !15
  %177 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 4 dereferenceable(8) %176) #7
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = load ptr, ptr %19, align 8, !tbaa !15
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 4 dereferenceable(8) %179) #7
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = invoke noundef zeroext i1 @_ZN9UnionFind7is_sameEii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %178, i32 noundef %181)
          to label %183 unwind label %186

183:                                              ; preds = %174
  br i1 %182, label %184, label %190

184:                                              ; preds = %183
  invoke void @_Z2Nov()
          to label %185 unwind label %186

185:                                              ; preds = %184
  br label %190

186:                                              ; preds = %184, %174
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %14, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %265

190:                                              ; preds = %185, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %191

191:                                              ; preds = %190
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %171

193:                                              ; preds = %173
  invoke void @_ZN9UnionFind8all_rootEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %194 unwind label %202

194:                                              ; preds = %193
  invoke void @_ZN9UnionFind4viewEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %195 unwind label %202

195:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 0, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  store i64 0, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %224, %195
  %197 = load i32, ptr %22, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = load i64, ptr @N, align 8, !tbaa !9
  %200 = icmp slt i64 %198, %199
  br i1 %200, label %206, label %201

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

202:                                              ; preds = %194, %193
  %203 = landingpad { ptr, i32 }
          cleanup
  %204 = extractvalue { ptr, i32 } %203, 0
  store ptr %204, ptr %14, align 8
  %205 = extractvalue { ptr, i32 } %203, 1
  store i32 %205, ptr %15, align 4
  br label %265

206:                                              ; preds = %196
  %207 = load i32, ptr %22, align 4, !tbaa !5
  %208 = invoke noundef zeroext i1 @_ZN9UnionFind7is_rootEi(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %207)
          to label %209 unwind label %219

209:                                              ; preds = %206
  br i1 %208, label %210, label %223

210:                                              ; preds = %209
  %211 = load i32, ptr %22, align 4, !tbaa !5
  %212 = invoke noundef i64 @_ZN9UnionFind4sizeEi(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %211)
          to label %213 unwind label %219

213:                                              ; preds = %210
  %214 = sub nsw i64 %212, 1
  %215 = load i64, ptr %21, align 8, !tbaa !9
  %216 = add nsw i64 %215, %214
  store i64 %216, ptr %21, align 8, !tbaa !9
  %217 = load i64, ptr %20, align 8, !tbaa !9
  %218 = add nsw i64 %217, 1
  store i64 %218, ptr %20, align 8, !tbaa !9
  br label %223

219:                                              ; preds = %210, %206
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %14, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %264

223:                                              ; preds = %213, %209
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %22, align 4, !tbaa !5
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %22, align 4, !tbaa !5
  br label %196, !llvm.loop !17

227:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %228 = load i64, ptr %21, align 8, !tbaa !9
  %229 = load i64, ptr %20, align 8, !tbaa !9
  %230 = add nsw i64 %228, %229
  store i64 %230, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %231 = load i64, ptr %21, align 8, !tbaa !9
  %232 = load i64, ptr %20, align 8, !tbaa !9
  %233 = load i64, ptr %20, align 8, !tbaa !9
  %234 = sub nsw i64 %233, 1
  %235 = mul nsw i64 %232, %234
  %236 = sdiv i64 %235, 2
  %237 = add nsw i64 %231, %236
  store i64 %237, ptr %24, align 8, !tbaa !9
  %238 = load i64, ptr %23, align 8, !tbaa !9
  %239 = load i64, ptr @N, align 8, !tbaa !9
  %240 = icmp eq i64 %238, %239
  br i1 %240, label %241, label %242

241:                                              ; preds = %227
  br label %244

242:                                              ; preds = %227
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 280, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

243:                                              ; No predecessors!
  br label %244

244:                                              ; preds = %243, %241
  %245 = load i64, ptr %20, align 8, !tbaa !9
  %246 = icmp sge i64 %245, 3
  br i1 %246, label %247, label %261

247:                                              ; preds = %244
  %248 = load i64, ptr %23, align 8, !tbaa !9
  %249 = load i64, ptr @M, align 8, !tbaa !9
  %250 = icmp sle i64 %248, %249
  br i1 %250, label %251, label %261

251:                                              ; preds = %247
  %252 = load i64, ptr @M, align 8, !tbaa !9
  %253 = load i64, ptr %24, align 8, !tbaa !9
  %254 = icmp sle i64 %252, %253
  br i1 %254, label %255, label %261

255:                                              ; preds = %251
  invoke void @_Z3Yesv()
          to label %256 unwind label %257

256:                                              ; preds = %255
  br label %261

257:                                              ; preds = %261, %255
  %258 = landingpad { ptr, i32 }
          cleanup
  %259 = extractvalue { ptr, i32 } %258, 0
  store ptr %259, ptr %14, align 8
  %260 = extractvalue { ptr, i32 } %258, 1
  store i32 %260, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %264

261:                                              ; preds = %256, %251, %247, %244
  invoke void @_Z2Nov()
          to label %262 unwind label %257

262:                                              ; preds = %261
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @_ZN9UnionFindD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  %263 = load i32, ptr %1, align 4
  ret i32 %263

264:                                              ; preds = %257, %219
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %265

265:                                              ; preds = %264, %202, %186, %162
  call void @_ZN9UnionFindD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  br label %266

266:                                              ; preds = %265
  %267 = load ptr, ptr %14, align 8
  %268 = load i32, ptr %15, align 4
  %269 = insertvalue { ptr, i32 } poison, ptr %267, 0
  %270 = insertvalue { ptr, i32 } %269, i32 %268, 1
  resume { ptr, i32 } %270
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9UnionFind7is_rootEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #5 align 2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::tuple<int, int>, std::tuple<int, int>, std::_Identity<std::tuple<int, int>>, std::less<std::tuple<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::tuple<int, int>, std::tuple<int, int>, std::_Identity<std::tuple<int, int>>, std::less<std::tuple<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.1" = type { i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%class.UnionFind = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@A = external dso_local global [100010 x i32], align 16
@B = external dso_local global [100010 x i32], align 16
@C = external dso_local global [100010 x i32], align 16
@S = external dso_local global [2 x %"class.std::set"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; 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 #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3Yesv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2Nov() local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::tuple", align 4
  %2 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca %class.UnionFind, align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  %12 = load i64, ptr @Q, align 8, !tbaa !5
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %14 = phi i64 [ %12, %0 ], [ %26, %.lr.ph ]
  %15 = load i64, ptr @M, align 8, !tbaa !5
  %16 = load i64, ptr @N, align 8, !tbaa !5
  %17 = add nsw i64 %16, -1
  %18 = icmp eq i64 %15, %17
  br i1 %18, label %.preheader60, label %36

.preheader60:                                     ; preds = %._crit_edge
  %19 = icmp sgt i64 %14, 0
  br i1 %19, label %.lr.ph66, label %._crit_edge67

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %20 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %indvars.iv
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %22 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %indvars.iv
  %23 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %24 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %indvars.iv
  %25 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i64, ptr @Q, align 8, !tbaa !5
  %27 = icmp sgt i64 %26, %indvars.iv.next
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge67:                                    ; preds = %33, %.preheader60
  tail call void @_Z3Yesv()
  %.pre96 = load i64, ptr @Q, align 8, !tbaa !5
  br label %36

.lr.ph66:                                         ; preds = %.preheader60, %33
  %28 = phi i64 [ %34, %33 ], [ %14, %.preheader60 ]
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %33 ], [ 0, %.preheader60 ]
  %29 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %indvars.iv87
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %33

32:                                               ; preds = %.lr.ph66
  tail call void @_Z2Nov()
  %.pre = load i64, ptr @Q, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %.lr.ph66, %32
  %34 = phi i64 [ %28, %.lr.ph66 ], [ %.pre, %32 ]
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %35 = icmp sgt i64 %34, %indvars.iv.next88
  br i1 %35, label %.lr.ph66, label %._crit_edge67, !llvm.loop !13

36:                                               ; preds = %._crit_edge67, %._crit_edge
  %37 = phi i64 [ %.pre96, %._crit_edge67 ], [ %14, %._crit_edge ]
  %38 = icmp sgt i64 %37, 0
  br i1 %38, label %.lr.ph70, label %._crit_edge71

._crit_edge71:                                    ; preds = %64, %36
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  %39 = load i64, ptr @N, align 8, !tbaa !5
  %40 = trunc i64 %39 to i32
  call void @_ZN9UnionFindC2Ei(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %40)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %41 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  store ptr %41, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %42 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  store ptr %42, ptr %6, align 8
  %43 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %43, label %.lr.ph73, label %._crit_edge74

.lr.ph70:                                         ; preds = %36, %64
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %64 ], [ 0, %36 ]
  %44 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %indvars.iv90
  %45 = load i32, ptr %44, align 4, !tbaa !11
  %46 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %indvars.iv90
  %47 = load i32, ptr %46, align 4, !tbaa !11
  %48 = icmp sgt i32 %45, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %.lr.ph70
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %46) #7
  br label %50

50:                                               ; preds = %49, %.lr.ph70
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %46) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %51 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %indvars.iv90
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = sub nsw i32 1, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [2 x %"class.std::set"], ptr @S, i64 0, i64 %54
  %56 = call ptr @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %55, ptr noundef nonnull align 4 dereferenceable(8) %1)
  store ptr %56, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %57 = load i32, ptr %51, align 4, !tbaa !11
  %58 = sub nsw i32 1, %57
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [2 x %"class.std::set"], ptr @S, i64 0, i64 %59
  %61 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %60) #7
  store ptr %61, ptr %3, align 8
  %62 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br i1 %62, label %63, label %64

63:                                               ; preds = %50
  call void @_Z2Nov()
  br label %64

64:                                               ; preds = %63, %50
  %65 = load i32, ptr %51, align 4, !tbaa !11
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [2 x %"class.std::set"], ptr @S, i64 0, i64 %66
  %68 = call { ptr, i8 } @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %67, ptr noundef nonnull align 4 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %69 = load i64, ptr @Q, align 8, !tbaa !5
  %70 = icmp sgt i64 %69, %indvars.iv.next91
  br i1 %70, label %.lr.ph70, label %._crit_edge71, !llvm.loop !14

._crit_edge74:                                    ; preds = %80, %._crit_edge71
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %71 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @S, i64 48)) #7
  store ptr %71, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %72 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @S, i64 48)) #7
  store ptr %72, ptr %8, align 8
  %73 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %73, label %.lr.ph76, label %._crit_edge77

.lr.ph73:                                         ; preds = %._crit_edge71, %80
  %74 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 4 dereferenceable(8) %74) #7
  %76 = load i32, ptr %75, align 4, !tbaa !11
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 4 dereferenceable(8) %74) #7
  %78 = load i32, ptr %77, align 4, !tbaa !11
  %79 = invoke noundef zeroext i1 @_ZN9UnionFind5mergeEii(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %76, i32 noundef %78)
          to label %80 unwind label %83

80:                                               ; preds = %.lr.ph73
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %82 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %82, label %.lr.ph73, label %._crit_edge74

83:                                               ; preds = %.lr.ph73
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %132

._crit_edge77:                                    ; preds = %95, %._crit_edge74
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  invoke void @_ZN9UnionFind8all_rootEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %98 unwind label %107

.lr.ph76:                                         ; preds = %._crit_edge74, %95
  %85 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 4 dereferenceable(8) %85) #7
  %87 = load i32, ptr %86, align 4, !tbaa !11
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 4 dereferenceable(8) %85) #7
  %89 = load i32, ptr %88, align 4, !tbaa !11
  %90 = invoke noundef zeroext i1 @_ZN9UnionFind7is_sameEii(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %87, i32 noundef %89)
          to label %91 unwind label %93

91:                                               ; preds = %.lr.ph76
  br i1 %90, label %92, label %95

92:                                               ; preds = %91
  invoke void @_Z2Nov()
          to label %95 unwind label %93

93:                                               ; preds = %92, %.lr.ph76
  %94 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %132

95:                                               ; preds = %92, %91
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %97 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %97, label %.lr.ph76, label %._crit_edge77

98:                                               ; preds = %._crit_edge77
  invoke void @_ZN9UnionFind4viewEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %.preheader unwind label %107

.preheader:                                       ; preds = %98
  %99 = load i64, ptr @N, align 8, !tbaa !5
  %100 = icmp sgt i64 %99, 0
  br i1 %100, label %.lr.ph81, label %._crit_edge82

._crit_edge82:                                    ; preds = %119, %.preheader
  %.043.lcssa = phi i64 [ 0, %.preheader ], [ %.144, %119 ]
  %.042.lcssa = phi i64 [ 0, %.preheader ], [ %.1, %119 ]
  %.lcssa = phi i64 [ %99, %.preheader ], [ %120, %119 ]
  %101 = add nsw i64 %.042.lcssa, %.043.lcssa
  %102 = add nsw i64 %.043.lcssa, -1
  %103 = mul nsw i64 %102, %.043.lcssa
  %104 = sdiv i64 %103, 2
  %105 = add nsw i64 %104, %.042.lcssa
  %106 = icmp eq i64 %101, %.lcssa
  br i1 %106, label %123, label %122

107:                                              ; preds = %98, %._crit_edge77
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %132

.lr.ph81:                                         ; preds = %.preheader, %119
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %119 ], [ 0, %.preheader ]
  %.04279 = phi i64 [ %.1, %119 ], [ 0, %.preheader ]
  %.04378 = phi i64 [ %.144, %119 ], [ 0, %.preheader ]
  %109 = trunc nuw nsw i64 %indvars.iv93 to i32
  %110 = call noundef zeroext i1 @_ZN9UnionFind7is_rootEi(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %109)
  br i1 %110, label %111, label %119

111:                                              ; preds = %.lr.ph81
  %112 = invoke noundef i64 @_ZN9UnionFind4sizeEi(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %109)
          to label %113 unwind label %117

113:                                              ; preds = %111
  %114 = add i64 %.04279, -1
  %115 = add i64 %114, %112
  %116 = add nsw i64 %.04378, 1
  br label %119

117:                                              ; preds = %111
  %118 = landingpad { ptr, i32 }
          cleanup
  br label %132

119:                                              ; preds = %.lr.ph81, %113
  %.144 = phi i64 [ %116, %113 ], [ %.04378, %.lr.ph81 ]
  %.1 = phi i64 [ %115, %113 ], [ %.04279, %.lr.ph81 ]
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %120 = load i64, ptr @N, align 8, !tbaa !5
  %121 = icmp sgt i64 %120, %indvars.iv.next94
  br i1 %121, label %.lr.ph81, label %._crit_edge82, !llvm.loop !15

122:                                              ; preds = %._crit_edge82
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 280, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

123:                                              ; preds = %._crit_edge82
  %124 = icmp sgt i64 %.043.lcssa, 2
  br i1 %124, label %125, label %130

125:                                              ; preds = %123
  %126 = load i64, ptr @M, align 8, !tbaa !5
  %.not = icmp sgt i64 %.lcssa, %126
  %.not56 = icmp sgt i64 %126, %105
  %or.cond = select i1 %.not, i1 true, i1 %.not56
  br i1 %or.cond, label %130, label %127

127:                                              ; preds = %125
  invoke void @_Z3Yesv()
          to label %130 unwind label %128

128:                                              ; preds = %130, %127
  %129 = landingpad { ptr, i32 }
          cleanup
  br label %132

130:                                              ; preds = %127, %125, %123
  invoke void @_Z2Nov()
          to label %131 unwind label %128

131:                                              ; preds = %130
  call void @_ZN9UnionFindD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  ret i32 0

132:                                              ; preds = %117, %128, %107, %93, %83
  %.pn58 = phi { ptr, i32 } [ %84, %83 ], [ %94, %93 ], [ %108, %107 ], [ %118, %117 ], [ %129, %128 ]
  call void @_ZN9UnionFindD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn58
}

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

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 #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9UnionFind7is_rootEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

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


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