; LLVM IR from tangjz/acm-icpc :: lydsy (1255)

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

%struct.Info = type { i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sum = external dso_local global [53 x [53 x i32]], align 16
@ans = external dso_local global i32, align 4
@mat = external dso_local global [53 x [53 x %struct.Info]], align 16
@row = external dso_local global [53 x %struct.Info], align 16
@tmp = external dso_local global %struct.Info, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

18:                                               ; preds = %340, %0
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %20 = icmp eq i32 %19, 2
  br i1 %20, label %21, label %343

21:                                               ; preds = %18
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = load i32, ptr @m, align 4, !tbaa !5
  %24 = mul nsw i32 %22, %23
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) @row)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %125, %21
  %27 = load i32, ptr %4, 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 4, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %128

31:                                               ; preds = %26
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = sub nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %34
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %37
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %38, ptr align 16 %35, i64 16, i1 false), !tbaa.struct !9
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %40
  %42 = getelementptr inbounds [53 x %struct.Info], ptr %41, i64 0, i64 0
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) %42)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %114, %31
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %7)
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %51
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [53 x i32], ptr %52, i64 0, i64 %54
  store i32 0, ptr %55, align 4, !tbaa !5
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [53 x %struct.Info], ptr %58, i64 0, i64 %60
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) %61)
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = icmp eq i32 %62, 1
  br i1 %63, label %64, label %73

64:                                               ; preds = %48
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %66
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [53 x i32], ptr %67, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %70, align 4, !tbaa !5
  br label %97

73:                                               ; preds = %48
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 2
  br i1 %75, label %76, label %96

76:                                               ; preds = %73
  %77 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %77, ptr %2, align 4, !tbaa !5
  %78 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %78, ptr %3, align 4, !tbaa !5
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %80
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [53 x %struct.Info], ptr %81, i64 0, i64 %83
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = load i32, ptr %6, align 4, !tbaa !5
  call void @_ZN4Info6assignEii(ptr noundef nonnull align 4 dereferenceable(16) %84, i32 noundef %85, i32 noundef %86)
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %88
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %91
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [53 x %struct.Info], ptr %92, i64 0, i64 %94
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %89, ptr noundef nonnull align 4 dereferenceable(16) %95)
  br label %96

96:                                               ; preds = %76, %73
  br label %97

97:                                               ; preds = %96, %64
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %99
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [53 x i32], ptr %100, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %107
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [53 x i32], ptr %108, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = add nsw i32 %112, %105
  store i32 %113, ptr %111, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %114

114:                                              ; preds = %97
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %6, align 4, !tbaa !5
  br label %43, !llvm.loop !10

117:                                              ; preds = %47
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %119
  %121 = load i32, ptr @m, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [53 x %struct.Info], ptr %120, i64 0, i64 %123
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) %124)
  br label %125

125:                                              ; preds = %117
  %126 = load i32, ptr %4, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %4, align 4, !tbaa !5
  br label %26, !llvm.loop !12

128:                                              ; preds = %30
  %129 = load i32, ptr %2, align 4, !tbaa !5
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %132, label %131

131:                                              ; preds = %128
  store i32 0, ptr @ans, align 4, !tbaa !5
  br label %132

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

133:                                              ; preds = %165, %132
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = load i32, ptr %2, align 4, !tbaa !5
  %136 = icmp sle i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %168

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

139:                                              ; preds = %161, %138
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = load i32, ptr @m, align 4, !tbaa !5
  %142 = icmp sle i32 %140, %141
  br i1 %142, label %144, label %143

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

144:                                              ; preds = %139
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = sub nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %147
  %149 = load i32, ptr %9, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [53 x i32], ptr %148, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %154
  %156 = load i32, ptr %9, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [53 x i32], ptr %155, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = add nsw i32 %159, %152
  store i32 %160, ptr %158, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %144
  %162 = load i32, ptr %9, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %9, align 4, !tbaa !5
  br label %139, !llvm.loop !13

164:                                              ; preds = %143
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %8, align 4, !tbaa !5
  br label %133, !llvm.loop !14

168:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %169 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %169, ptr %10, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %328, %168
  %171 = load i32, ptr %10, align 4, !tbaa !5
  %172 = icmp sge i32 %171, 1
  br i1 %172, label %174, label %173

173:                                              ; preds = %170
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %331

174:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 2, ptr %11, align 4, !tbaa !5
  br label %175

175:                                              ; preds = %194, %174
  %176 = load i32, ptr %11, align 4, !tbaa !5
  %177 = load i32, ptr %3, align 4, !tbaa !5
  %178 = icmp slt i32 %176, %177
  br i1 %178, label %180, label %179

179:                                              ; preds = %175
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %197

180:                                              ; preds = %175
  %181 = load i32, ptr %10, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %182
  %184 = load i32, ptr %11, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [53 x %struct.Info], ptr %183, i64 0, i64 %185
  %187 = load i32, ptr %10, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %188
  %190 = load i32, ptr %11, align 4, !tbaa !5
  %191 = sub nsw i32 %190, 1
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [53 x %struct.Info], ptr %189, i64 0, i64 %192
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %186, ptr noundef nonnull align 4 dereferenceable(16) %193)
  br label %194

194:                                              ; preds = %180
  %195 = load i32, ptr %11, align 4, !tbaa !5
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %11, align 4, !tbaa !5
  br label %175, !llvm.loop !15

197:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %198 = load i32, ptr @m, align 4, !tbaa !5
  %199 = sub nsw i32 %198, 1
  store i32 %199, ptr %12, align 4, !tbaa !5
  br label %200

200:                                              ; preds = %219, %197
  %201 = load i32, ptr %12, align 4, !tbaa !5
  %202 = load i32, ptr %3, align 4, !tbaa !5
  %203 = icmp sgt i32 %201, %202
  br i1 %203, label %205, label %204

204:                                              ; preds = %200
  store i32 22, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %222

205:                                              ; preds = %200
  %206 = load i32, ptr %10, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %207
  %209 = load i32, ptr %12, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [53 x %struct.Info], ptr %208, i64 0, i64 %210
  %212 = load i32, ptr %10, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %213
  %215 = load i32, ptr %12, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [53 x %struct.Info], ptr %214, i64 0, i64 %217
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %211, ptr noundef nonnull align 4 dereferenceable(16) %218)
  br label %219

219:                                              ; preds = %205
  %220 = load i32, ptr %12, align 4, !tbaa !5
  %221 = add nsw i32 %220, -1
  store i32 %221, ptr %12, align 4, !tbaa !5
  br label %200, !llvm.loop !16

222:                                              ; preds = %204
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %223 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %223, ptr %13, align 4, !tbaa !5
  br label %224

224:                                              ; preds = %301, %222
  %225 = load i32, ptr %13, align 4, !tbaa !5
  %226 = icmp sge i32 %225, 1
  br i1 %226, label %228, label %227

227:                                              ; preds = %224
  store i32 25, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %304

228:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %229 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %229, ptr %14, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %296, %228
  %231 = load i32, ptr %14, align 4, !tbaa !5
  %232 = load i32, ptr @m, align 4, !tbaa !5
  %233 = icmp sle i32 %231, %232
  br i1 %233, label %235, label %234

234:                                              ; preds = %230
  store i32 28, ptr %5, align 4
  br label %299

235:                                              ; preds = %230
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  %236 = getelementptr inbounds %struct.Info, ptr %15, i32 0, i32 0
  %237 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %237, ptr %236, align 4, !tbaa !17
  %238 = getelementptr inbounds %struct.Info, ptr %15, i32 0, i32 1
  %239 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %239, ptr %238, align 4, !tbaa !19
  %240 = getelementptr inbounds %struct.Info, ptr %15, i32 0, i32 2
  %241 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %241, ptr %240, align 4, !tbaa !20
  %242 = getelementptr inbounds %struct.Info, ptr %15, i32 0, i32 3
  %243 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %243, ptr %242, align 4, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @tmp, ptr align 4 %15, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %244 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  store i32 %244, ptr %16, align 4, !tbaa !5
  %245 = load i32, ptr %16, align 4, !tbaa !5
  %246 = load i32, ptr @ans, align 4, !tbaa !5
  %247 = icmp sge i32 %245, %246
  br i1 %247, label %248, label %249

248:                                              ; preds = %235
  store i32 28, ptr %5, align 4
  br label %293

249:                                              ; preds = %235
  %250 = call noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %250, label %252, label %251

251:                                              ; preds = %249
  store i32 30, ptr %5, align 4
  br label %293

252:                                              ; preds = %249
  %253 = load i32, ptr %10, align 4, !tbaa !5
  %254 = sub nsw i32 %253, 1
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %255
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @tmp, ptr align 16 %256, i64 16, i1 false), !tbaa.struct !9
  %257 = load i32, ptr %10, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %258
  %260 = load i32, ptr %13, align 4, !tbaa !5
  %261 = sub nsw i32 %260, 1
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [53 x %struct.Info], ptr %259, i64 0, i64 %262
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) @tmp, ptr noundef nonnull align 4 dereferenceable(16) %263)
  %264 = load i32, ptr %10, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %265
  %267 = load i32, ptr %14, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [53 x %struct.Info], ptr %266, i64 0, i64 %269
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) @tmp, ptr noundef nonnull align 4 dereferenceable(16) %270)
  %271 = call noundef zeroext i1 @_ZNK4Info5emptyEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %271, label %272, label %274

272:                                              ; preds = %252
  %273 = load i32, ptr %16, align 4, !tbaa !5
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %273)
  br label %292

274:                                              ; preds = %252
  %275 = call noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %275, label %276, label %291

276:                                              ; preds = %274
  %277 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %278 = load i32, ptr %16, align 4, !tbaa !5
  %279 = add nsw i32 %278, %277
  store i32 %279, ptr %16, align 4, !tbaa !5
  %280 = load i32, ptr %10, align 4, !tbaa !5
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) @tmp, i32 noundef %280)
  %281 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (%struct.Info, ptr @tmp, i32 0, i32 1), i32 noundef %281)
  %282 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (%struct.Info, ptr @tmp, i32 0, i32 2), i32 noundef %282)
  %283 = load i32, ptr %14, align 4, !tbaa !5
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (%struct.Info, ptr @tmp, i32 0, i32 3), i32 noundef %283)
  %284 = call noundef zeroext i1 @_ZNK4Info5emptyEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %284, label %289, label %285

285:                                              ; preds = %276
  %286 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %287 = load i32, ptr %16, align 4, !tbaa !5
  %288 = sub nsw i32 %287, %286
  store i32 %288, ptr %16, align 4, !tbaa !5
  br label %289

289:                                              ; preds = %285, %276
  %290 = load i32, ptr %16, align 4, !tbaa !5
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %290)
  br label %291

291:                                              ; preds = %289, %274
  br label %292

292:                                              ; preds = %291, %272
  store i32 0, ptr %5, align 4
  br label %293

293:                                              ; preds = %292, %251, %248
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %294 = load i32, ptr %5, align 4
  switch i32 %294, label %299 [
    i32 0, label %295
    i32 30, label %296
  ]

295:                                              ; preds = %293
  br label %296

296:                                              ; preds = %295, %293
  %297 = load i32, ptr %14, align 4, !tbaa !5
  %298 = add nsw i32 %297, 1
  store i32 %298, ptr %14, align 4, !tbaa !5
  br label %230, !llvm.loop !22

299:                                              ; preds = %293, %234
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %300

300:                                              ; preds = %299
  br label %301

301:                                              ; preds = %300
  %302 = load i32, ptr %13, align 4, !tbaa !5
  %303 = add nsw i32 %302, -1
  store i32 %303, ptr %13, align 4, !tbaa !5
  br label %224, !llvm.loop !23

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

305:                                              ; preds = %324, %304
  %306 = load i32, ptr %17, align 4, !tbaa !5
  %307 = load i32, ptr @m, align 4, !tbaa !5
  %308 = icmp sle i32 %306, %307
  br i1 %308, label %310, label %309

309:                                              ; preds = %305
  store i32 31, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %327

310:                                              ; preds = %305
  %311 = load i32, ptr %10, align 4, !tbaa !5
  %312 = sub nsw i32 %311, 1
  %313 = sext i32 %312 to i64
  %314 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %313
  %315 = load i32, ptr %17, align 4, !tbaa !5
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [53 x %struct.Info], ptr %314, i64 0, i64 %316
  %318 = load i32, ptr %10, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %319
  %321 = load i32, ptr %17, align 4, !tbaa !5
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [53 x %struct.Info], ptr %320, i64 0, i64 %322
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %317, ptr noundef nonnull align 4 dereferenceable(16) %323)
  br label %324

324:                                              ; preds = %310
  %325 = load i32, ptr %17, align 4, !tbaa !5
  %326 = add nsw i32 %325, 1
  store i32 %326, ptr %17, align 4, !tbaa !5
  br label %305, !llvm.loop !24

327:                                              ; preds = %309
  br label %328

328:                                              ; preds = %327
  %329 = load i32, ptr %10, align 4, !tbaa !5
  %330 = add nsw i32 %329, -1
  store i32 %330, ptr %10, align 4, !tbaa !5
  br label %170, !llvm.loop !25

331:                                              ; preds = %173
  %332 = load i32, ptr @ans, align 4, !tbaa !5
  %333 = load i32, ptr @n, align 4, !tbaa !5
  %334 = load i32, ptr @m, align 4, !tbaa !5
  %335 = mul nsw i32 %333, %334
  %336 = icmp sgt i32 %332, %335
  br i1 %336, label %337, label %338

337:                                              ; preds = %331
  br label %340

338:                                              ; preds = %331
  %339 = load i32, ptr @ans, align 4, !tbaa !5
  br label %340

340:                                              ; preds = %338, %337
  %341 = phi i32 [ -1, %337 ], [ %339, %338 ]
  %342 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %341)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %18, !llvm.loop !26

343:                                              ; preds = %18
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Info6assignEii(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Info5emptyEv(ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

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

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

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

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

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

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


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

%struct.Info = type { i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sum = external dso_local local_unnamed_addr global [53 x [53 x i32]], align 16
@ans = external dso_local global i32, align 4
@mat = external dso_local global [53 x [53 x %struct.Info]], align 16
@row = external dso_local global [53 x %struct.Info], align 16
@tmp = external dso_local global %struct.Info, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %3 = icmp eq i32 %2, 2
  br i1 %3, label %.lr.ph158, label %._crit_edge159

.lr.ph158:                                        ; preds = %0, %._crit_edge156
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = load i32, ptr @m, align 4, !tbaa !5
  %6 = mul nsw i32 %5, %4
  %7 = add nsw i32 %6, 1
  store i32 %7, ptr @ans, align 4, !tbaa !5
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) @row)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %.not122 = icmp slt i32 %8, 1
  br i1 %.not122, label %.thread, label %.lr.ph127

._crit_edge128:                                   ; preds = %._crit_edge
  %.not103 = icmp eq i32 %.1.lcssa, 0
  br i1 %.not103, label %.thread, label %38

.lr.ph127:                                        ; preds = %.lr.ph158, %._crit_edge
  %indvars.iv164 = phi i64 [ %indvars.iv.next165, %._crit_edge ], [ 1, %.lr.ph158 ]
  %.086125 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 0, %.lr.ph158 ]
  %.087124 = phi i32 [ %.188.lcssa, %._crit_edge ], [ 0, %.lr.ph158 ]
  %9 = add nsw i64 %indvars.iv164, -1
  %10 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %9
  %11 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %indvars.iv164
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %11, ptr noundef nonnull align 16 dereferenceable(16) %10, i64 16, i1 false), !tbaa.struct !9
  %12 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv164
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) %12)
  %13 = load i32, ptr @m, align 4, !tbaa !5
  %.not109116 = icmp slt i32 %13, 1
  br i1 %.not109116, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph127
  %14 = trunc nuw nsw i64 %indvars.iv164 to i32
  br label %.lr.ph

._crit_edge:                                      ; preds = %29, %.lr.ph127
  %.188.lcssa = phi i32 [ %.087124, %.lr.ph127 ], [ %.289, %29 ]
  %.1.lcssa = phi i32 [ %.086125, %.lr.ph127 ], [ %.2, %29 ]
  %.lcssa = phi i32 [ %13, %.lr.ph127 ], [ %35, %29 ]
  %15 = add nsw i32 %.lcssa, 1
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv164, i64 %16
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) %17)
  %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %.not.not = icmp slt i64 %indvars.iv164, %19
  br i1 %.not.not, label %.lr.ph127, label %._crit_edge128, !llvm.loop !10

.lr.ph:                                           ; preds = %.lr.ph.preheader, %29
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %29 ]
  %.1119 = phi i32 [ %.086125, %.lr.ph.preheader ], [ %.2, %29 ]
  %.188118 = phi i32 [ %.087124, %.lr.ph.preheader ], [ %.289, %29 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %21 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %indvars.iv164, i64 %indvars.iv
  store i32 0, ptr %21, align 4, !tbaa !5
  %22 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv164, i64 %indvars.iv
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) %22)
  %23 = load i32, ptr %1, align 4, !tbaa !5
  switch i32 %23, label %29 [
    i32 1, label %24
    i32 2, label %27
  ]

24:                                               ; preds = %.lr.ph
  %25 = load i32, ptr %21, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %21, align 4, !tbaa !5
  br label %29

27:                                               ; preds = %.lr.ph
  %28 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_ZN4Info6assignEii(ptr noundef nonnull align 4 dereferenceable(16) %22, i32 noundef %14, i32 noundef %28)
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(16) %22)
  br label %29

29:                                               ; preds = %.lr.ph, %27, %24
  %.289 = phi i32 [ %.188118, %24 ], [ %28, %27 ], [ %.188118, %.lr.ph ]
  %.2 = phi i32 [ %.1119, %24 ], [ %14, %27 ], [ %.1119, %.lr.ph ]
  %30 = add nsw i64 %indvars.iv, -1
  %31 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %indvars.iv164, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = load i32, ptr %21, align 4, !tbaa !5
  %34 = add nsw i32 %33, %32
  store i32 %34, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr @m, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %.not109.not = icmp slt i64 %indvars.iv, %36
  br i1 %.not109.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

.thread:                                          ; preds = %._crit_edge128, %.lr.ph158
  %37 = phi i32 [ %18, %._crit_edge128 ], [ %8, %.lr.ph158 ]
  store i32 0, ptr @ans, align 4, !tbaa !5
  br label %.preheader115.._crit_edge156_crit_edge

38:                                               ; preds = %._crit_edge128
  %.not104135 = icmp slt i32 %.1.lcssa, 1
  br i1 %.not104135, label %.preheader115.._crit_edge156_crit_edge, label %.preheader114.lr.ph

.preheader114.lr.ph:                              ; preds = %38
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %.not108131 = icmp slt i32 %39, 1
  br i1 %.not108131, label %.preheader113.lr.ph, label %.preheader114.preheader

.preheader114.preheader:                          ; preds = %.preheader114.lr.ph
  %40 = add nuw i32 %.1.lcssa, 1
  %wide.trip.count173 = zext i32 %40 to i64
  %41 = zext nneg i32 %39 to i64
  %xtraiter = and i64 %41, 1
  %42 = icmp eq i32 %39, 1
  %unroll_iter = and i64 %41, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader114

.preheader115.._crit_edge156_crit_edge:           ; preds = %38, %.thread
  %43 = phi i32 [ %18, %38 ], [ %37, %.thread ]
  %.pre201 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge156

.preheader113.lr.ph:                              ; preds = %._crit_edge134, %.preheader114.lr.ph
  %44 = icmp sgt i32 %.188.lcssa, 2
  %45 = icmp sgt i32 %.188.lcssa, 0
  %46 = sext i32 %.188.lcssa to i64
  %47 = zext i32 %.188.lcssa to i64
  %48 = zext nneg i32 %.1.lcssa to i64
  br label %.preheader113

.preheader114:                                    ; preds = %.preheader114.preheader, %._crit_edge134
  %indvars.iv170 = phi i64 [ 1, %.preheader114.preheader ], [ %indvars.iv.next171, %._crit_edge134 ]
  %49 = add nsw i64 %indvars.iv170, -1
  br i1 %42, label %._crit_edge134.unr-lcssa, label %.preheader114.new

._crit_edge134.unr-lcssa:                         ; preds = %.preheader114.new, %.preheader114
  %indvars.iv167.unr = phi i64 [ 1, %.preheader114 ], [ %indvars.iv.next168.1, %.preheader114.new ]
  br i1 %lcmp.mod.not, label %._crit_edge134, label %._crit_edge134.epilog-lcssa

._crit_edge134.epilog-lcssa:                      ; preds = %._crit_edge134.unr-lcssa
  %50 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %49, i64 %indvars.iv167.unr
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %indvars.iv170, i64 %indvars.iv167.unr
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, %51
  store i32 %54, ptr %52, align 4, !tbaa !5
  br label %._crit_edge134

._crit_edge134:                                   ; preds = %._crit_edge134.unr-lcssa, %._crit_edge134.epilog-lcssa
  %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
  %exitcond174.not = icmp eq i64 %indvars.iv.next171, %wide.trip.count173
  br i1 %exitcond174.not, label %.preheader113.lr.ph, label %.preheader114, !llvm.loop !13

.preheader114.new:                                ; preds = %.preheader114, %.preheader114.new
  %indvars.iv167 = phi i64 [ %indvars.iv.next168.1, %.preheader114.new ], [ 1, %.preheader114 ]
  %niter = phi i64 [ %niter.next.1, %.preheader114.new ], [ 0, %.preheader114 ]
  %55 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %49, i64 %indvars.iv167
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %indvars.iv170, i64 %indvars.iv167
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, %56
  store i32 %59, ptr %57, align 4, !tbaa !5
  %indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
  %60 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %49, i64 %indvars.iv.next168
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %indvars.iv170, i64 %indvars.iv.next168
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %63, %61
  store i32 %64, ptr %62, align 4, !tbaa !5
  %indvars.iv.next168.1 = add nuw nsw i64 %indvars.iv167, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge134.unr-lcssa, label %.preheader114.new, !llvm.loop !14

.preheader113:                                    ; preds = %.preheader113.lr.ph, %._crit_edge154
  %indvars.iv196 = phi i64 [ %48, %.preheader113.lr.ph ], [ %.pre204, %._crit_edge154 ]
  br i1 %44, label %.lr.ph138, label %._crit_edge139

._crit_edge156.loopexit:                          ; preds = %._crit_edge154
  %.pre200 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge156

._crit_edge156:                                   ; preds = %.preheader115.._crit_edge156_crit_edge, %._crit_edge156.loopexit
  %65 = phi i32 [ %117, %._crit_edge156.loopexit ], [ %.pre201, %.preheader115.._crit_edge156_crit_edge ]
  %66 = phi i32 [ %.pre200, %._crit_edge156.loopexit ], [ %43, %.preheader115.._crit_edge156_crit_edge ]
  %67 = load i32, ptr @ans, align 4
  %68 = mul nsw i32 %65, %66
  %69 = icmp sgt i32 %67, %68
  %70 = select i1 %69, i32 -1, i32 %67
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %70)
  %72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %73 = icmp eq i32 %72, 2
  br i1 %73, label %.lr.ph158, label %._crit_edge159, !llvm.loop !15

._crit_edge139:                                   ; preds = %.lr.ph138, %.preheader113
  %74 = load i32, ptr @m, align 4, !tbaa !5
  %.094140 = add nsw i32 %74, -1
  %75 = icmp sgt i32 %.094140, %.188.lcssa
  br i1 %75, label %.lr.ph144, label %.preheader112

.lr.ph144:                                        ; preds = %._crit_edge139
  %76 = sext i32 %74 to i64
  %77 = add nsw i64 %76, -1
  br label %85

.lr.ph138:                                        ; preds = %.preheader113, %.lr.ph138
  %indvars.iv175 = phi i64 [ %indvars.iv.next176, %.lr.ph138 ], [ 2, %.preheader113 ]
  %78 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv196, i64 %indvars.iv175
  %79 = add nsw i64 %indvars.iv175, -1
  %80 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv196, i64 %79
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %78, ptr noundef nonnull align 4 dereferenceable(16) %80)
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %exitcond179.not = icmp eq i64 %indvars.iv.next176, %47
  br i1 %exitcond179.not, label %._crit_edge139, label %.lr.ph138, !llvm.loop !16

.preheader112.loopexit:                           ; preds = %85
  %.pre199.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader112

.preheader112:                                    ; preds = %.preheader112.loopexit, %._crit_edge139
  %.pre199 = phi i32 [ %.pre199.pre, %.preheader112.loopexit ], [ %74, %._crit_edge139 ]
  br i1 %45, label %.preheader.lr.ph, label %.preheader111

.preheader.lr.ph:                                 ; preds = %.preheader112
  %81 = add nsw i64 %indvars.iv196, -1
  %82 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %81
  %83 = icmp sgt i32 %.188.lcssa, %.pre199
  br i1 %83, label %.preheader111, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %84 = trunc nuw nsw i64 %indvars.iv196 to i32
  br label %.preheader

85:                                               ; preds = %.lr.ph144, %85
  %indvars.iv182 = phi i64 [ %76, %.lr.ph144 ], [ %indvars.iv.next183, %85 ]
  %indvars.iv180 = phi i64 [ %77, %.lr.ph144 ], [ %indvars.iv.next181, %85 ]
  %86 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv196, i64 %indvars.iv180
  %87 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv196, i64 %indvars.iv182
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %86, ptr noundef nonnull align 4 dereferenceable(16) %87)
  %indvars.iv.next181 = add nsw i64 %indvars.iv180, -1
  %88 = icmp sgt i64 %indvars.iv.next181, %46
  %indvars.iv.next183 = add nsw i64 %indvars.iv182, -1
  br i1 %88, label %85, label %.preheader112.loopexit, !llvm.loop !17

.preheader111.loopexit160:                        ; preds = %._crit_edge148
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader111

.preheader111:                                    ; preds = %.preheader.lr.ph, %.preheader111.loopexit160, %.preheader112
  %89 = phi i32 [ %.pre, %.preheader111.loopexit160 ], [ %.pre199, %.preheader112 ], [ %.pre199, %.preheader.lr.ph ]
  %.not105151 = icmp slt i32 %89, 1
  %.pre204 = add nsw i64 %indvars.iv196, -1
  br i1 %.not105151, label %._crit_edge154, label %.lr.ph153

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge148
  %indvars.iv190 = phi i64 [ %47, %.preheader.preheader ], [ %.pre205, %._crit_edge148 ]
  %90 = load i32, ptr @m, align 4, !tbaa !5
  %.not106145 = icmp sgt i32 %.188.lcssa, %90
  %.pre205 = add nsw i64 %indvars.iv190, -1
  br i1 %.not106145, label %._crit_edge148, label %.lr.ph147

.lr.ph147:                                        ; preds = %.preheader
  %91 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv196, i64 %.pre205
  %92 = trunc nuw nsw i64 %indvars.iv190 to i32
  br label %93

93:                                               ; preds = %.lr.ph147, %114
  %indvars.iv187 = phi i64 [ %47, %.lr.ph147 ], [ %indvars.iv.next188.pre-phi, %114 ]
  store i32 %84, ptr @tmp, align 4, !tbaa !5
  store i32 %.1.lcssa, ptr getelementptr inbounds (i8, ptr @tmp, i64 4), align 4, !tbaa !5
  store i32 %92, ptr getelementptr inbounds (i8, ptr @tmp, i64 8), align 4, !tbaa !5
  %94 = trunc nuw i64 %indvars.iv187 to i32
  store i32 %94, ptr getelementptr inbounds (i8, ptr @tmp, i64 12), align 4, !tbaa !5
  %95 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %96 = load i32, ptr @ans, align 4, !tbaa !5
  %.not107 = icmp slt i32 %95, %96
  br i1 %.not107, label %97, label %._crit_edge148

97:                                               ; preds = %93
  %98 = call noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %98, label %99, label %._crit_edge203

._crit_edge203:                                   ; preds = %97
  %.pre206 = add nuw nsw i64 %indvars.iv187, 1
  br label %114

99:                                               ; preds = %97
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) @tmp, ptr noundef nonnull align 16 dereferenceable(16) %82, i64 16, i1 false), !tbaa.struct !9
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) @tmp, ptr noundef nonnull align 4 dereferenceable(16) %91)
  %100 = add nuw nsw i64 %indvars.iv187, 1
  %101 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv196, i64 %100
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) @tmp, ptr noundef nonnull align 4 dereferenceable(16) %101)
  %102 = call noundef zeroext i1 @_ZNK4Info5emptyEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %102, label %103, label %104

103:                                              ; preds = %99
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %95)
  br label %114

104:                                              ; preds = %99
  %105 = call noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %105, label %106, label %114

106:                                              ; preds = %104
  %107 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %108 = add nsw i32 %107, %95
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) @tmp, i32 noundef %84)
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @tmp, i64 4), i32 noundef %.1.lcssa)
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @tmp, i64 8), i32 noundef %92)
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @tmp, i64 12), i32 noundef %94)
  %109 = call noundef zeroext i1 @_ZNK4Info5emptyEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %109, label %113, label %110

110:                                              ; preds = %106
  %111 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %112 = sub nsw i32 %108, %111
  br label %113

113:                                              ; preds = %110, %106
  %.085 = phi i32 [ %108, %106 ], [ %112, %110 ]
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %.085)
  br label %114

114:                                              ; preds = %._crit_edge203, %104, %113, %103
  %indvars.iv.next188.pre-phi = phi i64 [ %.pre206, %._crit_edge203 ], [ %100, %104 ], [ %100, %113 ], [ %100, %103 ]
  %115 = load i32, ptr @m, align 4, !tbaa !5
  %.not106.not = icmp sgt i32 %115, %94
  br i1 %.not106.not, label %93, label %._crit_edge148, !llvm.loop !18

._crit_edge148:                                   ; preds = %114, %93, %.preheader
  %116 = icmp sgt i64 %indvars.iv190, 1
  br i1 %116, label %.preheader, label %.preheader111.loopexit160, !llvm.loop !19

._crit_edge154:                                   ; preds = %.lr.ph153, %.preheader111
  %117 = phi i32 [ %89, %.preheader111 ], [ %121, %.lr.ph153 ]
  %118 = icmp sgt i64 %indvars.iv196, 1
  br i1 %118, label %.preheader113, label %._crit_edge156.loopexit, !llvm.loop !21

.lr.ph153:                                        ; preds = %.preheader111, %.lr.ph153
  %indvars.iv193 = phi i64 [ %indvars.iv.next194, %.lr.ph153 ], [ 1, %.preheader111 ]
  %119 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %.pre204, i64 %indvars.iv193
  %120 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv196, i64 %indvars.iv193
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %119, ptr noundef nonnull align 4 dereferenceable(16) %120)
  %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1
  %121 = load i32, ptr @m, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %.not105.not = icmp slt i64 %indvars.iv193, %122
  br i1 %.not105.not, label %.lr.ph153, label %._crit_edge154, !llvm.loop !22

._crit_edge159:                                   ; preds = %._crit_edge156, %0
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Info6assignEii(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Info5emptyEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

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

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

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

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


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