; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2019-20/Jan/Plat (cave)

; 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_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 }
%struct.DSU = type { %"class.std::vector" }
%"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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.mi = type { i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.3" = type { ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@D = external dso_local global %struct.DSU, align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@comp = external dso_local global [1005 x [1005 x i32]], align 16
@_Z2grB5cxx11 = external dso_local global [1005 x %"class.std::__cxx11::basic_string"], align 16
@lst = external dso_local global [1010025 x i32], align 16
@out = external dso_local global [1010025 x i32], align 16
@ans = external dso_local global [1010025 x %struct.mi], align 16
@child = external dso_local global [1010025 x %"class.std::vector"], align 16

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32)) #1

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #3 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.mi, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.3", 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", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.3", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca %struct.mi, align 4
  %25 = alloca i64, align 8
  %26 = alloca ptr, align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca ptr, align 8
  %30 = alloca %struct.mi, align 4
  %31 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %32 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %33 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %34 = getelementptr i8, ptr %33, i64 -24
  %35 = load i64, ptr %34, align 8
  %36 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %35
  %37 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %36, ptr noundef null)
  call void @_ZN5input2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @N, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %47, %0
  %39 = load i32, ptr %2, align 4, !tbaa !8
  %40 = load i32, ptr @N, align 4, !tbaa !8
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  %44 = load i32, ptr %2, align 4, !tbaa !8
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %45
  call void @_ZN5input2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32) %46)
  br label %47

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

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

51:                                               ; preds = %69, %50
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = load i32, ptr @N, align 4, !tbaa !8
  %54 = sub nsw i32 %53, 1
  %55 = load i32, ptr %3, align 4, !tbaa !8
  %56 = sub nsw i32 %54, %55
  %57 = icmp slt i32 %52, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %72

59:                                               ; preds = %51
  %60 = load i32, ptr %3, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %61
  %63 = load i32, ptr @N, align 4, !tbaa !8
  %64 = sub nsw i32 %63, 1
  %65 = load i32, ptr %3, align 4, !tbaa !8
  %66 = sub nsw i32 %64, %65
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %67
  call void @_ZSt4swapIcSt11char_traitsIcESaIcEEvRNSt7__cxx1112basic_stringIT_T0_T1_EES9_(ptr noundef nonnull align 8 dereferenceable(32) %62, ptr noundef nonnull align 8 dereferenceable(32) %68) #8
  br label %69

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

72:                                               ; preds = %58
  %73 = load i32, ptr @N, align 4, !tbaa !8
  %74 = load i32, ptr @M, align 4, !tbaa !8
  %75 = mul nsw i32 %73, %74
  call void @_ZN3DSU4initEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %75)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %76

76:                                               ; preds = %235, %72
  %77 = load i32, ptr %5, align 4, !tbaa !8
  %78 = load i32, ptr @N, align 4, !tbaa !8
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %238

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 1, ptr %7, align 4, !tbaa !8
  br label %82

82:                                               ; preds = %173, %81
  %83 = load i32, ptr %7, align 4, !tbaa !8
  %84 = load i32, ptr @M, align 4, !tbaa !8
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %176

87:                                               ; preds = %82
  %88 = load i32, ptr %5, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %89
  %91 = load i32, ptr %7, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %90, i64 noundef %92)
  %94 = load i8, ptr %93, align 1, !tbaa !14
  %95 = sext i8 %94 to i32
  %96 = icmp eq i32 %95, 46
  br i1 %96, label %97, label %172

97:                                               ; preds = %87
  %98 = load i32, ptr %5, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %99
  %101 = load i32, ptr %7, align 4, !tbaa !8
  %102 = sub nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %100, i64 noundef %103)
  %105 = load i8, ptr %104, align 1, !tbaa !14
  %106 = sext i8 %105 to i32
  %107 = icmp eq i32 %106, 35
  br i1 %107, label %108, label %117

108:                                              ; preds = %97
  %109 = load i32, ptr %4, align 4, !tbaa !8
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %4, align 4, !tbaa !8
  %111 = load i32, ptr %5, align 4, !tbaa !8
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %112
  %114 = load i32, ptr %7, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1005 x i32], ptr %113, i64 0, i64 %115
  store i32 %110, ptr %116, align 4, !tbaa !8
  br label %125

117:                                              ; preds = %97
  %118 = load i32, ptr %4, align 4, !tbaa !8
  %119 = load i32, ptr %5, align 4, !tbaa !8
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %120
  %122 = load i32, ptr %7, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1005 x i32], ptr %121, i64 0, i64 %123
  store i32 %118, ptr %124, align 4, !tbaa !8
  br label %125

125:                                              ; preds = %117, %108
  %126 = load i32, ptr %5, align 4, !tbaa !8
  %127 = sub nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %128
  %130 = load i32, ptr %7, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %129, i64 noundef %131)
  %133 = load i8, ptr %132, align 1, !tbaa !14
  %134 = sext i8 %133 to i32
  %135 = icmp eq i32 %134, 46
  br i1 %135, label %136, label %171

136:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %137 = load i32, ptr %5, align 4, !tbaa !8
  %138 = sub nsw i32 %137, 1
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %139
  %141 = load i32, ptr %7, align 4, !tbaa !8
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [1005 x i32], ptr %140, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !8
  %145 = call noundef i32 @_ZN3DSU3getEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %144)
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [1010025 x i32], ptr @lst, i64 0, i64 %146
  store ptr %147, ptr %8, align 8, !tbaa !15
  %148 = load ptr, ptr %8, align 8, !tbaa !15
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %162

151:                                              ; preds = %136
  %152 = load ptr, ptr %8, align 8, !tbaa !15
  %153 = load i32, ptr %152, align 4, !tbaa !8
  %154 = load i32, ptr %5, align 4, !tbaa !8
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %155
  %157 = load i32, ptr %7, align 4, !tbaa !8
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [1005 x i32], ptr %156, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !8
  %161 = call noundef zeroext i1 @_ZN3DSU5uniteEii(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %153, i32 noundef %160)
  br label %162

162:                                              ; preds = %151, %136
  %163 = load i32, ptr %5, align 4, !tbaa !8
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %164
  %166 = load i32, ptr %7, align 4, !tbaa !8
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [1005 x i32], ptr %165, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !8
  %170 = load ptr, ptr %8, align 8, !tbaa !15
  store i32 %169, ptr %170, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %171

171:                                              ; preds = %162, %125
  br label %172

172:                                              ; preds = %171, %87
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %7, align 4, !tbaa !8
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %7, align 4, !tbaa !8
  br label %82, !llvm.loop !17

176:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %177

177:                                              ; preds = %231, %176
  %178 = load i32, ptr %9, align 4, !tbaa !8
  %179 = load i32, ptr @M, align 4, !tbaa !8
  %180 = icmp slt i32 %178, %179
  br i1 %180, label %182, label %181

181:                                              ; preds = %177
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %234

182:                                              ; preds = %177
  %183 = load i32, ptr %5, align 4, !tbaa !8
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %184
  %186 = load i32, ptr %9, align 4, !tbaa !8
  %187 = sext i32 %186 to i64
  %188 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %185, i64 noundef %187)
  %189 = load i8, ptr %188, align 1, !tbaa !14
  %190 = sext i8 %189 to i32
  %191 = icmp eq i32 %190, 46
  br i1 %191, label %192, label %230

192:                                              ; preds = %182
  %193 = load i32, ptr %5, align 4, !tbaa !8
  %194 = sub nsw i32 %193, 1
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %195
  %197 = load i32, ptr %9, align 4, !tbaa !8
  %198 = sext i32 %197 to i64
  %199 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %196, i64 noundef %198)
  %200 = load i8, ptr %199, align 1, !tbaa !14
  %201 = sext i8 %200 to i32
  %202 = icmp eq i32 %201, 46
  br i1 %202, label %203, label %229

203:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %204 = load i32, ptr %5, align 4, !tbaa !8
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %205
  %207 = load i32, ptr %9, align 4, !tbaa !8
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [1005 x i32], ptr %206, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !8
  %211 = call noundef i32 @_ZN3DSU3getEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %210)
  store i32 %211, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %212 = load i32, ptr %5, align 4, !tbaa !8
  %213 = sub nsw i32 %212, 1
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %214
  %216 = load i32, ptr %9, align 4, !tbaa !8
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [1005 x i32], ptr %215, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !8
  %220 = call noundef i32 @_ZN3DSU3getEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %219)
  store i32 %220, ptr %11, align 4, !tbaa !8
  %221 = load i32, ptr %10, align 4, !tbaa !8
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %222
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %223, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %224 = load i32, ptr %11, align 4, !tbaa !8
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [1010025 x i32], ptr @out, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !8
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %226, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %229

229:                                              ; preds = %203, %192
  br label %230

230:                                              ; preds = %229, %182
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %9, align 4, !tbaa !8
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %9, align 4, !tbaa !8
  br label %177, !llvm.loop !18

234:                                              ; preds = %181
  br label %235

235:                                              ; preds = %234
  %236 = load i32, ptr %5, align 4, !tbaa !8
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %5, align 4, !tbaa !8
  br label %76, !llvm.loop !19

238:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store i64 1, ptr %13, align 8, !tbaa !20
  call void @_ZN2miC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 1, ptr %14, align 4, !tbaa !8
  br label %239

239:                                              ; preds = %339, %238
  %240 = load i32, ptr %14, align 4, !tbaa !8
  %241 = load i32, ptr %4, align 4, !tbaa !8
  %242 = add nsw i32 %241, 1
  %243 = icmp slt i32 %240, %242
  br i1 %243, label %245, label %244

244:                                              ; preds = %239
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %342

245:                                              ; preds = %239
  %246 = load i32, ptr %14, align 4, !tbaa !8
  %247 = call noundef i32 @_ZN3DSU3getEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %246)
  %248 = load i32, ptr %14, align 4, !tbaa !8
  %249 = icmp eq i32 %247, %248
  br i1 %249, label %250, label %338

250:                                              ; preds = %245
  %251 = load i32, ptr %14, align 4, !tbaa !8
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %252
  %254 = call ptr @_ZSt5beginISt6vectorIiSaIiEEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24) %253)
  %255 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %254, ptr %255, align 8
  %256 = load i32, ptr %14, align 4, !tbaa !8
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %257
  %259 = call ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) %258)
  %260 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %259, ptr %260, align 8
  %261 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %262 = load ptr, ptr %261, align 8
  %263 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %264 = load ptr, ptr %263, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %262, ptr %264)
  %265 = load i32, ptr %14, align 4, !tbaa !8
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %266
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %268 = load i32, ptr %14, align 4, !tbaa !8
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %269
  %271 = call ptr @_ZSt5beginISt6vectorIiSaIiEEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24) %270)
  %272 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %271, ptr %272, align 8
  %273 = load i32, ptr %14, align 4, !tbaa !8
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %274
  %276 = call ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) %275)
  %277 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %276, ptr %277, align 8
  %278 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  %279 = load ptr, ptr %278, align 8
  %280 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %281 = load ptr, ptr %280, align 8
  %282 = call ptr @_ZSt6uniqueIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr %279, ptr %281)
  %283 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %282, ptr %283, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %284 = load i32, ptr %14, align 4, !tbaa !8
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %285
  %287 = call ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) %286)
  %288 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %287, ptr %288, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #8
  %289 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.3", ptr %17, i32 0, i32 0
  %290 = load ptr, ptr %289, align 8
  %291 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.3", ptr %21, i32 0, i32 0
  %292 = load ptr, ptr %291, align 8
  %293 = call ptr @_ZNSt6vectorIiSaIiEE5eraseEN9__gnu_cxx17__normal_iteratorIPKiS1_EES6_(ptr noundef nonnull align 8 dereferenceable(24) %267, ptr %290, ptr %292)
  %294 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %293, ptr %294, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  store i64 1, ptr %25, align 8, !tbaa !20
  call void @_ZN2miC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %295 = load i32, ptr %14, align 4, !tbaa !8
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [1010025 x %struct.mi], ptr @ans, i64 0, i64 %296
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %297, ptr align 4 %24, i64 4, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %298 = load i32, ptr %14, align 4, !tbaa !8
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %299
  store ptr %300, ptr %26, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %301 = load ptr, ptr %26, align 8, !tbaa !15
  %302 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %301) #8
  %303 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %302, ptr %303, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %304 = load ptr, ptr %26, align 8, !tbaa !15
  %305 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %304) #8
  %306 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %305, ptr %306, align 8
  br label %307

307:                                              ; preds = %320, %250
  %308 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28) #8
  br i1 %308, label %310, label %309

309:                                              ; preds = %307
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %322

310:                                              ; preds = %307
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %311 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  store ptr %311, ptr %29, align 8, !tbaa !15
  %312 = load ptr, ptr %29, align 8, !tbaa !15
  %313 = load i32, ptr %312, align 4, !tbaa !8
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [1010025 x %struct.mi], ptr @ans, i64 0, i64 %314
  %316 = load i32, ptr %14, align 4, !tbaa !8
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [1010025 x %struct.mi], ptr @ans, i64 0, i64 %317
  %319 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN2mimLERKS_(ptr noundef nonnull align 4 dereferenceable(4) %318, ptr noundef nonnull align 4 dereferenceable(4) %315)
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  br label %320

320:                                              ; preds = %310
  %321 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  br label %307

322:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  store i64 1, ptr %31, align 8, !tbaa !20
  call void @_ZN2miC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef nonnull align 8 dereferenceable(8) %31)
  %323 = load i32, ptr %14, align 4, !tbaa !8
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [1010025 x %struct.mi], ptr @ans, i64 0, i64 %324
  %326 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN2mipLERKS_(ptr noundef nonnull align 4 dereferenceable(4) %325, ptr noundef nonnull align 4 dereferenceable(4) %30)
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  %327 = load i32, ptr %14, align 4, !tbaa !8
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [1010025 x i32], ptr @out, i64 0, i64 %328
  %330 = load i32, ptr %329, align 4, !tbaa !8
  %331 = icmp ne i32 %330, 0
  br i1 %331, label %337, label %332

332:                                              ; preds = %322
  %333 = load i32, ptr %14, align 4, !tbaa !8
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds [1010025 x %struct.mi], ptr @ans, i64 0, i64 %334
  %336 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN2mimLERKS_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %335)
  br label %337

337:                                              ; preds = %332, %322
  br label %338

338:                                              ; preds = %337, %245
  br label %339

339:                                              ; preds = %338
  %340 = load i32, ptr %14, align 4, !tbaa !8
  %341 = add nsw i32 %340, 1
  store i32 %341, ptr %14, align 4, !tbaa !8
  br label %239, !llvm.loop !23

342:                                              ; preds = %244
  call void @_ZN6output2psI2miJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  %343 = load i32, ptr %1, align 4
  ret i32 %343
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIcSt11char_traitsIcESaIcEEvRNSt7__cxx1112basic_stringIT_T0_T1_EES9_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #5

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3DSU5uniteEii(ptr noundef nonnull align 8 dereferenceable(24), 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 nounwind uwtable
declare dso_local void @_ZN2miC2ERKx(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt6uniqueIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr, ptr) #6

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

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

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !10, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!21, !21, i64 0}
!21 = !{!"long long", !10, i64 0}
!22 = !{i64 0, i64 4, !8}
!23 = distinct !{!23, !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_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 }
%struct.DSU = type { %"class.std::vector" }
%"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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.mi = type { i32 }
%"class.__gnu_cxx::__normal_iterator.3" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@D = external dso_local global %struct.DSU, align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@comp = external dso_local local_unnamed_addr global [1005 x [1005 x i32]], align 16
@_Z2grB5cxx11 = external dso_local global [1005 x %"class.std::__cxx11::basic_string"], align 16
@lst = external dso_local local_unnamed_addr global [1010025 x i32], align 16
@out = external dso_local local_unnamed_addr global [1010025 x i32], align 16
@ans = external dso_local global [1010025 x %struct.mi], align 16
@child = external dso_local global [1010025 x %"class.std::vector"], align 16

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.mi, align 4
  %3 = alloca i64, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.3", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.3", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %struct.mi, align 4
  %9 = alloca i64, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %struct.mi, align 4
  %13 = alloca i64, align 8
  %14 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  tail call void @_ZN5input2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @N, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %20 = load i32, ptr @N, align 4, !tbaa !8
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %.preheader79

.preheader79:                                     ; preds = %.lr.ph, %0
  %22 = phi i32 [ %20, %0 ], [ %26, %.lr.ph ]
  %23 = add i32 %22, -1
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph82, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %25 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %indvars.iv
  tail call void @_ZN5input2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32) %25)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr @N, align 4, !tbaa !8
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  br i1 %28, label %.lr.ph, label %.preheader79, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph82, %.preheader79
  %.lcssa = phi i32 [ %22, %.preheader79 ], [ %37, %.lr.ph82 ]
  %29 = load i32, ptr @M, align 4, !tbaa !8
  %30 = mul nsw i32 %29, %.lcssa
  tail call void @_ZN3DSU4initEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %30)
  %31 = load i32, ptr @N, align 4, !tbaa !8
  %32 = icmp sgt i32 %31, 1
  br i1 %32, label %.preheader78.preheader, label %._crit_edge92.thread

._crit_edge92.thread:                             ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 1, ptr %3, align 8, !tbaa !13
  call void @_ZN2miC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %._crit_edge101

.preheader78.preheader:                           ; preds = %._crit_edge
  %.pre = load i32, ptr @M, align 4, !tbaa !8
  br label %.preheader78

.lr.ph82:                                         ; preds = %.preheader79, %.lr.ph82
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %.lr.ph82 ], [ 0, %.preheader79 ]
  %33 = phi i32 [ %39, %.lr.ph82 ], [ %23, %.preheader79 ]
  %34 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %indvars.iv104
  %35 = sext i32 %33 to i64
  %36 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %35
  tail call void @_ZSt4swapIcSt11char_traitsIcESaIcEEvRNSt7__cxx1112basic_stringIT_T0_T1_EES9_(ptr noundef nonnull align 8 dereferenceable(32) %34, ptr noundef nonnull align 8 dereferenceable(32) %36) #7
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %37 = load i32, ptr @N, align 4, !tbaa !8
  %38 = trunc nuw nsw i64 %indvars.iv104 to i32
  %reass.sub = sub i32 %37, %38
  %39 = add i32 %reass.sub, -2
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next105, %40
  br i1 %41, label %.lr.ph82, label %._crit_edge, !llvm.loop !15

.preheader78:                                     ; preds = %.preheader78.preheader, %._crit_edge89
  %42 = phi i32 [ %.pre, %.preheader78.preheader ], [ %82, %._crit_edge89 ]
  %indvars.iv113 = phi i64 [ 1, %.preheader78.preheader ], [ %indvars.iv.next114, %._crit_edge89 ]
  %.06991 = phi i32 [ 0, %.preheader78.preheader ], [ %.1.lcssa122, %._crit_edge89 ]
  %43 = icmp sgt i32 %42, 1
  br i1 %43, label %.lr.ph85, label %._crit_edge89

.lr.ph85:                                         ; preds = %.preheader78
  %44 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %indvars.iv113
  %45 = add nsw i64 %indvars.iv113, -1
  %46 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %45
  br label %52

._crit_edge92:                                    ; preds = %._crit_edge89
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 1, ptr %3, align 8, !tbaa !13
  call void @_ZN2miC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %.not97 = icmp slt i32 %.1.lcssa122, 1
  br i1 %.not97, label %._crit_edge101, label %.lr.ph100.preheader

.lr.ph100.preheader:                              ; preds = %._crit_edge92
  %47 = add nuw i32 %.1.lcssa122, 1
  %wide.trip.count = zext i32 %47 to i64
  br label %.lr.ph100

.preheader:                                       ; preds = %78
  %48 = icmp sgt i32 %79, 1
  br i1 %48, label %.lr.ph88, label %._crit_edge89

.lr.ph88:                                         ; preds = %.preheader
  %49 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %indvars.iv113
  %50 = add nsw i64 %indvars.iv113, -1
  %51 = getelementptr inbounds [1005 x %"class.std::__cxx11::basic_string"], ptr @_Z2grB5cxx11, i64 0, i64 %50
  br label %86

52:                                               ; preds = %.lr.ph85, %78
  %indvars.iv107 = phi i64 [ 1, %.lr.ph85 ], [ %indvars.iv.next108, %78 ]
  %.184 = phi i32 [ %.06991, %.lr.ph85 ], [ %.3, %78 ]
  %53 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %44, i64 noundef %indvars.iv107)
  %54 = load i8, ptr %53, align 1, !tbaa !16
  %55 = icmp eq i8 %54, 46
  br i1 %55, label %56, label %78

56:                                               ; preds = %52
  %57 = add nsw i64 %indvars.iv107, -1
  %58 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %44, i64 noundef %57)
  %59 = load i8, ptr %58, align 1, !tbaa !16
  %60 = icmp eq i8 %59, 35
  %61 = zext i1 %60 to i32
  %spec.select = add nsw i32 %.184, %61
  %62 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %indvars.iv113, i64 %indvars.iv107
  store i32 %spec.select, ptr %62, align 4
  %63 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %46, i64 noundef %indvars.iv107)
  %64 = load i8, ptr %63, align 1, !tbaa !16
  %65 = icmp eq i8 %64, 46
  br i1 %65, label %66, label %78

66:                                               ; preds = %56
  %67 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %45, i64 %indvars.iv107
  %68 = load i32, ptr %67, align 4, !tbaa !8
  %69 = call noundef i32 @_ZN3DSU3getEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %68)
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1010025 x i32], ptr @lst, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !8
  %.not77 = icmp eq i32 %72, 0
  br i1 %.not77, label %76, label %73

73:                                               ; preds = %66
  %74 = load i32, ptr %62, align 4, !tbaa !8
  %75 = call noundef zeroext i1 @_ZN3DSU5uniteEii(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %72, i32 noundef %74)
  br label %76

76:                                               ; preds = %73, %66
  %77 = load i32, ptr %62, align 4, !tbaa !8
  store i32 %77, ptr %71, align 4, !tbaa !8
  br label %78

78:                                               ; preds = %52, %76, %56
  %.3 = phi i32 [ %spec.select, %76 ], [ %spec.select, %56 ], [ %.184, %52 ]
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %79 = load i32, ptr @M, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = icmp slt i64 %indvars.iv.next108, %80
  br i1 %81, label %52, label %.preheader, !llvm.loop !17

._crit_edge89:                                    ; preds = %108, %.preheader78, %.preheader
  %.1.lcssa122 = phi i32 [ %.3, %.preheader ], [ %.06991, %.preheader78 ], [ %.3, %108 ]
  %82 = phi i32 [ %79, %.preheader ], [ %42, %.preheader78 ], [ %109, %108 ]
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %83 = load i32, ptr @N, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = icmp slt i64 %indvars.iv.next114, %84
  br i1 %85, label %.preheader78, label %._crit_edge92, !llvm.loop !18

86:                                               ; preds = %.lr.ph88, %108
  %indvars.iv110 = phi i64 [ 1, %.lr.ph88 ], [ %indvars.iv.next111, %108 ]
  %87 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %49, i64 noundef %indvars.iv110)
  %88 = load i8, ptr %87, align 1, !tbaa !16
  %89 = icmp eq i8 %88, 46
  br i1 %89, label %90, label %108

90:                                               ; preds = %86
  %91 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %51, i64 noundef %indvars.iv110)
  %92 = load i8, ptr %91, align 1, !tbaa !16
  %93 = icmp eq i8 %92, 46
  br i1 %93, label %94, label %108

94:                                               ; preds = %90
  %95 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %indvars.iv113, i64 %indvars.iv110
  %96 = load i32, ptr %95, align 4, !tbaa !8
  %97 = call noundef i32 @_ZN3DSU3getEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %96)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %98 = getelementptr inbounds [1005 x [1005 x i32]], ptr @comp, i64 0, i64 %50, i64 %indvars.iv110
  %99 = load i32, ptr %98, align 4, !tbaa !8
  %100 = call noundef i32 @_ZN3DSU3getEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %99)
  store i32 %100, ptr %1, align 4, !tbaa !8
  %101 = sext i32 %97 to i64
  %102 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %101
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %102, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %103 = load i32, ptr %1, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1010025 x i32], ptr @out, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !8
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %105, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  br label %108

108:                                              ; preds = %86, %94, %90
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %109 = load i32, ptr @M, align 4, !tbaa !8
  %110 = sext i32 %109 to i64
  %111 = icmp slt i64 %indvars.iv.next111, %110
  br i1 %111, label %86, label %._crit_edge89, !llvm.loop !19

._crit_edge101:                                   ; preds = %144, %._crit_edge92.thread, %._crit_edge92
  call void @_ZN6output2psI2miJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  ret i32 0

.lr.ph100:                                        ; preds = %.lr.ph100.preheader, %144
  %indvars.iv116 = phi i64 [ 1, %.lr.ph100.preheader ], [ %indvars.iv.next117, %144 ]
  %112 = trunc nuw nsw i64 %indvars.iv116 to i32
  %113 = call noundef i32 @_ZN3DSU3getEi(ptr noundef nonnull align 8 dereferenceable(24) @D, i32 noundef %112)
  %114 = zext i32 %113 to i64
  %115 = icmp eq i64 %indvars.iv116, %114
  br i1 %115, label %116, label %144

116:                                              ; preds = %.lr.ph100
  %117 = getelementptr inbounds [1010025 x %"class.std::vector"], ptr @child, i64 0, i64 %indvars.iv116
  %118 = call ptr @_ZSt5beginISt6vectorIiSaIiEEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24) %117)
  %119 = call ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) %117)
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %118, ptr %119)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %120 = call ptr @_ZSt5beginISt6vectorIiSaIiEEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24) %117)
  %121 = call ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) %117)
  %122 = call ptr @_ZSt6uniqueIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr %120, ptr %121)
  store ptr %122, ptr %5, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %123 = call ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) %117)
  store ptr %123, ptr %7, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %124 = load ptr, ptr %4, align 8
  %125 = load ptr, ptr %6, align 8
  %126 = call ptr @_ZNSt6vectorIiSaIiEE5eraseEN9__gnu_cxx17__normal_iteratorIPKiS1_EES6_(ptr noundef nonnull align 8 dereferenceable(24) %117, ptr %124, ptr %125)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  store i64 1, ptr %9, align 8, !tbaa !13
  call void @_ZN2miC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %127 = getelementptr inbounds [1010025 x %struct.mi], ptr @ans, i64 0, i64 %indvars.iv116
  %128 = load i32, ptr %8, align 4, !tbaa !8
  store i32 %128, ptr %127, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %129 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %117) #7
  store ptr %129, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %130 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %117) #7
  store ptr %130, ptr %11, align 8
  %131 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %131, label %.lr.ph95, label %._crit_edge96

._crit_edge96:                                    ; preds = %.lr.ph95, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  store i64 1, ptr %13, align 8, !tbaa !13
  call void @_ZN2miC2ERKx(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN2mipLERKS_(ptr noundef nonnull align 4 dereferenceable(4) %127, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  %133 = getelementptr inbounds [1010025 x i32], ptr @out, i64 0, i64 %indvars.iv116
  %134 = load i32, ptr %133, align 4, !tbaa !8
  %.not76 = icmp eq i32 %134, 0
  br i1 %.not76, label %142, label %144

.lr.ph95:                                         ; preds = %116, %.lr.ph95
  %135 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %136 = load i32, ptr %135, align 4, !tbaa !8
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1010025 x %struct.mi], ptr @ans, i64 0, i64 %137
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN2mimLERKS_(ptr noundef nonnull align 4 dereferenceable(4) %127, ptr noundef nonnull align 4 dereferenceable(4) %138)
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %141 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %141, label %.lr.ph95, label %._crit_edge96

142:                                              ; preds = %._crit_edge96
  %143 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN2mimLERKS_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %127)
  br label %144

144:                                              ; preds = %.lr.ph100, %142, %._crit_edge96
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge101, label %.lr.ph100, !llvm.loop !20
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIcSt11char_traitsIcESaIcEEvRNSt7__cxx1112basic_stringIT_T0_T1_EES9_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3DSU5uniteEii(ptr noundef nonnull align 8 dereferenceable(24), 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 nounwind uwtable
declare dso_local void @_ZN2miC2ERKx(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt6uniqueIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr, ptr) local_unnamed_addr #6

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psI2miJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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


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