; LLVM IR from abeaumont/competitive-programming :: atcoder/abc118 (d)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@ms = external dso_local global [9 x i32], align 16
@d = external dso_local global [10000 x [11 x i32]], align 16
@a = external dso_local global [9 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  %24 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %27

27:                                               ; preds = %42, %0
  %28 = load i32, ptr %5, align 4, !tbaa !8
  %29 = load i32, ptr %3, align 4, !tbaa !8
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %45

32:                                               ; preds = %27
  %33 = load i32, ptr %5, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %35)
  %37 = load i32, ptr %5, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !8
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr %39, align 4, !tbaa !8
  br label %42

42:                                               ; preds = %32
  %43 = load i32, ptr %5, align 4, !tbaa !8
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %5, align 4, !tbaa !8
  br label %27, !llvm.loop !11

45:                                               ; preds = %31
  %46 = load i32, ptr %3, align 4, !tbaa !8
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr @a, i64 %47
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %48)
  %49 = load i32, ptr %3, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr @a, i64 %50
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef @a, ptr noundef %51)
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [11 x i32], ptr @d, i64 0, i64 %53
  store i32 1, ptr %54, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %55

55:                                               ; preds = %313, %45
  %56 = load i32, ptr %6, align 4, !tbaa !8
  %57 = load i32, ptr %2, align 4, !tbaa !8
  %58 = icmp sle i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %316

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

61:                                               ; preds = %309, %60
  %62 = load i32, ptr %8, align 4, !tbaa !8
  %63 = load i32, ptr %3, align 4, !tbaa !8
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %61
  %67 = load i32, ptr %8, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !8
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !8
  %74 = load i32, ptr %6, align 4, !tbaa !8
  %75 = icmp sgt i32 %73, %74
  br i1 %75, label %120, label %76

76:                                               ; preds = %66
  %77 = load i32, ptr %6, align 4, !tbaa !8
  %78 = load i32, ptr %8, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !8
  %85 = sub nsw i32 %77, %84
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %86
  %88 = load i32, ptr %3, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [11 x i32], ptr %87, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !8
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %120

93:                                               ; preds = %76
  %94 = load i32, ptr %6, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %95
  %97 = load i32, ptr %3, align 4, !tbaa !8
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [11 x i32], ptr %96, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !8
  %102 = load i32, ptr %6, align 4, !tbaa !8
  %103 = load i32, ptr %8, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !8
  %110 = sub nsw i32 %102, %109
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %111
  %113 = load i32, ptr %3, align 4, !tbaa !8
  %114 = add nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [11 x i32], ptr %112, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !8
  %118 = add nsw i32 %117, 1
  %119 = icmp sgt i32 %101, %118
  br i1 %119, label %120, label %121

120:                                              ; preds = %93, %76, %66
  br label %309

121:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  %122 = load i32, ptr %3, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %123, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %124 unwind label %130

124:                                              ; preds = %121
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %125

125:                                              ; preds = %158, %124
  %126 = load i32, ptr %13, align 4, !tbaa !8
  %127 = load i32, ptr %3, align 4, !tbaa !8
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %134, label %129

129:                                              ; preds = %125
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %161

130:                                              ; preds = %121
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %11, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %12, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %351

134:                                              ; preds = %125
  %135 = load i32, ptr %13, align 4, !tbaa !8
  %136 = load i32, ptr %8, align 4, !tbaa !8
  %137 = icmp ne i32 %135, %136
  br i1 %137, label %138, label %157

138:                                              ; preds = %134
  %139 = load i32, ptr %6, align 4, !tbaa !8
  %140 = load i32, ptr %8, align 4, !tbaa !8
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !8
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = sub nsw i32 %139, %146
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %148
  %150 = load i32, ptr %13, align 4, !tbaa !8
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [11 x i32], ptr %149, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !8
  %154 = load i32, ptr %13, align 4, !tbaa !8
  %155 = sext i32 %154 to i64
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %155) #6
  store i32 %153, ptr %156, align 4, !tbaa !8
  br label %157

157:                                              ; preds = %138, %134
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %13, align 4, !tbaa !8
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %13, align 4, !tbaa !8
  br label %125, !llvm.loop !13

161:                                              ; preds = %129
  %162 = load i32, ptr %6, align 4, !tbaa !8
  %163 = load i32, ptr %8, align 4, !tbaa !8
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !8
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !8
  %170 = sub nsw i32 %162, %169
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %171
  %173 = load i32, ptr %8, align 4, !tbaa !8
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [11 x i32], ptr %172, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !8
  %177 = add nsw i32 %176, 1
  %178 = load i32, ptr %8, align 4, !tbaa !8
  %179 = sext i32 %178 to i64
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %179) #6
  store i32 %177, ptr %180, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !8
  br label %181

181:                                              ; preds = %220, %161
  %182 = load i32, ptr %15, align 4, !tbaa !8
  %183 = load i32, ptr %3, align 4, !tbaa !8
  %184 = icmp slt i32 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  store i32 14, ptr %7, align 4
  br label %223

186:                                              ; preds = %181
  %187 = load i32, ptr %6, align 4, !tbaa !8
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %188
  %190 = load i32, ptr %15, align 4, !tbaa !8
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [11 x i32], ptr %189, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !8
  %194 = load i32, ptr %15, align 4, !tbaa !8
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %195) #6
  %197 = load i32, ptr %196, align 4, !tbaa !8
  %198 = icmp sgt i32 %193, %197
  br i1 %198, label %199, label %200

199:                                              ; preds = %186
  store i32 1, ptr %14, align 4, !tbaa !8
  br label %215

200:                                              ; preds = %186
  %201 = load i32, ptr %6, align 4, !tbaa !8
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %202
  %204 = load i32, ptr %15, align 4, !tbaa !8
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [11 x i32], ptr %203, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !8
  %208 = load i32, ptr %15, align 4, !tbaa !8
  %209 = sext i32 %208 to i64
  %210 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %209) #6
  %211 = load i32, ptr %210, align 4, !tbaa !8
  %212 = icmp slt i32 %207, %211
  br i1 %212, label %213, label %214

213:                                              ; preds = %200
  store i32 -1, ptr %14, align 4, !tbaa !8
  br label %214

214:                                              ; preds = %213, %200
  br label %215

215:                                              ; preds = %214, %199
  %216 = load i32, ptr %14, align 4, !tbaa !8
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %218, label %219

218:                                              ; preds = %215
  store i32 14, ptr %7, align 4
  br label %223

219:                                              ; preds = %215
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %15, align 4, !tbaa !8
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %15, align 4, !tbaa !8
  br label %181, !llvm.loop !14

223:                                              ; preds = %218, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %6, align 4, !tbaa !8
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %226
  %228 = load i32, ptr %3, align 4, !tbaa !8
  %229 = add nsw i32 %228, 1
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [11 x i32], ptr %227, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !8
  %233 = load i32, ptr %6, align 4, !tbaa !8
  %234 = load i32, ptr %8, align 4, !tbaa !8
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !8
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %238
  %240 = load i32, ptr %239, align 4, !tbaa !8
  %241 = sub nsw i32 %233, %240
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %242
  %244 = load i32, ptr %3, align 4, !tbaa !8
  %245 = add nsw i32 %244, 1
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [11 x i32], ptr %243, i64 0, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !8
  %249 = add nsw i32 %248, 1
  %250 = icmp eq i32 %232, %249
  br i1 %250, label %251, label %255

251:                                              ; preds = %224
  %252 = load i32, ptr %14, align 4, !tbaa !8
  %253 = icmp sgt i32 %252, 0
  br i1 %253, label %254, label %255

254:                                              ; preds = %251
  store i32 10, ptr %7, align 4
  br label %306

255:                                              ; preds = %251, %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !8
  br label %256

256:                                              ; preds = %272, %255
  %257 = load i32, ptr %16, align 4, !tbaa !8
  %258 = load i32, ptr %3, align 4, !tbaa !8
  %259 = icmp slt i32 %257, %258
  br i1 %259, label %261, label %260

260:                                              ; preds = %256
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %275

261:                                              ; preds = %256
  %262 = load i32, ptr %16, align 4, !tbaa !8
  %263 = sext i32 %262 to i64
  %264 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %263) #6
  %265 = load i32, ptr %264, align 4, !tbaa !8
  %266 = load i32, ptr %6, align 4, !tbaa !8
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %267
  %269 = load i32, ptr %16, align 4, !tbaa !8
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [11 x i32], ptr %268, i64 0, i64 %270
  store i32 %265, ptr %271, align 4, !tbaa !8
  br label %272

272:                                              ; preds = %261
  %273 = load i32, ptr %16, align 4, !tbaa !8
  %274 = add nsw i32 %273, 1
  store i32 %274, ptr %16, align 4, !tbaa !8
  br label %256, !llvm.loop !15

275:                                              ; preds = %260
  %276 = load i32, ptr %6, align 4, !tbaa !8
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %277
  %279 = load i32, ptr %3, align 4, !tbaa !8
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [11 x i32], ptr %278, i64 0, i64 %280
  store i32 1, ptr %281, align 4, !tbaa !8
  %282 = load i32, ptr %6, align 4, !tbaa !8
  %283 = load i32, ptr %8, align 4, !tbaa !8
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %284
  %286 = load i32, ptr %285, align 4, !tbaa !8
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !8
  %290 = sub nsw i32 %282, %289
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %291
  %293 = load i32, ptr %3, align 4, !tbaa !8
  %294 = add nsw i32 %293, 1
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [11 x i32], ptr %292, i64 0, i64 %295
  %297 = load i32, ptr %296, align 4, !tbaa !8
  %298 = add nsw i32 %297, 1
  %299 = load i32, ptr %6, align 4, !tbaa !8
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %300
  %302 = load i32, ptr %3, align 4, !tbaa !8
  %303 = add nsw i32 %302, 1
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [11 x i32], ptr %301, i64 0, i64 %304
  store i32 %298, ptr %305, align 4, !tbaa !8
  store i32 0, ptr %7, align 4
  br label %306

306:                                              ; preds = %275, %254
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  %307 = load i32, ptr %7, align 4
  switch i32 %307, label %356 [
    i32 0, label %308
    i32 10, label %309
  ]

308:                                              ; preds = %306
  br label %309

309:                                              ; preds = %308, %306, %120
  %310 = load i32, ptr %8, align 4, !tbaa !8
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %8, align 4, !tbaa !8
  br label %61, !llvm.loop !16

312:                                              ; preds = %65
  br label %313

313:                                              ; preds = %312
  %314 = load i32, ptr %6, align 4, !tbaa !8
  %315 = add nsw i32 %314, 1
  store i32 %315, ptr %6, align 4, !tbaa !8
  br label %55, !llvm.loop !17

316:                                              ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !8
  br label %317

317:                                              ; preds = %345, %316
  %318 = load i32, ptr %17, align 4, !tbaa !8
  %319 = load i32, ptr %3, align 4, !tbaa !8
  %320 = icmp slt i32 %318, %319
  br i1 %320, label %322, label %321

321:                                              ; preds = %317
  store i32 20, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %348

322:                                              ; preds = %317
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !8
  br label %323

323:                                              ; preds = %341, %322
  %324 = load i32, ptr %18, align 4, !tbaa !8
  %325 = load i32, ptr %2, align 4, !tbaa !8
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %326
  %328 = load i32, ptr %17, align 4, !tbaa !8
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [11 x i32], ptr %327, i64 0, i64 %329
  %331 = load i32, ptr %330, align 4, !tbaa !8
  %332 = icmp slt i32 %324, %331
  br i1 %332, label %334, label %333

333:                                              ; preds = %323
  store i32 23, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %344

334:                                              ; preds = %323
  %335 = load i32, ptr %17, align 4, !tbaa !8
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %336
  %338 = load i32, ptr %337, align 4, !tbaa !8
  %339 = add nsw i32 %338, 1
  %340 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %339)
  br label %341

341:                                              ; preds = %334
  %342 = load i32, ptr %18, align 4, !tbaa !8
  %343 = add nsw i32 %342, 1
  store i32 %343, ptr %18, align 4, !tbaa !8
  br label %323, !llvm.loop !18

344:                                              ; preds = %333
  br label %345

345:                                              ; preds = %344
  %346 = load i32, ptr %17, align 4, !tbaa !8
  %347 = add nsw i32 %346, 1
  store i32 %347, ptr %17, align 4, !tbaa !8
  br label %317, !llvm.loop !19

348:                                              ; preds = %321
  %349 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %350 = load i32, ptr %1, align 4
  ret i32 %350

351:                                              ; preds = %130
  %352 = load ptr, ptr %11, align 8
  %353 = load i32, ptr %12, align 4
  %354 = insertvalue { ptr, i32 } poison, ptr %352, 0
  %355 = insertvalue { ptr, i32 } %354, i32 %353, 1
  resume { ptr, i32 } %355

356:                                              ; preds = %306
  unreachable
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) #4

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

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

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

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

attributes #0 = { 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 #1 = { 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 #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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress 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 = { nounwind }

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@ms = external dso_local local_unnamed_addr global [9 x i32], align 16
@d = external dso_local local_unnamed_addr global [10000 x [11 x i32]], align 16
@a = external dso_local global [9 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = load i32, ptr %2, align 4, !tbaa !8
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre148 = sext i32 %13 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi149 = phi i64 [ %.pre148, %.._crit_edge_crit_edge ], [ %29, %.lr.ph ]
  %15 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi149
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %15)
  %16 = load i32, ptr %2, align 4, !tbaa !8
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds i32, ptr @a, i64 %17
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %18)
  %19 = load i32, ptr %2, align 4, !tbaa !8
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [11 x i32], ptr @d, i64 0, i64 %20
  store i32 1, ptr %21, align 4, !tbaa !8
  %22 = load i32, ptr %1, align 4, !tbaa !8
  %.not101 = icmp slt i32 %22, 1
  br i1 %.not101, label %.preheader77, label %.preheader79.lr.ph

.preheader79.lr.ph:                               ; preds = %._crit_edge
  %23 = icmp sgt i32 %19, 0
  br i1 %23, label %.preheader79, label %._crit_edge107

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %24 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %indvars.iv
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %26 = load i32, ptr %24, align 4, !tbaa !8
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr %24, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr %2, align 4, !tbaa !8
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv.next, %29
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader79:                                     ; preds = %.preheader79.lr.ph, %._crit_edge100
  %31 = phi i32 [ %39, %._crit_edge100 ], [ %22, %.preheader79.lr.ph ]
  %32 = phi i32 [ %40, %._crit_edge100 ], [ %19, %.preheader79.lr.ph ]
  %33 = phi i32 [ %41, %._crit_edge100 ], [ %19, %.preheader79.lr.ph ]
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %._crit_edge100 ], [ 1, %.preheader79.lr.ph ]
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph99, label %._crit_edge100

.lr.ph99:                                         ; preds = %.preheader79
  %35 = trunc nuw nsw i64 %indvars.iv126 to i32
  br label %43

.preheader77:                                     ; preds = %._crit_edge100, %._crit_edge
  %36 = phi i32 [ %22, %._crit_edge ], [ %39, %._crit_edge100 ]
  %37 = phi i32 [ %19, %._crit_edge ], [ %40, %._crit_edge100 ]
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.preheader, label %._crit_edge107

._crit_edge100.loopexit:                          ; preds = %141
  %.pre137 = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge100

._crit_edge100:                                   ; preds = %._crit_edge100.loopexit, %.preheader79
  %39 = phi i32 [ %.pre137, %._crit_edge100.loopexit ], [ %31, %.preheader79 ]
  %40 = phi i32 [ %142, %._crit_edge100.loopexit ], [ %32, %.preheader79 ]
  %41 = phi i32 [ %142, %._crit_edge100.loopexit ], [ %33, %.preheader79 ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %42 = sext i32 %39 to i64
  %.not.not = icmp slt i64 %indvars.iv126, %42
  br i1 %.not.not, label %.preheader79, label %.preheader77, !llvm.loop !13

43:                                               ; preds = %.lr.ph99, %141
  %44 = phi i32 [ %32, %.lr.ph99 ], [ %142, %141 ]
  %indvars.iv123 = phi i64 [ 0, %.lr.ph99 ], [ %indvars.iv.next124, %141 ]
  %45 = phi i32 [ %33, %.lr.ph99 ], [ %142, %141 ]
  %46 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %indvars.iv123
  %47 = load i32, ptr %46, align 4, !tbaa !8
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv126, %51
  br i1 %52, label %141, label %53

53:                                               ; preds = %43
  %54 = sub nsw i32 %35, %50
  %55 = sext i32 %54 to i64
  %56 = sext i32 %45 to i64
  %57 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %55, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !8
  %.not70 = icmp eq i32 %58, 0
  br i1 %.not70, label %141, label %59

59:                                               ; preds = %53
  %60 = add nsw i32 %45, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %indvars.iv126, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %64 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %55, i64 %61
  %65 = load i32, ptr %64, align 4, !tbaa !8
  %66 = add nsw i32 %65, 1
  %67 = icmp sgt i32 %63, %66
  br i1 %67, label %141, label %68

68:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %56, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %69 unwind label %84

69:                                               ; preds = %68
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %70 = load i32, ptr %2, align 4, !tbaa !8
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %.lr.ph84, label %._crit_edge85

._crit_edge85:                                    ; preds = %97, %69
  %72 = load i32, ptr %46, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !8
  %76 = sub nsw i32 %35, %75
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %77, i64 %indvars.iv123
  %79 = load i32, ptr %78, align 4, !tbaa !8
  %80 = add nsw i32 %79, 1
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv123) #6
  store i32 %80, ptr %81, align 4, !tbaa !8
  %82 = load i32, ptr %2, align 4, !tbaa !8
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.lr.ph88, label %.thread

84:                                               ; preds = %68
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %85

.lr.ph84:                                         ; preds = %69, %97
  %86 = phi i32 [ %98, %97 ], [ %70, %69 ]
  %indvars.iv114 = phi i64 [ %indvars.iv.next115, %97 ], [ 0, %69 ]
  %.not72 = icmp eq i64 %indvars.iv114, %indvars.iv123
  br i1 %.not72, label %97, label %87

87:                                               ; preds = %.lr.ph84
  %88 = load i32, ptr %46, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !8
  %92 = sub nsw i32 %35, %91
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %93, i64 %indvars.iv114
  %95 = load i32, ptr %94, align 4, !tbaa !8
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv114) #6
  store i32 %95, ptr %96, align 4, !tbaa !8
  %.pre = load i32, ptr %2, align 4, !tbaa !8
  br label %97

97:                                               ; preds = %.lr.ph84, %87
  %98 = phi i32 [ %86, %.lr.ph84 ], [ %.pre, %87 ]
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %99 = sext i32 %98 to i64
  %100 = icmp slt i64 %indvars.iv.next115, %99
  br i1 %100, label %.lr.ph84, label %._crit_edge85, !llvm.loop !15

.lr.ph88:                                         ; preds = %._crit_edge85, %106
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %106 ], [ 0, %._crit_edge85 ]
  %101 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %indvars.iv126, i64 %indvars.iv117
  %102 = load i32, ptr %101, align 4, !tbaa !8
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv117) #6
  %104 = load i32, ptr %103, align 4, !tbaa !8
  %105 = icmp sgt i32 %102, %104
  br i1 %105, label %.lr.ph88..thread.loopexit_crit_edge, label %106

.lr.ph88..thread.loopexit_crit_edge:              ; preds = %.lr.ph88
  %.pre132.pre = load i32, ptr %2, align 4, !tbaa !8
  br label %.thread

106:                                              ; preds = %.lr.ph88
  %107 = load i32, ptr %101, align 4, !tbaa !8
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv117) #6
  %109 = load i32, ptr %108, align 4, !tbaa !8
  %.not76 = icmp sge i32 %107, %109
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %110 = load i32, ptr %2, align 4
  %111 = sext i32 %110 to i64
  %112 = icmp slt i64 %indvars.iv.next118, %111
  %or.cond109 = select i1 %.not76, i1 %112, i1 false
  br i1 %or.cond109, label %.lr.ph88, label %.thread, !llvm.loop !16

.thread:                                          ; preds = %106, %.lr.ph88..thread.loopexit_crit_edge, %._crit_edge85
  %113 = phi i32 [ %82, %._crit_edge85 ], [ %.pre132.pre, %.lr.ph88..thread.loopexit_crit_edge ], [ %110, %106 ]
  %.2 = phi i1 [ false, %._crit_edge85 ], [ true, %.lr.ph88..thread.loopexit_crit_edge ], [ false, %106 ]
  %114 = add nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %indvars.iv126, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !8
  %118 = load i32, ptr %46, align 4, !tbaa !8
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !8
  %122 = sub nsw i32 %35, %121
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %123, i64 %115
  %125 = load i32, ptr %124, align 4, !tbaa !8
  %126 = add nsw i32 %125, 1
  %127 = icmp eq i32 %117, %126
  %or.cond = and i1 %.2, %127
  br i1 %or.cond, label %140, label %.preheader78

.preheader78:                                     ; preds = %.thread
  %128 = icmp sgt i32 %113, 0
  br i1 %128, label %.lr.ph95, label %.preheader78.._crit_edge96_crit_edge

.preheader78.._crit_edge96_crit_edge:             ; preds = %.preheader78
  %.pre150 = sext i32 %113 to i64
  br label %._crit_edge96

._crit_edge96.loopexit:                           ; preds = %.lr.ph95
  %.pre133 = load i32, ptr %46, align 4, !tbaa !8
  %.phi.trans.insert = sext i32 %.pre133 to i64
  %.phi.trans.insert134 = getelementptr inbounds [9 x i32], ptr @ms, i64 0, i64 %.phi.trans.insert
  %.pre135 = load i32, ptr %.phi.trans.insert134, align 4, !tbaa !8
  %.pre140 = sub nsw i32 %35, %.pre135
  %.pre142 = sext i32 %.pre140 to i64
  %.pre144 = add nsw i32 %137, 1
  %.pre146 = sext i32 %.pre144 to i64
  br label %._crit_edge96

._crit_edge96:                                    ; preds = %.preheader78.._crit_edge96_crit_edge, %._crit_edge96.loopexit
  %.pre-phi151 = phi i64 [ %.pre150, %.preheader78.._crit_edge96_crit_edge ], [ %138, %._crit_edge96.loopexit ]
  %.pre-phi147 = phi i64 [ %115, %.preheader78.._crit_edge96_crit_edge ], [ %.pre146, %._crit_edge96.loopexit ]
  %.pre-phi143 = phi i64 [ %123, %.preheader78.._crit_edge96_crit_edge ], [ %.pre142, %._crit_edge96.loopexit ]
  %129 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %indvars.iv126, i64 %.pre-phi151
  store i32 1, ptr %129, align 4, !tbaa !8
  %130 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %.pre-phi143, i64 %.pre-phi147
  %131 = load i32, ptr %130, align 4, !tbaa !8
  %132 = add nsw i32 %131, 1
  %133 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %indvars.iv126, i64 %.pre-phi147
  store i32 %132, ptr %133, align 4, !tbaa !8
  br label %140

.lr.ph95:                                         ; preds = %.preheader78, %.lr.ph95
  %indvars.iv120 = phi i64 [ %indvars.iv.next121, %.lr.ph95 ], [ 0, %.preheader78 ]
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv120) #6
  %135 = load i32, ptr %134, align 4, !tbaa !8
  %136 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %indvars.iv126, i64 %indvars.iv120
  store i32 %135, ptr %136, align 4, !tbaa !8
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %137 = load i32, ptr %2, align 4, !tbaa !8
  %138 = sext i32 %137 to i64
  %139 = icmp slt i64 %indvars.iv.next121, %138
  br i1 %139, label %.lr.ph95, label %._crit_edge96.loopexit, !llvm.loop !17

140:                                              ; preds = %.thread, %._crit_edge96
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  %.pre136 = load i32, ptr %2, align 4, !tbaa !8
  br label %141

141:                                              ; preds = %140, %43, %53, %59
  %142 = phi i32 [ %.pre136, %140 ], [ %44, %43 ], [ %44, %53 ], [ %44, %59 ]
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %143 = sext i32 %142 to i64
  %144 = icmp slt i64 %indvars.iv.next124, %143
  br i1 %144, label %43, label %._crit_edge100.loopexit, !llvm.loop !18

.preheader:                                       ; preds = %.preheader77, %._crit_edge105
  %145 = phi i32 [ %153, %._crit_edge105 ], [ %37, %.preheader77 ]
  %146 = phi i32 [ %154, %._crit_edge105 ], [ %36, %.preheader77 ]
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %._crit_edge105 ], [ 0, %.preheader77 ]
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %147, i64 %indvars.iv129
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = icmp sgt i32 %149, 0
  br i1 %150, label %.lr.ph104, label %._crit_edge105

.lr.ph104:                                        ; preds = %.preheader
  %151 = getelementptr inbounds [9 x i32], ptr @a, i64 0, i64 %indvars.iv129
  br label %157

._crit_edge107:                                   ; preds = %._crit_edge105, %.preheader79.lr.ph, %.preheader77
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

._crit_edge105.loopexit:                          ; preds = %157
  %.pre138 = load i32, ptr %2, align 4, !tbaa !8
  br label %._crit_edge105

._crit_edge105:                                   ; preds = %._crit_edge105.loopexit, %.preheader
  %153 = phi i32 [ %.pre138, %._crit_edge105.loopexit ], [ %145, %.preheader ]
  %154 = phi i32 [ %162, %._crit_edge105.loopexit ], [ %146, %.preheader ]
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %155 = sext i32 %153 to i64
  %156 = icmp slt i64 %indvars.iv.next130, %155
  br i1 %156, label %.preheader, label %._crit_edge107, !llvm.loop !19

157:                                              ; preds = %.lr.ph104, %157
  %.0103 = phi i32 [ 0, %.lr.ph104 ], [ %161, %157 ]
  %158 = load i32, ptr %151, align 4, !tbaa !8
  %159 = add nsw i32 %158, 1
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %159)
  %161 = add nuw nsw i32 %.0103, 1
  %162 = load i32, ptr %1, align 4, !tbaa !8
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [10000 x [11 x i32]], ptr @d, i64 0, i64 %163, i64 %indvars.iv129
  %165 = load i32, ptr %164, align 4, !tbaa !8
  %166 = icmp slt i32 %161, %165
  br i1 %166, label %157, label %._crit_edge105.loopexit, !llvm.loop !20
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) 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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

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

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

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

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


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