; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/LONG/APRIL15/CARLOS (carlos)

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

@t = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@trans = external dso_local global [201 x [201 x i32]], align 16
@a = external dso_local global [200000 x i32], align 16
@mn = external dso_local global [200000 x i32], align 16
@minn = external dso_local global i32, align 4
@moves = external dso_local global [201 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %17

17:                                               ; preds = %261, %0
  %18 = load i32, ptr @t, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr @t, align 4, !tbaa !5
  %20 = icmp ne i32 %18, 0
  br i1 %20, label %21, label %262

21:                                               ; preds = %17
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @m, ptr noundef @k, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %57, %21
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = load i32, ptr @m, align 4, !tbaa !5
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %23
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %30
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #7
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [200000 x i32], ptr @mn, i64 0, i64 %33
  store i32 1000, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %47, %28
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %50

40:                                               ; preds = %35
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %42
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [201 x i32], ptr %43, i64 0, i64 %45
  store i32 0, ptr %46, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %40
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %4, align 4, !tbaa !5
  br label %35, !llvm.loop !9

50:                                               ; preds = %39
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %52
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [201 x i32], ptr %53, i64 0, i64 %55
  store i32 1, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %50
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !11

60:                                               ; preds = %27
  store i32 1000, ptr @minn, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %80, %60
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = load i32, ptr @k, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %61
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @x, ptr noundef @y)
  %68 = load i32, ptr @y, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %69
  %71 = load i32, ptr @x, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [201 x i32], ptr %70, i64 0, i64 %72
  store i32 1, ptr %73, align 4, !tbaa !5
  %74 = load i32, ptr @x, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %75
  %77 = load i32, ptr @y, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [201 x i32], ptr %76, i64 0, i64 %78
  store i32 1, ptr %79, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %66
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %5, align 4, !tbaa !5
  br label %61, !llvm.loop !12

83:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %131, %83
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = load i32, ptr @m, align 4, !tbaa !5
  %87 = icmp sle i32 %85, %86
  br i1 %87, label %89, label %88

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

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %127, %89
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = load i32, ptr @m, align 4, !tbaa !5
  %93 = icmp sle i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %130

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

96:                                               ; preds = %123, %95
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = load i32, ptr @m, align 4, !tbaa !5
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %101, label %100

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

101:                                              ; preds = %96
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %103
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [201 x i32], ptr %104, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %110
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [201 x i32], ptr %111, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = and i32 %108, %115
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %118
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [201 x i32], ptr %119, i64 0, i64 %121
  store i32 %116, ptr %122, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %101
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %8, align 4, !tbaa !5
  br label %96, !llvm.loop !13

126:                                              ; preds = %100
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %7, align 4, !tbaa !5
  br label %90, !llvm.loop !14

130:                                              ; preds = %94
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %6, align 4, !tbaa !5
  br label %84, !llvm.loop !15

134:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %178, %134
  %136 = load i32, ptr %9, align 4, !tbaa !5
  %137 = load i32, ptr @m, align 4, !tbaa !5
  %138 = icmp sle i32 %136, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %135
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %181

140:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %160, %140
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = load i32, ptr @m, align 4, !tbaa !5
  %144 = icmp sle i32 %142, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %141
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %163

146:                                              ; preds = %141
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %148
  %150 = load i32, ptr %10, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [201 x i32], ptr %149, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %159

155:                                              ; preds = %146
  %156 = load i32, ptr %9, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %157
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %158, ptr noundef nonnull align 4 dereferenceable(4) %10)
  br label %159

159:                                              ; preds = %155, %146
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %10, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %10, align 4, !tbaa !5
  br label %141, !llvm.loop !16

163:                                              ; preds = %145
  %164 = load i32, ptr %9, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %165
  %167 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %166) #7
  %168 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %167, ptr %168, align 8
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %170
  %172 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %171) #7
  %173 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %172, ptr %173, align 8
  %174 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8
  %176 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %175, ptr %177)
  br label %178

178:                                              ; preds = %163
  %179 = load i32, ptr %9, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %9, align 4, !tbaa !5
  br label %135, !llvm.loop !17

181:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %192, %181
  %183 = load i32, ptr %13, align 4, !tbaa !5
  %184 = load i32, ptr @n, align 4, !tbaa !5
  %185 = icmp slt i32 %183, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %182
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %195

187:                                              ; preds = %182
  %188 = load i32, ptr %13, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %189
  %191 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %190)
  br label %192

192:                                              ; preds = %187
  %193 = load i32, ptr %13, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %13, align 4, !tbaa !5
  br label %182, !llvm.loop !18

195:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %196 = load i32, ptr @n, align 4, !tbaa !5
  %197 = sub nsw i32 %196, 1
  store i32 %197, ptr %14, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %212, %195
  %199 = load i32, ptr %14, align 4, !tbaa !5
  %200 = icmp sge i32 %199, 0
  br i1 %200, label %202, label %201

201:                                              ; preds = %198
  store i32 31, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %215

202:                                              ; preds = %198
  %203 = load i32, ptr %14, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %204
  %206 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @minn, ptr noundef nonnull align 4 dereferenceable(4) %205)
  %207 = load i32, ptr %206, align 4, !tbaa !5
  store i32 %207, ptr @minn, align 4, !tbaa !5
  %208 = load i32, ptr @minn, align 4, !tbaa !5
  %209 = load i32, ptr %14, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [200000 x i32], ptr @mn, i64 0, i64 %210
  store i32 %208, ptr %211, align 4, !tbaa !5
  br label %212

212:                                              ; preds = %202
  %213 = load i32, ptr %14, align 4, !tbaa !5
  %214 = add nsw i32 %213, -1
  store i32 %214, ptr %14, align 4, !tbaa !5
  br label %198, !llvm.loop !19

215:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %258, %215
  %217 = load i32, ptr %15, align 4, !tbaa !5
  %218 = load i32, ptr @n, align 4, !tbaa !5
  %219 = icmp slt i32 %217, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %216
  store i32 34, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %261

221:                                              ; preds = %216
  %222 = load i32, ptr %15, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = load i32, ptr %15, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [200000 x i32], ptr @mn, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = icmp sgt i32 %225, %229
  br i1 %230, label %231, label %257

231:                                              ; preds = %221
  %232 = load i32, ptr %15, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %236
  %238 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %237) #7
  %239 = icmp ugt i64 %238, 0
  br i1 %239, label %240, label %255

240:                                              ; preds = %231
  %241 = load i32, ptr %15, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %242
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %245
  %247 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %246, i64 noundef 0) #7
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %249 = load i32, ptr %15, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [200000 x i32], ptr @mn, i64 0, i64 %250
  %252 = load i32, ptr %251, align 4, !tbaa !5
  %253 = icmp sle i32 %248, %252
  br i1 %253, label %254, label %255

254:                                              ; preds = %240
  br label %256

255:                                              ; preds = %240, %231
  br label %256

256:                                              ; preds = %255, %254
  br label %257

257:                                              ; preds = %256, %221
  br label %258

258:                                              ; preds = %257
  %259 = load i32, ptr %15, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr %15, align 4, !tbaa !5
  br label %216, !llvm.loop !20

261:                                              ; preds = %220
  br label %17, !llvm.loop !21

262:                                              ; preds = %17
  ret i32 0
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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)) #4 align 2

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

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

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

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

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

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


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

@t = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@trans = external dso_local local_unnamed_addr global [201 x [201 x i32]], align 16
@a = external dso_local global [200000 x i32], align 16
@mn = external dso_local local_unnamed_addr global [200000 x i32], align 16
@minn = external dso_local global i32, align 4
@moves = external dso_local global [201 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %3 = load i32, ptr @t, align 4, !tbaa !5
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr @t, align 4, !tbaa !5
  %.not104 = icmp eq i32 %3, 0
  br i1 %.not104, label %._crit_edge107, label %.lr.ph106

.loopexit:                                        ; preds = %111, %.preheader68, %.preheader67, %.preheader66
  %5 = load i32, ptr @t, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %._crit_edge107, label %.lr.ph106, !llvm.loop !9

.lr.ph106:                                        ; preds = %0, %.loopexit
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @m, ptr noundef nonnull @k, ptr noundef nonnull @n)
  %8 = load i32, ptr @m, align 4, !tbaa !5
  %.not5673 = icmp slt i32 %8, 1
  br i1 %.not5673, label %._crit_edge77, label %.lr.ph76

._crit_edge77:                                    ; preds = %._crit_edge, %.lr.ph106
  %9 = phi i32 [ %8, %.lr.ph106 ], [ %14, %._crit_edge ]
  store i32 1000, ptr @minn, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  %10 = load i32, ptr @k, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph80, label %.preheader70

.lr.ph76:                                         ; preds = %.lr.ph106, %._crit_edge
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge ], [ 1, %.lr.ph106 ]
  %indvar = phi i64 [ %indvar.next, %._crit_edge ], [ 0, %.lr.ph106 ]
  %12 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %13 = getelementptr inbounds [200000 x i32], ptr @mn, i64 0, i64 %indvars.iv
  store i32 1000, ptr %13, align 4, !tbaa !5
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %.not6471 = icmp slt i32 %14, 1
  br i1 %.not6471, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph76
  %15 = mul nuw nsw i64 %indvar, 804
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @trans, i64 808), i64 %15
  %16 = zext nneg i32 %14 to i64
  %17 = shl nuw nsw i64 %16, 2
  call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 0, i64 %17, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.lr.ph76
  %18 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv, i64 %indvars.iv
  store i32 1, ptr %18, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = sext i32 %14 to i64
  %.not56.not = icmp slt i64 %indvars.iv, %19
  %indvar.next = add nuw nsw i64 %indvar, 1
  br i1 %.not56.not, label %.lr.ph76, label %._crit_edge77, !llvm.loop !11

.preheader70.loopexit:                            ; preds = %.lr.ph80
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader70

.preheader70:                                     ; preds = %.preheader70.loopexit, %._crit_edge77
  %20 = phi i32 [ %.pre, %.preheader70.loopexit ], [ %9, %._crit_edge77 ]
  %.not5788 = icmp slt i32 %20, 1
  br i1 %.not5788, label %.preheader68, label %.preheader65.preheader

.preheader65.preheader:                           ; preds = %.preheader70
  %21 = add nuw i32 %20, 1
  %wide.trip.count122 = zext i32 %21 to i64
  %22 = mul nuw nsw i64 %wide.trip.count122, 808
  %scevgep = getelementptr i8, ptr getelementptr (i8, ptr @trans, i64 -804), i64 %22
  %23 = mul nuw nsw i64 %wide.trip.count122, 804
  %24 = shl nuw nsw i64 %wide.trip.count122, 2
  %25 = zext nneg i32 %20 to i64
  %26 = zext nneg i32 %20 to i64
  %gep158 = getelementptr i8, ptr getelementptr (i8, ptr @trans, i64 -796), i64 %23
  %gep159 = getelementptr i8, ptr getelementptr (i8, ptr @trans, i64 804), i64 %24
  %min.iters.check = icmp ult i32 %20, 8
  %n.vec = and i64 %25, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %cmp.n = icmp eq i64 %n.vec, %25
  %27 = and i32 %20, 1
  %lcmp.mod.not = icmp eq i32 %27, 0
  br label %.preheader65

.lr.ph80:                                         ; preds = %._crit_edge77, %.lr.ph80
  %.05178 = phi i32 [ %35, %.lr.ph80 ], [ 0, %._crit_edge77 ]
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @x, ptr noundef nonnull @y)
  %29 = load i32, ptr @y, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = load i32, ptr @x, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %30, i64 %32
  store i32 1, ptr %33, align 4, !tbaa !5
  %34 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %32, i64 %30
  store i32 1, ptr %34, align 4, !tbaa !5
  %35 = add nuw nsw i32 %.05178, 1
  %36 = load i32, ptr @k, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %.lr.ph80, label %.preheader70.loopexit, !llvm.loop !12

.preheader69:                                     ; preds = %._crit_edge87.split
  br i1 %.not5788, label %.preheader68, label %.lr.ph97

.preheader65:                                     ; preds = %.preheader65.preheader, %._crit_edge87.split
  %indvar142 = phi i64 [ 0, %.preheader65.preheader ], [ %indvar.next143, %._crit_edge87.split ]
  %indvars.iv119 = phi i64 [ 1, %.preheader65.preheader ], [ %indvars.iv.next120, %._crit_edge87.split ]
  %38 = shl nuw nsw i64 %indvar142, 2
  %gep156 = getelementptr i8, ptr getelementptr (i8, ptr @trans, i64 808), i64 %38
  %scevgep145 = getelementptr i8, ptr %gep158, i64 %38
  %39 = mul nuw nsw i64 %indvar142, 804
  %gep157 = getelementptr i8, ptr getelementptr (i8, ptr @trans, i64 808), i64 %39
  %scevgep147 = getelementptr i8, ptr %gep159, i64 %39
  %bound0 = icmp ugt ptr %scevgep145, getelementptr inbounds (i8, ptr @trans, i64 808)
  %bound1 = icmp ult ptr %gep156, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound0148 = icmp ugt ptr %scevgep147, getelementptr inbounds (i8, ptr @trans, i64 808)
  %bound1149 = icmp ult ptr %gep157, %scevgep
  %found.conflict150 = and i1 %bound0148, %bound1149
  %conflict.rdx = or i1 %found.conflict, %found.conflict150
  br label %.preheader

.preheader:                                       ; preds = %.preheader65, %._crit_edge84
  %indvars.iv114 = phi i64 [ 1, %.preheader65 ], [ %indvars.iv.next115, %._crit_edge84 ]
  %40 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv114, i64 %indvars.iv119
  %brmerge = select i1 %min.iters.check, i1 true, i1 %conflict.rdx
  br i1 %brmerge, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %.preheader, %middle.block
  %indvars.iv111.ph = phi i64 [ 1, %.preheader ], [ %ind.end, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv119, i64 %indvars.iv111.ph
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = and i32 %43, %41
  %45 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv114, i64 %indvars.iv111.ph
  store i32 %44, ptr %45, align 4, !tbaa !5
  %indvars.iv.next112.prol = add nuw nsw i64 %indvars.iv111.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv111.unr = phi i64 [ %indvars.iv111.ph, %scalar.ph.preheader ], [ %indvars.iv.next112.prol, %scalar.ph.prol ]
  %46 = icmp eq i64 %indvars.iv111.ph, %26
  br i1 %46, label %._crit_edge84, label %scalar.ph

vector.ph:                                        ; preds = %.preheader
  %47 = load i32, ptr %40, align 4, !tbaa !5, !alias.scope !13
  %broadcast.splatinsert152 = insertelement <4 x i32> poison, i32 %47, i64 0
  %broadcast.splat153 = shufflevector <4 x i32> %broadcast.splatinsert152, <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 ]
  %offset.idx = or disjoint i64 %index, 1
  %48 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv119, i64 %offset.idx
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %wide.load = load <4 x i32>, ptr %48, align 4, !tbaa !5, !alias.scope !16
  %wide.load151 = load <4 x i32>, ptr %49, align 4, !tbaa !5, !alias.scope !16
  %50 = and <4 x i32> %wide.load, %broadcast.splat153
  %51 = and <4 x i32> %wide.load151, %broadcast.splat153
  %52 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv114, i64 %offset.idx
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  store <4 x i32> %50, ptr %52, align 4, !tbaa !5, !alias.scope !18, !noalias !20
  store <4 x i32> %51, ptr %53, align 4, !tbaa !5, !alias.scope !18, !noalias !20
  %index.next = add nuw i64 %index, 8
  %54 = icmp eq i64 %index.next, %n.vec
  br i1 %54, label %middle.block, label %vector.body, !llvm.loop !21

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge84, label %scalar.ph.preheader

._crit_edge87.split:                              ; preds = %._crit_edge84
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %exitcond123.not = icmp eq i64 %indvars.iv.next120, %wide.trip.count122
  %indvar.next143 = add i64 %indvar142, 1
  br i1 %exitcond123.not, label %.preheader69, label %.preheader65, !llvm.loop !24

._crit_edge84:                                    ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %exitcond118.not = icmp eq i64 %indvars.iv.next115, %wide.trip.count122
  br i1 %exitcond118.not, label %._crit_edge87.split, label %.preheader, !llvm.loop !25

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv111 = phi i64 [ %indvars.iv.next112.1, %scalar.ph ], [ %indvars.iv111.unr, %scalar.ph.prol.loopexit ]
  %55 = load i32, ptr %40, align 4, !tbaa !5
  %56 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv119, i64 %indvars.iv111
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = and i32 %57, %55
  %59 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv114, i64 %indvars.iv111
  store i32 %58, ptr %59, align 4, !tbaa !5
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %60 = load i32, ptr %40, align 4, !tbaa !5
  %61 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv119, i64 %indvars.iv.next112
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = and i32 %62, %60
  %64 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv114, i64 %indvars.iv.next112
  store i32 %63, ptr %64, align 4, !tbaa !5
  %indvars.iv.next112.1 = add nuw nsw i64 %indvars.iv111, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next112.1, %wide.trip.count122
  br i1 %exitcond.not.1, label %._crit_edge84, label %scalar.ph, !llvm.loop !26

.preheader68:                                     ; preds = %._crit_edge94, %.preheader70, %.preheader69
  %65 = load i32, ptr @n, align 4, !tbaa !5
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.lr.ph99, label %.loopexit

.lr.ph97:                                         ; preds = %.preheader69, %._crit_edge94
  %67 = phi i32 [ %72, %._crit_edge94 ], [ %20, %.preheader69 ]
  %indvars.iv124 = phi i64 [ %indvars.iv.next125, %._crit_edge94 ], [ 1, %.preheader69 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 1, ptr %1, align 4, !tbaa !5
  %.not6090 = icmp slt i32 %67, 1
  br i1 %.not6090, label %._crit_edge94, label %.lr.ph93

.lr.ph93:                                         ; preds = %.lr.ph97
  %68 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %indvars.iv124
  br label %74

._crit_edge94:                                    ; preds = %80, %.lr.ph97
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %69 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %indvars.iv124
  %70 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %69) #8
  %71 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %69) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %70, ptr %71)
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %72 = load i32, ptr @m, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %.not58.not = icmp slt i64 %indvars.iv124, %73
  br i1 %.not58.not, label %.lr.ph97, label %.preheader68, !llvm.loop !27

74:                                               ; preds = %.lr.ph93, %80
  %75 = phi i32 [ %67, %.lr.ph93 ], [ %81, %80 ]
  %storemerge91 = phi i32 [ 1, %.lr.ph93 ], [ %83, %80 ]
  %76 = sext i32 %storemerge91 to i64
  %77 = getelementptr inbounds [201 x [201 x i32]], ptr @trans, i64 0, i64 %indvars.iv124, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %.not61 = icmp eq i32 %78, 0
  br i1 %.not61, label %80, label %79

79:                                               ; preds = %74
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.pre136 = load i32, ptr %1, align 4, !tbaa !5
  %.pre137 = load i32, ptr @m, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %74, %79
  %81 = phi i32 [ %75, %74 ], [ %.pre137, %79 ]
  %82 = phi i32 [ %storemerge91, %74 ], [ %.pre136, %79 ]
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %1, align 4, !tbaa !5
  %.not60.not = icmp slt i32 %82, %81
  br i1 %.not60.not, label %74, label %._crit_edge94, !llvm.loop !28

.preheader67:                                     ; preds = %.lr.ph99
  %84 = icmp sgt i32 %88, 0
  br i1 %84, label %.lr.ph101.preheader, label %.loopexit

.lr.ph101.preheader:                              ; preds = %.preheader67
  %85 = zext nneg i32 %88 to i64
  br label %.lr.ph101

.lr.ph99:                                         ; preds = %.preheader68, %.lr.ph99
  %indvars.iv127 = phi i64 [ %indvars.iv.next128, %.lr.ph99 ], [ 0, %.preheader68 ]
  %86 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %indvars.iv127
  %87 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %86)
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = icmp slt i64 %indvars.iv.next128, %89
  br i1 %90, label %.lr.ph99, label %.preheader67, !llvm.loop !29

.preheader66:                                     ; preds = %.lr.ph101
  %.pre138 = load i32, ptr @n, align 4, !tbaa !5
  %91 = icmp sgt i32 %.pre138, 0
  br i1 %91, label %.lr.ph103, label %.loopexit

.lr.ph101:                                        ; preds = %.lr.ph101.preheader, %.lr.ph101
  %indvars.iv130 = phi i64 [ %85, %.lr.ph101.preheader ], [ %indvars.iv.next131, %.lr.ph101 ]
  %indvars.iv.next131 = add nsw i64 %indvars.iv130, -1
  %92 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %indvars.iv.next131
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @minn, ptr noundef nonnull align 4 dereferenceable(4) %92)
  %94 = load i32, ptr %93, align 4, !tbaa !5
  store i32 %94, ptr @minn, align 4, !tbaa !5
  %95 = getelementptr inbounds [200000 x i32], ptr @mn, i64 0, i64 %indvars.iv.next131
  store i32 %94, ptr %95, align 4, !tbaa !5
  %96 = icmp ugt i64 %indvars.iv130, 1
  br i1 %96, label %.lr.ph101, label %.preheader66, !llvm.loop !30

.lr.ph103:                                        ; preds = %.preheader66, %111
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %111 ], [ 0, %.preheader66 ]
  %97 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %indvars.iv133
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = getelementptr inbounds [200000 x i32], ptr @mn, i64 0, i64 %indvars.iv133
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = icmp sgt i32 %98, %100
  br i1 %101, label %102, label %111

102:                                              ; preds = %.lr.ph103
  %103 = sext i32 %98 to i64
  %104 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %103
  %105 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #8
  %.not59 = icmp eq i64 %105, 0
  br i1 %.not59, label %111, label %106

106:                                              ; preds = %102
  %107 = load i32, ptr %97, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [201 x %"class.std::vector"], ptr @moves, i64 0, i64 %108
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %109, i64 noundef 0) #8
  br label %111

111:                                              ; preds = %106, %.lr.ph103, %102
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = icmp slt i64 %indvars.iv.next134, %113
  br i1 %114, label %.lr.ph103, label %.loopexit, !llvm.loop !31

._crit_edge107:                                   ; preds = %.loopexit, %0
  ret i32 0
}

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

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 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: 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 #4 align 2

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

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

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

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

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

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

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

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

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

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


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