; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/1230 (ABC005_D)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@P = external dso_local global [2510 x i32], align 16
@T = external dso_local global [2510 x i32], align 16
@imos = external dso_local global [60 x [60 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sumiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %21 = load i32, ptr @N, align 4, !tbaa !5
  %22 = load i32, ptr @N, align 4, !tbaa !5
  %23 = mul nsw i32 %21, %22
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @imos, i64 %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @imos, ptr noundef %25, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %49, %0
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = load i32, ptr @N, align 4, !tbaa !5
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

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

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

32:                                               ; preds = %45, %31
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = load i32, ptr @N, align 4, !tbaa !5
  %35 = icmp sle i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %48

37:                                               ; preds = %32
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %39
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [60 x i32], ptr %40, i64 0, i64 %42
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %43)
  br label %45

45:                                               ; preds = %37
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !5
  br label %32, !llvm.loop !9

48:                                               ; preds = %36
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %3, align 4, !tbaa !5
  br label %26, !llvm.loop !11

52:                                               ; preds = %30
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %64, %52
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = load i32, ptr @Q, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

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

59:                                               ; preds = %54
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [2510 x i32], ptr @P, i64 0, i64 %61
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %62)
  br label %64

64:                                               ; preds = %59
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %6, align 4, !tbaa !5
  br label %54, !llvm.loop !12

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

68:                                               ; preds = %100, %67
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr @N, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

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

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

74:                                               ; preds = %96, %73
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = load i32, ptr @N, align 4, !tbaa !5
  %77 = icmp sle i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %99

79:                                               ; preds = %74
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %81
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [60 x i32], ptr %82, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %89
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [60 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = add nsw i32 %94, %87
  store i32 %95, ptr %93, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %79
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %8, align 4, !tbaa !5
  br label %74, !llvm.loop !13

99:                                               ; preds = %78
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %7, align 4, !tbaa !5
  br label %68, !llvm.loop !14

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

104:                                              ; preds = %136, %103
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = load i32, ptr @N, align 4, !tbaa !5
  %107 = icmp sle i32 %105, %106
  br i1 %107, label %109, label %108

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

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

110:                                              ; preds = %132, %109
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = load i32, ptr @N, align 4, !tbaa !5
  %113 = icmp sle i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %135

115:                                              ; preds = %110
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %118
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [60 x i32], ptr %119, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %125
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [60 x i32], ptr %126, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = add nsw i32 %130, %123
  store i32 %131, ptr %129, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %115
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %10, align 4, !tbaa !5
  br label %110, !llvm.loop !15

135:                                              ; preds = %114
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %9, align 4, !tbaa !5
  br label %104, !llvm.loop !16

139:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @T, ptr noundef getelementptr inbounds (i32, ptr @T, i64 2510), ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %200, %139
  %141 = load i32, ptr %13, align 4, !tbaa !5
  %142 = load i32, ptr @N, align 4, !tbaa !5
  %143 = icmp sle i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 23, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %203

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

146:                                              ; preds = %196, %145
  %147 = load i32, ptr %14, align 4, !tbaa !5
  %148 = load i32, ptr @N, align 4, !tbaa !5
  %149 = icmp sle i32 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %199

151:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %152 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %152, ptr %15, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %192, %151
  %154 = load i32, ptr %15, align 4, !tbaa !5
  %155 = load i32, ptr @N, align 4, !tbaa !5
  %156 = icmp sle i32 %154, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %153
  store i32 29, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %195

158:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %159 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %159, ptr %16, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %188, %158
  %161 = load i32, ptr %16, align 4, !tbaa !5
  %162 = load i32, ptr @N, align 4, !tbaa !5
  %163 = icmp sle i32 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i32 32, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %191

165:                                              ; preds = %160
  %166 = load i32, ptr %15, align 4, !tbaa !5
  %167 = load i32, ptr %13, align 4, !tbaa !5
  %168 = sub nsw i32 %166, %167
  %169 = add nsw i32 %168, 1
  %170 = load i32, ptr %16, align 4, !tbaa !5
  %171 = load i32, ptr %14, align 4, !tbaa !5
  %172 = sub nsw i32 %170, %171
  %173 = add nsw i32 %172, 1
  %174 = mul nsw i32 %169, %173
  store i32 %174, ptr %12, align 4, !tbaa !5
  %175 = load i32, ptr %12, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %178 = load i32, ptr %13, align 4, !tbaa !5
  %179 = load i32, ptr %14, align 4, !tbaa !5
  %180 = load i32, ptr %15, align 4, !tbaa !5
  %181 = load i32, ptr %16, align 4, !tbaa !5
  %182 = call noundef i32 @_Z3sumiiii(i32 noundef %178, i32 noundef %179, i32 noundef %180, i32 noundef %181)
  store i32 %182, ptr %17, align 4, !tbaa !5
  %183 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %177, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = load i32, ptr %12, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %186
  store i32 %184, ptr %187, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %188

188:                                              ; preds = %165
  %189 = load i32, ptr %16, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %16, align 4, !tbaa !5
  br label %160, !llvm.loop !17

191:                                              ; preds = %164
  br label %192

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

195:                                              ; preds = %157
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %14, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %14, align 4, !tbaa !5
  br label %146, !llvm.loop !19

199:                                              ; preds = %150
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %13, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %13, align 4, !tbaa !5
  br label %140, !llvm.loop !20

203:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %225, %203
  %205 = load i32, ptr %18, align 4, !tbaa !5
  %206 = load i32, ptr @N, align 4, !tbaa !5
  %207 = load i32, ptr @N, align 4, !tbaa !5
  %208 = mul nsw i32 %206, %207
  %209 = icmp slt i32 %205, %208
  br i1 %209, label %211, label %210

210:                                              ; preds = %204
  store i32 35, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %228

211:                                              ; preds = %204
  %212 = load i32, ptr %18, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %214
  %216 = load i32, ptr %18, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %217
  %219 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %215, ptr noundef nonnull align 4 dereferenceable(4) %218)
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = load i32, ptr %18, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %223
  store i32 %220, ptr %224, align 4, !tbaa !5
  br label %225

225:                                              ; preds = %211
  %226 = load i32, ptr %18, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %18, align 4, !tbaa !5
  br label %204, !llvm.loop !21

228:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %229

229:                                              ; preds = %244, %228
  %230 = load i32, ptr %19, align 4, !tbaa !5
  %231 = load i32, ptr @Q, align 4, !tbaa !5
  %232 = icmp slt i32 %230, %231
  br i1 %232, label %234, label %233

233:                                              ; preds = %229
  store i32 38, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %247

234:                                              ; preds = %229
  %235 = load i32, ptr %19, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [2510 x i32], ptr @P, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %241)
  %243 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %242, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %244

244:                                              ; preds = %234
  %245 = load i32, ptr %19, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %19, align 4, !tbaa !5
  br label %229, !llvm.loop !22

247:                                              ; preds = %233
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %248 = load i32, ptr %1, align 4
  ret i32 %248
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #3

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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


; 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 i32, align 4
@Q = external dso_local global i32, align 4
@P = external dso_local global [2510 x i32], align 16
@T = external dso_local global [2510 x i32], align 16
@imos = external dso_local global [60 x [60 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %5 = load i32, ptr @N, align 4, !tbaa !5
  %6 = mul nsw i32 %5, %5
  %7 = zext nneg i32 %6 to i64
  %8 = getelementptr inbounds i32, ptr @imos, i64 %7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @imos, ptr noundef nonnull %8, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %9 = load i32, ptr @N, align 4, !tbaa !5
  %.not86 = icmp slt i32 %9, 1
  br i1 %.not86, label %._crit_edge88, label %.preheader83

.preheader83:                                     ; preds = %0, %._crit_edge
  %10 = phi i32 [ %14, %._crit_edge ], [ %9, %0 ]
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %._crit_edge ], [ 1, %0 ]
  %.not7484 = icmp slt i32 %10, 1
  br i1 %.not7484, label %.preheader83.._crit_edge_crit_edge, label %.lr.ph

.preheader83.._crit_edge_crit_edge:               ; preds = %.preheader83
  %.pre176 = sext i32 %10 to i64
  br label %._crit_edge

._crit_edge88:                                    ; preds = %._crit_edge, %0
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  %12 = load i32, ptr @Q, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph91, label %.preheader82

._crit_edge:                                      ; preds = %.lr.ph, %.preheader83.._crit_edge_crit_edge
  %.pre-phi177 = phi i64 [ %.pre176, %.preheader83.._crit_edge_crit_edge ], [ %18, %.lr.ph ]
  %14 = phi i32 [ %10, %.preheader83.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %.not.not = icmp slt i64 %indvars.iv130, %.pre-phi177
  br i1 %.not.not, label %.preheader83, label %._crit_edge88, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader83, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader83 ]
  %15 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %indvars.iv130, i64 %indvars.iv
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr @N, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %.not74.not = icmp slt i64 %indvars.iv, %18
  br i1 %.not74.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

.preheader82:                                     ; preds = %.lr.ph91, %._crit_edge88
  %19 = load i32, ptr @N, align 4, !tbaa !5
  %.not6696 = icmp slt i32 %19, 1
  br i1 %.not6696, label %._crit_edge104, label %.preheader81.preheader

.preheader81.preheader:                           ; preds = %.preheader82
  %20 = add nuw i32 %19, 1
  %wide.trip.count142 = zext i32 %20 to i64
  %21 = zext nneg i32 %19 to i64
  %22 = add nsw i64 %wide.trip.count142, -2
  %xtraiter = and i64 %21, 3
  %23 = icmp ult i64 %22, 3
  %unroll_iter = and i64 %21, 2147483644
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader81

.lr.ph91:                                         ; preds = %._crit_edge88, %.lr.ph91
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %.lr.ph91 ], [ 0, %._crit_edge88 ]
  %24 = getelementptr inbounds [2510 x i32], ptr @P, i64 0, i64 %indvars.iv133
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %26 = load i32, ptr @Q, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next134, %27
  br i1 %28, label %.lr.ph91, label %.preheader82, !llvm.loop !13

.preheader81:                                     ; preds = %.preheader81.preheader, %._crit_edge95
  %indvars.iv139 = phi i64 [ 1, %.preheader81.preheader ], [ %indvars.iv.next140, %._crit_edge95 ]
  %.phi.trans.insert = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %indvars.iv139, i64 0
  %.pre = load i32, ptr %.phi.trans.insert, align 16, !tbaa !5
  br i1 %23, label %._crit_edge95.unr-lcssa, label %.preheader81.new

.preheader80:                                     ; preds = %._crit_edge95
  br i1 %.not6696, label %._crit_edge104, label %.preheader79.preheader

.preheader79.preheader:                           ; preds = %.preheader80
  %29 = add nuw i32 %19, 1
  %wide.trip.count152 = zext i32 %29 to i64
  %30 = zext nneg i32 %19 to i64
  %min.iters.check = icmp ult i32 %19, 4
  %n.vec = and i64 %30, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  %cmp.n = icmp eq i64 %n.vec, %30
  br label %.preheader79

._crit_edge95.unr-lcssa:                          ; preds = %.preheader81.new, %.preheader81
  %.unr = phi i32 [ %.pre, %.preheader81 ], [ %47, %.preheader81.new ]
  %indvars.iv136.unr = phi i64 [ 1, %.preheader81 ], [ %indvars.iv.next137.3, %.preheader81.new ]
  br i1 %lcmp.mod.not, label %._crit_edge95, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge95.unr-lcssa, %.epil.preheader
  %31 = phi i32 [ %34, %.epil.preheader ], [ %.unr, %._crit_edge95.unr-lcssa ]
  %indvars.iv136.epil = phi i64 [ %indvars.iv.next137.epil, %.epil.preheader ], [ %indvars.iv136.unr, %._crit_edge95.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge95.unr-lcssa ]
  %32 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %indvars.iv139, i64 %indvars.iv136.epil
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = add nsw i32 %33, %31
  store i32 %34, ptr %32, align 4, !tbaa !5
  %indvars.iv.next137.epil = add nuw nsw i64 %indvars.iv136.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_edge95, label %.epil.preheader, !llvm.loop !14

._crit_edge95:                                    ; preds = %.epil.preheader, %._crit_edge95.unr-lcssa
  %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
  %exitcond143.not = icmp eq i64 %indvars.iv.next140, %wide.trip.count142
  br i1 %exitcond143.not, label %.preheader80, label %.preheader81, !llvm.loop !16

.preheader81.new:                                 ; preds = %.preheader81, %.preheader81.new
  %35 = phi i32 [ %47, %.preheader81.new ], [ %.pre, %.preheader81 ]
  %indvars.iv136 = phi i64 [ %indvars.iv.next137.3, %.preheader81.new ], [ 1, %.preheader81 ]
  %niter = phi i64 [ %niter.next.3, %.preheader81.new ], [ 0, %.preheader81 ]
  %36 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %indvars.iv139, i64 %indvars.iv136
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, %35
  store i32 %38, ptr %36, align 4, !tbaa !5
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %39 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %indvars.iv139, i64 %indvars.iv.next137
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = add nsw i32 %40, %38
  store i32 %41, ptr %39, align 4, !tbaa !5
  %indvars.iv.next137.1 = add nuw nsw i64 %indvars.iv136, 2
  %42 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %indvars.iv139, i64 %indvars.iv.next137.1
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %43, %41
  store i32 %44, ptr %42, align 4, !tbaa !5
  %indvars.iv.next137.2 = add nuw nsw i64 %indvars.iv136, 3
  %45 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %indvars.iv139, i64 %indvars.iv.next137.2
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = add nsw i32 %46, %44
  store i32 %47, ptr %45, align 4, !tbaa !5
  %indvars.iv.next137.3 = add nuw nsw i64 %indvars.iv136, 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_edge95.unr-lcssa, label %.preheader81.new, !llvm.loop !17

.preheader79:                                     ; preds = %.preheader79.preheader, %._crit_edge101
  %indvars.iv149 = phi i64 [ 1, %.preheader79.preheader ], [ %indvars.iv.next150, %._crit_edge101 ]
  %48 = add nsw i64 %indvars.iv149, -1
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader79
  %indvars.iv144.ph = phi i64 [ 1, %.preheader79 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.body:                                      ; preds = %.preheader79, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader79 ]
  %offset.idx = or disjoint i64 %index, 1
  %49 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %48, i64 %offset.idx
  %wide.load = load <4 x i32>, ptr %49, align 4, !tbaa !5
  %50 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %indvars.iv149, i64 %offset.idx
  %wide.load194 = load <4 x i32>, ptr %50, align 4, !tbaa !5
  %51 = add nsw <4 x i32> %wide.load194, %wide.load
  store <4 x i32> %51, ptr %50, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %52 = icmp eq i64 %index.next, %n.vec
  br i1 %52, label %middle.block, label %vector.body, !llvm.loop !18

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

._crit_edge104:                                   ; preds = %._crit_edge101, %.preheader82, %.preheader80
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @T, ptr noundef nonnull getelementptr inbounds (i8, ptr @T, i64 10040), ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %53 = load i32, ptr @N, align 4, !tbaa !5
  %.not68116 = icmp slt i32 %53, 1
  br i1 %.not68116, label %.preheader75, label %.preheader78

._crit_edge101:                                   ; preds = %scalar.ph, %middle.block
  %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
  %exitcond153.not = icmp eq i64 %indvars.iv.next150, %wide.trip.count152
  br i1 %exitcond153.not, label %._crit_edge104, label %.preheader79, !llvm.loop !21

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv144 = phi i64 [ %indvars.iv.next145, %scalar.ph ], [ %indvars.iv144.ph, %scalar.ph.preheader ]
  %54 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %48, i64 %indvars.iv144
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds [60 x [60 x i32]], ptr @imos, i64 0, i64 %indvars.iv149, i64 %indvars.iv144
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, %55
  store i32 %58, ptr %56, align 4, !tbaa !5
  %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
  %exitcond148.not = icmp eq i64 %indvars.iv.next145, %wide.trip.count152
  br i1 %exitcond148.not, label %._crit_edge101, label %scalar.ph, !llvm.loop !22

.preheader78:                                     ; preds = %._crit_edge104, %._crit_edge115
  %59 = phi i32 [ %69, %._crit_edge115 ], [ %53, %._crit_edge104 ]
  %indvars.iv160 = phi i64 [ %indvars.iv.next161, %._crit_edge115 ], [ 1, %._crit_edge104 ]
  %.not69112 = icmp slt i32 %59, 1
  %60 = zext nneg i32 %59 to i64
  %61 = icmp ugt i64 %indvars.iv160, %60
  %or.cond = select i1 %.not69112, i1 true, i1 %61
  br i1 %or.cond, label %._crit_edge115, label %.preheader77.preheader

.preheader77.preheader:                           ; preds = %.preheader78
  %62 = trunc nuw nsw i64 %indvars.iv160 to i32
  br label %.preheader77

.preheader75:                                     ; preds = %._crit_edge115, %._crit_edge104
  %63 = phi i32 [ %53, %._crit_edge104 ], [ %69, %._crit_edge115 ]
  %.not = icmp eq i32 %63, 0
  br i1 %.not, label %.preheader, label %.lr.ph120

.preheader77:                                     ; preds = %.preheader77.preheader, %._crit_edge111
  %64 = phi i32 [ %59, %.preheader77.preheader ], [ %78, %._crit_edge111 ]
  %65 = phi i32 [ %59, %.preheader77.preheader ], [ %79, %._crit_edge111 ]
  %indvars.iv154 = phi i64 [ 1, %.preheader77.preheader ], [ %indvars.iv.next155, %._crit_edge111 ]
  %66 = sext i32 %65 to i64
  %.not70109 = icmp sgt i64 %indvars.iv160, %66
  %67 = icmp sgt i64 %indvars.iv154, %66
  %or.cond186 = select i1 %.not70109, i1 true, i1 %67
  br i1 %or.cond186, label %._crit_edge111, label %.preheader76.preheader

.preheader76.preheader:                           ; preds = %.preheader77
  %68 = trunc nuw nsw i64 %indvars.iv154 to i32
  br label %.preheader76

._crit_edge115:                                   ; preds = %._crit_edge111, %.preheader78
  %69 = phi i32 [ %59, %.preheader78 ], [ %78, %._crit_edge111 ]
  %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
  %70 = sext i32 %69 to i64
  %.not68.not = icmp slt i64 %indvars.iv160, %70
  br i1 %.not68.not, label %.preheader78, label %.preheader75, !llvm.loop !23

.preheader76:                                     ; preds = %.preheader76.preheader, %._crit_edge108
  %71 = phi i32 [ %64, %.preheader76.preheader ], [ %80, %._crit_edge108 ]
  %72 = phi i32 [ %65, %.preheader76.preheader ], [ %81, %._crit_edge108 ]
  %73 = phi i32 [ %65, %.preheader76.preheader ], [ %82, %._crit_edge108 ]
  %indvars.iv162 = phi i64 [ %indvars.iv160, %.preheader76.preheader ], [ %indvars.iv.next163, %._crit_edge108 ]
  %74 = sext i32 %73 to i64
  %.not71105 = icmp sgt i64 %indvars.iv154, %74
  br i1 %.not71105, label %._crit_edge108, label %.lr.ph107

.lr.ph107:                                        ; preds = %.preheader76
  %75 = sub nuw nsw i64 %indvars.iv162, %indvars.iv160
  %76 = add nuw nsw i64 %75, 1
  %77 = trunc nuw nsw i64 %indvars.iv162 to i32
  br label %83

._crit_edge111.loopexit125:                       ; preds = %._crit_edge108
  %.pre174 = sext i32 %81 to i64
  br label %._crit_edge111

._crit_edge111:                                   ; preds = %._crit_edge111.loopexit125, %.preheader77
  %.pre-phi = phi i64 [ %.pre174, %._crit_edge111.loopexit125 ], [ %66, %.preheader77 ]
  %78 = phi i32 [ %80, %._crit_edge111.loopexit125 ], [ %64, %.preheader77 ]
  %79 = phi i32 [ %81, %._crit_edge111.loopexit125 ], [ %65, %.preheader77 ]
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %.not69.not = icmp slt i64 %indvars.iv154, %.pre-phi
  br i1 %.not69.not, label %.preheader77, label %._crit_edge115, !llvm.loop !24

._crit_edge108:                                   ; preds = %83, %.preheader76
  %.pre-phi175 = phi i64 [ %74, %.preheader76 ], [ %93, %83 ]
  %80 = phi i32 [ %71, %.preheader76 ], [ %92, %83 ]
  %81 = phi i32 [ %72, %.preheader76 ], [ %92, %83 ]
  %82 = phi i32 [ %73, %.preheader76 ], [ %92, %83 ]
  %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
  %.not70.not = icmp slt i64 %indvars.iv162, %.pre-phi175
  br i1 %.not70.not, label %.preheader76, label %._crit_edge111.loopexit125, !llvm.loop !25

83:                                               ; preds = %.lr.ph107, %83
  %indvars.iv156 = phi i64 [ %indvars.iv154, %.lr.ph107 ], [ %indvars.iv.next157, %83 ]
  %84 = sub nuw nsw i64 %indvars.iv156, %indvars.iv154
  %85 = add nuw nsw i64 %84, 1
  %86 = mul nuw nsw i64 %85, %76
  %87 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %86
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %88 = trunc nuw nsw i64 %indvars.iv156 to i32
  %89 = call noundef i32 @_Z3sumiiii(i32 noundef %62, i32 noundef %68, i32 noundef %77, i32 noundef %88)
  store i32 %89, ptr %3, align 4, !tbaa !5
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %87, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %91 = load i32, ptr %90, align 4, !tbaa !5
  store i32 %91, ptr %87, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
  %92 = load i32, ptr @N, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %.not71.not = icmp slt i64 %indvars.iv156, %93
  br i1 %.not71.not, label %83, label %._crit_edge108, !llvm.loop !26

.preheader:                                       ; preds = %.lr.ph120, %.preheader75
  %94 = load i32, ptr @Q, align 4, !tbaa !5
  %95 = icmp sgt i32 %94, 0
  br i1 %95, label %.lr.ph122, label %._crit_edge123

.lr.ph120:                                        ; preds = %.preheader75, %.lr.ph120
  %indvars.iv168 = phi i64 [ %indvars.iv.next169, %.lr.ph120 ], [ 0, %.preheader75 ]
  %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
  %96 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %indvars.iv.next169
  %97 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %indvars.iv168
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %96, ptr noundef nonnull align 4 dereferenceable(4) %97)
  %99 = load i32, ptr %98, align 4, !tbaa !5
  store i32 %99, ptr %96, align 4, !tbaa !5
  %100 = load i32, ptr @N, align 4, !tbaa !5
  %101 = mul nsw i32 %100, %100
  %102 = zext nneg i32 %101 to i64
  %103 = icmp ult i64 %indvars.iv.next169, %102
  br i1 %103, label %.lr.ph120, label %.preheader, !llvm.loop !27

._crit_edge123:                                   ; preds = %.lr.ph122, %.preheader
  ret i32 0

.lr.ph122:                                        ; preds = %.preheader, %.lr.ph122
  %indvars.iv171 = phi i64 [ %indvars.iv.next172, %.lr.ph122 ], [ 0, %.preheader ]
  %104 = getelementptr inbounds [2510 x i32], ptr @P, i64 0, i64 %indvars.iv171
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [2510 x i32], ptr @T, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %108)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
  %111 = load i32, ptr @Q, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = icmp slt i64 %indvars.iv.next172, %112
  br i1 %113, label %.lr.ph122, label %._crit_edge123, !llvm.loop !28
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !20, !19}
!23 = distinct !{!23, !10, !11}
!24 = distinct !{!24, !10, !11}
!25 = distinct !{!25, !10, !11}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}


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