; LLVM IR from tangjz/acm-icpc :: lydsy (2638)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = 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.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dsu = external dso_local global [2601 x i32], align 16
@que = external dso_local global [2601 x i32], align 16
@dis = external dso_local global [2601 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@str = external dso_local global [51 x [51 x i8]], align 16
@e = external dso_local global [2601 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %122, %0
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %125

32:                                               ; preds = %27
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %34
  %36 = getelementptr inbounds [51 x i8], ptr %35, i64 0, i64 0
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %118, %32
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr @m, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %121

43:                                               ; preds = %38
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = call noundef i32 @_Z3idxii(i32 noundef %44, i32 noundef %45)
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = call noundef i32 @_Z3idxii(i32 noundef %47, i32 noundef %48)
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %50
  store i32 %46, ptr %51, align 4, !tbaa !5
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %84

54:                                               ; preds = %43
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %57
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [51 x i8], ptr %58, i64 0, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !9
  %63 = sext i8 %62 to i32
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %65
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [51 x i8], ptr %66, i64 0, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !9
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %63, %71
  br i1 %72, label %73, label %84

73:                                               ; preds = %54
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = call noundef i32 @_Z3idxii(i32 noundef %74, i32 noundef %75)
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = sub nsw i32 %77, 1
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = call noundef i32 @_Z3idxii(i32 noundef %78, i32 noundef %79)
  %81 = call noundef i32 @_Z4findi(i32 noundef %80)
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %82
  store i32 %76, ptr %83, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %73, %54, %43
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %117

87:                                               ; preds = %84
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %89
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = sub nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [51 x i8], ptr %90, i64 0, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !9
  %96 = sext i8 %95 to i32
  %97 = load i32, ptr %2, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %98
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [51 x i8], ptr %99, i64 0, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !9
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %96, %104
  br i1 %105, label %106, label %117

106:                                              ; preds = %87
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = call noundef i32 @_Z3idxii(i32 noundef %107, i32 noundef %108)
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = load i32, ptr %4, align 4, !tbaa !5
  %112 = sub nsw i32 %111, 1
  %113 = call noundef i32 @_Z3idxii(i32 noundef %110, i32 noundef %112)
  %114 = call noundef i32 @_Z4findi(i32 noundef %113)
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %115
  store i32 %109, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %106, %87, %84
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %4, align 4, !tbaa !5
  br label %38, !llvm.loop !10

121:                                              ; preds = %42
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %2, align 4, !tbaa !5
  br label %27, !llvm.loop !12

125:                                              ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %218, %125
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = load i32, ptr @n, align 4, !tbaa !5
  %129 = icmp slt i32 %127, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %126
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %221

131:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %214, %131
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = load i32, ptr @m, align 4, !tbaa !5
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %217

137:                                              ; preds = %132
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %175

140:                                              ; preds = %137
  %141 = load i32, ptr %5, align 4, !tbaa !5
  %142 = sub nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %143
  %145 = load i32, ptr %6, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [51 x i8], ptr %144, i64 0, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !9
  %149 = sext i8 %148 to i32
  %150 = load i32, ptr %5, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %151
  %153 = load i32, ptr %6, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [51 x i8], ptr %152, i64 0, i64 %154
  %156 = load i8, ptr %155, align 1, !tbaa !9
  %157 = sext i8 %156 to i32
  %158 = icmp ne i32 %149, %157
  br i1 %158, label %159, label %175

159:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %160 = load i32, ptr %5, align 4, !tbaa !5
  %161 = sub nsw i32 %160, 1
  %162 = load i32, ptr %6, align 4, !tbaa !5
  %163 = call noundef i32 @_Z3idxii(i32 noundef %161, i32 noundef %162)
  %164 = call noundef i32 @_Z4findi(i32 noundef %163)
  store i32 %164, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %165 = load i32, ptr %5, align 4, !tbaa !5
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = call noundef i32 @_Z3idxii(i32 noundef %165, i32 noundef %166)
  %168 = call noundef i32 @_Z4findi(i32 noundef %167)
  store i32 %168, ptr %8, align 4, !tbaa !5
  %169 = load i32, ptr %7, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %170
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %171, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %173
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %174, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %175

175:                                              ; preds = %159, %140, %137
  %176 = load i32, ptr %6, align 4, !tbaa !5
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %213

178:                                              ; preds = %175
  %179 = load i32, ptr %5, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %180
  %182 = load i32, ptr %6, align 4, !tbaa !5
  %183 = sub nsw i32 %182, 1
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [51 x i8], ptr %181, i64 0, i64 %184
  %186 = load i8, ptr %185, align 1, !tbaa !9
  %187 = sext i8 %186 to i32
  %188 = load i32, ptr %5, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %189
  %191 = load i32, ptr %6, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [51 x i8], ptr %190, i64 0, i64 %192
  %194 = load i8, ptr %193, align 1, !tbaa !9
  %195 = sext i8 %194 to i32
  %196 = icmp ne i32 %187, %195
  br i1 %196, label %197, label %213

197:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %198 = load i32, ptr %5, align 4, !tbaa !5
  %199 = load i32, ptr %6, align 4, !tbaa !5
  %200 = sub nsw i32 %199, 1
  %201 = call noundef i32 @_Z3idxii(i32 noundef %198, i32 noundef %200)
  %202 = call noundef i32 @_Z4findi(i32 noundef %201)
  store i32 %202, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %203 = load i32, ptr %5, align 4, !tbaa !5
  %204 = load i32, ptr %6, align 4, !tbaa !5
  %205 = call noundef i32 @_Z3idxii(i32 noundef %203, i32 noundef %204)
  %206 = call noundef i32 @_Z4findi(i32 noundef %205)
  store i32 %206, ptr %10, align 4, !tbaa !5
  %207 = load i32, ptr %9, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %208
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %209, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %210 = load i32, ptr %10, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %211
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %212, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %213

213:                                              ; preds = %197, %178, %175
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %6, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %6, align 4, !tbaa !5
  br label %132, !llvm.loop !13

217:                                              ; preds = %136
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %5, align 4, !tbaa !5
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %5, align 4, !tbaa !5
  br label %126, !llvm.loop !14

221:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %260, %221
  %223 = load i32, ptr %11, align 4, !tbaa !5
  %224 = load i32, ptr @n, align 4, !tbaa !5
  %225 = load i32, ptr @m, align 4, !tbaa !5
  %226 = mul nsw i32 %224, %225
  %227 = icmp slt i32 %223, %226
  br i1 %227, label %229, label %228

228:                                              ; preds = %222
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %263

229:                                              ; preds = %222
  %230 = load i32, ptr %11, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %231
  %233 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %232) #8
  %234 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %233, ptr %234, align 8
  %235 = load i32, ptr %11, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %236
  %238 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %237) #8
  %239 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %238, ptr %239, align 8
  %240 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %241 = load ptr, ptr %240, align 8
  %242 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %243 = load ptr, ptr %242, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %241, ptr %243)
  %244 = load i32, ptr %11, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %245
  %247 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %246) #8
  %248 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %247, ptr %248, align 8
  %249 = load i32, ptr %11, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %250
  %252 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %251) #8
  %253 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %252, ptr %253, align 8
  %254 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  %255 = load ptr, ptr %254, align 8
  %256 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %257 = load ptr, ptr %256, align 8
  %258 = call ptr @_ZSt6uniqueIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr %255, ptr %257)
  %259 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %258, ptr %259, align 8
  br label %260

260:                                              ; preds = %229
  %261 = load i32, ptr %11, align 4, !tbaa !5
  %262 = add nsw i32 %261, 1
  store i32 %262, ptr %11, align 4, !tbaa !5
  br label %222, !llvm.loop !15

263:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %264 = load i32, ptr @n, align 4, !tbaa !5
  %265 = load i32, ptr @m, align 4, !tbaa !5
  %266 = mul nsw i32 %264, %265
  store i32 %266, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %267

267:                                              ; preds = %383, %263
  %268 = load i32, ptr %18, align 4, !tbaa !5
  %269 = load i32, ptr @n, align 4, !tbaa !5
  %270 = load i32, ptr @m, align 4, !tbaa !5
  %271 = mul nsw i32 %269, %270
  %272 = icmp slt i32 %268, %271
  br i1 %272, label %274, label %273

273:                                              ; preds = %267
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %386

274:                                              ; preds = %267
  %275 = load i32, ptr %18, align 4, !tbaa !5
  %276 = call noundef i32 @_Z4findi(i32 noundef %275)
  %277 = load i32, ptr %18, align 4, !tbaa !5
  %278 = icmp ne i32 %276, %277
  br i1 %278, label %279, label %280

279:                                              ; preds = %274
  br label %383

280:                                              ; preds = %274
  %281 = load i32, ptr @n, align 4, !tbaa !5
  %282 = load i32, ptr @m, align 4, !tbaa !5
  %283 = mul nsw i32 %281, %282
  %284 = sext i32 %283 to i64
  %285 = mul i64 %284, 4
  call void @llvm.memset.p0.i64(ptr align 16 @dis, i8 0, i64 %285, i1 false)
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  %286 = load i32, ptr %18, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [2601 x i32], ptr @dis, i64 0, i64 %287
  store i32 1, ptr %288, align 4, !tbaa !5
  %289 = load i32, ptr %18, align 4, !tbaa !5
  %290 = load i32, ptr @R, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr @R, align 4, !tbaa !5
  %292 = sext i32 %290 to i64
  %293 = getelementptr inbounds [2601 x i32], ptr @que, i64 0, i64 %292
  store i32 %289, ptr %293, align 4, !tbaa !5
  br label %294

294:                                              ; preds = %342, %280
  %295 = load i32, ptr @L, align 4, !tbaa !5
  %296 = load i32, ptr @R, align 4, !tbaa !5
  %297 = icmp slt i32 %295, %296
  br i1 %297, label %298, label %343

298:                                              ; preds = %294
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %299 = load i32, ptr @L, align 4, !tbaa !5
  %300 = add nsw i32 %299, 1
  store i32 %300, ptr @L, align 4, !tbaa !5
  %301 = sext i32 %299 to i64
  %302 = getelementptr inbounds [2601 x i32], ptr @que, i64 0, i64 %301
  %303 = load i32, ptr %302, align 4, !tbaa !5
  store i32 %303, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %304 = load i32, ptr %19, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %305
  %307 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %306) #8
  %308 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %307, ptr %308, align 8
  br label %309

309:                                              ; preds = %340, %298
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %310 = load i32, ptr %19, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %311
  %313 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %312) #8
  %314 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %313, ptr %314, align 8
  %315 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  br i1 %315, label %317, label %316

316:                                              ; preds = %309
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %342

317:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %318 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  %319 = load i32, ptr %318, align 4, !tbaa !5
  store i32 %319, ptr %22, align 4, !tbaa !5
  %320 = load i32, ptr %22, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [2601 x i32], ptr @dis, i64 0, i64 %321
  %323 = load i32, ptr %322, align 4, !tbaa !5
  %324 = icmp ne i32 %323, 0
  br i1 %324, label %339, label %325

325:                                              ; preds = %317
  %326 = load i32, ptr %19, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [2601 x i32], ptr @dis, i64 0, i64 %327
  %329 = load i32, ptr %328, align 4, !tbaa !5
  %330 = add nsw i32 %329, 1
  %331 = load i32, ptr %22, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [2601 x i32], ptr @dis, i64 0, i64 %332
  store i32 %330, ptr %333, align 4, !tbaa !5
  %334 = load i32, ptr %22, align 4, !tbaa !5
  %335 = load i32, ptr @R, align 4, !tbaa !5
  %336 = add nsw i32 %335, 1
  store i32 %336, ptr @R, align 4, !tbaa !5
  %337 = sext i32 %335 to i64
  %338 = getelementptr inbounds [2601 x i32], ptr @que, i64 0, i64 %337
  store i32 %334, ptr %338, align 4, !tbaa !5
  br label %339

339:                                              ; preds = %325, %317
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %340

340:                                              ; preds = %339
  %341 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  br label %309, !llvm.loop !16

342:                                              ; preds = %316
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %294, !llvm.loop !17

343:                                              ; preds = %294
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %344 = load i32, ptr @R, align 4, !tbaa !5
  %345 = sub nsw i32 %344, 1
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [2601 x i32], ptr @que, i64 0, i64 %346
  %348 = load i32, ptr %347, align 4, !tbaa !5
  %349 = load i32, ptr @m, align 4, !tbaa !5
  %350 = sdiv i32 %348, %349
  store i32 %350, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %351 = load i32, ptr @R, align 4, !tbaa !5
  %352 = sub nsw i32 %351, 1
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds [2601 x i32], ptr @que, i64 0, i64 %353
  %355 = load i32, ptr %354, align 4, !tbaa !5
  %356 = load i32, ptr @m, align 4, !tbaa !5
  %357 = srem i32 %355, %356
  store i32 %357, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %358 = load i32, ptr @R, align 4, !tbaa !5
  %359 = sub nsw i32 %358, 1
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [2601 x i32], ptr @que, i64 0, i64 %360
  %362 = load i32, ptr %361, align 4, !tbaa !5
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds [2601 x i32], ptr @dis, i64 0, i64 %363
  %365 = load i32, ptr %364, align 4, !tbaa !5
  %366 = load i32, ptr %23, align 4, !tbaa !5
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %367
  %369 = load i32, ptr %24, align 4, !tbaa !5
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [51 x i8], ptr %368, i64 0, i64 %370
  %372 = load i8, ptr %371, align 1, !tbaa !9
  %373 = sext i8 %372 to i32
  %374 = icmp eq i32 %373, 87
  %375 = zext i1 %374 to i32
  %376 = sub nsw i32 %365, %375
  store i32 %376, ptr %25, align 4, !tbaa !5
  %377 = load i32, ptr %17, align 4, !tbaa !5
  %378 = load i32, ptr %25, align 4, !tbaa !5
  %379 = icmp sgt i32 %377, %378
  br i1 %379, label %380, label %382

380:                                              ; preds = %343
  %381 = load i32, ptr %25, align 4, !tbaa !5
  store i32 %381, ptr %17, align 4, !tbaa !5
  br label %382

382:                                              ; preds = %380, %343
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %383

383:                                              ; preds = %382, %279
  %384 = load i32, ptr %18, align 4, !tbaa !5
  %385 = add nsw i32 %384, 1
  store i32 %385, ptr %18, align 4, !tbaa !5
  br label %267, !llvm.loop !18

386:                                              ; preds = %273
  %387 = load i32, ptr %17, align 4, !tbaa !5
  %388 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %387)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  %389 = load i32, ptr %1, align 4
  ret i32 %389
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3idxii(i32 noundef, i32 noundef) #4

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

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; 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)) #4

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = 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.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dsu = external dso_local local_unnamed_addr global [2601 x i32], align 16
@que = external dso_local local_unnamed_addr global [2601 x i32], align 16
@dis = external dso_local local_unnamed_addr global [2601 x i32], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@str = external dso_local global [51 x [51 x i8]], align 16
@e = external dso_local global [2601 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph103, label %.preheader97.thread

.preheader97.thread:                              ; preds = %0
  %.pre160.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader95

.preheader97:                                     ; preds = %._crit_edge
  %10 = icmp sgt i32 %66, 0
  %11 = icmp sgt i32 %.pre160166, 0
  %or.cond = and i1 %10, %11
  br i1 %or.cond, label %.preheader96, label %.preheader95

.lr.ph103:                                        ; preds = %0, %._crit_edge
  %indvars.iv134 = phi i64 [ %indvars.iv.next135, %._crit_edge ], [ 0, %0 ]
  %12 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %indvars.iv134
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %12)
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph103
  %.not93 = icmp eq i64 %indvars.iv134, 0
  %16 = add nsw i64 %indvars.iv134, -1
  br i1 %.not93, label %37, label %.lr.ph.split.preheader

.lr.ph.split.preheader:                           ; preds = %.lr.ph
  %17 = trunc nuw nsw i64 %indvars.iv134 to i32
  %18 = tail call noundef i32 @_Z3idxii(i32 noundef %17, i32 noundef 0)
  %19 = tail call noundef i32 @_Z3idxii(i32 noundef %17, i32 noundef 0)
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %20
  store i32 %18, ptr %21, align 4, !tbaa !5
  %22 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %16, i64 0
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = load i8, ptr %12, align 1, !tbaa !9
  %25 = icmp eq i8 %23, %24
  br i1 %25, label %26, label %33

26:                                               ; preds = %.lr.ph.split.preheader
  %27 = tail call noundef i32 @_Z3idxii(i32 noundef %17, i32 noundef 0)
  %28 = trunc nsw i64 %16 to i32
  %29 = tail call noundef i32 @_Z3idxii(i32 noundef %28, i32 noundef 0)
  %30 = tail call noundef i32 @_Z4findi(i32 noundef %29)
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %31
  store i32 %27, ptr %32, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %.lr.ph.split.preheader, %26
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 1
  br i1 %35, label %.lr.ph.split.peel.next, label %._crit_edge

.lr.ph.split.peel.next:                           ; preds = %33
  %36 = trunc nsw i64 %16 to i32
  br label %.lr.ph.split

37:                                               ; preds = %.lr.ph
  %38 = tail call noundef i32 @_Z3idxii(i32 noundef 0, i32 noundef 0)
  %39 = tail call noundef i32 @_Z3idxii(i32 noundef 0, i32 noundef 0)
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %40
  store i32 %38, ptr %41, align 4, !tbaa !5
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 1
  br i1 %43, label %.lr.ph.split.us.peel.next, label %._crit_edge

.lr.ph.split.us.peel.next:                        ; preds = %37, %62
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %62 ], [ 1, %37 ]
  %44 = trunc nuw nsw i64 %indvars.iv130 to i32
  %45 = tail call noundef i32 @_Z3idxii(i32 noundef 0, i32 noundef %44)
  %46 = tail call noundef i32 @_Z3idxii(i32 noundef 0, i32 noundef %44)
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %47
  store i32 %45, ptr %48, align 4, !tbaa !5
  %49 = add nsw i64 %indvars.iv130, -1
  %50 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 0, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !9
  %52 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 0, i64 %indvars.iv130
  %53 = load i8, ptr %52, align 1, !tbaa !9
  %54 = icmp eq i8 %51, %53
  br i1 %54, label %55, label %62

55:                                               ; preds = %.lr.ph.split.us.peel.next
  %56 = tail call noundef i32 @_Z3idxii(i32 noundef 0, i32 noundef %44)
  %57 = trunc nsw i64 %49 to i32
  %58 = tail call noundef i32 @_Z3idxii(i32 noundef 0, i32 noundef %57)
  %59 = tail call noundef i32 @_Z4findi(i32 noundef %58)
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %60
  store i32 %56, ptr %61, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %55, %.lr.ph.split.us.peel.next
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %63 = load i32, ptr @m, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv.next131, %64
  br i1 %65, label %.lr.ph.split.us.peel.next, label %._crit_edge, !llvm.loop !10

._crit_edge:                                      ; preds = %98, %62, %33, %37, %.lr.ph103
  %.pre160166 = phi i32 [ %14, %.lr.ph103 ], [ %42, %37 ], [ %34, %33 ], [ %63, %62 ], [ %99, %98 ]
  %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %indvars.iv.next135, %67
  br i1 %68, label %.lr.ph103, label %.preheader97, !llvm.loop !13

.lr.ph.split:                                     ; preds = %.lr.ph.split.peel.next, %98
  %indvars.iv = phi i64 [ 1, %.lr.ph.split.peel.next ], [ %indvars.iv.next, %98 ]
  %69 = trunc nuw nsw i64 %indvars.iv to i32
  %70 = tail call noundef i32 @_Z3idxii(i32 noundef %17, i32 noundef %69)
  %71 = tail call noundef i32 @_Z3idxii(i32 noundef %17, i32 noundef %69)
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %72
  store i32 %70, ptr %73, align 4, !tbaa !5
  %74 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %16, i64 %indvars.iv
  %75 = load i8, ptr %74, align 1, !tbaa !9
  %76 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %indvars.iv134, i64 %indvars.iv
  %77 = load i8, ptr %76, align 1, !tbaa !9
  %78 = icmp eq i8 %75, %77
  br i1 %78, label %79, label %85

79:                                               ; preds = %.lr.ph.split
  %80 = tail call noundef i32 @_Z3idxii(i32 noundef %17, i32 noundef %69)
  %81 = tail call noundef i32 @_Z3idxii(i32 noundef %36, i32 noundef %69)
  %82 = tail call noundef i32 @_Z4findi(i32 noundef %81)
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %83
  store i32 %80, ptr %84, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %.lr.ph.split, %79
  %86 = add nsw i64 %indvars.iv, -1
  %87 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %indvars.iv134, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !9
  %89 = load i8, ptr %76, align 1, !tbaa !9
  %90 = icmp eq i8 %88, %89
  br i1 %90, label %91, label %98

91:                                               ; preds = %85
  %92 = tail call noundef i32 @_Z3idxii(i32 noundef %17, i32 noundef %69)
  %93 = trunc nsw i64 %86 to i32
  %94 = tail call noundef i32 @_Z3idxii(i32 noundef %17, i32 noundef %93)
  %95 = tail call noundef i32 @_Z4findi(i32 noundef %94)
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [2601 x i32], ptr @dsu, i64 0, i64 %96
  store i32 %92, ptr %97, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %85, %91
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %99 = load i32, ptr @m, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = icmp slt i64 %indvars.iv.next, %100
  br i1 %101, label %.lr.ph.split, label %._crit_edge, !llvm.loop !14

.preheader96:                                     ; preds = %.preheader97, %._crit_edge106
  %102 = phi i32 [ %158, %._crit_edge106 ], [ %.pre160166, %.preheader97 ]
  %103 = phi i32 [ %159, %._crit_edge106 ], [ %.pre160166, %.preheader97 ]
  %104 = phi i32 [ %160, %._crit_edge106 ], [ %.pre160166, %.preheader97 ]
  %indvars.iv145 = phi i64 [ %indvars.iv.next146, %._crit_edge106 ], [ 0, %.preheader97 ]
  %105 = icmp sgt i32 %104, 0
  br i1 %105, label %.lr.ph105, label %._crit_edge106

.lr.ph105:                                        ; preds = %.preheader96
  %.not89 = icmp eq i64 %indvars.iv145, 0
  %106 = add nsw i64 %indvars.iv145, -1
  br i1 %.not89, label %.lr.ph105.split.us.preheader, label %.lr.ph105.split.preheader

.lr.ph105.split.preheader:                        ; preds = %.lr.ph105
  %107 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %106, i64 0
  %108 = load i8, ptr %107, align 1, !tbaa !9
  %109 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %indvars.iv145, i64 0
  %110 = load i8, ptr %109, align 1, !tbaa !9
  %.not90.peel = icmp eq i8 %108, %110
  br i1 %.not90.peel, label %124, label %111

111:                                              ; preds = %.lr.ph105.split.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  %112 = trunc nsw i64 %106 to i32
  %113 = call noundef i32 @_Z3idxii(i32 noundef %112, i32 noundef 0)
  %114 = call noundef i32 @_Z4findi(i32 noundef %113)
  store i32 %114, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %115 = trunc nuw nsw i64 %indvars.iv145 to i32
  %116 = call noundef i32 @_Z3idxii(i32 noundef %115, i32 noundef 0)
  %117 = call noundef i32 @_Z4findi(i32 noundef %116)
  store i32 %117, ptr %2, align 4, !tbaa !5
  %118 = load i32, ptr %1, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %119
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %120, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %121 = load i32, ptr %2, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %122
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %123, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  br label %124

124:                                              ; preds = %.lr.ph105.split.preheader, %111
  %125 = load i32, ptr @m, align 4, !tbaa !5
  %126 = icmp sgt i32 %125, 1
  br i1 %126, label %.lr.ph105.split.peel.next, label %._crit_edge106

.lr.ph105.split.peel.next:                        ; preds = %124
  %127 = trunc nsw i64 %106 to i32
  %128 = trunc nuw nsw i64 %indvars.iv145 to i32
  %129 = trunc nuw nsw i64 %indvars.iv145 to i32
  br label %.lr.ph105.split

.lr.ph105.split.us.preheader:                     ; preds = %.lr.ph105
  %130 = icmp sgt i32 %103, 1
  br i1 %130, label %.lr.ph105.split.us.peel.next, label %._crit_edge106

.lr.ph105.split.us.peel.next:                     ; preds = %.lr.ph105.split.us.preheader, %150
  %131 = phi i32 [ %151, %150 ], [ %102, %.lr.ph105.split.us.preheader ]
  %indvars.iv141 = phi i64 [ %indvars.iv.next142, %150 ], [ 1, %.lr.ph105.split.us.preheader ]
  %132 = add nsw i64 %indvars.iv141, -1
  %133 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 0, i64 %132
  %134 = load i8, ptr %133, align 1, !tbaa !9
  %135 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 0, i64 %indvars.iv141
  %136 = load i8, ptr %135, align 1, !tbaa !9
  %.not92.us = icmp eq i8 %134, %136
  br i1 %.not92.us, label %150, label %137

137:                                              ; preds = %.lr.ph105.split.us.peel.next
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %138 = trunc nsw i64 %132 to i32
  %139 = call noundef i32 @_Z3idxii(i32 noundef 0, i32 noundef %138)
  %140 = call noundef i32 @_Z4findi(i32 noundef %139)
  store i32 %140, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %141 = trunc nuw nsw i64 %indvars.iv141 to i32
  %142 = call noundef i32 @_Z3idxii(i32 noundef 0, i32 noundef %141)
  %143 = call noundef i32 @_Z4findi(i32 noundef %142)
  store i32 %143, ptr %4, align 4, !tbaa !5
  %144 = load i32, ptr %3, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %145
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %146, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %147 = load i32, ptr %4, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %148
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %149, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %137, %.lr.ph105.split.us.peel.next
  %151 = phi i32 [ %.pre, %137 ], [ %131, %.lr.ph105.split.us.peel.next ]
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %152 = sext i32 %151 to i64
  %153 = icmp slt i64 %indvars.iv.next142, %152
  br i1 %153, label %.lr.ph105.split.us.peel.next, label %._crit_edge106, !llvm.loop !15

.preheader95:                                     ; preds = %._crit_edge106, %.preheader97.thread, %.preheader97
  %154 = phi i32 [ %.pre160166, %.preheader97 ], [ %.pre160.pre, %.preheader97.thread ], [ %158, %._crit_edge106 ]
  %155 = phi i32 [ %66, %.preheader97 ], [ %8, %.preheader97.thread ], [ %161, %._crit_edge106 ]
  %156 = mul nsw i32 %154, %155
  %157 = icmp sgt i32 %156, 0
  br i1 %157, label %.lr.ph110, label %._crit_edge121

._crit_edge106:                                   ; preds = %198, %150, %124, %.lr.ph105.split.us.preheader, %.preheader96
  %158 = phi i32 [ %102, %.preheader96 ], [ %102, %.lr.ph105.split.us.preheader ], [ %125, %124 ], [ %151, %150 ], [ %199, %198 ]
  %159 = phi i32 [ %103, %.preheader96 ], [ %103, %.lr.ph105.split.us.preheader ], [ %125, %124 ], [ %151, %150 ], [ %199, %198 ]
  %160 = phi i32 [ %104, %.preheader96 ], [ %103, %.lr.ph105.split.us.preheader ], [ %125, %124 ], [ %151, %150 ], [ %199, %198 ]
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %161 = load i32, ptr @n, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = icmp slt i64 %indvars.iv.next146, %162
  br i1 %163, label %.preheader96, label %.preheader95, !llvm.loop !16

.lr.ph105.split:                                  ; preds = %.lr.ph105.split.peel.next, %198
  %indvars.iv137 = phi i64 [ 1, %.lr.ph105.split.peel.next ], [ %indvars.iv.next138, %198 ]
  %164 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %106, i64 %indvars.iv137
  %165 = load i8, ptr %164, align 1, !tbaa !9
  %166 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %indvars.iv145, i64 %indvars.iv137
  %167 = load i8, ptr %166, align 1, !tbaa !9
  %.not90 = icmp eq i8 %165, %167
  br i1 %.not90, label %180, label %168

168:                                              ; preds = %.lr.ph105.split
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  %169 = trunc nuw nsw i64 %indvars.iv137 to i32
  %170 = call noundef i32 @_Z3idxii(i32 noundef %127, i32 noundef %169)
  %171 = call noundef i32 @_Z4findi(i32 noundef %170)
  store i32 %171, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %172 = call noundef i32 @_Z3idxii(i32 noundef %128, i32 noundef %169)
  %173 = call noundef i32 @_Z4findi(i32 noundef %172)
  store i32 %173, ptr %2, align 4, !tbaa !5
  %174 = load i32, ptr %1, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %175
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %176, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %177 = load i32, ptr %2, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %178
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %179, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  br label %180

180:                                              ; preds = %.lr.ph105.split, %168
  %181 = add nsw i64 %indvars.iv137, -1
  %182 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %indvars.iv145, i64 %181
  %183 = load i8, ptr %182, align 1, !tbaa !9
  %184 = load i8, ptr %166, align 1, !tbaa !9
  %.not92 = icmp eq i8 %183, %184
  br i1 %.not92, label %198, label %185

185:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %186 = trunc nsw i64 %181 to i32
  %187 = call noundef i32 @_Z3idxii(i32 noundef %129, i32 noundef %186)
  %188 = call noundef i32 @_Z4findi(i32 noundef %187)
  store i32 %188, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %189 = trunc nuw nsw i64 %indvars.iv137 to i32
  %190 = call noundef i32 @_Z3idxii(i32 noundef %129, i32 noundef %189)
  %191 = call noundef i32 @_Z4findi(i32 noundef %190)
  store i32 %191, ptr %4, align 4, !tbaa !5
  %192 = load i32, ptr %3, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %193
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %194, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %195 = load i32, ptr %4, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %196
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %197, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  br label %198

198:                                              ; preds = %180, %185
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %199 = load i32, ptr @m, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = icmp slt i64 %indvars.iv.next138, %200
  br i1 %201, label %.lr.ph105.split, label %._crit_edge106, !llvm.loop !18

.preheader:                                       ; preds = %.lr.ph110
  %202 = icmp sgt i32 %211, 0
  br i1 %202, label %.lr.ph120, label %._crit_edge121

.lr.ph110:                                        ; preds = %.preheader95, %.lr.ph110
  %indvars.iv148 = phi i64 [ %indvars.iv.next149, %.lr.ph110 ], [ 0, %.preheader95 ]
  %203 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv148
  %204 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %203) #9
  %205 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %203) #9
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %204, ptr %205)
  %206 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %203) #9
  %207 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %203) #9
  %208 = call ptr @_ZSt6uniqueIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr %206, ptr %207)
  %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1
  %209 = load i32, ptr @n, align 4, !tbaa !5
  %210 = load i32, ptr @m, align 4, !tbaa !5
  %211 = mul nsw i32 %210, %209
  %212 = sext i32 %211 to i64
  %213 = icmp slt i64 %indvars.iv.next149, %212
  br i1 %213, label %.lr.ph110, label %.preheader, !llvm.loop !19

._crit_edge121:                                   ; preds = %268, %.preheader95, %.preheader
  %.081.lcssa = phi i32 [ %211, %.preheader ], [ %156, %.preheader95 ], [ %.2, %268 ]
  %214 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.081.lcssa)
  ret i32 0

.lr.ph120:                                        ; preds = %.preheader, %268
  %indvars.iv151 = phi i64 [ %indvars.iv.next152, %268 ], [ 0, %.preheader ]
  %.081118 = phi i32 [ %.2, %268 ], [ %211, %.preheader ]
  %215 = trunc nuw nsw i64 %indvars.iv151 to i32
  %216 = call noundef i32 @_Z4findi(i32 noundef %215)
  %217 = zext i32 %216 to i64
  %.not = icmp eq i64 %indvars.iv151, %217
  %.pre163 = load i32, ptr @n, align 4, !tbaa !5
  %.pre164 = load i32, ptr @m, align 4, !tbaa !5
  br i1 %.not, label %.lr.ph115.preheader, label %268

.lr.ph115.preheader:                              ; preds = %.lr.ph120
  %218 = mul nsw i32 %.pre164, %.pre163
  %219 = sext i32 %218 to i64
  %220 = shl nsw i64 %219, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @dis, i8 0, i64 %220, i1 false)
  %221 = getelementptr inbounds [2601 x i32], ptr @dis, i64 0, i64 %indvars.iv151
  store i32 1, ptr %221, align 4, !tbaa !5
  store i32 1, ptr @R, align 4, !tbaa !5
  store i32 %215, ptr @que, align 16, !tbaa !5
  br label %.lr.ph115

.lr.ph115:                                        ; preds = %.lr.ph115.preheader, %._crit_edge113
  %222 = phi i32 [ %233, %._crit_edge113 ], [ 0, %.lr.ph115.preheader ]
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr @L, align 4, !tbaa !5
  %224 = sext i32 %222 to i64
  %225 = getelementptr inbounds [2601 x i32], ptr @que, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [2601 x %"class.std::vector"], ptr @e, i64 0, i64 %227
  %229 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %228) #9
  store ptr %229, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %230 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %228) #9
  store ptr %230, ptr %6, align 8
  %231 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  br i1 %231, label %.lr.ph112, label %._crit_edge113

.lr.ph112:                                        ; preds = %.lr.ph115
  %232 = getelementptr inbounds [2601 x i32], ptr @dis, i64 0, i64 %227
  br label %236

._crit_edge113:                                   ; preds = %249, %.lr.ph115
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  %233 = load i32, ptr @L, align 4, !tbaa !5
  %234 = load i32, ptr @R, align 4, !tbaa !5
  %235 = icmp slt i32 %233, %234
  br i1 %235, label %.lr.ph115, label %._crit_edge116, !llvm.loop !20

236:                                              ; preds = %.lr.ph112, %249
  %237 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [2601 x i32], ptr @dis, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %.not88 = icmp eq i32 %241, 0
  br i1 %.not88, label %242, label %249

242:                                              ; preds = %236
  %243 = load i32, ptr %232, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %240, align 4, !tbaa !5
  %245 = load i32, ptr @R, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr @R, align 4, !tbaa !5
  %247 = sext i32 %245 to i64
  %248 = getelementptr inbounds [2601 x i32], ptr @que, i64 0, i64 %247
  store i32 %238, ptr %248, align 4, !tbaa !5
  br label %249

249:                                              ; preds = %242, %236
  %250 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %251 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %228) #9
  store ptr %251, ptr %6, align 8
  %252 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  br i1 %252, label %236, label %._crit_edge113, !llvm.loop !21

._crit_edge116:                                   ; preds = %._crit_edge113
  %.pre162.pre = load i32, ptr @n, align 4, !tbaa !5
  %.pre161 = load i32, ptr @m, align 4, !tbaa !5
  %253 = add nsw i32 %234, -1
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [2601 x i32], ptr @que, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = sdiv i32 %256, %.pre161
  %258 = srem i32 %256, %.pre161
  %259 = sext i32 %256 to i64
  %260 = getelementptr inbounds [2601 x i32], ptr @dis, i64 0, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !5
  %262 = sext i32 %257 to i64
  %263 = sext i32 %258 to i64
  %264 = getelementptr inbounds [51 x [51 x i8]], ptr @str, i64 0, i64 %262, i64 %263
  %265 = load i8, ptr %264, align 1, !tbaa !9
  %266 = icmp eq i8 %265, 87
  %.neg = sext i1 %266 to i32
  %267 = add i32 %261, %.neg
  %spec.select = call i32 @llvm.smin.i32(i32 %.081118, i32 %267)
  br label %268

268:                                              ; preds = %.lr.ph120, %._crit_edge116
  %269 = phi i32 [ %.pre164, %.lr.ph120 ], [ %.pre161, %._crit_edge116 ]
  %270 = phi i32 [ %.pre163, %.lr.ph120 ], [ %.pre162.pre, %._crit_edge116 ]
  %.2 = phi i32 [ %.081118, %.lr.ph120 ], [ %spec.select, %._crit_edge116 ]
  %indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
  %271 = mul nsw i32 %269, %270
  %272 = sext i32 %271 to i64
  %273 = icmp slt i64 %indvars.iv.next152, %272
  br i1 %273, label %.lr.ph120, label %._crit_edge121, !llvm.loop !22
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3idxii(i32 noundef, i32 noundef) local_unnamed_addr #4

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

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; 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 #4

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8

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 = { nofree 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11, !12}
!15 = distinct !{!15, !11, !12}
!16 = distinct !{!16, !11, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = distinct !{!18, !11, !12}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass