; LLVM IR from tangjz/acm-icpc :: hdu (6125)

; 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 }

@tot = external dso_local global i32, align 4
@pr = external dso_local global [501 x i32], align 16
@d = external dso_local global [501 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sz = external dso_local global i32, align 4
@all = external dso_local global i32, align 4
@tr = external dso_local global [257 x i32], align 16
@f = external dso_local global [3 x [501 x [257 x i32]]], align 16
@s = external dso_local global [501 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; 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 %"class.std::vector", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %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 i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %82, %0
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 501
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %85

33:                                               ; preds = %29
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [501 x i32], ptr @d, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %48, label %39

39:                                               ; preds = %33
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [501 x i32], ptr @d, i64 0, i64 %42
  store i32 %40, ptr %43, align 4, !tbaa !5
  %44 = load i32, ptr @tot, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr @tot, align 4, !tbaa !5
  %46 = sext i32 %44 to i64
  %47 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %46
  store i32 %40, ptr %47, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %39, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  br label %49

49:                                               ; preds = %77, %48
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = mul nsw i32 %50, %54
  store i32 %55, ptr %5, align 4, !tbaa !5
  %56 = icmp slt i32 %55, 501
  br i1 %56, label %58, label %57

57:                                               ; preds = %49
  store i32 5, ptr %3, align 4
  br label %80

58:                                               ; preds = %49
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [501 x i32], ptr @d, i64 0, i64 %64
  store i32 %62, ptr %65, align 4, !tbaa !5
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [501 x i32], ptr @d, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp eq i32 %69, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %58
  store i32 5, ptr %3, align 4
  br label %80

76:                                               ; preds = %58
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %4, align 4, !tbaa !5
  br label %49, !llvm.loop !9

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

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %2, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %2, align 4, !tbaa !5
  br label %29, !llvm.loop !11

85:                                               ; preds = %32
  %86 = load i32, ptr @tot, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %87
  store i32 501, ptr %88, align 4, !tbaa !5
  %89 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %90

90:                                               ; preds = %410, %85
  %91 = load i32, ptr @t, align 4, !tbaa !5
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr @t, align 4, !tbaa !5
  %93 = icmp ne i32 %91, 0
  br i1 %93, label %94, label %413

94:                                               ; preds = %90
  %95 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  store i32 0, ptr @sz, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %109, %94
  %97 = load i32, ptr @sz, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr @sz, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = mul nsw i32 %100, %104
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = icmp sle i32 %105, %106
  br i1 %107, label %108, label %112

108:                                              ; preds = %96
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr @sz, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr @sz, align 4, !tbaa !5
  br label %96, !llvm.loop !12

112:                                              ; preds = %96
  %113 = load i32, ptr @sz, align 4, !tbaa !5
  %114 = shl i32 1, %113
  store i32 %114, ptr @all, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %181, %112
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %118 = icmp sle i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %184

120:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #7
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [501 x %"class.std::vector"], ptr @s, i64 0, i64 %122
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %123) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %124 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %124, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %169, %120
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = load i32, ptr @sz, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %129, label %132

129:                                              ; preds = %125
  %130 = load i32, ptr %8, align 4, !tbaa !5
  %131 = icmp sgt i32 %130, 1
  br label %132

132:                                              ; preds = %129, %125
  %133 = phi i1 [ false, %125 ], [ %131, %129 ]
  br i1 %133, label %135, label %134

134:                                              ; preds = %132
  store i32 16, ptr %3, align 4
  br label %172

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

136:                                              ; preds = %147, %135
  %137 = load i32, ptr %8, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [501 x i32], ptr @d, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = icmp eq i32 %140, %144
  br i1 %145, label %146, label %156

146:                                              ; preds = %136
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = load i32, ptr %8, align 4, !tbaa !5
  %153 = sdiv i32 %152, %151
  store i32 %153, ptr %8, align 4, !tbaa !5
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %11, align 4, !tbaa !5
  br label %136, !llvm.loop !13

156:                                              ; preds = %136
  %157 = load i32, ptr %11, align 4, !tbaa !5
  %158 = icmp sgt i32 %157, 1
  br i1 %158, label %159, label %160

159:                                              ; preds = %156
  store i32 -1, ptr %9, align 4, !tbaa !5
  store i32 16, ptr %3, align 4
  br label %166

160:                                              ; preds = %156
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = load i32, ptr %10, align 4, !tbaa !5
  %163 = shl i32 %161, %162
  %164 = load i32, ptr %9, align 4, !tbaa !5
  %165 = add nsw i32 %164, %163
  store i32 %165, ptr %9, align 4, !tbaa !5
  store i32 0, ptr %3, align 4
  br label %166

166:                                              ; preds = %160, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %167 = load i32, ptr %3, align 4
  switch i32 %167, label %172 [
    i32 0, label %168
  ]

168:                                              ; preds = %166
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr %10, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %10, align 4, !tbaa !5
  br label %125, !llvm.loop !14

172:                                              ; preds = %166, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %9, align 4, !tbaa !5
  %175 = icmp sge i32 %174, 0
  br i1 %175, label %176, label %180

176:                                              ; preds = %173
  %177 = load i32, ptr %8, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [501 x %"class.std::vector"], ptr @s, i64 0, i64 %178
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %179, ptr noundef nonnull align 4 dereferenceable(4) %9)
  br label %180

180:                                              ; preds = %176, %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %6, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %6, align 4, !tbaa !5
  br label %115, !llvm.loop !15

184:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %205, %184
  %186 = load i32, ptr %12, align 4, !tbaa !5
  %187 = load i32, ptr @m, align 4, !tbaa !5
  %188 = icmp sle i32 %186, %187
  br i1 %188, label %190, label %189

189:                                              ; preds = %185
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %208

190:                                              ; preds = %185
  %191 = load i32, ptr %12, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %192
  %194 = getelementptr inbounds [257 x i32], ptr %193, i64 0, i64 0
  %195 = load i32, ptr @all, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = mul i64 %196, 4
  call void @llvm.memset.p0.i64(ptr align 4 %194, i8 0, i64 %197, i1 false)
  %198 = load i32, ptr %12, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [501 x [257 x i32]], ptr getelementptr inbounds ([3 x [501 x [257 x i32]]], ptr @f, i64 0, i64 1), i64 0, i64 %199
  %201 = getelementptr inbounds [257 x i32], ptr %200, i64 0, i64 0
  %202 = load i32, ptr @all, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = mul i64 %203, 4
  call void @llvm.memset.p0.i64(ptr align 4 %201, i8 0, i64 %204, i1 false)
  br label %205

205:                                              ; preds = %190
  %206 = load i32, ptr %12, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %12, align 4, !tbaa !5
  br label %185, !llvm.loop !16

208:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  store i32 1, ptr @f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %380, %208
  %210 = load i32, ptr %14, align 4, !tbaa !5
  %211 = load i32, ptr @n, align 4, !tbaa !5
  %212 = icmp sle i32 %210, %211
  br i1 %212, label %214, label %213

213:                                              ; preds = %209
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %383

214:                                              ; preds = %209
  %215 = load i32, ptr %14, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [501 x %"class.std::vector"], ptr @s, i64 0, i64 %216
  %218 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %217) #7
  %219 = icmp ne i64 %218, 0
  br i1 %219, label %221, label %220

220:                                              ; preds = %214
  br label %380

221:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %222 = load i32, ptr %14, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [501 x %"class.std::vector"], ptr @s, i64 0, i64 %223
  %225 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %224) #7
  %226 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %225, ptr %226, align 8
  br label %227

227:                                              ; preds = %338, %221
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %228 = load i32, ptr %14, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [501 x %"class.std::vector"], ptr @s, i64 0, i64 %229
  %231 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %230) #7
  %232 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %231, ptr %232, align 8
  %233 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br i1 %233, label %235, label %234

234:                                              ; preds = %227
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %340

235:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %236 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  %237 = load i32, ptr %236, align 4, !tbaa !5
  store i32 %237, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %238 = load i32, ptr %14, align 4, !tbaa !5
  %239 = icmp sgt i32 %238, 1
  %240 = zext i1 %239 to i32
  store i32 %240, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %278, %235
  %242 = load i32, ptr %19, align 4, !tbaa !5
  %243 = load i32, ptr @all, align 4, !tbaa !5
  %244 = icmp slt i32 %242, %243
  br i1 %244, label %246, label %245

245:                                              ; preds = %241
  store i32 31, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %281

246:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %247 = load i32, ptr %17, align 4, !tbaa !5
  %248 = load i32, ptr %19, align 4, !tbaa !5
  %249 = or i32 %247, %248
  store i32 %249, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %250

250:                                              ; preds = %269, %246
  %251 = load i32, ptr %21, align 4, !tbaa !5
  %252 = load i32, ptr @sz, align 4, !tbaa !5
  %253 = icmp slt i32 %251, %252
  br i1 %253, label %255, label %254

254:                                              ; preds = %250
  store i32 34, ptr %3, align 4
  br label %272

255:                                              ; preds = %250
  %256 = load i32, ptr %17, align 4, !tbaa !5
  %257 = load i32, ptr %21, align 4, !tbaa !5
  %258 = ashr i32 %256, %257
  %259 = and i32 %258, 1
  %260 = icmp ne i32 %259, 0
  br i1 %260, label %261, label %268

261:                                              ; preds = %255
  %262 = load i32, ptr %19, align 4, !tbaa !5
  %263 = load i32, ptr %21, align 4, !tbaa !5
  %264 = ashr i32 %262, %263
  %265 = and i32 %264, 1
  %266 = icmp ne i32 %265, 0
  br i1 %266, label %267, label %268

267:                                              ; preds = %261
  store i32 -1, ptr %20, align 4, !tbaa !5
  store i32 34, ptr %3, align 4
  br label %272

268:                                              ; preds = %261, %255
  br label %269

269:                                              ; preds = %268
  %270 = load i32, ptr %21, align 4, !tbaa !5
  %271 = add nsw i32 %270, 1
  store i32 %271, ptr %21, align 4, !tbaa !5
  br label %250, !llvm.loop !17

272:                                              ; preds = %267, %254
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %273

273:                                              ; preds = %272
  %274 = load i32, ptr %20, align 4, !tbaa !5
  %275 = load i32, ptr %19, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [257 x i32], ptr @tr, i64 0, i64 %276
  store i32 %274, ptr %277, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %278

278:                                              ; preds = %273
  %279 = load i32, ptr %19, align 4, !tbaa !5
  %280 = add nsw i32 %279, 1
  store i32 %280, ptr %19, align 4, !tbaa !5
  br label %241, !llvm.loop !18

281:                                              ; preds = %245
  %282 = load i32, ptr %13, align 4, !tbaa !5
  %283 = load i32, ptr @m, align 4, !tbaa !5
  %284 = icmp slt i32 %282, %283
  br i1 %284, label %285, label %289

285:                                              ; preds = %281
  %286 = load i32, ptr %13, align 4, !tbaa !5
  %287 = add nsw i32 %286, 1
  store i32 %287, ptr %13, align 4, !tbaa !5
  %288 = icmp ne i32 %287, 0
  br label %289

289:                                              ; preds = %285, %281
  %290 = phi i1 [ false, %281 ], [ %288, %285 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %291 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %291, ptr %22, align 4, !tbaa !5
  br label %292

292:                                              ; preds = %334, %289
  %293 = load i32, ptr %22, align 4, !tbaa !5
  %294 = icmp sgt i32 %293, 0
  br i1 %294, label %296, label %295

295:                                              ; preds = %292
  store i32 37, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %337

296:                                              ; preds = %292
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %297

297:                                              ; preds = %330, %296
  %298 = load i32, ptr %23, align 4, !tbaa !5
  %299 = load i32, ptr @all, align 4, !tbaa !5
  %300 = icmp slt i32 %298, %299
  br i1 %300, label %302, label %301

301:                                              ; preds = %297
  store i32 40, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %333

302:                                              ; preds = %297
  %303 = load i32, ptr %23, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [257 x i32], ptr @tr, i64 0, i64 %304
  %306 = load i32, ptr %305, align 4, !tbaa !5
  %307 = icmp sge i32 %306, 0
  br i1 %307, label %308, label %329

308:                                              ; preds = %302
  %309 = load i32, ptr %18, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [3 x [501 x [257 x i32]]], ptr @f, i64 0, i64 %310
  %312 = load i32, ptr %22, align 4, !tbaa !5
  %313 = sext i32 %312 to i64
  %314 = getelementptr inbounds [501 x [257 x i32]], ptr %311, i64 0, i64 %313
  %315 = load i32, ptr %23, align 4, !tbaa !5
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [257 x i32], ptr @tr, i64 0, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [257 x i32], ptr %314, i64 0, i64 %319
  %321 = load i32, ptr %22, align 4, !tbaa !5
  %322 = sub nsw i32 %321, 1
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %323
  %325 = load i32, ptr %23, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [257 x i32], ptr %324, i64 0, i64 %326
  %328 = load i32, ptr %327, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %320, i32 noundef %328)
  br label %329

329:                                              ; preds = %308, %302
  br label %330

330:                                              ; preds = %329
  %331 = load i32, ptr %23, align 4, !tbaa !5
  %332 = add nsw i32 %331, 1
  store i32 %332, ptr %23, align 4, !tbaa !5
  br label %297, !llvm.loop !19

333:                                              ; preds = %301
  br label %334

334:                                              ; preds = %333
  %335 = load i32, ptr %22, align 4, !tbaa !5
  %336 = add nsw i32 %335, -1
  store i32 %336, ptr %22, align 4, !tbaa !5
  br label %292, !llvm.loop !20

337:                                              ; preds = %295
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %338

338:                                              ; preds = %337
  %339 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br label %227, !llvm.loop !21

340:                                              ; preds = %234
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %341

341:                                              ; preds = %376, %340
  %342 = load i32, ptr %24, align 4, !tbaa !5
  %343 = load i32, ptr %13, align 4, !tbaa !5
  %344 = icmp sle i32 %342, %343
  br i1 %344, label %346, label %345

345:                                              ; preds = %341
  store i32 43, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %379

346:                                              ; preds = %341
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %347

347:                                              ; preds = %372, %346
  %348 = load i32, ptr %25, align 4, !tbaa !5
  %349 = load i32, ptr @all, align 4, !tbaa !5
  %350 = icmp slt i32 %348, %349
  br i1 %350, label %352, label %351

351:                                              ; preds = %347
  store i32 46, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %375

352:                                              ; preds = %347
  %353 = load i32, ptr %24, align 4, !tbaa !5
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %354
  %356 = load i32, ptr %25, align 4, !tbaa !5
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds [257 x i32], ptr %355, i64 0, i64 %357
  %359 = load i32, ptr %24, align 4, !tbaa !5
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [501 x [257 x i32]], ptr getelementptr inbounds ([3 x [501 x [257 x i32]]], ptr @f, i64 0, i64 1), i64 0, i64 %360
  %362 = load i32, ptr %25, align 4, !tbaa !5
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds [257 x i32], ptr %361, i64 0, i64 %363
  %365 = load i32, ptr %364, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %358, i32 noundef %365)
  %366 = load i32, ptr %24, align 4, !tbaa !5
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds [501 x [257 x i32]], ptr getelementptr inbounds ([3 x [501 x [257 x i32]]], ptr @f, i64 0, i64 1), i64 0, i64 %367
  %369 = load i32, ptr %25, align 4, !tbaa !5
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [257 x i32], ptr %368, i64 0, i64 %370
  store i32 0, ptr %371, align 4, !tbaa !5
  br label %372

372:                                              ; preds = %352
  %373 = load i32, ptr %25, align 4, !tbaa !5
  %374 = add nsw i32 %373, 1
  store i32 %374, ptr %25, align 4, !tbaa !5
  br label %347, !llvm.loop !22

375:                                              ; preds = %351
  br label %376

376:                                              ; preds = %375
  %377 = load i32, ptr %24, align 4, !tbaa !5
  %378 = add nsw i32 %377, 1
  store i32 %378, ptr %24, align 4, !tbaa !5
  br label %341, !llvm.loop !23

379:                                              ; preds = %345
  br label %380

380:                                              ; preds = %379, %220
  %381 = load i32, ptr %14, align 4, !tbaa !5
  %382 = add nsw i32 %381, 1
  store i32 %382, ptr %14, align 4, !tbaa !5
  br label %209, !llvm.loop !24

383:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 1, ptr %27, align 4, !tbaa !5
  br label %384

384:                                              ; preds = %407, %383
  %385 = load i32, ptr %27, align 4, !tbaa !5
  %386 = load i32, ptr %13, align 4, !tbaa !5
  %387 = icmp sle i32 %385, %386
  br i1 %387, label %389, label %388

388:                                              ; preds = %384
  store i32 49, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %410

389:                                              ; preds = %384
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %390

390:                                              ; preds = %403, %389
  %391 = load i32, ptr %28, align 4, !tbaa !5
  %392 = load i32, ptr @all, align 4, !tbaa !5
  %393 = icmp slt i32 %391, %392
  br i1 %393, label %395, label %394

394:                                              ; preds = %390
  store i32 52, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %406

395:                                              ; preds = %390
  %396 = load i32, ptr %27, align 4, !tbaa !5
  %397 = sext i32 %396 to i64
  %398 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %397
  %399 = load i32, ptr %28, align 4, !tbaa !5
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [257 x i32], ptr %398, i64 0, i64 %400
  %402 = load i32, ptr %401, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %26, i32 noundef %402)
  br label %403

403:                                              ; preds = %395
  %404 = load i32, ptr %28, align 4, !tbaa !5
  %405 = add nsw i32 %404, 1
  store i32 %405, ptr %28, align 4, !tbaa !5
  br label %390, !llvm.loop !25

406:                                              ; preds = %394
  br label %407

407:                                              ; preds = %406
  %408 = load i32, ptr %27, align 4, !tbaa !5
  %409 = add nsw i32 %408, 1
  store i32 %409, ptr %27, align 4, !tbaa !5
  br label %384, !llvm.loop !26

410:                                              ; preds = %388
  %411 = load i32, ptr %26, align 4, !tbaa !5
  %412 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %411)
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %90, !llvm.loop !27

413:                                              ; preds = %90
  ret i32 0
}

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 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)) #6

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

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

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

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

declare i32 @printf(ptr noundef, ...) #3

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

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

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


; 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 }

@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [501 x i32], align 16
@d = external dso_local local_unnamed_addr global [501 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sz = external dso_local local_unnamed_addr global i32, align 4
@all = external dso_local local_unnamed_addr global i32, align 4
@tr = external dso_local local_unnamed_addr global [257 x i32], align 16
@f = external dso_local global [3 x [501 x [257 x i32]]], align 16
@s = external dso_local global [501 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i32, align 4
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca i32, align 4
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br label %12

6:                                                ; preds = %._crit_edge
  %7 = sext i32 %21 to i64
  %8 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %7
  store i32 501, ptr %8, align 4, !tbaa !5
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %10 = load i32, ptr @t, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr @t, align 4, !tbaa !5
  %.not186 = icmp eq i32 %10, 0
  br i1 %.not186, label %._crit_edge189, label %.lr.ph188

12:                                               ; preds = %0, %._crit_edge
  %indvars.iv198 = phi i64 [ 2, %0 ], [ %indvars.iv.next199, %._crit_edge ]
  %13 = phi i32 [ %tot.promoted, %0 ], [ %21, %._crit_edge ]
  %14 = getelementptr inbounds [501 x i32], ptr @d, i64 0, i64 %indvars.iv198
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %.not115 = icmp eq i32 %15, 0
  %16 = trunc nuw nsw i64 %indvars.iv198 to i32
  br i1 %.not115, label %17, label %._crit_edge252

17:                                               ; preds = %12
  store i32 %16, ptr %14, align 4, !tbaa !5
  %18 = add nsw i32 %13, 1
  store i32 %18, ptr @tot, align 4, !tbaa !5
  %19 = sext i32 %13 to i64
  %20 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %19
  store i32 %16, ptr %20, align 4, !tbaa !5
  br label %._crit_edge252

._crit_edge252:                                   ; preds = %12, %17
  %21 = phi i32 [ %18, %17 ], [ %13, %12 ]
  %22 = load i32, ptr @pr, align 16, !tbaa !5
  %23 = mul nsw i32 %22, %16
  %24 = icmp slt i32 %23, 501
  br i1 %24, label %.lr.ph, label %._crit_edge

25:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = mul nsw i32 %27, %16
  %29 = icmp slt i32 %28, 501
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %._crit_edge252, %25
  %indvars.iv = phi i64 [ %indvars.iv.next, %25 ], [ 0, %._crit_edge252 ]
  %30 = phi i32 [ %28, %25 ], [ %23, %._crit_edge252 ]
  %31 = phi i32 [ %27, %25 ], [ %22, %._crit_edge252 ]
  %32 = sext i32 %30 to i64
  %33 = getelementptr inbounds [501 x i32], ptr @d, i64 0, i64 %32
  store i32 %31, ptr %33, align 4, !tbaa !5
  %34 = load i32, ptr %14, align 4, !tbaa !5
  %35 = icmp eq i32 %34, %31
  br i1 %35, label %._crit_edge, label %25

._crit_edge:                                      ; preds = %25, %.lr.ph, %._crit_edge252
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next199, 501
  br i1 %exitcond.not, label %6, label %12, !llvm.loop !11

.lr.ph188:                                        ; preds = %6, %._crit_edge185
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %37 = load i32, ptr @n, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %38, %.lr.ph188
  %indvars.iv201 = phi i64 [ %indvars.iv.next202, %38 ], [ 0, %.lr.ph188 ]
  %39 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %indvars.iv201
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = mul nsw i32 %40, %40
  %.not105 = icmp sgt i32 %41, %37
  %indvars.iv.next202 = add nuw nsw i64 %indvars.iv201, 1
  br i1 %.not105, label %42, label %38, !llvm.loop !12

42:                                               ; preds = %38
  %43 = trunc nuw nsw i64 %indvars.iv201 to i32
  store i32 %43, ptr @sz, align 4, !tbaa !5
  %44 = shl nuw i32 1, %43
  store i32 %44, ptr @all, align 4, !tbaa !5
  %.not106137 = icmp slt i32 %37, 1
  br i1 %.not106137, label %.preheader120, label %.lr.ph141

.preheader120:                                    ; preds = %thread-pre-split.thread263, %42
  %45 = phi i32 [ %37, %42 ], [ %81, %thread-pre-split.thread263 ]
  %46 = load i32, ptr @m, align 4, !tbaa !5
  %.not107142 = icmp slt i32 %46, 0
  br i1 %.not107142, label %._crit_edge145, label %.lr.ph144

.lr.ph144:                                        ; preds = %.preheader120
  %47 = load i32, ptr @all, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = shl nsw i64 %48, 2
  %50 = add nuw i32 %46, 1
  %wide.trip.count = zext i32 %50 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %51 = icmp ult i32 %46, 3
  br i1 %51, label %._crit_edge145.loopexit.unr-lcssa, label %.lr.ph144.new

.lr.ph144.new:                                    ; preds = %.lr.ph144
  %unroll_iter = and i64 %wide.trip.count, 4294967292
  br label %85

.lr.ph141:                                        ; preds = %42, %thread-pre-split.thread263
  %indvars.iv207 = phi i64 [ %indvars.iv.next208, %thread-pre-split.thread263 ], [ 1, %42 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %52 = getelementptr inbounds [501 x %"class.std::vector"], ptr @s, i64 0, i64 %indvars.iv207
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %52) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  %53 = load i32, ptr @sz, align 4, !tbaa !5
  %54 = icmp sgt i32 %53, 0
  %55 = icmp ugt i64 %indvars.iv207, 1
  %56 = and i1 %55, %54
  %57 = trunc nuw nsw i64 %indvars.iv207 to i32
  br i1 %56, label %.preheader117.preheader, label %thread-pre-split.thread

.preheader117.preheader:                          ; preds = %.lr.ph141
  %58 = zext nneg i32 %53 to i64
  br label %.preheader117

._crit_edge129.thread:                            ; preds = %.preheader117, %._crit_edge129
  %storemerge114260 = phi i32 [ %77, %._crit_edge129 ], [ %storemerge114131132, %.preheader117 ]
  %.198.lcssa259 = phi i32 [ %68, %._crit_edge129 ], [ %.097133, %.preheader117 ]
  %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
  %59 = icmp ult i64 %indvars.iv.next205, %58
  %60 = icmp sgt i32 %.198.lcssa259, 1
  %61 = and i1 %60, %59
  br i1 %61, label %.preheader117, label %thread-pre-split, !llvm.loop !13

.preheader117:                                    ; preds = %.preheader117.preheader, %._crit_edge129.thread
  %indvars.iv204 = phi i64 [ 0, %.preheader117.preheader ], [ %indvars.iv.next205, %._crit_edge129.thread ]
  %.097133 = phi i32 [ %57, %.preheader117.preheader ], [ %.198.lcssa259, %._crit_edge129.thread ]
  %storemerge114131132 = phi i32 [ 0, %.preheader117.preheader ], [ %storemerge114260, %._crit_edge129.thread ]
  %62 = getelementptr inbounds [501 x i32], ptr @pr, i64 0, i64 %indvars.iv204
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = sext i32 %.097133 to i64
  %65 = getelementptr inbounds [501 x i32], ptr @d, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp eq i32 %66, %63
  br i1 %67, label %.lr.ph128, label %._crit_edge129.thread

.lr.ph128:                                        ; preds = %.preheader117, %.lr.ph128
  %.095127 = phi i32 [ %69, %.lr.ph128 ], [ 0, %.preheader117 ]
  %.198126 = phi i32 [ %68, %.lr.ph128 ], [ %.097133, %.preheader117 ]
  %68 = sdiv i32 %.198126, %63
  %69 = add nuw nsw i32 %.095127, 1
  %70 = sext i32 %68 to i64
  %71 = getelementptr inbounds [501 x i32], ptr @d, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp eq i32 %72, %63
  br i1 %73, label %.lr.ph128, label %._crit_edge129, !llvm.loop !14

._crit_edge129:                                   ; preds = %.lr.ph128
  %74 = icmp eq i32 %.095127, 0
  %75 = trunc nuw nsw i64 %indvars.iv204 to i32
  %76 = shl nuw i32 %69, %75
  %77 = add nsw i32 %storemerge114131132, %76
  br i1 %74, label %._crit_edge129.thread, label %thread-pre-split.thread263

thread-pre-split:                                 ; preds = %._crit_edge129.thread
  store i32 %storemerge114260, ptr %2, align 4, !tbaa !5
  %78 = icmp sgt i32 %storemerge114260, -1
  br i1 %78, label %thread-pre-split.thread, label %thread-pre-split.thread263

thread-pre-split.thread:                          ; preds = %.lr.ph141, %thread-pre-split
  %.299262 = phi i32 [ %.198.lcssa259, %thread-pre-split ], [ %57, %.lr.ph141 ]
  %79 = sext i32 %.299262 to i64
  %80 = getelementptr inbounds [501 x %"class.std::vector"], ptr @s, i64 0, i64 %79
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %80, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %thread-pre-split.thread263

thread-pre-split.thread263:                       ; preds = %._crit_edge129, %thread-pre-split.thread, %thread-pre-split
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %indvars.iv.next208 = add nuw nsw i64 %indvars.iv207, 1
  %81 = load i32, ptr @n, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %.not106.not = icmp slt i64 %indvars.iv207, %82
  br i1 %.not106.not, label %.lr.ph141, label %.preheader120, !llvm.loop !15

._crit_edge145.loopexit.unr-lcssa:                ; preds = %85, %.lr.ph144
  %indvars.iv210.unr = phi i64 [ 0, %.lr.ph144 ], [ %indvars.iv.next211.3, %85 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge145, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge145.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv210.epil = phi i64 [ %indvars.iv.next211.epil, %.epil.preheader ], [ %indvars.iv210.unr, %._crit_edge145.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge145.loopexit.unr-lcssa ]
  %83 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %indvars.iv210.epil
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %83, i8 0, i64 %49, i1 false)
  %84 = getelementptr inbounds [501 x [257 x i32]], ptr getelementptr inbounds (i8, ptr @f, i64 515028), i64 0, i64 %indvars.iv210.epil
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %84, i8 0, i64 %49, i1 false)
  %indvars.iv.next211.epil = add nuw nsw i64 %indvars.iv210.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge145, label %.epil.preheader, !llvm.loop !16

._crit_edge145:                                   ; preds = %._crit_edge145.loopexit.unr-lcssa, %.epil.preheader, %.preheader120
  store i32 1, ptr @f, align 16, !tbaa !5
  %.not108172 = icmp slt i32 %45, 1
  br i1 %.not108172, label %._crit_edge178.thread, label %.lr.ph177

._crit_edge178.thread:                            ; preds = %._crit_edge145
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %._crit_edge185

85:                                               ; preds = %85, %.lr.ph144.new
  %indvars.iv210 = phi i64 [ 0, %.lr.ph144.new ], [ %indvars.iv.next211.3, %85 ]
  %niter = phi i64 [ 0, %.lr.ph144.new ], [ %niter.next.3, %85 ]
  %86 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %indvars.iv210
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %86, i8 0, i64 %49, i1 false)
  %87 = getelementptr inbounds [501 x [257 x i32]], ptr getelementptr inbounds (i8, ptr @f, i64 515028), i64 0, i64 %indvars.iv210
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %87, i8 0, i64 %49, i1 false)
  %indvars.iv.next211 = or disjoint i64 %indvars.iv210, 1
  %88 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %indvars.iv.next211
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %88, i8 0, i64 %49, i1 false)
  %89 = getelementptr inbounds [501 x [257 x i32]], ptr getelementptr inbounds (i8, ptr @f, i64 515028), i64 0, i64 %indvars.iv.next211
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %89, i8 0, i64 %49, i1 false)
  %indvars.iv.next211.1 = or disjoint i64 %indvars.iv210, 2
  %90 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %indvars.iv.next211.1
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %90, i8 0, i64 %49, i1 false)
  %91 = getelementptr inbounds [501 x [257 x i32]], ptr getelementptr inbounds (i8, ptr @f, i64 515028), i64 0, i64 %indvars.iv.next211.1
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %91, i8 0, i64 %49, i1 false)
  %indvars.iv.next211.2 = or disjoint i64 %indvars.iv210, 3
  %92 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %indvars.iv.next211.2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %92, i8 0, i64 %49, i1 false)
  %93 = getelementptr inbounds [501 x [257 x i32]], ptr getelementptr inbounds (i8, ptr @f, i64 515028), i64 0, i64 %indvars.iv.next211.2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %93, i8 0, i64 %49, i1 false)
  %indvars.iv.next211.3 = add nuw nsw i64 %indvars.iv210, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge145.loopexit.unr-lcssa, label %85, !llvm.loop !18

._crit_edge178:                                   ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  %.not109183 = icmp slt i32 %.3, 1
  br i1 %.not109183, label %._crit_edge185, label %.preheader118.lr.ph

.preheader118.lr.ph:                              ; preds = %._crit_edge178
  %94 = load i32, ptr @all, align 4, !tbaa !5
  %95 = icmp sgt i32 %94, 0
  br i1 %95, label %.preheader118.preheader, label %._crit_edge185

.preheader118.preheader:                          ; preds = %.preheader118.lr.ph
  %96 = add nuw i32 %.3, 1
  %wide.trip.count248 = zext i32 %96 to i64
  br label %.preheader118

.lr.ph177:                                        ; preds = %._crit_edge145, %.loopexit
  %indvars.iv239 = phi i64 [ %indvars.iv.next240, %.loopexit ], [ 1, %._crit_edge145 ]
  %.093173 = phi i32 [ %.3, %.loopexit ], [ 0, %._crit_edge145 ]
  %97 = getelementptr inbounds [501 x %"class.std::vector"], ptr @s, i64 0, i64 %indvars.iv239
  %98 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #7
  %.not110 = icmp eq i64 %98, 0
  br i1 %.not110, label %.loopexit, label %99

99:                                               ; preds = %.lr.ph177
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %100 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #7
  store ptr %100, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %101 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #7
  store ptr %101, ptr %4, align 8
  %102 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %102, label %.lr.ph164, label %._crit_edge165

.lr.ph164:                                        ; preds = %99
  %103 = icmp ugt i64 %indvars.iv239, 1
  %104 = zext i1 %103 to i64
  br label %108

._crit_edge165:                                   ; preds = %._crit_edge161, %99
  %.1.lcssa = phi i32 [ %.093173, %99 ], [ %spec.select268, %._crit_edge161 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %.not111170 = icmp slt i32 %.1.lcssa, 0
  br i1 %.not111170, label %.loopexit, label %.preheader116.lr.ph

.preheader116.lr.ph:                              ; preds = %._crit_edge165
  %105 = load i32, ptr @all, align 4, !tbaa !5
  %106 = icmp sgt i32 %105, 0
  br i1 %106, label %.preheader116.preheader, label %.loopexit

.preheader116.preheader:                          ; preds = %.preheader116.lr.ph
  %107 = add nuw i32 %.1.lcssa, 1
  %wide.trip.count237 = zext i32 %107 to i64
  br label %.preheader116

108:                                              ; preds = %.lr.ph164, %._crit_edge161
  %.1162 = phi i32 [ %.093173, %.lr.ph164 ], [ %spec.select268, %._crit_edge161 ]
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr @all, align 4, !tbaa !5
  %112 = icmp slt i32 %111, 1
  br i1 %112, label %._crit_edge156.thread, label %.lr.ph155

.lr.ph155:                                        ; preds = %108
  %113 = load i32, ptr @sz, align 4, !tbaa !5
  %114 = icmp sgt i32 %113, 0
  %wide.trip.count223 = zext nneg i32 %111 to i64
  br i1 %114, label %.lr.ph148.us, label %.lr.ph155.split.preheader

.lr.ph155.split.preheader:                        ; preds = %.lr.ph155
  %min.iters.check = icmp ult i32 %111, 8
  br i1 %min.iters.check, label %.lr.ph155.split.preheader289, label %vector.ph

.lr.ph155.split.preheader289:                     ; preds = %middle.block, %.lr.ph155.split.preheader
  %indvars.iv214.ph = phi i64 [ 0, %.lr.ph155.split.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph155.split

vector.ph:                                        ; preds = %.lr.ph155.split.preheader
  %n.vec = and i64 %wide.trip.count223, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %110, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %115 = or <4 x i32> %broadcast.splat, %vec.ind
  %116 = or <4 x i32> %broadcast.splat, %step.add
  %117 = getelementptr inbounds [257 x i32], ptr @tr, i64 0, i64 %index
  %118 = getelementptr inbounds i8, ptr %117, i64 16
  store <4 x i32> %115, ptr %117, align 16, !tbaa !5
  store <4 x i32> %116, ptr %118, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %119 = icmp eq i64 %index.next, %n.vec
  br i1 %119, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count223
  br i1 %cmp.n, label %._crit_edge156, label %.lr.ph155.split.preheader289

.lr.ph148.us:                                     ; preds = %.lr.ph155, %._crit_edge149.us
  %indvars.iv220 = phi i64 [ %indvars.iv.next221, %._crit_edge149.us ], [ 0, %.lr.ph155 ]
  %120 = trunc nuw nsw i64 %indvars.iv220 to i32
  %121 = or i32 %110, %120
  br label %124

122:                                              ; preds = %124
  %123 = add nuw nsw i32 %.087146.us, 1
  %exitcond219.not = icmp eq i32 %123, %113
  br i1 %exitcond219.not, label %._crit_edge149.us, label %124, !llvm.loop !22

124:                                              ; preds = %.lr.ph148.us, %122
  %.087146.us = phi i32 [ 0, %.lr.ph148.us ], [ %123, %122 ]
  %125 = shl nuw i32 1, %.087146.us
  %126 = and i32 %125, %110
  %.not112.us = icmp eq i32 %126, 0
  %127 = and i32 %125, %120
  %.not113.us = icmp eq i32 %127, 0
  %or.cond.us = or i1 %.not112.us, %.not113.us
  br i1 %or.cond.us, label %122, label %._crit_edge149.us

._crit_edge149.us:                                ; preds = %122, %124
  %.088.us = phi i32 [ -1, %124 ], [ %121, %122 ]
  %128 = getelementptr inbounds [257 x i32], ptr @tr, i64 0, i64 %indvars.iv220
  store i32 %.088.us, ptr %128, align 4, !tbaa !5
  %indvars.iv.next221 = add nuw nsw i64 %indvars.iv220, 1
  %exitcond224.not = icmp eq i64 %indvars.iv.next221, %wide.trip.count223
  br i1 %exitcond224.not, label %._crit_edge156, label %.lr.ph148.us, !llvm.loop !23

._crit_edge156:                                   ; preds = %.lr.ph155.split, %._crit_edge149.us, %middle.block
  %129 = load i32, ptr @m, align 4, !tbaa !5
  %130 = icmp slt i32 %.1162, %129
  %131 = zext i1 %130 to i32
  %spec.select = add nsw i32 %.1162, %131
  %132 = icmp slt i32 %spec.select, 1
  %brmerge = or i1 %132, %112
  br i1 %brmerge, label %._crit_edge161, label %.preheader.preheader

._crit_edge156.thread:                            ; preds = %108
  %133 = load i32, ptr @m, align 4, !tbaa !5
  %134 = icmp slt i32 %.1162, %133
  %135 = zext i1 %134 to i32
  %spec.select267 = add nsw i32 %.1162, %135
  br label %._crit_edge161

.preheader.preheader:                             ; preds = %._crit_edge156
  %136 = zext nneg i32 %spec.select to i64
  br label %.preheader

.lr.ph155.split:                                  ; preds = %.lr.ph155.split.preheader289, %.lr.ph155.split
  %indvars.iv214 = phi i64 [ %indvars.iv.next215, %.lr.ph155.split ], [ %indvars.iv214.ph, %.lr.ph155.split.preheader289 ]
  %137 = trunc nuw nsw i64 %indvars.iv214 to i32
  %138 = or i32 %110, %137
  %139 = getelementptr inbounds [257 x i32], ptr @tr, i64 0, i64 %indvars.iv214
  store i32 %138, ptr %139, align 4, !tbaa !5
  %indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
  %exitcond218.not = icmp eq i64 %indvars.iv.next215, %wide.trip.count223
  br i1 %exitcond218.not, label %._crit_edge156, label %.lr.ph155.split, !llvm.loop !24

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge159
  %140 = phi i32 [ %111, %.preheader.preheader ], [ %148, %._crit_edge159 ]
  %141 = phi i32 [ %111, %.preheader.preheader ], [ %149, %._crit_edge159 ]
  %indvars.iv228 = phi i64 [ %136, %.preheader.preheader ], [ %indvars.iv.next229, %._crit_edge159 ]
  %142 = icmp sgt i32 %141, 0
  br i1 %142, label %.lr.ph158, label %._crit_edge159

.lr.ph158:                                        ; preds = %.preheader
  %143 = add i64 %indvars.iv228, 4294967295
  %144 = and i64 %143, 4294967295
  br label %151

._crit_edge161:                                   ; preds = %._crit_edge159, %._crit_edge156, %._crit_edge156.thread
  %spec.select268 = phi i32 [ %spec.select, %._crit_edge156 ], [ %spec.select267, %._crit_edge156.thread ], [ %spec.select, %._crit_edge159 ]
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %146 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #7
  store ptr %146, ptr %4, align 8
  %147 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %147, label %108, label %._crit_edge165, !llvm.loop !25

._crit_edge159:                                   ; preds = %161, %.preheader
  %148 = phi i32 [ %140, %.preheader ], [ %162, %161 ]
  %149 = phi i32 [ %141, %.preheader ], [ %162, %161 ]
  %.pre-phi255 = trunc i64 %indvars.iv228 to i32
  %indvars.iv.next229 = add nsw i64 %indvars.iv228, -1
  %150 = icmp sgt i32 %.pre-phi255, 1
  br i1 %150, label %.preheader, label %._crit_edge161, !llvm.loop !26

151:                                              ; preds = %.lr.ph158, %161
  %152 = phi i32 [ %140, %.lr.ph158 ], [ %162, %161 ]
  %indvars.iv225 = phi i64 [ 0, %.lr.ph158 ], [ %indvars.iv.next226, %161 ]
  %153 = getelementptr inbounds [257 x i32], ptr @tr, i64 0, i64 %indvars.iv225
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = icmp sgt i32 %154, -1
  br i1 %155, label %156, label %161

156:                                              ; preds = %151
  %157 = zext nneg i32 %154 to i64
  %158 = getelementptr inbounds [3 x [501 x [257 x i32]]], ptr @f, i64 0, i64 %104, i64 %indvars.iv228, i64 %157
  %159 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %144, i64 %indvars.iv225
  %160 = load i32, ptr %159, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %158, i32 noundef %160)
  %.pre = load i32, ptr @all, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %151, %156
  %162 = phi i32 [ %152, %151 ], [ %.pre, %156 ]
  %indvars.iv.next226 = add nuw nsw i64 %indvars.iv225, 1
  %163 = sext i32 %162 to i64
  %164 = icmp slt i64 %indvars.iv.next226, %163
  br i1 %164, label %151, label %._crit_edge159, !llvm.loop !28

.preheader116:                                    ; preds = %.preheader116.preheader, %._crit_edge169
  %165 = phi i32 [ %105, %.preheader116.preheader ], [ %167, %._crit_edge169 ]
  %indvars.iv234 = phi i64 [ 0, %.preheader116.preheader ], [ %indvars.iv.next235, %._crit_edge169 ]
  %166 = icmp sgt i32 %165, 0
  br i1 %166, label %.lr.ph168, label %._crit_edge169

._crit_edge169:                                   ; preds = %.lr.ph168, %.preheader116
  %167 = phi i32 [ %165, %.preheader116 ], [ %171, %.lr.ph168 ]
  %indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
  %exitcond238.not = icmp eq i64 %indvars.iv.next235, %wide.trip.count237
  br i1 %exitcond238.not, label %.loopexit, label %.preheader116, !llvm.loop !29

.lr.ph168:                                        ; preds = %.preheader116, %.lr.ph168
  %indvars.iv231 = phi i64 [ %indvars.iv.next232, %.lr.ph168 ], [ 0, %.preheader116 ]
  %168 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %indvars.iv234, i64 %indvars.iv231
  %169 = getelementptr inbounds [501 x [257 x i32]], ptr getelementptr inbounds (i8, ptr @f, i64 515028), i64 0, i64 %indvars.iv234, i64 %indvars.iv231
  %170 = load i32, ptr %169, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %168, i32 noundef %170)
  store i32 0, ptr %169, align 4, !tbaa !5
  %indvars.iv.next232 = add nuw nsw i64 %indvars.iv231, 1
  %171 = load i32, ptr @all, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = icmp slt i64 %indvars.iv.next232, %172
  br i1 %173, label %.lr.ph168, label %._crit_edge169, !llvm.loop !30

.loopexit:                                        ; preds = %._crit_edge169, %.preheader116.lr.ph, %._crit_edge165, %.lr.ph177
  %.3 = phi i32 [ %.093173, %.lr.ph177 ], [ %.1.lcssa, %._crit_edge165 ], [ %.1.lcssa, %.preheader116.lr.ph ], [ %.1.lcssa, %._crit_edge169 ]
  %indvars.iv.next240 = add nuw nsw i64 %indvars.iv239, 1
  %174 = load i32, ptr @n, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %.not108.not = icmp slt i64 %indvars.iv239, %175
  br i1 %.not108.not, label %.lr.ph177, label %._crit_edge178, !llvm.loop !31

.preheader118:                                    ; preds = %.preheader118.preheader, %._crit_edge182
  %176 = phi i32 [ %94, %.preheader118.preheader ], [ %182, %._crit_edge182 ]
  %indvars.iv245 = phi i64 [ 1, %.preheader118.preheader ], [ %indvars.iv.next246, %._crit_edge182 ]
  %177 = icmp sgt i32 %176, 0
  br i1 %177, label %.lr.ph181, label %._crit_edge182

._crit_edge185.loopexit:                          ; preds = %._crit_edge182
  %.pre251 = load i32, ptr %5, align 4, !tbaa !5
  br label %._crit_edge185

._crit_edge185:                                   ; preds = %.preheader118.lr.ph, %._crit_edge178.thread, %._crit_edge185.loopexit, %._crit_edge178
  %178 = phi i32 [ %.pre251, %._crit_edge185.loopexit ], [ 0, %._crit_edge178 ], [ 0, %._crit_edge178.thread ], [ 0, %.preheader118.lr.ph ]
  %179 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %178)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %180 = load i32, ptr @t, align 4, !tbaa !5
  %181 = add nsw i32 %180, -1
  store i32 %181, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %180, 0
  br i1 %.not, label %._crit_edge189, label %.lr.ph188, !llvm.loop !32

._crit_edge182:                                   ; preds = %.lr.ph181, %.preheader118
  %182 = phi i32 [ %176, %.preheader118 ], [ %185, %.lr.ph181 ]
  %indvars.iv.next246 = add nuw nsw i64 %indvars.iv245, 1
  %exitcond249.not = icmp eq i64 %indvars.iv.next246, %wide.trip.count248
  br i1 %exitcond249.not, label %._crit_edge185.loopexit, label %.preheader118, !llvm.loop !33

.lr.ph181:                                        ; preds = %.preheader118, %.lr.ph181
  %indvars.iv242 = phi i64 [ %indvars.iv.next243, %.lr.ph181 ], [ 0, %.preheader118 ]
  %183 = getelementptr inbounds [501 x [257 x i32]], ptr @f, i64 0, i64 %indvars.iv245, i64 %indvars.iv242
  %184 = load i32, ptr %183, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef %184)
  %indvars.iv.next243 = add nuw nsw i64 %indvars.iv242, 1
  %185 = load i32, ptr @all, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = icmp slt i64 %indvars.iv.next243, %186
  br i1 %187, label %.lr.ph181, label %._crit_edge182, !llvm.loop !34

._crit_edge189:                                   ; preds = %._crit_edge185, %6
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 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 #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 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 #6

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

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

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

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

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

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

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

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


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