; LLVM IR from lzyrapx/Competitive-Programming :: 百度之星/2016 Astar Contest - Round 2A (1002-Sitting in Line)

; 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
@sn = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@f = external dso_local global [18 x [65536 x [18 x i32]]], align 16
@a = external dso_local global [18 x i32], align 16
@m = external dso_local global i32, align 4
@b = external dso_local global [18 x i32], align 16
@c = external dso_local global [18 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 [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

18:                                               ; preds = %276, %0
  %19 = load i32, ptr @T, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr @T, align 4, !tbaa !5
  %21 = icmp ne i32 %19, 0
  br i1 %21, label %22, label %279

22:                                               ; preds = %18
  call void @llvm.memset.p0.i64(ptr align 16 @c, i8 0, i64 72, i1 false)
  store i32 0, ptr @m, align 4, !tbaa !5
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %50, %22
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %53

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4)
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = icmp eq i32 %31, -1
  br i1 %32, label %33, label %39

33:                                               ; preds = %29
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = load i32, ptr @m, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr @m, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [18 x i32], ptr @a, i64 0, i64 %37
  store i32 %34, ptr %38, align 4, !tbaa !5
  br label %49

39:                                               ; preds = %29
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [18 x i32], ptr @b, i64 0, i64 %44
  store i32 %42, ptr %45, align 4, !tbaa !5
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [18 x i32], ptr @c, i64 0, i64 %47
  store i32 1, ptr %48, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %39, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %2, align 4, !tbaa !5
  br label %24, !llvm.loop !9

53:                                               ; preds = %28
  %54 = load i32, ptr @m, align 4, !tbaa !5
  %55 = shl i32 1, %54
  %56 = sub nsw i32 %55, 1
  store i32 %56, ptr @sn, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %92, %53
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %88, %62
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = load i32, ptr @sn, align 4, !tbaa !5
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %84, %68
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = load i32, ptr @m, align 4, !tbaa !5
  %72 = icmp sle i32 %70, %71
  br i1 %72, label %74, label %73

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

74:                                               ; preds = %69
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %76
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [65536 x [18 x i32]], ptr %77, i64 0, i64 %79
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [18 x i32], ptr %80, i64 0, i64 %82
  store i32 -2147483647, ptr %83, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %74
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %8, align 4, !tbaa !5
  br label %69, !llvm.loop !11

87:                                               ; preds = %73
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %7, align 4, !tbaa !5
  br label %63, !llvm.loop !12

91:                                               ; preds = %67
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %5, align 4, !tbaa !5
  br label %57, !llvm.loop !13

95:                                               ; preds = %61
  store i32 0, ptr @f, align 16, !tbaa !5
  store i32 0, ptr @a, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %249, %95
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = load i32, ptr @n, align 4, !tbaa !5
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 16, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %252

101:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %234, %101
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = load i32, ptr @sn, align 4, !tbaa !5
  %105 = icmp sle i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 19, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %237

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

108:                                              ; preds = %230, %107
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = load i32, ptr @m, align 4, !tbaa !5
  %111 = icmp sle i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 22, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %233

113:                                              ; preds = %108
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = sub nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %116
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [65536 x [18 x i32]], ptr %117, i64 0, i64 %119
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [18 x i32], ptr %120, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = icmp sgt i32 %124, -2147483647
  br i1 %125, label %126, label %229

126:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = sub nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %129
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [65536 x [18 x i32]], ptr %130, i64 0, i64 %132
  %134 = load i32, ptr %11, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [18 x i32], ptr %133, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  store i32 %137, ptr %12, align 4, !tbaa !5
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [18 x i32], ptr @c, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %171

143:                                              ; preds = %126
  %144 = load i32, ptr %9, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %145
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [65536 x [18 x i32]], ptr %146, i64 0, i64 %148
  %150 = getelementptr inbounds [18 x i32], ptr %149, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %151 = load i32, ptr %12, align 4, !tbaa !5
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [18 x i32], ptr @a, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = load i32, ptr %9, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [18 x i32], ptr @b, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = mul nsw i32 %155, %159
  %161 = add nsw i32 %151, %160
  store i32 %161, ptr %13, align 4, !tbaa !5
  %162 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %150, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = load i32, ptr %9, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %165
  %167 = load i32, ptr %10, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [65536 x [18 x i32]], ptr %166, i64 0, i64 %168
  %170 = getelementptr inbounds [18 x i32], ptr %169, i64 0, i64 0
  store i32 %163, ptr %170, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  store i32 24, ptr %6, align 4
  br label %226

171:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %222, %171
  %173 = load i32, ptr %14, align 4, !tbaa !5
  %174 = load i32, ptr @m, align 4, !tbaa !5
  %175 = icmp sle i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  store i32 25, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %225

177:                                              ; preds = %172
  %178 = load i32, ptr %14, align 4, !tbaa !5
  %179 = call noundef i32 @_Z1di(i32 noundef %178)
  %180 = load i32, ptr %10, align 4, !tbaa !5
  %181 = and i32 %179, %180
  %182 = icmp ne i32 %181, 0
  br i1 %182, label %221, label %183

183:                                              ; preds = %177
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %185
  %187 = load i32, ptr %10, align 4, !tbaa !5
  %188 = load i32, ptr %14, align 4, !tbaa !5
  %189 = call noundef i32 @_Z1di(i32 noundef %188)
  %190 = or i32 %187, %189
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [65536 x [18 x i32]], ptr %186, i64 0, i64 %191
  %193 = load i32, ptr %14, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [18 x i32], ptr %192, i64 0, i64 %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %196 = load i32, ptr %12, align 4, !tbaa !5
  %197 = load i32, ptr %14, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [18 x i32], ptr @a, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = load i32, ptr %11, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [18 x i32], ptr @a, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = mul nsw i32 %200, %204
  %206 = add nsw i32 %196, %205
  store i32 %206, ptr %15, align 4, !tbaa !5
  %207 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %195, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = load i32, ptr %9, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %210
  %212 = load i32, ptr %10, align 4, !tbaa !5
  %213 = load i32, ptr %14, align 4, !tbaa !5
  %214 = call noundef i32 @_Z1di(i32 noundef %213)
  %215 = or i32 %212, %214
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [65536 x [18 x i32]], ptr %211, i64 0, i64 %216
  %218 = load i32, ptr %14, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [18 x i32], ptr %217, i64 0, i64 %219
  store i32 %208, ptr %220, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %221

221:                                              ; preds = %183, %177
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %14, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %14, align 4, !tbaa !5
  br label %172, !llvm.loop !14

225:                                              ; preds = %176
  store i32 0, ptr %6, align 4
  br label %226

226:                                              ; preds = %225, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %227 = load i32, ptr %6, align 4
  switch i32 %227, label %280 [
    i32 0, label %228
    i32 24, label %230
  ]

228:                                              ; preds = %226
  br label %229

229:                                              ; preds = %228, %113
  br label %230

230:                                              ; preds = %229, %226
  %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 %108, !llvm.loop !15

233:                                              ; preds = %112
  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 %102, !llvm.loop !16

237:                                              ; preds = %106
  %238 = load i32, ptr %9, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [18 x i32], ptr @c, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = icmp ne i32 %241, 0
  br i1 %242, label %243, label %248

243:                                              ; preds = %237
  %244 = load i32, ptr %9, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [18 x i32], ptr @b, i64 0, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  store i32 %247, ptr @a, align 16, !tbaa !5
  br label %248

248:                                              ; preds = %243, %237
  br label %249

249:                                              ; preds = %248
  %250 = load i32, ptr %9, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %9, align 4, !tbaa !5
  br label %96, !llvm.loop !17

252:                                              ; preds = %100
  %253 = load i32, ptr @t, align 4, !tbaa !5
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr @t, align 4, !tbaa !5
  %255 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %254)
  store i32 -2147483647, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %273, %252
  %257 = load i32, ptr %16, align 4, !tbaa !5
  %258 = load i32, ptr @m, align 4, !tbaa !5
  %259 = icmp sle i32 %257, %258
  br i1 %259, label %261, label %260

260:                                              ; preds = %256
  store i32 28, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %276

261:                                              ; preds = %256
  %262 = load i32, ptr @n, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %263
  %265 = load i32, ptr @sn, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [65536 x [18 x i32]], ptr %264, i64 0, i64 %266
  %268 = load i32, ptr %16, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [18 x i32], ptr %267, i64 0, i64 %269
  %271 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %270)
  %272 = load i32, ptr %271, align 4, !tbaa !5
  store i32 %272, ptr @ans, align 4, !tbaa !5
  br label %273

273:                                              ; preds = %261
  %274 = load i32, ptr %16, align 4, !tbaa !5
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %16, align 4, !tbaa !5
  br label %256, !llvm.loop !18

276:                                              ; preds = %260
  %277 = load i32, ptr @ans, align 4, !tbaa !5
  %278 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %277)
  br label %18, !llvm.loop !19

279:                                              ; preds = %18
  ret i32 0

280:                                              ; preds = %226
  unreachable
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

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

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

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

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

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


; 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
@sn = external dso_local local_unnamed_addr global i32, align 4
@t = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local global [18 x [65536 x [18 x i32]]], align 16
@a = external dso_local local_unnamed_addr global [18 x i32], align 16
@m = external dso_local local_unnamed_addr global i32, align 4
@b = external dso_local local_unnamed_addr global [18 x i32], align 16
@c = external dso_local local_unnamed_addr global [18 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 [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = 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
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr @T, align 4, !tbaa !5
  %.not105 = icmp eq i32 %6, 0
  br i1 %.not105, label %._crit_edge108, label %.lr.ph107

.lr.ph107:                                        ; preds = %0, %._crit_edge104
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(72) @c, i8 0, i64 72, i1 false)
  store i32 0, ptr @m, 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
  %.not6177 = icmp slt i32 %9, 1
  br i1 %.not6177, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %31, %.lr.ph107
  %10 = phi i32 [ %9, %.lr.ph107 ], [ %33, %31 ]
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %notmask = shl nsw i32 -1, %11
  %12 = xor i32 %notmask, -1
  store i32 %12, ptr @sn, align 4, !tbaa !5
  %.not6284 = icmp slt i32 %10, 0
  br i1 %.not6284, label %._crit_edge86.thread, label %.preheader76.lr.ph

._crit_edge86.thread:                             ; preds = %._crit_edge
  store i32 0, ptr @f, align 16, !tbaa !5
  store i32 0, ptr @a, align 16, !tbaa !5
  br label %._crit_edge99

.preheader76.lr.ph:                               ; preds = %._crit_edge
  %.not7279 = icmp slt i32 %11, 0
  br i1 %.not7279, label %._crit_edge86, label %.preheader76.preheader

.preheader76.preheader:                           ; preds = %.preheader76.lr.ph
  %13 = add nuw i32 %11, 1
  %14 = sub i32 0, %notmask
  %15 = add nuw i32 %10, 1
  %wide.trip.count121 = zext i32 %15 to i64
  %wide.trip.count116 = zext i32 %14 to i64
  %wide.trip.count = zext i32 %13 to i64
  %min.iters.check = icmp ult i32 %11, 7
  %n.vec = and i64 %wide.trip.count, 4294967288
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br label %.preheader76

.lr.ph:                                           ; preds = %.lr.ph107, %31
  %.05278 = phi i32 [ %32, %31 ], [ 1, %.lr.ph107 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp eq i32 %17, -1
  br i1 %18, label %19, label %25

19:                                               ; preds = %.lr.ph
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr @m, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [18 x i32], ptr @a, i64 0, i64 %23
  store i32 %20, ptr %24, align 4, !tbaa !5
  br label %31

25:                                               ; preds = %.lr.ph
  %26 = add nuw nsw i32 %17, 1
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = sext i32 %26 to i64
  %29 = getelementptr inbounds [18 x i32], ptr @b, i64 0, i64 %28
  store i32 %27, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds [18 x i32], ptr @c, i64 0, i64 %28
  store i32 1, ptr %30, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %25, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %32 = add nuw nsw i32 %.05278, 1
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %.not61.not = icmp slt i32 %.05278, %33
  br i1 %.not61.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader76:                                     ; preds = %.preheader76.preheader, %.split
  %indvars.iv118 = phi i64 [ 0, %.preheader76.preheader ], [ %indvars.iv.next119, %.split ]
  br label %.preheader74

._crit_edge86:                                    ; preds = %.split, %.preheader76.lr.ph
  store i32 0, ptr @f, align 16, !tbaa !5
  store i32 0, ptr @a, align 16, !tbaa !5
  %.not6397 = icmp eq i32 %10, 0
  br i1 %.not6397, label %._crit_edge99, label %.preheader75

.preheader74:                                     ; preds = %.preheader76, %._crit_edge82
  %indvars.iv113 = phi i64 [ 0, %.preheader76 ], [ %indvars.iv.next114, %._crit_edge82 ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader74
  %indvars.iv.ph = phi i64 [ 0, %.preheader74 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.body:                                      ; preds = %.preheader74, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader74 ]
  %34 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %indvars.iv118, i64 %indvars.iv113, i64 %index
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  store <4 x i32> <i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647>, ptr %34, align 8, !tbaa !5
  store <4 x i32> <i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647>, ptr %35, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %36 = icmp eq i64 %index.next, %n.vec
  br i1 %36, label %middle.block, label %vector.body, !llvm.loop !11

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

.split:                                           ; preds = %._crit_edge82
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count121
  br i1 %exitcond122.not, label %._crit_edge86, label %.preheader76, !llvm.loop !14

._crit_edge82:                                    ; preds = %scalar.ph, %middle.block
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %exitcond117.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count116
  br i1 %exitcond117.not, label %.split, label %.preheader74, !llvm.loop !15

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %37 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %indvars.iv118, i64 %indvars.iv113, i64 %indvars.iv
  store i32 -2147483647, ptr %37, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge82, label %scalar.ph, !llvm.loop !16

.preheader75:                                     ; preds = %._crit_edge86, %112
  %38 = phi i32 [ %56, %112 ], [ %12, %._crit_edge86 ]
  %39 = phi i32 [ %57, %112 ], [ %11, %._crit_edge86 ]
  %40 = phi i32 [ %58, %112 ], [ %11, %._crit_edge86 ]
  %41 = phi i32 [ %59, %112 ], [ %11, %._crit_edge86 ]
  %42 = phi i32 [ %60, %112 ], [ %12, %._crit_edge86 ]
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %112 ], [ 1, %._crit_edge86 ]
  %.not6594 = icmp slt i32 %42, 0
  br i1 %.not6594, label %._crit_edge96, label %.preheader73.lr.ph

.preheader73.lr.ph:                               ; preds = %.preheader75
  %43 = add nsw i64 %indvars.iv132, -1
  %44 = getelementptr inbounds [18 x i32], ptr @c, i64 0, i64 %indvars.iv132
  %45 = getelementptr inbounds [18 x i32], ptr @b, i64 0, i64 %indvars.iv132
  %46 = icmp slt i32 %41, 0
  br i1 %46, label %._crit_edge96, label %.preheader73

._crit_edge99:                                    ; preds = %112, %._crit_edge86.thread, %._crit_edge86
  %47 = load i32, ptr @t, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr @t, align 4, !tbaa !5
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %48)
  store i32 -2147483647, ptr @ans, align 4, !tbaa !5
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %.not64100 = icmp slt i32 %50, 0
  br i1 %.not64100, label %._crit_edge104, label %.lr.ph103

.preheader73:                                     ; preds = %.preheader73.lr.ph, %._crit_edge93
  %51 = phi i32 [ %63, %._crit_edge93 ], [ %38, %.preheader73.lr.ph ]
  %52 = phi i32 [ %64, %._crit_edge93 ], [ %39, %.preheader73.lr.ph ]
  %53 = phi i32 [ %65, %._crit_edge93 ], [ %40, %.preheader73.lr.ph ]
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %._crit_edge93 ], [ 0, %.preheader73.lr.ph ]
  %.not6790 = icmp slt i32 %53, 0
  br i1 %.not6790, label %._crit_edge93, label %.lr.ph92

.lr.ph92:                                         ; preds = %.preheader73
  %54 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %indvars.iv132, i64 %indvars.iv129
  %55 = trunc nuw nsw i64 %indvars.iv129 to i32
  br label %67

._crit_edge96:                                    ; preds = %._crit_edge93, %.preheader73.lr.ph, %.preheader75
  %56 = phi i32 [ %38, %.preheader75 ], [ %38, %.preheader73.lr.ph ], [ %63, %._crit_edge93 ]
  %57 = phi i32 [ %39, %.preheader75 ], [ %39, %.preheader73.lr.ph ], [ %64, %._crit_edge93 ]
  %58 = phi i32 [ %40, %.preheader75 ], [ %40, %.preheader73.lr.ph ], [ %65, %._crit_edge93 ]
  %59 = phi i32 [ %41, %.preheader75 ], [ %41, %.preheader73.lr.ph ], [ %65, %._crit_edge93 ]
  %60 = phi i32 [ %42, %.preheader75 ], [ %42, %.preheader73.lr.ph ], [ %63, %._crit_edge93 ]
  %61 = getelementptr inbounds [18 x i32], ptr @c, i64 0, i64 %indvars.iv132
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %.not66 = icmp eq i32 %62, 0
  br i1 %.not66, label %112, label %109

._crit_edge93.loopexit:                           ; preds = %.loopexit
  %.pre138 = load i32, ptr @sn, align 4, !tbaa !5
  br label %._crit_edge93

._crit_edge93:                                    ; preds = %._crit_edge93.loopexit, %.preheader73
  %63 = phi i32 [ %.pre138, %._crit_edge93.loopexit ], [ %51, %.preheader73 ]
  %64 = phi i32 [ %107, %._crit_edge93.loopexit ], [ %52, %.preheader73 ]
  %65 = phi i32 [ %107, %._crit_edge93.loopexit ], [ %53, %.preheader73 ]
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %66 = sext i32 %63 to i64
  %.not65.not = icmp slt i64 %indvars.iv129, %66
  br i1 %.not65.not, label %.preheader73, label %._crit_edge96, !llvm.loop !17

67:                                               ; preds = %.lr.ph92, %.loopexit
  %68 = phi i32 [ %52, %.lr.ph92 ], [ %107, %.loopexit ]
  %69 = phi i32 [ %53, %.lr.ph92 ], [ %107, %.loopexit ]
  %indvars.iv126 = phi i64 [ 0, %.lr.ph92 ], [ %indvars.iv.next127, %.loopexit ]
  %70 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %43, i64 %indvars.iv129, i64 %indvars.iv126
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = icmp sgt i32 %71, -2147483647
  br i1 %72, label %73, label %.loopexit

73:                                               ; preds = %67
  %74 = load i32, ptr %44, align 4, !tbaa !5
  %.not68 = icmp eq i32 %74, 0
  br i1 %.not68, label %.preheader, label %76

.preheader:                                       ; preds = %73
  %.not6987 = icmp slt i32 %69, 1
  br i1 %.not6987, label %.loopexit, label %.lr.ph89

.lr.ph89:                                         ; preds = %.preheader
  %75 = getelementptr inbounds [18 x i32], ptr @a, i64 0, i64 %indvars.iv126
  br label %84

76:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %77 = getelementptr inbounds [18 x i32], ptr @a, i64 0, i64 %indvars.iv126
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %45, align 4, !tbaa !5
  %80 = mul nsw i32 %79, %78
  %81 = add nsw i32 %80, %71
  store i32 %81, ptr %3, align 4, !tbaa !5
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %54, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %83 = load i32, ptr %82, align 4, !tbaa !5
  store i32 %83, ptr %54, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %.loopexit

84:                                               ; preds = %.lr.ph89, %104
  %indvars.iv123 = phi i64 [ 1, %.lr.ph89 ], [ %indvars.iv.next124, %104 ]
  %85 = trunc nuw nsw i64 %indvars.iv123 to i32
  %86 = call noundef i32 @_Z1di(i32 noundef %85)
  %87 = and i32 %86, %55
  %.not70 = icmp eq i32 %87, 0
  br i1 %.not70, label %88, label %104

88:                                               ; preds = %84
  %89 = call noundef i32 @_Z1di(i32 noundef %85)
  %90 = or i32 %89, %55
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %indvars.iv132, i64 %91, i64 %indvars.iv123
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %93 = getelementptr inbounds [18 x i32], ptr @a, i64 0, i64 %indvars.iv123
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %75, align 4, !tbaa !5
  %96 = mul nsw i32 %95, %94
  %97 = add nsw i32 %96, %71
  store i32 %97, ptr %4, align 4, !tbaa !5
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %92, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = call noundef i32 @_Z1di(i32 noundef %85)
  %101 = or i32 %100, %55
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %indvars.iv132, i64 %102, i64 %indvars.iv123
  store i32 %99, ptr %103, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %104

104:                                              ; preds = %84, %88
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %105 = load i32, ptr @m, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %.not69.not = icmp slt i64 %indvars.iv123, %106
  br i1 %.not69.not, label %84, label %.loopexit, !llvm.loop !19

.loopexit:                                        ; preds = %104, %.preheader, %76, %67
  %107 = phi i32 [ %68, %.preheader ], [ %.pre, %76 ], [ %68, %67 ], [ %105, %104 ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %108 = sext i32 %107 to i64
  %.not67.not = icmp slt i64 %indvars.iv126, %108
  br i1 %.not67.not, label %67, label %._crit_edge93.loopexit, !llvm.loop !20

109:                                              ; preds = %._crit_edge96
  %110 = getelementptr inbounds [18 x i32], ptr @b, i64 0, i64 %indvars.iv132
  %111 = load i32, ptr %110, align 4, !tbaa !5
  store i32 %111, ptr @a, align 16, !tbaa !5
  br label %112

112:                                              ; preds = %._crit_edge96, %109
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %.not63.not = icmp slt i64 %indvars.iv132, %114
  br i1 %.not63.not, label %.preheader75, label %._crit_edge99, !llvm.loop !21

._crit_edge104:                                   ; preds = %.lr.ph103, %._crit_edge99
  %115 = phi i32 [ -2147483647, %._crit_edge99 ], [ %125, %.lr.ph103 ]
  %116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %115)
  %117 = load i32, ptr @T, align 4, !tbaa !5
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr @T, align 4, !tbaa !5
  %.not = icmp eq i32 %117, 0
  br i1 %.not, label %._crit_edge108, label %.lr.ph107, !llvm.loop !22

.lr.ph103:                                        ; preds = %._crit_edge99, %.lr.ph103
  %indvars.iv135 = phi i64 [ %indvars.iv.next136, %.lr.ph103 ], [ 0, %._crit_edge99 ]
  %119 = load i32, ptr @n, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = load i32, ptr @sn, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [18 x [65536 x [18 x i32]]], ptr @f, i64 0, i64 %120, i64 %122, i64 %indvars.iv135
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %123)
  %125 = load i32, ptr %124, align 4, !tbaa !5
  store i32 %125, ptr @ans, align 4, !tbaa !5
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %126 = load i32, ptr @m, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %.not64.not = icmp slt i64 %indvars.iv135, %127
  br i1 %.not64.not, label %.lr.ph103, label %._crit_edge104, !llvm.loop !23

._crit_edge108:                                   ; preds = %._crit_edge104, %0
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

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

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

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


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