; LLVM IR from tangjz/acm-icpc :: hdu (5258)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@nv = external dso_local global i32, align 4
@nh = external dso_local global i32, align 4
@v = external dso_local global [25 x [3 x i32]], align 16
@h = external dso_local global [25 x [3 x i32]], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = 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 i32, align 4
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %244, %0
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr @t, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %247

23:                                               ; preds = %18
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %24)
  store i32 0, ptr @nh, align 4, !tbaa !5
  store i32 0, ptr @nv, align 4, !tbaa !5
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %82, %23
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %85

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %5, ptr noundef %7, ptr noundef %6, ptr noundef %8)
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = icmp sgt i32 %34, %35
  br i1 %36, label %37, label %38

37:                                               ; preds = %32
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6) #4
  br label %38

38:                                               ; preds = %37, %32
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = load i32, ptr %8, align 4, !tbaa !5
  %41 = icmp sgt i32 %39, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %38
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8) #4
  br label %43

43:                                               ; preds = %42, %38
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = icmp eq i32 %44, %45
  br i1 %46, label %47, label %64

47:                                               ; preds = %43
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = load i32, ptr @nv, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %50
  %52 = getelementptr inbounds [3 x i32], ptr %51, i64 0, i64 0
  store i32 %48, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load i32, ptr @nv, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %55
  %57 = getelementptr inbounds [3 x i32], ptr %56, i64 0, i64 1
  store i32 %53, ptr %57, align 4, !tbaa !5
  %58 = load i32, ptr %8, align 4, !tbaa !5
  %59 = load i32, ptr @nv, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr @nv, align 4, !tbaa !5
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %61
  %63 = getelementptr inbounds [3 x i32], ptr %62, i64 0, i64 2
  store i32 %58, ptr %63, align 4, !tbaa !5
  br label %81

64:                                               ; preds = %43
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = load i32, ptr @nh, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %67
  %69 = getelementptr inbounds [3 x i32], ptr %68, i64 0, i64 0
  store i32 %65, ptr %69, align 4, !tbaa !5
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = load i32, ptr @nh, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %72
  %74 = getelementptr inbounds [3 x i32], ptr %73, i64 0, i64 1
  store i32 %70, ptr %74, align 4, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = load i32, ptr @nh, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr @nh, align 4, !tbaa !5
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %78
  %80 = getelementptr inbounds [3 x i32], ptr %79, i64 0, i64 2
  store i32 %75, ptr %80, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %64, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %4, align 4, !tbaa !5
  br label %27, !llvm.loop !9

85:                                               ; preds = %31
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %238, %85
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = load i32, ptr @nh, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %241

91:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %10, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %234, %91
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = load i32, ptr @nh, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %237

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %230, %99
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = load i32, ptr @nv, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %233

105:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %12, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %226, %105
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = load i32, ptr @nv, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %229

113:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %114 = load i32, ptr %11, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %115
  %117 = getelementptr inbounds [3 x i32], ptr %116, i64 0, i64 1
  %118 = load i32, ptr %12, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %119
  %121 = getelementptr inbounds [3 x i32], ptr %120, i64 0, i64 1
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %117, ptr noundef nonnull align 4 dereferenceable(4) %121)
  %123 = load i32, ptr %122, align 4, !tbaa !5
  store i32 %123, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %125
  %127 = getelementptr inbounds [3 x i32], ptr %126, i64 0, i64 2
  %128 = load i32, ptr %12, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %129
  %131 = getelementptr inbounds [3 x i32], ptr %130, i64 0, i64 2
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %127, ptr noundef nonnull align 4 dereferenceable(4) %131)
  %133 = load i32, ptr %132, align 4, !tbaa !5
  store i32 %133, ptr %14, align 4, !tbaa !5
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %135
  %137 = getelementptr inbounds [3 x i32], ptr %136, i64 0, i64 0
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %165, label %141

141:                                              ; preds = %113
  %142 = load i32, ptr %9, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %143
  %145 = getelementptr inbounds [3 x i32], ptr %144, i64 0, i64 0
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = load i32, ptr %14, align 4, !tbaa !5
  %148 = icmp sgt i32 %146, %147
  br i1 %148, label %165, label %149

149:                                              ; preds = %141
  %150 = load i32, ptr %10, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %151
  %153 = getelementptr inbounds [3 x i32], ptr %152, i64 0, i64 0
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = load i32, ptr %13, align 4, !tbaa !5
  %156 = icmp slt i32 %154, %155
  br i1 %156, label %165, label %157

157:                                              ; preds = %149
  %158 = load i32, ptr %10, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %159
  %161 = getelementptr inbounds [3 x i32], ptr %160, i64 0, i64 0
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = load i32, ptr %14, align 4, !tbaa !5
  %164 = icmp sgt i32 %162, %163
  br i1 %164, label %165, label %166

165:                                              ; preds = %157, %149, %141, %113
  store i32 19, ptr %3, align 4
  br label %223

166:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %167 = load i32, ptr %9, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %168
  %170 = getelementptr inbounds [3 x i32], ptr %169, i64 0, i64 1
  %171 = load i32, ptr %10, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %172
  %174 = getelementptr inbounds [3 x i32], ptr %173, i64 0, i64 1
  %175 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %170, ptr noundef nonnull align 4 dereferenceable(4) %174)
  %176 = load i32, ptr %175, align 4, !tbaa !5
  store i32 %176, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %177 = load i32, ptr %9, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %178
  %180 = getelementptr inbounds [3 x i32], ptr %179, i64 0, i64 2
  %181 = load i32, ptr %10, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %182
  %184 = getelementptr inbounds [3 x i32], ptr %183, i64 0, i64 2
  %185 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %180, ptr noundef nonnull align 4 dereferenceable(4) %184)
  %186 = load i32, ptr %185, align 4, !tbaa !5
  store i32 %186, ptr %16, align 4, !tbaa !5
  %187 = load i32, ptr %11, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %188
  %190 = getelementptr inbounds [3 x i32], ptr %189, i64 0, i64 0
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = load i32, ptr %15, align 4, !tbaa !5
  %193 = icmp slt i32 %191, %192
  br i1 %193, label %218, label %194

194:                                              ; preds = %166
  %195 = load i32, ptr %11, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %196
  %198 = getelementptr inbounds [3 x i32], ptr %197, i64 0, i64 0
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = load i32, ptr %16, align 4, !tbaa !5
  %201 = icmp sgt i32 %199, %200
  br i1 %201, label %218, label %202

202:                                              ; preds = %194
  %203 = load i32, ptr %12, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %204
  %206 = getelementptr inbounds [3 x i32], ptr %205, i64 0, i64 0
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = load i32, ptr %15, align 4, !tbaa !5
  %209 = icmp slt i32 %207, %208
  br i1 %209, label %218, label %210

210:                                              ; preds = %202
  %211 = load i32, ptr %12, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %212
  %214 = getelementptr inbounds [3 x i32], ptr %213, i64 0, i64 0
  %215 = load i32, ptr %214, align 4, !tbaa !5
  %216 = load i32, ptr %16, align 4, !tbaa !5
  %217 = icmp sgt i32 %215, %216
  br i1 %217, label %218, label %219

218:                                              ; preds = %210, %202, %194, %166
  store i32 19, ptr %3, align 4
  br label %222

219:                                              ; preds = %210
  %220 = load i32, ptr @ans, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr %3, align 4
  br label %222

222:                                              ; preds = %219, %218
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %223

223:                                              ; preds = %222, %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  %224 = load i32, ptr %3, align 4
  switch i32 %224, label %248 [
    i32 0, label %225
    i32 19, label %226
  ]

225:                                              ; preds = %223
  br label %226

226:                                              ; preds = %225, %223
  %227 = load i32, ptr %12, align 4, !tbaa !5
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %12, align 4, !tbaa !5
  br label %108, !llvm.loop !11

229:                                              ; preds = %112
  br label %230

230:                                              ; preds = %229
  %231 = load i32, ptr %11, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %11, align 4, !tbaa !5
  br label %100, !llvm.loop !12

233:                                              ; preds = %104
  br label %234

234:                                              ; preds = %233
  %235 = load i32, ptr %10, align 4, !tbaa !5
  %236 = add nsw i32 %235, 1
  store i32 %236, ptr %10, align 4, !tbaa !5
  br label %94, !llvm.loop !13

237:                                              ; preds = %98
  br label %238

238:                                              ; preds = %237
  %239 = load i32, ptr %9, align 4, !tbaa !5
  %240 = add nsw i32 %239, 1
  store i32 %240, ptr %9, align 4, !tbaa !5
  br label %86, !llvm.loop !14

241:                                              ; preds = %90
  %242 = load i32, ptr @ans, align 4, !tbaa !5
  %243 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %242)
  br label %244

244:                                              ; preds = %241
  %245 = load i32, ptr %2, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !15

247:                                              ; preds = %22
  ret i32 0

248:                                              ; preds = %223
  unreachable
}

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

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

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

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

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

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

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 = { 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 #4 = { nounwind }

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

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


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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@nv = external dso_local local_unnamed_addr global i32, align 4
@nh = external dso_local local_unnamed_addr global i32, align 4
@v = external dso_local global [25 x [3 x i32]], align 16
@h = external dso_local global [25 x [3 x i32]], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %6 = load i32, ptr @t, align 4, !tbaa !5
  %.not69 = icmp slt i32 %6, 1
  br i1 %.not69, label %._crit_edge73, label %.lr.ph72

._crit_edge73:                                    ; preds = %._crit_edge68, %0
  ret i32 0

.lr.ph72:                                         ; preds = %0, %._crit_edge68
  %.070 = phi i32 [ %52, %._crit_edge68 ], [ 1, %0 ]
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.070)
  store i32 0, ptr @nh, align 4, !tbaa !5
  store i32 0, ptr @nv, align 4, !tbaa !5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %44, %.lr.ph72
  store i32 0, ptr @ans, align 4, !tbaa !5
  %11 = load i32, ptr @nh, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph67, label %._crit_edge68

.lr.ph:                                           ; preds = %.lr.ph72, %44
  %.03957 = phi i32 [ %45, %44 ], [ 0, %.lr.ph72 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %3, ptr noundef nonnull %2, ptr noundef nonnull %4)
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp sgt i32 %14, %15
  br i1 %16, label %17, label %18

17:                                               ; preds = %.lr.ph
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #4
  br label %18

18:                                               ; preds = %17, %.lr.ph
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = icmp sgt i32 %19, %20
  br i1 %21, label %22, label %23

22:                                               ; preds = %18
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #4
  br label %23

23:                                               ; preds = %22, %18
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = icmp eq i32 %24, %25
  br i1 %26, label %27, label %36

27:                                               ; preds = %23
  %28 = load i32, ptr @nv, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %29
  store i32 %24, ptr %30, align 4, !tbaa !5
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %29, i64 1
  store i32 %31, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = add nsw i32 %28, 1
  store i32 %34, ptr @nv, align 4, !tbaa !5
  %35 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %29, i64 2
  store i32 %33, ptr %35, align 4, !tbaa !5
  br label %44

36:                                               ; preds = %23
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr @nh, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %39
  store i32 %37, ptr %40, align 4, !tbaa !5
  %41 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %39, i64 1
  store i32 %24, ptr %41, align 4, !tbaa !5
  %42 = add nsw i32 %38, 1
  store i32 %42, ptr @nh, align 4, !tbaa !5
  %43 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %39, i64 2
  store i32 %25, ptr %43, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %36, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %45 = add nuw nsw i32 %.03957, 1
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.loopexit56.loopexit:                             ; preds = %._crit_edge63
  %.pre90 = sext i32 %73 to i64
  br label %.loopexit56

.loopexit56:                                      ; preds = %.preheader.lr.ph, %.loopexit56.loopexit, %.lr.ph67
  %.pre-phi = phi i64 [ %.pre90, %.loopexit56.loopexit ], [ %55, %.lr.ph67 ], [ %55, %.preheader.lr.ph ]
  %48 = phi i32 [ %73, %.loopexit56.loopexit ], [ %54, %.lr.ph67 ], [ %54, %.preheader.lr.ph ]
  %49 = icmp slt i64 %indvars.iv.next87, %.pre-phi
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  br i1 %49, label %.lr.ph67, label %._crit_edge68.loopexit, !llvm.loop !11

._crit_edge68.loopexit:                           ; preds = %.loopexit56
  %.pre89 = load i32, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge68

._crit_edge68:                                    ; preds = %._crit_edge68.loopexit, %._crit_edge
  %50 = phi i32 [ %.pre89, %._crit_edge68.loopexit ], [ 0, %._crit_edge ]
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %50)
  %52 = add nuw nsw i32 %.070, 1
  %53 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.070, %53
  br i1 %.not.not, label %.lr.ph72, label %._crit_edge73, !llvm.loop !12

.lr.ph67:                                         ; preds = %._crit_edge, %.loopexit56
  %54 = phi i32 [ %48, %.loopexit56 ], [ %11, %._crit_edge ]
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %.loopexit56 ], [ 0, %._crit_edge ]
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.loopexit56 ], [ 1, %._crit_edge ]
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next87, %55
  br i1 %56, label %.preheader.lr.ph, label %.loopexit56

.preheader.lr.ph:                                 ; preds = %.lr.ph67
  %57 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %indvars.iv86
  %58 = getelementptr inbounds i8, ptr %57, i64 4
  %59 = getelementptr inbounds i8, ptr %57, i64 8
  %60 = load i32, ptr @nv, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %.preheader, label %.loopexit56

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge63
  %62 = phi i32 [ %73, %._crit_edge63 ], [ %54, %.preheader.lr.ph ]
  %63 = phi i32 [ %74, %._crit_edge63 ], [ %54, %.preheader.lr.ph ]
  %64 = phi i32 [ %75, %._crit_edge63 ], [ %60, %.preheader.lr.ph ]
  %65 = phi i32 [ %76, %._crit_edge63 ], [ %60, %.preheader.lr.ph ]
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %._crit_edge63 ], [ %indvars.iv81, %.preheader.lr.ph ]
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.lr.ph62, label %._crit_edge63

.lr.ph62:                                         ; preds = %.preheader
  %67 = getelementptr inbounds [25 x [3 x i32]], ptr @h, i64 0, i64 %indvars.iv83
  %68 = getelementptr inbounds i8, ptr %67, i64 4
  %69 = getelementptr inbounds i8, ptr %67, i64 8
  br label %79

.loopexit:                                        ; preds = %117, %79
  %70 = phi i32 [ %80, %79 ], [ %118, %117 ]
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next79, %71
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %72, label %79, label %._crit_edge63.loopexit, !llvm.loop !13

._crit_edge63.loopexit:                           ; preds = %.loopexit
  %.pre = load i32, ptr @nh, align 4, !tbaa !5
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %._crit_edge63.loopexit, %.preheader
  %73 = phi i32 [ %.pre, %._crit_edge63.loopexit ], [ %62, %.preheader ]
  %74 = phi i32 [ %.pre, %._crit_edge63.loopexit ], [ %63, %.preheader ]
  %75 = phi i32 [ %70, %._crit_edge63.loopexit ], [ %64, %.preheader ]
  %76 = phi i32 [ %70, %._crit_edge63.loopexit ], [ %65, %.preheader ]
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %77 = trunc nuw i64 %indvars.iv.next84 to i32
  %78 = icmp sgt i32 %74, %77
  br i1 %78, label %.preheader, label %.loopexit56.loopexit, !llvm.loop !14

79:                                               ; preds = %.lr.ph62, %.loopexit
  %80 = phi i32 [ %64, %.lr.ph62 ], [ %70, %.loopexit ]
  %81 = phi i32 [ %65, %.lr.ph62 ], [ %70, %.loopexit ]
  %indvars.iv78 = phi i64 [ 0, %.lr.ph62 ], [ %indvars.iv.next79, %.loopexit ]
  %indvars.iv = phi i64 [ 1, %.lr.ph62 ], [ %indvars.iv.next, %.loopexit ]
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %82 = sext i32 %81 to i64
  %83 = icmp slt i64 %indvars.iv.next79, %82
  br i1 %83, label %.lr.ph60, label %.loopexit

.lr.ph60:                                         ; preds = %79
  %84 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %indvars.iv78
  %85 = getelementptr inbounds i8, ptr %84, i64 4
  %86 = getelementptr inbounds i8, ptr %84, i64 8
  br label %87

87:                                               ; preds = %.lr.ph60, %117
  %indvars.iv75 = phi i64 [ %indvars.iv, %.lr.ph60 ], [ %indvars.iv.next76, %117 ]
  %88 = getelementptr inbounds [25 x [3 x i32]], ptr @v, i64 0, i64 %indvars.iv75
  %89 = getelementptr inbounds i8, ptr %88, i64 4
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %85, ptr noundef nonnull align 4 dereferenceable(4) %89)
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %88, i64 8
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %86, ptr noundef nonnull align 4 dereferenceable(4) %92)
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %57, align 4, !tbaa !5
  %96 = icmp slt i32 %95, %91
  %97 = icmp sgt i32 %95, %94
  %or.cond = select i1 %96, i1 true, i1 %97
  br i1 %or.cond, label %117, label %98

98:                                               ; preds = %87
  %99 = load i32, ptr %67, align 4, !tbaa !5
  %100 = icmp slt i32 %99, %91
  %101 = icmp sgt i32 %99, %94
  %or.cond53 = select i1 %100, i1 true, i1 %101
  br i1 %or.cond53, label %117, label %102

102:                                              ; preds = %98
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %58, ptr noundef nonnull align 4 dereferenceable(4) %68)
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %59, ptr noundef nonnull align 4 dereferenceable(4) %69)
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load i32, ptr %84, align 4, !tbaa !5
  %108 = icmp slt i32 %107, %104
  %109 = icmp sgt i32 %107, %106
  %or.cond54 = select i1 %108, i1 true, i1 %109
  br i1 %or.cond54, label %117, label %110

110:                                              ; preds = %102
  %111 = load i32, ptr %88, align 4, !tbaa !5
  %112 = icmp slt i32 %111, %104
  %113 = icmp sgt i32 %111, %106
  %or.cond55 = select i1 %112, i1 true, i1 %113
  br i1 %or.cond55, label %117, label %114

114:                                              ; preds = %110
  %115 = load i32, ptr @ans, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr @ans, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %114, %110, %102, %87, %98
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %118 = load i32, ptr @nv, align 4, !tbaa !5
  %119 = trunc nuw i64 %indvars.iv.next76 to i32
  %120 = icmp sgt i32 %118, %119
  br i1 %120, label %87, label %.loopexit, !llvm.loop !16
}

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

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

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

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

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

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

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


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