; LLVM IR from eyangch/competitive-programming :: Codeforces/873 (e)

; 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.anon = type { i8 }

@N = external dso_local global i64, align 8
@A = external dso_local global [3000 x i64], align 16
@I = external dso_local global [3000 x i64], align 16
@D = external dso_local global [3000 x i64], align 16
@mx = external dso_local global [3000 x [3000 x i64]], align 16
@mxi = external dso_local global [3000 x [3000 x i64]], align 16
@ans = external dso_local global [3000 x i64], 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 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %class.anon, align 1
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %32 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %33 = getelementptr i8, ptr %32, i64 -24
  %34 = load i64, ptr %33, align 8
  %35 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %34
  %36 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %35, ptr noundef null)
  %37 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %39

39:                                               ; preds = %48, %0
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = load i64, ptr @N, align 8, !tbaa !8
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %51

44:                                               ; preds = %39
  %45 = load i64, ptr %2, align 8, !tbaa !8
  %46 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %45
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %46)
  br label %48

48:                                               ; preds = %44
  %49 = load i64, ptr %2, align 8, !tbaa !8
  %50 = add nsw i64 %49, 1
  store i64 %50, ptr %2, align 8, !tbaa !8
  br label %39, !llvm.loop !11

51:                                               ; preds = %43
  %52 = load i64, ptr @N, align 8, !tbaa !8
  %53 = getelementptr inbounds i64, ptr @I, i64 %52
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef @I, ptr noundef %53, i32 noundef 0)
  %54 = load i64, ptr @N, align 8, !tbaa !8
  %55 = getelementptr inbounds i64, ptr @I, i64 %54
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef @I, ptr noundef %55)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 1, ptr %4, align 8, !tbaa !8
  br label %56

56:                                               ; preds = %76, %51
  %57 = load i64, ptr %4, align 8, !tbaa !8
  %58 = load i64, ptr @N, align 8, !tbaa !8
  %59 = icmp slt i64 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %79

61:                                               ; preds = %56
  %62 = load i64, ptr %4, align 8, !tbaa !8
  %63 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !8
  %67 = load i64, ptr %4, align 8, !tbaa !8
  %68 = sub nsw i64 %67, 1
  %69 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = sub nsw i64 %66, %72
  %74 = load i64, ptr %4, align 8, !tbaa !8
  %75 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %74
  store i64 %73, ptr %75, align 8, !tbaa !8
  br label %76

76:                                               ; preds = %61
  %77 = load i64, ptr %4, align 8, !tbaa !8
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %4, align 8, !tbaa !8
  br label %56, !llvm.loop !13

79:                                               ; preds = %60
  %80 = load i64, ptr @I, align 16, !tbaa !8
  %81 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !8
  store i64 %82, ptr @D, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %83

83:                                               ; preds = %157, %79
  %84 = load i64, ptr %5, align 8, !tbaa !8
  %85 = load i64, ptr @N, align 8, !tbaa !8
  %86 = icmp slt i64 %84, %85
  br i1 %86, label %88, label %87

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

88:                                               ; preds = %83
  %89 = load i64, ptr %5, align 8, !tbaa !8
  %90 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !8
  %92 = load i64, ptr %5, align 8, !tbaa !8
  %93 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mx, i64 0, i64 %92
  %94 = load i64, ptr %5, align 8, !tbaa !8
  %95 = getelementptr inbounds [3000 x i64], ptr %93, i64 0, i64 %94
  store i64 %91, ptr %95, align 8, !tbaa !8
  %96 = load i64, ptr %5, align 8, !tbaa !8
  %97 = load i64, ptr %5, align 8, !tbaa !8
  %98 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mxi, i64 0, i64 %97
  %99 = load i64, ptr %5, align 8, !tbaa !8
  %100 = getelementptr inbounds [3000 x i64], ptr %98, i64 0, i64 %99
  store i64 %96, ptr %100, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %101 = load i64, ptr %5, align 8, !tbaa !8
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %7, align 8, !tbaa !8
  br label %103

103:                                              ; preds = %153, %88
  %104 = load i64, ptr %7, align 8, !tbaa !8
  %105 = load i64, ptr @N, align 8, !tbaa !8
  %106 = icmp slt i64 %104, %105
  br i1 %106, label %108, label %107

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

108:                                              ; preds = %103
  %109 = load i64, ptr %5, align 8, !tbaa !8
  %110 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mx, i64 0, i64 %109
  %111 = load i64, ptr %7, align 8, !tbaa !8
  %112 = sub nsw i64 %111, 1
  %113 = getelementptr inbounds [3000 x i64], ptr %110, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !8
  %115 = load i64, ptr %5, align 8, !tbaa !8
  %116 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mx, i64 0, i64 %115
  %117 = load i64, ptr %7, align 8, !tbaa !8
  %118 = getelementptr inbounds [3000 x i64], ptr %116, i64 0, i64 %117
  store i64 %114, ptr %118, align 8, !tbaa !8
  %119 = load i64, ptr %5, align 8, !tbaa !8
  %120 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mxi, i64 0, i64 %119
  %121 = load i64, ptr %7, align 8, !tbaa !8
  %122 = sub nsw i64 %121, 1
  %123 = getelementptr inbounds [3000 x i64], ptr %120, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !8
  %125 = load i64, ptr %5, align 8, !tbaa !8
  %126 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mxi, i64 0, i64 %125
  %127 = load i64, ptr %7, align 8, !tbaa !8
  %128 = getelementptr inbounds [3000 x i64], ptr %126, i64 0, i64 %127
  store i64 %124, ptr %128, align 8, !tbaa !8
  %129 = load i64, ptr %7, align 8, !tbaa !8
  %130 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !8
  %132 = load i64, ptr %5, align 8, !tbaa !8
  %133 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mx, i64 0, i64 %132
  %134 = load i64, ptr %7, align 8, !tbaa !8
  %135 = sub nsw i64 %134, 1
  %136 = getelementptr inbounds [3000 x i64], ptr %133, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !8
  %138 = icmp sgt i64 %131, %137
  br i1 %138, label %139, label %152

139:                                              ; preds = %108
  %140 = load i64, ptr %7, align 8, !tbaa !8
  %141 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !8
  %143 = load i64, ptr %5, align 8, !tbaa !8
  %144 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mx, i64 0, i64 %143
  %145 = load i64, ptr %7, align 8, !tbaa !8
  %146 = getelementptr inbounds [3000 x i64], ptr %144, i64 0, i64 %145
  store i64 %142, ptr %146, align 8, !tbaa !8
  %147 = load i64, ptr %7, align 8, !tbaa !8
  %148 = load i64, ptr %5, align 8, !tbaa !8
  %149 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mxi, i64 0, i64 %148
  %150 = load i64, ptr %7, align 8, !tbaa !8
  %151 = getelementptr inbounds [3000 x i64], ptr %149, i64 0, i64 %150
  store i64 %147, ptr %151, align 8, !tbaa !8
  br label %152

152:                                              ; preds = %139, %108
  br label %153

153:                                              ; preds = %152
  %154 = load i64, ptr %7, align 8, !tbaa !8
  %155 = add nsw i64 %154, 1
  store i64 %155, ptr %7, align 8, !tbaa !8
  br label %103, !llvm.loop !14

156:                                              ; preds = %107
  br label %157

157:                                              ; preds = %156
  %158 = load i64, ptr %5, align 8, !tbaa !8
  %159 = add nsw i64 %158, 1
  store i64 %159, ptr %5, align 8, !tbaa !8
  br label %83, !llvm.loop !15

160:                                              ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %161 = load i64, ptr @N, align 8, !tbaa !8
  %162 = mul nsw i64 2, %161
  %163 = sdiv i64 %162, 3
  store i64 %163, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %164 = load i64, ptr @N, align 8, !tbaa !8
  %165 = sdiv i64 %164, 3
  store i64 %165, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  br label %166

166:                                              ; preds = %287, %160
  %167 = load i64, ptr %11, align 8, !tbaa !8
  %168 = load i64, ptr @N, align 8, !tbaa !8
  %169 = icmp slt i64 %167, %168
  br i1 %169, label %171, label %170

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

171:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %172 = load i64, ptr %11, align 8, !tbaa !8
  %173 = add nsw i64 %172, 1
  store i64 %173, ptr %12, align 8, !tbaa !8
  br label %174

174:                                              ; preds = %283, %171
  %175 = load i64, ptr %12, align 8, !tbaa !8
  %176 = load i64, ptr @N, align 8, !tbaa !8
  %177 = icmp slt i64 %175, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %174
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %286

179:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %180 = load i64, ptr @N, align 8, !tbaa !8
  %181 = load i64, ptr %12, align 8, !tbaa !8
  %182 = sub nsw i64 %180, %181
  store i64 %182, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %183 = load i64, ptr %12, align 8, !tbaa !8
  %184 = load i64, ptr %11, align 8, !tbaa !8
  %185 = sub nsw i64 %183, %184
  store i64 %185, ptr %14, align 8, !tbaa !8
  %186 = load i64, ptr %13, align 8, !tbaa !8
  %187 = mul nsw i64 %186, 2
  %188 = load i64, ptr %14, align 8, !tbaa !8
  %189 = icmp slt i64 %187, %188
  br i1 %189, label %195, label %190

190:                                              ; preds = %179
  %191 = load i64, ptr %14, align 8, !tbaa !8
  %192 = mul nsw i64 %191, 2
  %193 = load i64, ptr %13, align 8, !tbaa !8
  %194 = icmp slt i64 %192, %193
  br i1 %194, label %195, label %196

195:                                              ; preds = %190, %179
  store i32 19, ptr %6, align 4
  br label %280

196:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %197 = load i64, ptr %8, align 8, !tbaa !8
  %198 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %197
  %199 = load i64, ptr %198, align 8, !tbaa !8
  store i64 %199, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %200 = load i64, ptr %12, align 8, !tbaa !8
  %201 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %200
  %202 = load i64, ptr %201, align 8, !tbaa !8
  store i64 %202, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %203 = load i64, ptr %9, align 8, !tbaa !8
  %204 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %203
  %205 = load i64, ptr %204, align 8, !tbaa !8
  store i64 %205, ptr %17, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %206 = load i64, ptr %11, align 8, !tbaa !8
  %207 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %206
  %208 = load i64, ptr %207, align 8, !tbaa !8
  store i64 %208, ptr %18, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %210 = load i64, ptr %209, align 8, !tbaa !8
  store i64 %210, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %212 = load i64, ptr %211, align 8, !tbaa !8
  store i64 %212, ptr %20, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %213 = load i64, ptr %11, align 8, !tbaa !8
  %214 = load i64, ptr %19, align 8, !tbaa !8
  %215 = sdiv i64 %214, 2
  %216 = load i64, ptr %19, align 8, !tbaa !8
  %217 = srem i64 %216, 2
  %218 = add nsw i64 %215, %217
  %219 = sub nsw i64 %213, %218
  store i64 %219, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %220 = load i64, ptr %11, align 8, !tbaa !8
  %221 = load i64, ptr %20, align 8, !tbaa !8
  %222 = mul nsw i64 %221, 2
  %223 = sub nsw i64 %220, %222
  store i64 %223, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %224 = load i64, ptr %10, align 8, !tbaa !8
  %225 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %224
  %226 = load i64, ptr %225, align 8, !tbaa !8
  store i64 %226, ptr %23, align 8, !tbaa !8
  %227 = load i64, ptr %21, align 8, !tbaa !8
  %228 = icmp slt i64 %227, 0
  br i1 %228, label %229, label %230

229:                                              ; preds = %196
  store i32 19, ptr %6, align 4
  br label %279

230:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store i64 0, ptr %24, align 8, !tbaa !8
  %231 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %232 = load i64, ptr %231, align 8, !tbaa !8
  store i64 %232, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %233 = load i64, ptr %22, align 8, !tbaa !8
  %234 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mx, i64 0, i64 %233
  %235 = load i64, ptr %21, align 8, !tbaa !8
  %236 = getelementptr inbounds [3000 x i64], ptr %234, i64 0, i64 %235
  %237 = load i64, ptr %236, align 8, !tbaa !8
  store i64 %237, ptr %25, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %238 = load i64, ptr %22, align 8, !tbaa !8
  %239 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mxi, i64 0, i64 %238
  %240 = load i64, ptr %21, align 8, !tbaa !8
  %241 = getelementptr inbounds [3000 x i64], ptr %239, i64 0, i64 %240
  %242 = load i64, ptr %241, align 8, !tbaa !8
  store i64 %242, ptr %26, align 8, !tbaa !8
  %243 = load i64, ptr %16, align 8, !tbaa !8
  %244 = load i64, ptr %15, align 8, !tbaa !8
  %245 = icmp sgt i64 %243, %244
  br i1 %245, label %246, label %250

246:                                              ; preds = %230
  %247 = load i64, ptr %12, align 8, !tbaa !8
  store i64 %247, ptr %8, align 8, !tbaa !8
  %248 = load i64, ptr %11, align 8, !tbaa !8
  store i64 %248, ptr %9, align 8, !tbaa !8
  %249 = load i64, ptr %26, align 8, !tbaa !8
  store i64 %249, ptr %10, align 8, !tbaa !8
  br label %278

250:                                              ; preds = %230
  %251 = load i64, ptr %16, align 8, !tbaa !8
  %252 = load i64, ptr %15, align 8, !tbaa !8
  %253 = icmp eq i64 %251, %252
  br i1 %253, label %254, label %277

254:                                              ; preds = %250
  %255 = load i64, ptr %18, align 8, !tbaa !8
  %256 = load i64, ptr %17, align 8, !tbaa !8
  %257 = icmp sgt i64 %255, %256
  br i1 %257, label %258, label %262

258:                                              ; preds = %254
  %259 = load i64, ptr %12, align 8, !tbaa !8
  store i64 %259, ptr %8, align 8, !tbaa !8
  %260 = load i64, ptr %11, align 8, !tbaa !8
  store i64 %260, ptr %9, align 8, !tbaa !8
  %261 = load i64, ptr %26, align 8, !tbaa !8
  store i64 %261, ptr %10, align 8, !tbaa !8
  br label %276

262:                                              ; preds = %254
  %263 = load i64, ptr %18, align 8, !tbaa !8
  %264 = load i64, ptr %17, align 8, !tbaa !8
  %265 = icmp eq i64 %263, %264
  br i1 %265, label %266, label %275

266:                                              ; preds = %262
  %267 = load i64, ptr %25, align 8, !tbaa !8
  %268 = load i64, ptr %23, align 8, !tbaa !8
  %269 = icmp sgt i64 %267, %268
  br i1 %269, label %270, label %274

270:                                              ; preds = %266
  %271 = load i64, ptr %12, align 8, !tbaa !8
  store i64 %271, ptr %8, align 8, !tbaa !8
  %272 = load i64, ptr %11, align 8, !tbaa !8
  store i64 %272, ptr %9, align 8, !tbaa !8
  %273 = load i64, ptr %26, align 8, !tbaa !8
  store i64 %273, ptr %10, align 8, !tbaa !8
  br label %274

274:                                              ; preds = %270, %266
  br label %275

275:                                              ; preds = %274, %262
  br label %276

276:                                              ; preds = %275, %258
  br label %277

277:                                              ; preds = %276, %250
  br label %278

278:                                              ; preds = %277, %246
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  store i32 0, ptr %6, align 4
  br label %279

279:                                              ; preds = %278, %229
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %280

280:                                              ; preds = %279, %195
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  %281 = load i32, ptr %6, align 4
  switch i32 %281, label %367 [
    i32 0, label %282
    i32 19, label %283
  ]

282:                                              ; preds = %280
  br label %283

283:                                              ; preds = %282, %280
  %284 = load i64, ptr %12, align 8, !tbaa !8
  %285 = add nsw i64 %284, 1
  store i64 %285, ptr %12, align 8, !tbaa !8
  br label %174, !llvm.loop !16

286:                                              ; preds = %178
  br label %287

287:                                              ; preds = %286
  %288 = load i64, ptr %11, align 8, !tbaa !8
  %289 = add nsw i64 %288, 1
  store i64 %289, ptr %11, align 8, !tbaa !8
  br label %166, !llvm.loop !17

290:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  store i64 0, ptr %27, align 8, !tbaa !8
  br label %291

291:                                              ; preds = %301, %290
  %292 = load i64, ptr %27, align 8, !tbaa !8
  %293 = load i64, ptr %10, align 8, !tbaa !8
  %294 = icmp slt i64 %292, %293
  br i1 %294, label %296, label %295

295:                                              ; preds = %291
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %304

296:                                              ; preds = %291
  %297 = load i64, ptr %27, align 8, !tbaa !8
  %298 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %297
  %299 = load i64, ptr %298, align 8, !tbaa !8
  %300 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %299
  store i64 -1, ptr %300, align 8, !tbaa !8
  br label %301

301:                                              ; preds = %296
  %302 = load i64, ptr %27, align 8, !tbaa !8
  %303 = add nsw i64 %302, 1
  store i64 %303, ptr %27, align 8, !tbaa !8
  br label %291, !llvm.loop !18

304:                                              ; preds = %295
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %305 = load i64, ptr %10, align 8, !tbaa !8
  store i64 %305, ptr %28, align 8, !tbaa !8
  br label %306

306:                                              ; preds = %316, %304
  %307 = load i64, ptr %28, align 8, !tbaa !8
  %308 = load i64, ptr %9, align 8, !tbaa !8
  %309 = icmp slt i64 %307, %308
  br i1 %309, label %311, label %310

310:                                              ; preds = %306
  store i32 23, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %319

311:                                              ; preds = %306
  %312 = load i64, ptr %28, align 8, !tbaa !8
  %313 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %312
  %314 = load i64, ptr %313, align 8, !tbaa !8
  %315 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %314
  store i64 3, ptr %315, align 8, !tbaa !8
  br label %316

316:                                              ; preds = %311
  %317 = load i64, ptr %28, align 8, !tbaa !8
  %318 = add nsw i64 %317, 1
  store i64 %318, ptr %28, align 8, !tbaa !8
  br label %306, !llvm.loop !19

319:                                              ; preds = %310
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %320 = load i64, ptr %9, align 8, !tbaa !8
  store i64 %320, ptr %29, align 8, !tbaa !8
  br label %321

321:                                              ; preds = %331, %319
  %322 = load i64, ptr %29, align 8, !tbaa !8
  %323 = load i64, ptr %8, align 8, !tbaa !8
  %324 = icmp slt i64 %322, %323
  br i1 %324, label %326, label %325

325:                                              ; preds = %321
  store i32 26, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %334

326:                                              ; preds = %321
  %327 = load i64, ptr %29, align 8, !tbaa !8
  %328 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %327
  %329 = load i64, ptr %328, align 8, !tbaa !8
  %330 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %329
  store i64 2, ptr %330, align 8, !tbaa !8
  br label %331

331:                                              ; preds = %326
  %332 = load i64, ptr %29, align 8, !tbaa !8
  %333 = add nsw i64 %332, 1
  store i64 %333, ptr %29, align 8, !tbaa !8
  br label %321, !llvm.loop !20

334:                                              ; preds = %325
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %335 = load i64, ptr %8, align 8, !tbaa !8
  store i64 %335, ptr %30, align 8, !tbaa !8
  br label %336

336:                                              ; preds = %346, %334
  %337 = load i64, ptr %30, align 8, !tbaa !8
  %338 = load i64, ptr @N, align 8, !tbaa !8
  %339 = icmp slt i64 %337, %338
  br i1 %339, label %341, label %340

340:                                              ; preds = %336
  store i32 29, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %349

341:                                              ; preds = %336
  %342 = load i64, ptr %30, align 8, !tbaa !8
  %343 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %342
  %344 = load i64, ptr %343, align 8, !tbaa !8
  %345 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %344
  store i64 1, ptr %345, align 8, !tbaa !8
  br label %346

346:                                              ; preds = %341
  %347 = load i64, ptr %30, align 8, !tbaa !8
  %348 = add nsw i64 %347, 1
  store i64 %348, ptr %30, align 8, !tbaa !8
  br label %336, !llvm.loop !21

349:                                              ; preds = %340
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  store i64 0, ptr %31, align 8, !tbaa !8
  br label %350

350:                                              ; preds = %361, %349
  %351 = load i64, ptr %31, align 8, !tbaa !8
  %352 = load i64, ptr @N, align 8, !tbaa !8
  %353 = icmp slt i64 %351, %352
  br i1 %353, label %355, label %354

354:                                              ; preds = %350
  store i32 32, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %364

355:                                              ; preds = %350
  %356 = load i64, ptr %31, align 8, !tbaa !8
  %357 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %356
  %358 = load i64, ptr %357, align 8, !tbaa !8
  %359 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %358)
  %360 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %359, i8 noundef signext 32)
  br label %361

361:                                              ; preds = %355
  %362 = load i64, ptr %31, align 8, !tbaa !8
  %363 = add nsw i64 %362, 1
  store i64 %363, ptr %31, align 8, !tbaa !8
  br label %350, !llvm.loop !22

364:                                              ; preds = %354
  %365 = 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 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %366 = load i32, ptr %1, align 4
  ret i32 %366

367:                                              ; preds = %280
  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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) #5

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), 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 = { 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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !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}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !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" }

@N = external dso_local global i64, align 8
@A = external dso_local global [3000 x i64], align 16
@I = external dso_local global [3000 x i64], align 16
@D = external dso_local local_unnamed_addr global [3000 x i64], align 16
@mx = external dso_local local_unnamed_addr global [3000 x [3000 x i64]], align 16
@mxi = external dso_local local_unnamed_addr global [3000 x [3000 x i64]], align 16
@ans = external dso_local local_unnamed_addr global [3000 x i64], 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 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %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)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %12 = load i64, ptr @N, align 8, !tbaa !8
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa138 = phi i64 [ %12, %0 ], [ %25, %.lr.ph ]
  %14 = getelementptr inbounds i64, ptr @I, i64 %.lcssa138
  tail call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef nonnull @I, ptr noundef nonnull %14, i32 noundef 0)
  %15 = load i64, ptr @N, align 8, !tbaa !8
  %16 = getelementptr inbounds i64, ptr @I, i64 %15
  tail call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @I, ptr noundef nonnull %16)
  %17 = load i64, ptr @N, align 8, !tbaa !8
  %18 = icmp sgt i64 %17, 1
  %.pre = load i64, ptr @I, align 16, !tbaa !8
  %.phi.trans.insert = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %.pre
  %.pre191 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !8
  br i1 %18, label %.lr.ph142.preheader, label %._crit_edge143

.lr.ph142.preheader:                              ; preds = %._crit_edge
  %19 = add nsw i64 %17, -1
  %20 = add nsw i64 %17, -2
  %xtraiter = and i64 %19, 3
  %21 = icmp ult i64 %20, 3
  br i1 %21, label %._crit_edge143.loopexit.unr-lcssa, label %.lr.ph142.preheader.new

.lr.ph142.preheader.new:                          ; preds = %.lr.ph142.preheader
  %unroll_iter = and i64 %19, -4
  br label %.lr.ph142

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.0102139 = phi i64 [ %24, %.lr.ph ], [ 0, %0 ]
  %22 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %.0102139
  %23 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %24 = add nuw nsw i64 %.0102139, 1
  %25 = load i64, ptr @N, align 8, !tbaa !8
  %26 = icmp slt i64 %24, %25
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge143.loopexit.unr-lcssa:                ; preds = %.lr.ph142, %.lr.ph142.preheader
  %.unr = phi i64 [ %.pre191, %.lr.ph142.preheader ], [ %64, %.lr.ph142 ]
  %.0103140.unr = phi i64 [ 1, %.lr.ph142.preheader ], [ %67, %.lr.ph142 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge143, label %.lr.ph142.epil

.lr.ph142.epil:                                   ; preds = %._crit_edge143.loopexit.unr-lcssa, %.lr.ph142.epil
  %27 = phi i64 [ %31, %.lr.ph142.epil ], [ %.unr, %._crit_edge143.loopexit.unr-lcssa ]
  %.0103140.epil = phi i64 [ %34, %.lr.ph142.epil ], [ %.0103140.unr, %._crit_edge143.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph142.epil ], [ 0, %._crit_edge143.loopexit.unr-lcssa ]
  %28 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.0103140.epil
  %29 = load i64, ptr %28, align 8, !tbaa !8
  %30 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !8
  %32 = sub nsw i64 %31, %27
  %33 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %.0103140.epil
  store i64 %32, ptr %33, align 8, !tbaa !8
  %34 = add nuw nsw i64 %.0103140.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge143, label %.lr.ph142.epil, !llvm.loop !13

._crit_edge143:                                   ; preds = %._crit_edge143.loopexit.unr-lcssa, %.lr.ph142.epil, %._crit_edge
  store i64 %.pre191, ptr @D, align 16, !tbaa !8
  %35 = icmp sgt i64 %17, 0
  br i1 %35, label %.lr.ph150, label %._crit_edge151.thread

._crit_edge151.thread:                            ; preds = %._crit_edge143
  %36 = shl nsw i64 %17, 1
  %37 = sdiv i64 %36, 3
  %.nonneg = sub i64 0, %17
  %38 = udiv i64 %.nonneg, 3
  %.neg = sub nsw i64 0, %38
  br label %.preheader134

.lr.ph142:                                        ; preds = %.lr.ph142, %.lr.ph142.preheader.new
  %39 = phi i64 [ %.pre191, %.lr.ph142.preheader.new ], [ %64, %.lr.ph142 ]
  %.0103140 = phi i64 [ 1, %.lr.ph142.preheader.new ], [ %67, %.lr.ph142 ]
  %niter = phi i64 [ 0, %.lr.ph142.preheader.new ], [ %niter.next.3, %.lr.ph142 ]
  %40 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.0103140
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = sub nsw i64 %43, %39
  %45 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %.0103140
  store i64 %44, ptr %45, align 8, !tbaa !8
  %46 = add nuw nsw i64 %.0103140, 1
  %47 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !8
  %49 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = sub nsw i64 %50, %43
  %52 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %46
  store i64 %51, ptr %52, align 8, !tbaa !8
  %53 = add nuw nsw i64 %.0103140, 2
  %54 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !8
  %58 = sub nsw i64 %57, %50
  %59 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %53
  store i64 %58, ptr %59, align 8, !tbaa !8
  %60 = add nuw nsw i64 %.0103140, 3
  %61 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !8
  %63 = getelementptr inbounds [3000 x i64], ptr @A, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = sub nsw i64 %64, %57
  %66 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %60
  store i64 %65, ptr %66, align 8, !tbaa !8
  %67 = add nuw nsw i64 %.0103140, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge143.loopexit.unr-lcssa, label %.lr.ph142, !llvm.loop !15

.loopexit136:                                     ; preds = %85, %.lr.ph150
  %exitcond186.not = icmp eq i64 %75, %17
  br i1 %exitcond186.not, label %._crit_edge151, label %.lr.ph150, !llvm.loop !16

._crit_edge151:                                   ; preds = %.loopexit136
  %68 = shl nuw nsw i64 %17, 1
  %69 = udiv i64 %68, 3
  %70 = udiv i64 %17, 3
  br i1 %35, label %.lr.ph167, label %.preheader134

.lr.ph150:                                        ; preds = %._crit_edge143, %.loopexit136
  %.0104148 = phi i64 [ %75, %.loopexit136 ], [ 0, %._crit_edge143 ]
  %71 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %.0104148
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mx, i64 0, i64 %.0104148, i64 %.0104148
  store i64 %72, ptr %73, align 8, !tbaa !8
  %74 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mxi, i64 0, i64 %.0104148, i64 %.0104148
  store i64 %.0104148, ptr %74, align 8, !tbaa !8
  %75 = add nuw nsw i64 %.0104148, 1
  %76 = icmp slt i64 %75, %17
  br i1 %76, label %.lr.ph147, label %.loopexit136

.lr.ph147:                                        ; preds = %.lr.ph150, %85
  %77 = phi i64 [ %86, %85 ], [ %.0104148, %.lr.ph150 ]
  %78 = phi i64 [ %87, %85 ], [ %72, %.lr.ph150 ]
  %.0105145 = phi i64 [ %88, %85 ], [ %75, %.lr.ph150 ]
  %79 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mx, i64 0, i64 %.0104148, i64 %.0105145
  store i64 %78, ptr %79, align 8, !tbaa !8
  %80 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mxi, i64 0, i64 %.0104148, i64 %.0105145
  store i64 %77, ptr %80, align 8, !tbaa !8
  %81 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %.0105145
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = icmp sgt i64 %82, %78
  br i1 %83, label %84, label %85

84:                                               ; preds = %.lr.ph147
  store i64 %82, ptr %79, align 8, !tbaa !8
  store i64 %.0105145, ptr %80, align 8, !tbaa !8
  br label %85

85:                                               ; preds = %.lr.ph147, %84
  %86 = phi i64 [ %77, %.lr.ph147 ], [ %.0105145, %84 ]
  %87 = phi i64 [ %78, %.lr.ph147 ], [ %82, %84 ]
  %88 = add nuw nsw i64 %.0105145, 1
  %89 = icmp slt i64 %88, %17
  br i1 %89, label %.lr.ph147, label %.loopexit136, !llvm.loop !17

.loopexit:                                        ; preds = %143, %.lr.ph167
  %90 = phi i64 [ %94, %.lr.ph167 ], [ %144, %143 ]
  %.1113.lcssa = phi i64 [ %.0112163, %.lr.ph167 ], [ %.4116, %143 ]
  %.1108.lcssa = phi i64 [ %.0107164, %.lr.ph167 ], [ %.4111, %143 ]
  %.1.lcssa = phi i64 [ %.0106165, %.lr.ph167 ], [ %.4, %143 ]
  %91 = icmp slt i64 %95, %90
  br i1 %91, label %.lr.ph167, label %.preheader135, !llvm.loop !18

.preheader135:                                    ; preds = %.loopexit
  %92 = icmp sgt i64 %.1113.lcssa, 0
  br i1 %92, label %.lr.ph173.preheader, label %.preheader134

.lr.ph173.preheader:                              ; preds = %.preheader135
  %xtraiter208 = and i64 %.1113.lcssa, 3
  %93 = icmp ult i64 %.1113.lcssa, 4
  br i1 %93, label %.preheader134.loopexit.unr-lcssa, label %.lr.ph173.preheader.new

.lr.ph173.preheader.new:                          ; preds = %.lr.ph173.preheader
  %unroll_iter211 = and i64 %.1113.lcssa, 9223372036854775804
  br label %.lr.ph173

.lr.ph167:                                        ; preds = %._crit_edge151, %.loopexit
  %94 = phi i64 [ %90, %.loopexit ], [ %17, %._crit_edge151 ]
  %.0106165 = phi i64 [ %.1.lcssa, %.loopexit ], [ %69, %._crit_edge151 ]
  %.0107164 = phi i64 [ %.1108.lcssa, %.loopexit ], [ %70, %._crit_edge151 ]
  %.0112163 = phi i64 [ %.1113.lcssa, %.loopexit ], [ 0, %._crit_edge151 ]
  %.0117162 = phi i64 [ %95, %.loopexit ], [ 0, %._crit_edge151 ]
  %95 = add nuw nsw i64 %.0117162, 1
  %96 = icmp slt i64 %95, %94
  br i1 %96, label %.lr.ph158, label %.loopexit

.lr.ph158:                                        ; preds = %.lr.ph167
  %97 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %.0117162
  br label %98

98:                                               ; preds = %.lr.ph158, %143
  %99 = phi i64 [ %94, %.lr.ph158 ], [ %144, %143 ]
  %100 = phi i64 [ %94, %.lr.ph158 ], [ %145, %143 ]
  %.1156 = phi i64 [ %.0106165, %.lr.ph158 ], [ %.4, %143 ]
  %.1108155 = phi i64 [ %.0107164, %.lr.ph158 ], [ %.4111, %143 ]
  %.1113154 = phi i64 [ %.0112163, %.lr.ph158 ], [ %.4116, %143 ]
  %.0118152 = phi i64 [ %95, %.lr.ph158 ], [ %146, %143 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %101 = sub nsw i64 %100, %.0118152
  store i64 %101, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %102 = sub nuw nsw i64 %.0118152, %.0117162
  store i64 %102, ptr %2, align 8, !tbaa !8
  %103 = shl nsw i64 %101, 1
  %104 = icmp slt i64 %103, %102
  %105 = shl nuw nsw i64 %102, 1
  %106 = icmp slt i64 %105, %101
  %or.cond = select i1 %104, i1 true, i1 %106
  br i1 %or.cond, label %143, label %107

107:                                              ; preds = %98
  %108 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %.1156
  %109 = load i64, ptr %108, align 8, !tbaa !8
  %110 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %.0118152
  %111 = load i64, ptr %110, align 8, !tbaa !8
  %112 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %.1108155
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = load i64, ptr %97, align 8, !tbaa !8
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %118 = load i64, ptr %117, align 8, !tbaa !8
  %.neg183 = sdiv i64 %116, -2
  %119 = srem i64 %116, 2
  %.neg131 = sub i64 %.0117162, %119
  %120 = add i64 %.neg131, %.neg183
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %121 = shl nsw i64 %118, 1
  %122 = sub nsw i64 %.0117162, %121
  store i64 %122, ptr %3, align 8, !tbaa !8
  %123 = getelementptr inbounds [3000 x i64], ptr @D, i64 0, i64 %.1113154
  %124 = load i64, ptr %123, align 8, !tbaa !8
  %125 = icmp slt i64 %120, 0
  br i1 %125, label %142, label %126

126:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %128 = load i64, ptr %127, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %129 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mx, i64 0, i64 %128, i64 %120
  %130 = load i64, ptr %129, align 8, !tbaa !8
  %131 = getelementptr inbounds [3000 x [3000 x i64]], ptr @mxi, i64 0, i64 %128, i64 %120
  %132 = load i64, ptr %131, align 8, !tbaa !8
  %133 = icmp sgt i64 %111, %109
  br i1 %133, label %142, label %134

134:                                              ; preds = %126
  %135 = icmp eq i64 %111, %109
  br i1 %135, label %136, label %142

136:                                              ; preds = %134
  %137 = icmp sgt i64 %114, %113
  br i1 %137, label %142, label %138

138:                                              ; preds = %136
  %139 = icmp eq i64 %114, %113
  %140 = icmp sgt i64 %130, %124
  %or.cond129 = select i1 %139, i1 %140, i1 false
  br i1 %or.cond129, label %141, label %142

141:                                              ; preds = %138
  br label %142

142:                                              ; preds = %141, %138, %134, %126, %136, %107
  %.3115 = phi i64 [ %.1113154, %107 ], [ %132, %141 ], [ %.1113154, %138 ], [ %.1113154, %134 ], [ %132, %126 ], [ %132, %136 ]
  %.3110 = phi i64 [ %.1108155, %107 ], [ %.0117162, %141 ], [ %.1108155, %138 ], [ %.1108155, %134 ], [ %.0117162, %126 ], [ %.0117162, %136 ]
  %.3 = phi i64 [ %.1156, %107 ], [ %.0118152, %141 ], [ %.1156, %138 ], [ %.1156, %134 ], [ %.0118152, %126 ], [ %.0118152, %136 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %.pre195 = load i64, ptr @N, align 8, !tbaa !8
  br label %143

143:                                              ; preds = %98, %142
  %144 = phi i64 [ %.pre195, %142 ], [ %99, %98 ]
  %145 = phi i64 [ %.pre195, %142 ], [ %100, %98 ]
  %.4116 = phi i64 [ %.3115, %142 ], [ %.1113154, %98 ]
  %.4111 = phi i64 [ %.3110, %142 ], [ %.1108155, %98 ]
  %.4 = phi i64 [ %.3, %142 ], [ %.1156, %98 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %146 = add nuw nsw i64 %.0118152, 1
  %147 = icmp slt i64 %146, %145
  br i1 %147, label %98, label %.loopexit, !llvm.loop !19

.preheader134.loopexit.unr-lcssa:                 ; preds = %.lr.ph173, %.lr.ph173.preheader
  %.0101172.unr = phi i64 [ 0, %.lr.ph173.preheader ], [ %176, %.lr.ph173 ]
  %lcmp.mod210.not = icmp eq i64 %xtraiter208, 0
  br i1 %lcmp.mod210.not, label %.preheader134, label %.lr.ph173.epil

.lr.ph173.epil:                                   ; preds = %.preheader134.loopexit.unr-lcssa, %.lr.ph173.epil
  %.0101172.epil = phi i64 [ %151, %.lr.ph173.epil ], [ %.0101172.unr, %.preheader134.loopexit.unr-lcssa ]
  %epil.iter209 = phi i64 [ %epil.iter209.next, %.lr.ph173.epil ], [ 0, %.preheader134.loopexit.unr-lcssa ]
  %148 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.0101172.epil
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %149
  store i64 -1, ptr %150, align 8, !tbaa !8
  %151 = add nuw nsw i64 %.0101172.epil, 1
  %epil.iter209.next = add i64 %epil.iter209, 1
  %epil.iter209.cmp.not = icmp eq i64 %epil.iter209.next, %xtraiter208
  br i1 %epil.iter209.cmp.not, label %.preheader134, label %.lr.ph173.epil, !llvm.loop !20

.preheader134:                                    ; preds = %.preheader134.loopexit.unr-lcssa, %.lr.ph173.epil, %._crit_edge151.thread, %._crit_edge151, %.preheader135
  %152 = phi i64 [ %90, %.preheader135 ], [ %17, %._crit_edge151 ], [ %17, %._crit_edge151.thread ], [ %90, %.lr.ph173.epil ], [ %90, %.preheader134.loopexit.unr-lcssa ]
  %.0106.lcssa201 = phi i64 [ %.1.lcssa, %.preheader135 ], [ %69, %._crit_edge151 ], [ %37, %._crit_edge151.thread ], [ %.1.lcssa, %.lr.ph173.epil ], [ %.1.lcssa, %.preheader134.loopexit.unr-lcssa ]
  %.0107.lcssa200 = phi i64 [ %.1108.lcssa, %.preheader135 ], [ %70, %._crit_edge151 ], [ %.neg, %._crit_edge151.thread ], [ %.1108.lcssa, %.lr.ph173.epil ], [ %.1108.lcssa, %.preheader134.loopexit.unr-lcssa ]
  %.0112.lcssa199 = phi i64 [ %.1113.lcssa, %.preheader135 ], [ 0, %._crit_edge151 ], [ 0, %._crit_edge151.thread ], [ %.1113.lcssa, %.lr.ph173.epil ], [ %.1113.lcssa, %.preheader134.loopexit.unr-lcssa ]
  %153 = icmp slt i64 %.0112.lcssa199, %.0107.lcssa200
  br i1 %153, label %.lr.ph175.preheader, label %.preheader133

.lr.ph175.preheader:                              ; preds = %.preheader134
  %154 = sub i64 %.0107.lcssa200, %.0112.lcssa199
  %xtraiter213 = and i64 %154, 3
  %lcmp.mod214.not = icmp eq i64 %xtraiter213, 0
  br i1 %lcmp.mod214.not, label %.lr.ph175.prol.loopexit, label %.lr.ph175.prol

.lr.ph175.prol:                                   ; preds = %.lr.ph175.preheader, %.lr.ph175.prol
  %.0100174.prol = phi i64 [ %158, %.lr.ph175.prol ], [ %.0112.lcssa199, %.lr.ph175.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph175.prol ], [ 0, %.lr.ph175.preheader ]
  %155 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.0100174.prol
  %156 = load i64, ptr %155, align 8, !tbaa !8
  %157 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %156
  store i64 3, ptr %157, align 8, !tbaa !8
  %158 = add nsw i64 %.0100174.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter213
  br i1 %prol.iter.cmp.not, label %.lr.ph175.prol.loopexit, label %.lr.ph175.prol, !llvm.loop !21

.lr.ph175.prol.loopexit:                          ; preds = %.lr.ph175.prol, %.lr.ph175.preheader
  %.0100174.unr = phi i64 [ %.0112.lcssa199, %.lr.ph175.preheader ], [ %158, %.lr.ph175.prol ]
  %159 = sub i64 %.0112.lcssa199, %.0107.lcssa200
  %160 = icmp ugt i64 %159, -4
  br i1 %160, label %.preheader133, label %.lr.ph175

.lr.ph173:                                        ; preds = %.lr.ph173, %.lr.ph173.preheader.new
  %.0101172 = phi i64 [ 0, %.lr.ph173.preheader.new ], [ %176, %.lr.ph173 ]
  %niter212 = phi i64 [ 0, %.lr.ph173.preheader.new ], [ %niter212.next.3, %.lr.ph173 ]
  %161 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.0101172
  %162 = load i64, ptr %161, align 16, !tbaa !8
  %163 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %162
  store i64 -1, ptr %163, align 8, !tbaa !8
  %164 = or disjoint i64 %.0101172, 1
  %165 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %164
  %166 = load i64, ptr %165, align 8, !tbaa !8
  %167 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %166
  store i64 -1, ptr %167, align 8, !tbaa !8
  %168 = or disjoint i64 %.0101172, 2
  %169 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %168
  %170 = load i64, ptr %169, align 16, !tbaa !8
  %171 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %170
  store i64 -1, ptr %171, align 8, !tbaa !8
  %172 = or disjoint i64 %.0101172, 3
  %173 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %172
  %174 = load i64, ptr %173, align 8, !tbaa !8
  %175 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %174
  store i64 -1, ptr %175, align 8, !tbaa !8
  %176 = add nuw nsw i64 %.0101172, 4
  %niter212.next.3 = add i64 %niter212, 4
  %niter212.ncmp.3 = icmp eq i64 %niter212.next.3, %unroll_iter211
  br i1 %niter212.ncmp.3, label %.preheader134.loopexit.unr-lcssa, label %.lr.ph173, !llvm.loop !22

.preheader133:                                    ; preds = %.lr.ph175.prol.loopexit, %.lr.ph175, %.preheader134
  %177 = icmp slt i64 %.0107.lcssa200, %.0106.lcssa201
  br i1 %177, label %.lr.ph177.preheader, label %.preheader132

.lr.ph177.preheader:                              ; preds = %.preheader133
  %178 = sub i64 %.0106.lcssa201, %.0107.lcssa200
  %xtraiter215 = and i64 %178, 3
  %lcmp.mod216.not = icmp eq i64 %xtraiter215, 0
  br i1 %lcmp.mod216.not, label %.lr.ph177.prol.loopexit, label %.lr.ph177.prol

.lr.ph177.prol:                                   ; preds = %.lr.ph177.preheader, %.lr.ph177.prol
  %.099176.prol = phi i64 [ %182, %.lr.ph177.prol ], [ %.0107.lcssa200, %.lr.ph177.preheader ]
  %prol.iter217 = phi i64 [ %prol.iter217.next, %.lr.ph177.prol ], [ 0, %.lr.ph177.preheader ]
  %179 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.099176.prol
  %180 = load i64, ptr %179, align 8, !tbaa !8
  %181 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %180
  store i64 2, ptr %181, align 8, !tbaa !8
  %182 = add nsw i64 %.099176.prol, 1
  %prol.iter217.next = add i64 %prol.iter217, 1
  %prol.iter217.cmp.not = icmp eq i64 %prol.iter217.next, %xtraiter215
  br i1 %prol.iter217.cmp.not, label %.lr.ph177.prol.loopexit, label %.lr.ph177.prol, !llvm.loop !23

.lr.ph177.prol.loopexit:                          ; preds = %.lr.ph177.prol, %.lr.ph177.preheader
  %.099176.unr = phi i64 [ %.0107.lcssa200, %.lr.ph177.preheader ], [ %182, %.lr.ph177.prol ]
  %183 = sub i64 %.0107.lcssa200, %.0106.lcssa201
  %184 = icmp ugt i64 %183, -4
  br i1 %184, label %.preheader132, label %.lr.ph177

.lr.ph175:                                        ; preds = %.lr.ph175.prol.loopexit, %.lr.ph175
  %.0100174 = phi i64 [ %200, %.lr.ph175 ], [ %.0100174.unr, %.lr.ph175.prol.loopexit ]
  %185 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.0100174
  %186 = load i64, ptr %185, align 8, !tbaa !8
  %187 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %186
  store i64 3, ptr %187, align 8, !tbaa !8
  %188 = add nsw i64 %.0100174, 1
  %189 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %188
  %190 = load i64, ptr %189, align 8, !tbaa !8
  %191 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %190
  store i64 3, ptr %191, align 8, !tbaa !8
  %192 = add nsw i64 %.0100174, 2
  %193 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %192
  %194 = load i64, ptr %193, align 8, !tbaa !8
  %195 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %194
  store i64 3, ptr %195, align 8, !tbaa !8
  %196 = add nsw i64 %.0100174, 3
  %197 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %196
  %198 = load i64, ptr %197, align 8, !tbaa !8
  %199 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %198
  store i64 3, ptr %199, align 8, !tbaa !8
  %200 = add nsw i64 %.0100174, 4
  %exitcond188.not.3 = icmp eq i64 %200, %.0107.lcssa200
  br i1 %exitcond188.not.3, label %.preheader133, label %.lr.ph175, !llvm.loop !24

.preheader132:                                    ; preds = %.lr.ph177.prol.loopexit, %.lr.ph177, %.preheader133
  %201 = icmp slt i64 %.0106.lcssa201, %152
  br i1 %201, label %.lr.ph179.preheader, label %.preheader

.lr.ph179.preheader:                              ; preds = %.preheader132
  %202 = sub i64 %152, %.0106.lcssa201
  %xtraiter218 = and i64 %202, 3
  %lcmp.mod219.not = icmp eq i64 %xtraiter218, 0
  br i1 %lcmp.mod219.not, label %.lr.ph179.prol.loopexit, label %.lr.ph179.prol

.lr.ph179.prol:                                   ; preds = %.lr.ph179.preheader, %.lr.ph179.prol
  %.098178.prol = phi i64 [ %206, %.lr.ph179.prol ], [ %.0106.lcssa201, %.lr.ph179.preheader ]
  %prol.iter220 = phi i64 [ %prol.iter220.next, %.lr.ph179.prol ], [ 0, %.lr.ph179.preheader ]
  %203 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.098178.prol
  %204 = load i64, ptr %203, align 8, !tbaa !8
  %205 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %204
  store i64 1, ptr %205, align 8, !tbaa !8
  %206 = add nsw i64 %.098178.prol, 1
  %prol.iter220.next = add i64 %prol.iter220, 1
  %prol.iter220.cmp.not = icmp eq i64 %prol.iter220.next, %xtraiter218
  br i1 %prol.iter220.cmp.not, label %.lr.ph179.prol.loopexit, label %.lr.ph179.prol, !llvm.loop !25

.lr.ph179.prol.loopexit:                          ; preds = %.lr.ph179.prol, %.lr.ph179.preheader
  %.098178.unr = phi i64 [ %.0106.lcssa201, %.lr.ph179.preheader ], [ %206, %.lr.ph179.prol ]
  %207 = sub i64 %.0106.lcssa201, %152
  %208 = icmp ugt i64 %207, -4
  br i1 %208, label %.preheader, label %.lr.ph179

.lr.ph177:                                        ; preds = %.lr.ph177.prol.loopexit, %.lr.ph177
  %.099176 = phi i64 [ %224, %.lr.ph177 ], [ %.099176.unr, %.lr.ph177.prol.loopexit ]
  %209 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.099176
  %210 = load i64, ptr %209, align 8, !tbaa !8
  %211 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %210
  store i64 2, ptr %211, align 8, !tbaa !8
  %212 = add nsw i64 %.099176, 1
  %213 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %212
  %214 = load i64, ptr %213, align 8, !tbaa !8
  %215 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %214
  store i64 2, ptr %215, align 8, !tbaa !8
  %216 = add nsw i64 %.099176, 2
  %217 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !8
  %219 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %218
  store i64 2, ptr %219, align 8, !tbaa !8
  %220 = add nsw i64 %.099176, 3
  %221 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %220
  %222 = load i64, ptr %221, align 8, !tbaa !8
  %223 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %222
  store i64 2, ptr %223, align 8, !tbaa !8
  %224 = add nsw i64 %.099176, 4
  %exitcond189.not.3 = icmp eq i64 %224, %.0106.lcssa201
  br i1 %exitcond189.not.3, label %.preheader132, label %.lr.ph177, !llvm.loop !26

.preheader:                                       ; preds = %.lr.ph179.prol.loopexit, %.lr.ph179, %.preheader132
  %225 = icmp sgt i64 %152, 0
  br i1 %225, label %.lr.ph181, label %._crit_edge182

.lr.ph179:                                        ; preds = %.lr.ph179.prol.loopexit, %.lr.ph179
  %.098178 = phi i64 [ %241, %.lr.ph179 ], [ %.098178.unr, %.lr.ph179.prol.loopexit ]
  %226 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %.098178
  %227 = load i64, ptr %226, align 8, !tbaa !8
  %228 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %227
  store i64 1, ptr %228, align 8, !tbaa !8
  %229 = add nsw i64 %.098178, 1
  %230 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %229
  %231 = load i64, ptr %230, align 8, !tbaa !8
  %232 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %231
  store i64 1, ptr %232, align 8, !tbaa !8
  %233 = add nsw i64 %.098178, 2
  %234 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %233
  %235 = load i64, ptr %234, align 8, !tbaa !8
  %236 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %235
  store i64 1, ptr %236, align 8, !tbaa !8
  %237 = add nsw i64 %.098178, 3
  %238 = getelementptr inbounds [3000 x i64], ptr @I, i64 0, i64 %237
  %239 = load i64, ptr %238, align 8, !tbaa !8
  %240 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %239
  store i64 1, ptr %240, align 8, !tbaa !8
  %241 = add nsw i64 %.098178, 4
  %exitcond190.not.3 = icmp eq i64 %241, %152
  br i1 %exitcond190.not.3, label %.preheader, label %.lr.ph179, !llvm.loop !27

._crit_edge182:                                   ; preds = %.lr.ph181, %.preheader
  %242 = 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)
  ret i32 0

.lr.ph181:                                        ; preds = %.preheader, %.lr.ph181
  %.0180 = phi i64 [ %247, %.lr.ph181 ], [ 0, %.preheader ]
  %243 = getelementptr inbounds [3000 x i64], ptr @ans, i64 0, i64 %.0180
  %244 = load i64, ptr %243, align 8, !tbaa !8
  %245 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %244)
  %246 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %245, i8 noundef signext 32)
  %247 = add nuw nsw i64 %.0180, 1
  %248 = load i64, ptr @N, align 8, !tbaa !8
  %249 = icmp slt i64 %247, %248
  br i1 %249, label %.lr.ph181, label %._crit_edge182, !llvm.loop !28
}

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #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 = { 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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}


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