; LLVM IR from tangjz/acm-icpc :: poj (2332)

; 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
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = mul nsw i32 %19, %20
  %22 = add nsw i32 %21, 1
  store i32 %22, 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 %23

23:                                               ; preds = %122, %0
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %28, label %27

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

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

40:                                               ; preds = %111, %28
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

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

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

61:                                               ; preds = %45
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %63
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [53 x i32], ptr %64, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %67, align 4, !tbaa !5
  br label %94

70:                                               ; preds = %45
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = icmp eq i32 %71, 2
  br i1 %72, label %73, label %93

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

93:                                               ; preds = %73, %70
  br label %94

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

111:                                              ; preds = %94
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %6, align 4, !tbaa !5
  br label %40, !llvm.loop !10

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

122:                                              ; preds = %114
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %4, align 4, !tbaa !5
  br label %23, !llvm.loop !12

125:                                              ; preds = %27
  %126 = load i32, ptr %2, align 4, !tbaa !5
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %129, label %128

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

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

130:                                              ; preds = %162, %129
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = load i32, ptr %2, align 4, !tbaa !5
  %133 = icmp sle i32 %131, %132
  br i1 %133, label %135, label %134

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

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

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

140:                                              ; preds = %136
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %161

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

158:                                              ; preds = %141
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %9, align 4, !tbaa !5
  br label %136, !llvm.loop !13

161:                                              ; preds = %140
  br label %162

162:                                              ; preds = %161
  %163 = load i32, ptr %8, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %8, align 4, !tbaa !5
  br label %130, !llvm.loop !14

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

167:                                              ; preds = %325, %165
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = icmp sge i32 %168, 1
  br i1 %169, label %171, label %170

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

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

172:                                              ; preds = %191, %171
  %173 = load i32, ptr %11, align 4, !tbaa !5
  %174 = load i32, ptr %3, align 4, !tbaa !5
  %175 = icmp slt i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %194

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

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

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

197:                                              ; preds = %216, %194
  %198 = load i32, ptr %12, align 4, !tbaa !5
  %199 = load i32, ptr %3, align 4, !tbaa !5
  %200 = icmp sgt i32 %198, %199
  br i1 %200, label %202, label %201

201:                                              ; preds = %197
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %219

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

216:                                              ; preds = %202
  %217 = load i32, ptr %12, align 4, !tbaa !5
  %218 = add nsw i32 %217, -1
  store i32 %218, ptr %12, align 4, !tbaa !5
  br label %197, !llvm.loop !16

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

221:                                              ; preds = %298, %219
  %222 = load i32, ptr %13, align 4, !tbaa !5
  %223 = icmp sge i32 %222, 1
  br i1 %223, label %225, label %224

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

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

227:                                              ; preds = %293, %225
  %228 = load i32, ptr %14, align 4, !tbaa !5
  %229 = load i32, ptr @m, align 4, !tbaa !5
  %230 = icmp sle i32 %228, %229
  br i1 %230, label %232, label %231

231:                                              ; preds = %227
  store i32 26, ptr %5, align 4
  br label %296

232:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  %233 = getelementptr inbounds %struct.Info, ptr %15, i32 0, i32 0
  %234 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %234, ptr %233, align 4, !tbaa !17
  %235 = getelementptr inbounds %struct.Info, ptr %15, i32 0, i32 1
  %236 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %236, ptr %235, align 4, !tbaa !19
  %237 = getelementptr inbounds %struct.Info, ptr %15, i32 0, i32 2
  %238 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %238, ptr %237, align 4, !tbaa !20
  %239 = getelementptr inbounds %struct.Info, ptr %15, i32 0, i32 3
  %240 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %240, ptr %239, 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
  %241 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  store i32 %241, ptr %16, align 4, !tbaa !5
  %242 = load i32, ptr %16, align 4, !tbaa !5
  %243 = load i32, ptr @ans, align 4, !tbaa !5
  %244 = icmp sge i32 %242, %243
  br i1 %244, label %245, label %246

245:                                              ; preds = %232
  store i32 26, ptr %5, align 4
  br label %290

246:                                              ; preds = %232
  %247 = call noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %247, label %249, label %248

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

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

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

271:                                              ; preds = %249
  %272 = call noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %272, label %273, label %288

273:                                              ; preds = %271
  %274 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %275 = load i32, ptr %16, align 4, !tbaa !5
  %276 = add nsw i32 %275, %274
  store i32 %276, ptr %16, align 4, !tbaa !5
  %277 = load i32, ptr %10, align 4, !tbaa !5
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) @tmp, i32 noundef %277)
  %278 = 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 %278)
  %279 = 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 %279)
  %280 = 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 %280)
  %281 = call noundef zeroext i1 @_ZNK4Info5emptyEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %281, label %286, label %282

282:                                              ; preds = %273
  %283 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %284 = load i32, ptr %16, align 4, !tbaa !5
  %285 = sub nsw i32 %284, %283
  store i32 %285, ptr %16, align 4, !tbaa !5
  br label %286

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

288:                                              ; preds = %286, %271
  br label %289

289:                                              ; preds = %288, %269
  store i32 0, ptr %5, align 4
  br label %290

290:                                              ; preds = %289, %248, %245
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %291 = load i32, ptr %5, align 4
  switch i32 %291, label %296 [
    i32 0, label %292
    i32 28, label %293
  ]

292:                                              ; preds = %290
  br label %293

293:                                              ; preds = %292, %290
  %294 = load i32, ptr %14, align 4, !tbaa !5
  %295 = add nsw i32 %294, 1
  store i32 %295, ptr %14, align 4, !tbaa !5
  br label %227, !llvm.loop !22

296:                                              ; preds = %290, %231
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %297

297:                                              ; preds = %296
  br label %298

298:                                              ; preds = %297
  %299 = load i32, ptr %13, align 4, !tbaa !5
  %300 = add nsw i32 %299, -1
  store i32 %300, ptr %13, align 4, !tbaa !5
  br label %221, !llvm.loop !23

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

302:                                              ; preds = %321, %301
  %303 = load i32, ptr %17, align 4, !tbaa !5
  %304 = load i32, ptr @m, align 4, !tbaa !5
  %305 = icmp sle i32 %303, %304
  br i1 %305, label %307, label %306

306:                                              ; preds = %302
  store i32 29, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %324

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

321:                                              ; preds = %307
  %322 = load i32, ptr %17, align 4, !tbaa !5
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr %17, align 4, !tbaa !5
  br label %302, !llvm.loop !24

324:                                              ; preds = %306
  br label %325

325:                                              ; preds = %324
  %326 = load i32, ptr %10, align 4, !tbaa !5
  %327 = add nsw i32 %326, -1
  store i32 %327, ptr %10, align 4, !tbaa !5
  br label %167, !llvm.loop !25

328:                                              ; preds = %170
  %329 = load i32, ptr @ans, align 4, !tbaa !5
  %330 = load i32, ptr @n, align 4, !tbaa !5
  %331 = load i32, ptr @m, align 4, !tbaa !5
  %332 = mul nsw i32 %330, %331
  %333 = icmp sgt i32 %329, %332
  br i1 %333, label %334, label %335

334:                                              ; preds = %328
  br label %337

335:                                              ; preds = %328
  %336 = load i32, ptr @ans, align 4, !tbaa !5
  br label %337

337:                                              ; preds = %335, %334
  %338 = phi i32 [ -1, %334 ], [ %336, %335 ]
  %339 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %338)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %340 = load i32, ptr %1, align 4
  ret i32 %340
}

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}


; 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 = load i32, ptr @n, align 4, !tbaa !5
  %4 = load i32, ptr @m, align 4, !tbaa !5
  %5 = mul nsw i32 %4, %3
  %6 = add nsw i32 %5, 1
  store i32 %6, ptr @ans, align 4, !tbaa !5
  tail call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) @row)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %.not123 = icmp slt i32 %7, 1
  br i1 %.not123, label %.thread, label %.lr.ph128

._crit_edge129:                                   ; preds = %._crit_edge
  %.not104 = icmp eq i32 %.1.lcssa, 0
  br i1 %.not104, label %.thread, label %37

.lr.ph128:                                        ; preds = %0, %._crit_edge
  %indvars.iv162 = phi i64 [ %indvars.iv.next163, %._crit_edge ], [ 1, %0 ]
  %.087126 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 0, %0 ]
  %.088125 = phi i32 [ %.189.lcssa, %._crit_edge ], [ 0, %0 ]
  %8 = add nsw i64 %indvars.iv162, -1
  %9 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %8
  %10 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %indvars.iv162
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %10, ptr noundef nonnull align 16 dereferenceable(16) %9, i64 16, i1 false), !tbaa.struct !9
  %11 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv162
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) %11)
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %.not110117 = icmp slt i32 %12, 1
  br i1 %.not110117, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph128
  %13 = trunc nuw nsw i64 %indvars.iv162 to i32
  br label %.lr.ph

._crit_edge:                                      ; preds = %28, %.lr.ph128
  %.189.lcssa = phi i32 [ %.088125, %.lr.ph128 ], [ %.290, %28 ]
  %.1.lcssa = phi i32 [ %.087126, %.lr.ph128 ], [ %.2, %28 ]
  %.lcssa = phi i32 [ %12, %.lr.ph128 ], [ %34, %28 ]
  %14 = add nsw i32 %.lcssa, 1
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv162, i64 %15
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) %16)
  %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %.not.not = icmp slt i64 %indvars.iv162, %18
  br i1 %.not.not, label %.lr.ph128, label %._crit_edge129, !llvm.loop !10

.lr.ph:                                           ; preds = %.lr.ph.preheader, %28
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %28 ]
  %.1120 = phi i32 [ %.087126, %.lr.ph.preheader ], [ %.2, %28 ]
  %.189119 = phi i32 [ %.088125, %.lr.ph.preheader ], [ %.290, %28 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %20 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %indvars.iv162, i64 %indvars.iv
  store i32 0, ptr %20, align 4, !tbaa !5
  %21 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv162, i64 %indvars.iv
  call void @_ZN4Info6assignEv(ptr noundef nonnull align 4 dereferenceable(16) %21)
  %22 = load i32, ptr %1, align 4, !tbaa !5
  switch i32 %22, label %28 [
    i32 1, label %23
    i32 2, label %26
  ]

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

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

28:                                               ; preds = %.lr.ph, %26, %23
  %.290 = phi i32 [ %.189119, %23 ], [ %27, %26 ], [ %.189119, %.lr.ph ]
  %.2 = phi i32 [ %.1120, %23 ], [ %13, %26 ], [ %.1120, %.lr.ph ]
  %29 = add nsw i64 %indvars.iv, -1
  %30 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %indvars.iv162, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = load i32, ptr %20, align 4, !tbaa !5
  %33 = add nsw i32 %32, %31
  store i32 %33, ptr %20, 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
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %.not110.not = icmp slt i64 %indvars.iv, %35
  br i1 %.not110.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

.thread:                                          ; preds = %._crit_edge129, %0
  %36 = phi i32 [ %17, %._crit_edge129 ], [ %7, %0 ]
  store i32 0, ptr @ans, align 4, !tbaa !5
  br label %.preheader115.._crit_edge157_crit_edge

37:                                               ; preds = %._crit_edge129
  %.not105136 = icmp slt i32 %.1.lcssa, 1
  br i1 %.not105136, label %.preheader115.._crit_edge157_crit_edge, label %.preheader116.lr.ph

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

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

.preheader116:                                    ; preds = %.preheader116.preheader, %._crit_edge135
  %indvars.iv168 = phi i64 [ 1, %.preheader116.preheader ], [ %indvars.iv.next169, %._crit_edge135 ]
  %42 = add nsw i64 %indvars.iv168, -1
  br i1 %41, label %._crit_edge135.unr-lcssa, label %.preheader116.new

.preheader115.._crit_edge157_crit_edge:           ; preds = %37, %.thread
  %43 = phi i32 [ %17, %37 ], [ %36, %.thread ]
  %.pre199 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge157

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

._crit_edge135.unr-lcssa:                         ; preds = %.preheader116.new, %.preheader116
  %indvars.iv165.unr = phi i64 [ 1, %.preheader116 ], [ %indvars.iv.next166.1, %.preheader116.new ]
  br i1 %lcmp.mod.not, label %._crit_edge135, label %._crit_edge135.epilog-lcssa

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

._crit_edge135:                                   ; preds = %._crit_edge135.unr-lcssa, %._crit_edge135.epilog-lcssa
  %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
  %exitcond172.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count171
  br i1 %exitcond172.not, label %.preheader114.lr.ph, label %.preheader116, !llvm.loop !13

.preheader116.new:                                ; preds = %.preheader116, %.preheader116.new
  %indvars.iv165 = phi i64 [ %indvars.iv.next166.1, %.preheader116.new ], [ 1, %.preheader116 ]
  %niter = phi i64 [ %niter.next.1, %.preheader116.new ], [ 0, %.preheader116 ]
  %54 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %42, i64 %indvars.iv165
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %indvars.iv168, i64 %indvars.iv165
  %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.next166 = add nuw nsw i64 %indvars.iv165, 1
  %59 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %42, i64 %indvars.iv.next166
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = getelementptr inbounds [53 x [53 x i32]], ptr @sum, i64 0, i64 %indvars.iv168, i64 %indvars.iv.next166
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, %60
  store i32 %63, ptr %61, align 4, !tbaa !5
  %indvars.iv.next166.1 = add nuw nsw i64 %indvars.iv165, 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_edge135.unr-lcssa, label %.preheader116.new, !llvm.loop !14

.preheader114:                                    ; preds = %.preheader114.lr.ph, %._crit_edge155
  %indvars.iv194 = phi i64 [ %48, %.preheader114.lr.ph ], [ %.pre202, %._crit_edge155 ]
  br i1 %44, label %.lr.ph139, label %._crit_edge140

._crit_edge157.loopexit:                          ; preds = %._crit_edge155
  %.pre198 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge157

._crit_edge157:                                   ; preds = %.preheader115.._crit_edge157_crit_edge, %._crit_edge157.loopexit
  %64 = phi i32 [ %114, %._crit_edge157.loopexit ], [ %.pre199, %.preheader115.._crit_edge157_crit_edge ]
  %65 = phi i32 [ %.pre198, %._crit_edge157.loopexit ], [ %43, %.preheader115.._crit_edge157_crit_edge ]
  %66 = load i32, ptr @ans, align 4
  %67 = mul nsw i32 %64, %65
  %68 = icmp sgt i32 %66, %67
  %69 = select i1 %68, i32 -1, i32 %66
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %69)
  ret i32 0

._crit_edge140:                                   ; preds = %.lr.ph139, %.preheader114
  %71 = load i32, ptr @m, align 4, !tbaa !5
  %.094141 = add nsw i32 %71, -1
  %72 = icmp sgt i32 %.094141, %.189.lcssa
  br i1 %72, label %.lr.ph145, label %.preheader113

.lr.ph145:                                        ; preds = %._crit_edge140
  %73 = sext i32 %71 to i64
  %74 = add nsw i64 %73, -1
  br label %82

.lr.ph139:                                        ; preds = %.preheader114, %.lr.ph139
  %indvars.iv173 = phi i64 [ %indvars.iv.next174, %.lr.ph139 ], [ 2, %.preheader114 ]
  %75 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv194, i64 %indvars.iv173
  %76 = add nsw i64 %indvars.iv173, -1
  %77 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv194, i64 %76
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %75, ptr noundef nonnull align 4 dereferenceable(16) %77)
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %exitcond177.not = icmp eq i64 %indvars.iv.next174, %47
  br i1 %exitcond177.not, label %._crit_edge140, label %.lr.ph139, !llvm.loop !15

.preheader113.loopexit:                           ; preds = %82
  %.pre197.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader113

.preheader113:                                    ; preds = %.preheader113.loopexit, %._crit_edge140
  %.pre197 = phi i32 [ %.pre197.pre, %.preheader113.loopexit ], [ %71, %._crit_edge140 ]
  br i1 %45, label %.preheader.lr.ph, label %.preheader112

.preheader.lr.ph:                                 ; preds = %.preheader113
  %78 = add nsw i64 %indvars.iv194, -1
  %79 = getelementptr inbounds [53 x %struct.Info], ptr @row, i64 0, i64 %78
  %80 = icmp sgt i32 %.189.lcssa, %.pre197
  br i1 %80, label %.preheader112, label %.preheader.preheader

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

82:                                               ; preds = %.lr.ph145, %82
  %indvars.iv180 = phi i64 [ %73, %.lr.ph145 ], [ %indvars.iv.next181, %82 ]
  %indvars.iv178 = phi i64 [ %74, %.lr.ph145 ], [ %indvars.iv.next179, %82 ]
  %83 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv194, i64 %indvars.iv178
  %84 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv194, i64 %indvars.iv180
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %83, ptr noundef nonnull align 4 dereferenceable(16) %84)
  %indvars.iv.next179 = add nsw i64 %indvars.iv178, -1
  %85 = icmp sgt i64 %indvars.iv.next179, %46
  %indvars.iv.next181 = add nsw i64 %indvars.iv180, -1
  br i1 %85, label %82, label %.preheader113.loopexit, !llvm.loop !16

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

.preheader112:                                    ; preds = %.preheader.lr.ph, %.preheader112.loopexit158, %.preheader113
  %86 = phi i32 [ %.pre, %.preheader112.loopexit158 ], [ %.pre197, %.preheader113 ], [ %.pre197, %.preheader.lr.ph ]
  %.not106152 = icmp slt i32 %86, 1
  %.pre202 = add nsw i64 %indvars.iv194, -1
  br i1 %.not106152, label %._crit_edge155, label %.lr.ph154

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge149
  %indvars.iv188 = phi i64 [ %47, %.preheader.preheader ], [ %.pre203, %._crit_edge149 ]
  %87 = load i32, ptr @m, align 4, !tbaa !5
  %.not107146 = icmp sgt i32 %.189.lcssa, %87
  %.pre203 = add nsw i64 %indvars.iv188, -1
  br i1 %.not107146, label %._crit_edge149, label %.lr.ph148

.lr.ph148:                                        ; preds = %.preheader
  %88 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv194, i64 %.pre203
  %89 = trunc nuw nsw i64 %indvars.iv188 to i32
  br label %90

90:                                               ; preds = %.lr.ph148, %111
  %indvars.iv185 = phi i64 [ %47, %.lr.ph148 ], [ %indvars.iv.next186.pre-phi, %111 ]
  store i32 %81, ptr @tmp, align 4, !tbaa !5
  store i32 %.1.lcssa, ptr getelementptr inbounds (i8, ptr @tmp, i64 4), align 4, !tbaa !5
  store i32 %89, ptr getelementptr inbounds (i8, ptr @tmp, i64 8), align 4, !tbaa !5
  %91 = trunc nuw i64 %indvars.iv185 to i32
  store i32 %91, ptr getelementptr inbounds (i8, ptr @tmp, i64 12), align 4, !tbaa !5
  %92 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %93 = load i32, ptr @ans, align 4, !tbaa !5
  %.not108 = icmp slt i32 %92, %93
  br i1 %.not108, label %94, label %._crit_edge149

94:                                               ; preds = %90
  %95 = call noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %95, label %96, label %._crit_edge201

._crit_edge201:                                   ; preds = %94
  %.pre204 = add nuw nsw i64 %indvars.iv185, 1
  br label %111

96:                                               ; preds = %94
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) @tmp, ptr noundef nonnull align 16 dereferenceable(16) %79, 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) %88)
  %97 = add nuw nsw i64 %indvars.iv185, 1
  %98 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv194, i64 %97
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) @tmp, ptr noundef nonnull align 4 dereferenceable(16) %98)
  %99 = call noundef zeroext i1 @_ZNK4Info5emptyEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %99, label %100, label %101

100:                                              ; preds = %96
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %92)
  br label %111

101:                                              ; preds = %96
  %102 = call noundef zeroext i1 @_ZNK4Info5checkEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %102, label %103, label %111

103:                                              ; preds = %101
  %104 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %105 = add nsw i32 %104, %92
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) @tmp, i32 noundef %81)
  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 %89)
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @tmp, i64 12), i32 noundef %91)
  %106 = call noundef zeroext i1 @_ZNK4Info5emptyEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  br i1 %106, label %110, label %107

107:                                              ; preds = %103
  %108 = call noundef i32 @_ZNK4Info4areaEv(ptr noundef nonnull align 4 dereferenceable(16) @tmp)
  %109 = sub nsw i32 %105, %108
  br label %110

110:                                              ; preds = %107, %103
  %.086 = phi i32 [ %105, %103 ], [ %109, %107 ]
  call void @_Z7upd_minRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %.086)
  br label %111

111:                                              ; preds = %._crit_edge201, %101, %110, %100
  %indvars.iv.next186.pre-phi = phi i64 [ %.pre204, %._crit_edge201 ], [ %97, %101 ], [ %97, %110 ], [ %97, %100 ]
  %112 = load i32, ptr @m, align 4, !tbaa !5
  %.not107.not = icmp sgt i32 %112, %91
  br i1 %.not107.not, label %90, label %._crit_edge149, !llvm.loop !17

._crit_edge149:                                   ; preds = %111, %90, %.preheader
  %113 = icmp sgt i64 %indvars.iv188, 1
  br i1 %113, label %.preheader, label %.preheader112.loopexit158, !llvm.loop !18

._crit_edge155:                                   ; preds = %.lr.ph154, %.preheader112
  %114 = phi i32 [ %86, %.preheader112 ], [ %118, %.lr.ph154 ]
  %115 = icmp sgt i64 %indvars.iv194, 1
  br i1 %115, label %.preheader114, label %._crit_edge157.loopexit, !llvm.loop !20

.lr.ph154:                                        ; preds = %.preheader112, %.lr.ph154
  %indvars.iv191 = phi i64 [ %indvars.iv.next192, %.lr.ph154 ], [ 1, %.preheader112 ]
  %116 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %.pre202, i64 %indvars.iv191
  %117 = getelementptr inbounds [53 x [53 x %struct.Info]], ptr @mat, i64 0, i64 %indvars.iv194, i64 %indvars.iv191
  call void @_ZN4Info6updateERKS_(ptr noundef nonnull align 4 dereferenceable(16) %116, ptr noundef nonnull align 4 dereferenceable(16) %117)
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %118 = load i32, ptr @m, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %.not106.not = icmp slt i64 %indvars.iv191, %119
  br i1 %.not106.not, label %.lr.ph154, label %._crit_edge155, !llvm.loop !21
}

; 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}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !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