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

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

@pat = external dso_local global ptr, align 8
@_ZZ4mainE4bits = external hidden global [32769 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3buf = external hidden global [17 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3nxt = external hidden global [5 x [32769 x i32]], align 16
@_ZZ4mainE3que = external hidden global ptr, align 8
@_ZZ4mainE1f = external hidden global [17 x i32], align 16
@_ZZ4mainE1g = external hidden global [17 x i32], align 16
@_ZZ4mainE1o = external hidden global i32, align 4
@_ZZ4mainE2dp = external hidden global [2 x [32769 x i32]], align 16
@_ZZ4mainE3ans = external hidden global [17 x i32], align 16
@.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
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i32 0, ptr @_ZZ4mainE4bits, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %37, %0
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 32769
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %21
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = ashr i32 %26, 1
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE4bits, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = and i32 %31, 1
  %33 = add nsw i32 %30, %32
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE4bits, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %25
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !9

40:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3)
  br label %42

42:                                               ; preds = %333, %40
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = add nsw i32 %43, -1
  store i32 %44, ptr %3, align 4, !tbaa !5
  %45 = icmp ne i32 %43, 0
  br i1 %45, label %46, label %334

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @_ZZ4mainE3buf, ptr noundef %5)
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %55, %46
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [17 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !11
  %53 = icmp ne i8 %52, 0
  br i1 %53, label %54, label %58

54:                                               ; preds = %48
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %4, align 4, !tbaa !5
  br label %48, !llvm.loop !12

58:                                               ; preds = %48
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = shl i32 1, %59
  %61 = sext i32 %60 to i64
  %62 = mul i64 %61, 4
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ4mainE3nxt, i8 -1, i64 %62, i1 false)
  store i32 0, ptr @_ZZ4mainE3nxt, align 16, !tbaa !5
  %63 = load ptr, ptr @_ZZ4mainE3que, align 8, !tbaa !13
  %64 = getelementptr inbounds i32, ptr %63, i64 0
  store i32 0, ptr %64, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %200, %58
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

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

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %71 = load ptr, ptr @_ZZ4mainE3que, align 8, !tbaa !13
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %71, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %9, align 4, !tbaa !5
  store i32 0, ptr @_ZZ4mainE1f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %76 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %76, ptr %11, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %94, %70
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 13, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %99

82:                                               ; preds = %77
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = and i32 %87, 1
  %89 = add nsw i32 %86, %88
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %92
  store i32 %89, ptr %93, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %82
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %10, align 4, !tbaa !5
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = ashr i32 %97, 1
  store i32 %98, ptr %11, align 4, !tbaa !5
  br label %77, !llvm.loop !15

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

100:                                              ; preds = %196, %99
  %101 = load i32, ptr %12, align 4, !tbaa !5
  %102 = icmp slt i32 %101, 4
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %199

104:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr @_ZZ4mainE1g, align 16, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %145, %104
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 19, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %148

110:                                              ; preds = %105
  %111 = load i32, ptr %14, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [17 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !11
  %115 = sext i8 %114 to i32
  %116 = load ptr, ptr @pat, align 8, !tbaa !13
  %117 = load i32, ptr %12, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i8, ptr %116, i64 %118
  %120 = load i8, ptr %119, align 1, !tbaa !11
  %121 = sext i8 %120 to i32
  %122 = icmp eq i32 %115, %121
  br i1 %122, label %123, label %129

123:                                              ; preds = %110
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  br label %139

129:                                              ; preds = %110
  %130 = load i32, ptr %14, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %132
  %134 = load i32, ptr %14, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %135
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %133, ptr noundef nonnull align 4 dereferenceable(4) %136)
  %138 = load i32, ptr %137, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %129, %123
  %140 = phi i32 [ %128, %123 ], [ %138, %129 ]
  %141 = load i32, ptr %14, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %143
  store i32 %140, ptr %144, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %139
  %146 = load i32, ptr %14, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %14, align 4, !tbaa !5
  br label %105, !llvm.loop !16

148:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %149 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %149, ptr %15, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %169, %148
  %151 = load i32, ptr %15, align 4, !tbaa !5
  %152 = icmp sgt i32 %151, 0
  br i1 %152, label %154, label %153

153:                                              ; preds = %150
  store i32 22, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %172

154:                                              ; preds = %150
  %155 = load i32, ptr %13, align 4, !tbaa !5
  %156 = shl i32 %155, 1
  %157 = load i32, ptr %15, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = load i32, ptr %15, align 4, !tbaa !5
  %162 = sub nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = icmp sgt i32 %160, %165
  %167 = zext i1 %166 to i32
  %168 = or i32 %156, %167
  store i32 %168, ptr %13, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %154
  %170 = load i32, ptr %15, align 4, !tbaa !5
  %171 = add nsw i32 %170, -1
  store i32 %171, ptr %15, align 4, !tbaa !5
  br label %150, !llvm.loop !17

172:                                              ; preds = %153
  %173 = load i32, ptr %13, align 4, !tbaa !5
  %174 = load i32, ptr %12, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 %175
  %177 = load i32, ptr %9, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [32769 x i32], ptr %176, i64 0, i64 %178
  store i32 %173, ptr %179, align 4, !tbaa !5
  %180 = load i32, ptr %13, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE3nxt, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = icmp eq i32 %183, -1
  br i1 %184, label %185, label %195

185:                                              ; preds = %172
  %186 = load i32, ptr %13, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE3nxt, i64 0, i64 %187
  store i32 0, ptr %188, align 4, !tbaa !5
  %189 = load i32, ptr %13, align 4, !tbaa !5
  %190 = load ptr, ptr @_ZZ4mainE3que, align 8, !tbaa !13
  %191 = load i32, ptr %7, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %7, align 4, !tbaa !5
  %193 = sext i32 %191 to i64
  %194 = getelementptr inbounds i32, ptr %190, i64 %193
  store i32 %189, ptr %194, align 4, !tbaa !5
  br label %195

195:                                              ; preds = %185, %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %196

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

199:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %200

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

203:                                              ; preds = %69
  %204 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %205
  %207 = getelementptr inbounds [32769 x i32], ptr %206, i64 0, i64 0
  %208 = load i32, ptr %4, align 4, !tbaa !5
  %209 = shl i32 1, %208
  %210 = sext i32 %209 to i64
  %211 = mul i64 %210, 4
  call void @llvm.memset.p0.i64(ptr align 4 %207, i8 0, i64 %211, i1 false)
  %212 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %213
  %215 = getelementptr inbounds [32769 x i32], ptr %214, i64 0, i64 0
  store i32 1, ptr %215, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %287, %203
  %217 = load i32, ptr %16, align 4, !tbaa !5
  %218 = load i32, ptr %5, align 4, !tbaa !5
  %219 = icmp slt i32 %217, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %216
  store i32 25, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %290

221:                                              ; preds = %216
  %222 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %223 = icmp ne i32 %222, 0
  %224 = xor i1 %223, true
  %225 = zext i1 %224 to i32
  store i32 %225, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %226 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %227
  %229 = getelementptr inbounds [32769 x i32], ptr %228, i64 0, i64 0
  %230 = load i32, ptr %4, align 4, !tbaa !5
  %231 = shl i32 1, %230
  %232 = sext i32 %231 to i64
  %233 = mul i64 %232, 4
  call void @llvm.memset.p0.i64(ptr align 4 %229, i8 0, i64 %233, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %234

234:                                              ; preds = %283, %221
  %235 = load i32, ptr %17, align 4, !tbaa !5
  %236 = load i32, ptr %4, align 4, !tbaa !5
  %237 = shl i32 1, %236
  %238 = icmp slt i32 %235, %237
  br i1 %238, label %240, label %239

239:                                              ; preds = %234
  store i32 28, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %286

240:                                              ; preds = %234
  %241 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %242 = icmp ne i32 %241, 0
  %243 = xor i1 %242, true
  %244 = zext i1 %243 to i64
  %245 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %244
  %246 = load i32, ptr %17, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [32769 x i32], ptr %245, i64 0, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = icmp ne i32 %249, 0
  br i1 %250, label %251, label %282

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

252:                                              ; preds = %278, %251
  %253 = load i32, ptr %18, align 4, !tbaa !5
  %254 = icmp slt i32 %253, 4
  br i1 %254, label %256, label %255

255:                                              ; preds = %252
  store i32 31, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %281

256:                                              ; preds = %252
  %257 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %258
  %260 = load i32, ptr %18, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 %261
  %263 = load i32, ptr %17, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [32769 x i32], ptr %262, i64 0, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [32769 x i32], ptr %259, i64 0, i64 %267
  %269 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %270 = icmp ne i32 %269, 0
  %271 = xor i1 %270, true
  %272 = zext i1 %271 to i64
  %273 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %272
  %274 = load i32, ptr %17, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [32769 x i32], ptr %273, i64 0, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %268, i32 noundef %277)
  br label %278

278:                                              ; preds = %256
  %279 = load i32, ptr %18, align 4, !tbaa !5
  %280 = add nsw i32 %279, 1
  store i32 %280, ptr %18, align 4, !tbaa !5
  br label %252, !llvm.loop !20

281:                                              ; preds = %255
  br label %282

282:                                              ; preds = %281, %240
  br label %283

283:                                              ; preds = %282
  %284 = load i32, ptr %17, align 4, !tbaa !5
  %285 = add nsw i32 %284, 1
  store i32 %285, ptr %17, align 4, !tbaa !5
  br label %234, !llvm.loop !21

286:                                              ; preds = %239
  br label %287

287:                                              ; preds = %286
  %288 = load i32, ptr %16, align 4, !tbaa !5
  %289 = add nsw i32 %288, 1
  store i32 %289, ptr %16, align 4, !tbaa !5
  br label %216, !llvm.loop !22

290:                                              ; preds = %220
  %291 = load i32, ptr %4, align 4, !tbaa !5
  %292 = add nsw i32 %291, 1
  %293 = sext i32 %292 to i64
  %294 = mul i64 %293, 4
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ4mainE3ans, i8 0, i64 %294, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %295

295:                                              ; preds = %315, %290
  %296 = load i32, ptr %19, align 4, !tbaa !5
  %297 = load i32, ptr %4, align 4, !tbaa !5
  %298 = shl i32 1, %297
  %299 = icmp slt i32 %296, %298
  br i1 %299, label %301, label %300

300:                                              ; preds = %295
  store i32 34, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %318

301:                                              ; preds = %295
  %302 = load i32, ptr %19, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE4bits, i64 0, i64 %303
  %305 = load i32, ptr %304, align 4, !tbaa !5
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %306
  %308 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %309
  %311 = load i32, ptr %19, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [32769 x i32], ptr %310, i64 0, i64 %312
  %314 = load i32, ptr %313, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %307, i32 noundef %314)
  br label %315

315:                                              ; preds = %301
  %316 = load i32, ptr %19, align 4, !tbaa !5
  %317 = add nsw i32 %316, 1
  store i32 %317, ptr %19, align 4, !tbaa !5
  br label %295, !llvm.loop !23

318:                                              ; preds = %300
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %319

319:                                              ; preds = %330, %318
  %320 = load i32, ptr %20, align 4, !tbaa !5
  %321 = load i32, ptr %4, align 4, !tbaa !5
  %322 = icmp sle i32 %320, %321
  br i1 %322, label %324, label %323

323:                                              ; preds = %319
  store i32 37, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %333

324:                                              ; preds = %319
  %325 = load i32, ptr %20, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %326
  %328 = load i32, ptr %327, align 4, !tbaa !5
  %329 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %328)
  br label %330

330:                                              ; preds = %324
  %331 = load i32, ptr %20, align 4, !tbaa !5
  %332 = add nsw i32 %331, 1
  store i32 %332, ptr %20, align 4, !tbaa !5
  br label %319, !llvm.loop !24

333:                                              ; preds = %323
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %42, !llvm.loop !25

334:                                              ; preds = %42
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  %335 = load i32, ptr %1, align 4
  ret i32 %335
}

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

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

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: 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)) #4

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !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"

@pat = external dso_local local_unnamed_addr global ptr, align 8
@_ZZ4mainE4bits = external hidden local_unnamed_addr global [32769 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3buf = external hidden global [17 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3nxt = external hidden local_unnamed_addr global [5 x [32769 x i32]], align 16
@_ZZ4mainE3que = external hidden local_unnamed_addr global ptr, align 8
@_ZZ4mainE1f = external hidden global [17 x i32], align 16
@_ZZ4mainE1g = external hidden global [17 x i32], align 16
@_ZZ4mainE1o = external hidden local_unnamed_addr global i32, align 4
@_ZZ4mainE2dp = external hidden global [2 x [32769 x i32]], align 16
@_ZZ4mainE3ans = external hidden global [17 x i32], align 16
@.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
  store i32 0, ptr @_ZZ4mainE4bits, align 16, !tbaa !5
  br label %7

3:                                                ; preds = %7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr %1, align 4, !tbaa !5
  %.not116 = icmp eq i32 %5, 0
  br i1 %.not116, label %._crit_edge119, label %.lr.ph118

7:                                                ; preds = %7, %0
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next.1, %7 ]
  %8 = lshr i64 %indvars.iv, 1
  %9 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE4bits, i64 0, i64 %8
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = add nsw i32 %10, 1
  %12 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE4bits, i64 0, i64 %indvars.iv
  store i32 %11, ptr %12, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = lshr i64 %indvars.iv.next, 1
  %14 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE4bits, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE4bits, i64 0, i64 %indvars.iv.next
  store i32 %15, ptr %16, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 32769
  br i1 %exitcond.not.1, label %3, label %7, !llvm.loop !9

.lr.ph118:                                        ; preds = %3, %357
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @_ZZ4mainE3buf, ptr noundef nonnull %2)
  br label %18

18:                                               ; preds = %18, %.lr.ph118
  %indvars.iv175 = phi i32 [ %indvars.iv.next176, %18 ], [ 1, %.lr.ph118 ]
  %indvars.iv132 = phi i32 [ %indvars.iv.next133, %18 ], [ 0, %.lr.ph118 ]
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %18 ], [ 0, %.lr.ph118 ]
  %19 = getelementptr inbounds [17 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv126
  %20 = load i8, ptr %19, align 1, !tbaa !11
  %.not82 = icmp eq i8 %20, 0
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %indvars.iv.next133 = add i32 %indvars.iv132, 1
  %indvars.iv.next176 = add nuw i32 %indvars.iv175, 1
  br i1 %.not82, label %21, label %18, !llvm.loop !12

21:                                               ; preds = %18
  %22 = trunc nuw nsw i64 %indvars.iv126 to i32
  %23 = shl nuw i32 1, %22
  %24 = sext i32 %23 to i64
  %25 = shl nsw i64 %24, 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @_ZZ4mainE3nxt, i8 -1, i64 %25, i1 false)
  store i32 0, ptr @_ZZ4mainE3nxt, align 16, !tbaa !5
  %26 = load ptr, ptr @_ZZ4mainE3que, align 8, !tbaa !13
  store i32 0, ptr %26, align 4, !tbaa !5
  %.not120 = icmp eq i64 %indvars.iv126, 0
  %wide.trip.count = zext i32 %indvars.iv132 to i64
  %wide.trip.count139 = zext i32 %indvars.iv132 to i64
  %wide.trip.count139.1 = zext i32 %indvars.iv132 to i64
  %wide.trip.count139.2 = zext i32 %indvars.iv132 to i64
  %wide.trip.count139.3 = zext i32 %indvars.iv132 to i64
  %27 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %wide.trip.count, 3
  %28 = icmp ult i64 %27, 3
  %unroll_iter = and i64 %wide.trip.count, 4294967292
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %xtraiter205 = and i64 %wide.trip.count, 1
  %29 = icmp eq i64 %27, 0
  %unroll_iter209 = and i64 %wide.trip.count, 4294967294
  %lcmp.mod207.not = icmp eq i64 %xtraiter205, 0
  %xtraiter215 = and i64 %indvars.iv126, 1
  %30 = icmp eq i64 %27, 0
  %unroll_iter219 = and i64 %indvars.iv126, 9223372036854775806
  %lcmp.mod217.not = icmp eq i64 %xtraiter215, 0
  %xtraiter221 = and i64 %indvars.iv126, 1
  %31 = icmp eq i64 %27, 0
  %unroll_iter225 = and i64 %indvars.iv126, 9223372036854775806
  %lcmp.mod223.not = icmp eq i64 %xtraiter221, 0
  %xtraiter227 = and i64 %indvars.iv126, 1
  %32 = icmp eq i64 %27, 0
  %unroll_iter231 = and i64 %indvars.iv126, 9223372036854775806
  %lcmp.mod229.not = icmp eq i64 %xtraiter227, 0
  br label %39

33:                                               ; preds = %296
  %34 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %35
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %36, i8 0, i64 %25, i1 false)
  store i32 1, ptr %36, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph110, label %._crit_edge111

.lr.ph110:                                        ; preds = %33
  %.not123 = icmp eq i64 %indvars.iv126, 31
  %smax = call i32 @llvm.smax.i32(i32 %23, i32 1)
  %wide.trip.count162 = zext nneg i32 %smax to i64
  br label %302

39:                                               ; preds = %21, %296
  %indvars.iv149 = phi i64 [ 0, %21 ], [ %indvars.iv.next150, %296 ]
  %.078102 = phi i32 [ 1, %21 ], [ %.2.3, %296 ]
  %40 = load ptr, ptr @_ZZ4mainE3que, align 8, !tbaa !13
  %41 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv149
  %42 = load i32, ptr %41, align 4, !tbaa !5
  store i32 0, ptr @_ZZ4mainE1f, align 16, !tbaa !5
  br i1 %.not120, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %39
  br i1 %28, label %.preheader89.unr-lcssa, label %.lr.ph

.preheader89.unr-lcssa:                           ; preds = %.lr.ph, %.lr.ph.preheader
  %.unr = phi i32 [ 0, %.lr.ph.preheader ], [ %62, %.lr.ph ]
  %indvars.iv129.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next130.3, %.lr.ph ]
  %.07693.unr = phi i32 [ %42, %.lr.ph.preheader ], [ %64, %.lr.ph ]
  br i1 %lcmp.mod.not, label %.preheader89, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader89.unr-lcssa, %.lr.ph.epil
  %43 = phi i32 [ %45, %.lr.ph.epil ], [ %.unr, %.preheader89.unr-lcssa ]
  %indvars.iv129.epil = phi i64 [ %indvars.iv.next130.epil, %.lr.ph.epil ], [ %indvars.iv129.unr, %.preheader89.unr-lcssa ]
  %.07693.epil = phi i32 [ %47, %.lr.ph.epil ], [ %.07693.unr, %.preheader89.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader89.unr-lcssa ]
  %44 = and i32 %.07693.epil, 1
  %45 = add nuw nsw i32 %43, %44
  %indvars.iv.next130.epil = add nuw nsw i64 %indvars.iv129.epil, 1
  %46 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %indvars.iv.next130.epil
  store i32 %45, ptr %46, align 4, !tbaa !5
  %47 = ashr i32 %.07693.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader89, label %.lr.ph.epil, !llvm.loop !15

.preheader89:                                     ; preds = %.lr.ph.epil, %.preheader89.unr-lcssa
  store i32 0, ptr @_ZZ4mainE1g, align 16, !tbaa !5
  br i1 %.not120, label %._crit_edge, label %.lr.ph95

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %48 = phi i32 [ %62, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %indvars.iv129 = phi i64 [ %indvars.iv.next130.3, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %.07693 = phi i32 [ %64, %.lr.ph ], [ %42, %.lr.ph.preheader ]
  %niter = phi i64 [ %niter.next.3, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %49 = and i32 %.07693, 1
  %50 = add nuw nsw i32 %48, %49
  %indvars.iv.next130 = or disjoint i64 %indvars.iv129, 1
  %51 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %indvars.iv.next130
  store i32 %50, ptr %51, align 4, !tbaa !5
  %52 = lshr i32 %.07693, 1
  %53 = and i32 %52, 1
  %54 = add nuw nsw i32 %50, %53
  %indvars.iv.next130.1 = or disjoint i64 %indvars.iv129, 2
  %55 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %indvars.iv.next130.1
  store i32 %54, ptr %55, align 8, !tbaa !5
  %56 = lshr i32 %.07693, 2
  %57 = and i32 %56, 1
  %58 = add nuw nsw i32 %54, %57
  %indvars.iv.next130.2 = or disjoint i64 %indvars.iv129, 3
  %59 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %indvars.iv.next130.2
  store i32 %58, ptr %59, align 4, !tbaa !5
  %60 = lshr i32 %.07693, 3
  %61 = and i32 %60, 1
  %62 = add nuw nsw i32 %58, %61
  %indvars.iv.next130.3 = add nuw nsw i64 %indvars.iv129, 4
  %63 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %indvars.iv.next130.3
  store i32 %62, ptr %63, align 16, !tbaa !5
  %64 = ashr i32 %.07693, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader89.unr-lcssa, label %.lr.ph, !llvm.loop !17

.lr.ph95:                                         ; preds = %.preheader89
  %.pre179 = load ptr, ptr @pat, align 8, !tbaa !13
  br label %65

.preheader88:                                     ; preds = %81
  br i1 %.not120, label %._crit_edge, label %.lr.ph98.preheader

.lr.ph98.preheader:                               ; preds = %.preheader88
  br i1 %29, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph98

65:                                               ; preds = %.lr.ph95, %81
  %66 = phi ptr [ %.pre179, %.lr.ph95 ], [ %82, %81 ]
  %indvars.iv135 = phi i64 [ 0, %.lr.ph95 ], [ %indvars.iv.next136.pre-phi, %81 ]
  %67 = getelementptr inbounds [17 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv135
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = load i8, ptr %66, align 1, !tbaa !11
  %70 = icmp eq i8 %68, %69
  br i1 %70, label %71, label %75

71:                                               ; preds = %65
  %72 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %indvars.iv135
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  %.pre192 = add nuw nsw i64 %indvars.iv135, 1
  br label %81

75:                                               ; preds = %65
  %76 = add nuw nsw i64 %indvars.iv135, 1
  %77 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %76
  %78 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv135
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %77, ptr noundef nonnull align 4 dereferenceable(4) %78)
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %.pre = load ptr, ptr @pat, align 8, !tbaa !13
  br label %81

81:                                               ; preds = %75, %71
  %indvars.iv.next136.pre-phi = phi i64 [ %76, %75 ], [ %.pre192, %71 ]
  %82 = phi ptr [ %.pre, %75 ], [ %66, %71 ]
  %83 = phi i32 [ %80, %75 ], [ %74, %71 ]
  %84 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv.next136.pre-phi
  store i32 %83, ptr %84, align 4, !tbaa !5
  %exitcond140.not = icmp eq i64 %indvars.iv.next136.pre-phi, %wide.trip.count139
  br i1 %exitcond140.not, label %.preheader88, label %65, !llvm.loop !18

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph98, %.lr.ph98.preheader
  %.lcssa.ph = phi i32 [ poison, %.lr.ph98.preheader ], [ %116, %.lr.ph98 ]
  %indvars.iv141.unr = phi i64 [ %indvars.iv126, %.lr.ph98.preheader ], [ %indvars.iv.next142.1213, %.lr.ph98 ]
  %.07496.unr = phi i32 [ 0, %.lr.ph98.preheader ], [ %116, %.lr.ph98 ]
  br i1 %lcmp.mod207.not, label %._crit_edge, label %.lr.ph98.epil

.lr.ph98.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %85 = shl i32 %.07496.unr, 1
  %86 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv141.unr
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %indvars.iv.next142.epil = add i64 %indvars.iv141.unr, 4294967295
  %88 = and i64 %indvars.iv.next142.epil, 4294967295
  %89 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp sgt i32 %87, %90
  %92 = zext i1 %91 to i32
  %93 = or disjoint i32 %85, %92
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph98.epil, %._crit_edge.loopexit.unr-lcssa, %39, %.preheader89, %.preheader88
  %.074.lcssa = phi i32 [ 0, %.preheader88 ], [ 0, %.preheader89 ], [ 0, %39 ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %93, %.lr.ph98.epil ]
  %94 = sext i32 %42 to i64
  %95 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 0, i64 %94
  store i32 %.074.lcssa, ptr %95, align 4, !tbaa !5
  %96 = sext i32 %.074.lcssa to i64
  %97 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE3nxt, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp eq i32 %98, -1
  br i1 %99, label %117, label %122

.lr.ph98:                                         ; preds = %.lr.ph98.preheader, %.lr.ph98
  %indvars.iv141 = phi i64 [ %indvars.iv.next142.1213, %.lr.ph98 ], [ %indvars.iv126, %.lr.ph98.preheader ]
  %.07496 = phi i32 [ %116, %.lr.ph98 ], [ 0, %.lr.ph98.preheader ]
  %niter210 = phi i64 [ %niter210.next.1, %.lr.ph98 ], [ 0, %.lr.ph98.preheader ]
  %100 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv141
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %indvars.iv.next142 = add nsw i64 %indvars.iv141, -1
  %102 = and i64 %indvars.iv.next142, 4294967295
  %103 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp sgt i32 %101, %104
  %106 = shl i32 %.07496, 2
  %107 = select i1 %105, i32 2, i32 0
  %108 = or disjoint i32 %106, %107
  %109 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv.next142
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %indvars.iv.next142.1213 = add nsw i64 %indvars.iv141, -2
  %111 = and i64 %indvars.iv.next142.1213, 4294967295
  %112 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = icmp sgt i32 %110, %113
  %115 = zext i1 %114 to i32
  %116 = or disjoint i32 %108, %115
  %niter210.next.1 = add i64 %niter210, 2
  %niter210.ncmp.1.not = icmp eq i64 %niter210.next.1, %unroll_iter209
  br i1 %niter210.ncmp.1.not, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph98, !llvm.loop !19

117:                                              ; preds = %._crit_edge
  store i32 0, ptr %97, align 4, !tbaa !5
  %118 = load ptr, ptr @_ZZ4mainE3que, align 8, !tbaa !13
  %119 = add nsw i32 %.078102, 1
  %120 = sext i32 %.078102 to i64
  %121 = getelementptr inbounds i32, ptr %118, i64 %120
  store i32 %.074.lcssa, ptr %121, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %117, %._crit_edge
  %.2 = phi i32 [ %119, %117 ], [ %.078102, %._crit_edge ]
  store i32 0, ptr @_ZZ4mainE1g, align 16, !tbaa !5
  br i1 %.not120, label %._crit_edge.1, label %.lr.ph95.1

.lr.ph95.1:                                       ; preds = %122
  %.pre181 = load ptr, ptr @pat, align 8, !tbaa !13
  br label %123

123:                                              ; preds = %140, %.lr.ph95.1
  %124 = phi ptr [ %.pre181, %.lr.ph95.1 ], [ %141, %140 ]
  %indvars.iv135.1 = phi i64 [ 0, %.lr.ph95.1 ], [ %indvars.iv.next136.1.pre-phi, %140 ]
  %125 = getelementptr inbounds [17 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv135.1
  %126 = load i8, ptr %125, align 1, !tbaa !11
  %127 = getelementptr inbounds i8, ptr %124, i64 1
  %128 = load i8, ptr %127, align 1, !tbaa !11
  %129 = icmp eq i8 %126, %128
  br i1 %129, label %136, label %130

130:                                              ; preds = %123
  %131 = add nuw nsw i64 %indvars.iv135.1, 1
  %132 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %131
  %133 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv135.1
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %132, ptr noundef nonnull align 4 dereferenceable(4) %133)
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %.pre180 = load ptr, ptr @pat, align 8, !tbaa !13
  br label %140

136:                                              ; preds = %123
  %137 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %indvars.iv135.1
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  %.pre191 = add nuw nsw i64 %indvars.iv135.1, 1
  br label %140

140:                                              ; preds = %136, %130
  %indvars.iv.next136.1.pre-phi = phi i64 [ %.pre191, %136 ], [ %131, %130 ]
  %141 = phi ptr [ %124, %136 ], [ %.pre180, %130 ]
  %142 = phi i32 [ %139, %136 ], [ %135, %130 ]
  %143 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv.next136.1.pre-phi
  store i32 %142, ptr %143, align 4, !tbaa !5
  %exitcond140.1.not = icmp eq i64 %indvars.iv.next136.1.pre-phi, %wide.trip.count139.1
  br i1 %exitcond140.1.not, label %.preheader88.1, label %123, !llvm.loop !18

.preheader88.1:                                   ; preds = %140
  br i1 %.not120, label %._crit_edge.1, label %.lr.ph98.1.preheader

.lr.ph98.1.preheader:                             ; preds = %.preheader88.1
  br i1 %30, label %._crit_edge.1.loopexit.unr-lcssa, label %.lr.ph98.1

.lr.ph98.1:                                       ; preds = %.lr.ph98.1.preheader, %.lr.ph98.1
  %indvars.iv141.1 = phi i64 [ %indvars.iv.next142.1.1, %.lr.ph98.1 ], [ %indvars.iv126, %.lr.ph98.1.preheader ]
  %.07496.1 = phi i32 [ %160, %.lr.ph98.1 ], [ 0, %.lr.ph98.1.preheader ]
  %niter220 = phi i64 [ %niter220.next.1, %.lr.ph98.1 ], [ 0, %.lr.ph98.1.preheader ]
  %144 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv141.1
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %indvars.iv.next142.1 = add nsw i64 %indvars.iv141.1, -1
  %146 = and i64 %indvars.iv.next142.1, 4294967295
  %147 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = icmp sgt i32 %145, %148
  %150 = shl i32 %.07496.1, 2
  %151 = select i1 %149, i32 2, i32 0
  %152 = or disjoint i32 %150, %151
  %153 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv.next142.1
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %indvars.iv.next142.1.1 = add nsw i64 %indvars.iv141.1, -2
  %155 = and i64 %indvars.iv.next142.1.1, 4294967295
  %156 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = icmp sgt i32 %154, %157
  %159 = zext i1 %158 to i32
  %160 = or disjoint i32 %152, %159
  %niter220.next.1 = add i64 %niter220, 2
  %niter220.ncmp.1.not = icmp eq i64 %niter220.next.1, %unroll_iter219
  br i1 %niter220.ncmp.1.not, label %._crit_edge.1.loopexit.unr-lcssa, label %.lr.ph98.1, !llvm.loop !19

._crit_edge.1.loopexit.unr-lcssa:                 ; preds = %.lr.ph98.1, %.lr.ph98.1.preheader
  %.lcssa201.ph = phi i32 [ poison, %.lr.ph98.1.preheader ], [ %160, %.lr.ph98.1 ]
  %indvars.iv141.1.unr = phi i64 [ %indvars.iv126, %.lr.ph98.1.preheader ], [ %indvars.iv.next142.1.1, %.lr.ph98.1 ]
  %.07496.1.unr = phi i32 [ 0, %.lr.ph98.1.preheader ], [ %160, %.lr.ph98.1 ]
  br i1 %lcmp.mod217.not, label %._crit_edge.1, label %.lr.ph98.1.epil

.lr.ph98.1.epil:                                  ; preds = %._crit_edge.1.loopexit.unr-lcssa
  %161 = shl i32 %.07496.1.unr, 1
  %162 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv141.1.unr
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %indvars.iv.next142.1.epil = add i64 %indvars.iv141.1.unr, 4294967295
  %164 = and i64 %indvars.iv.next142.1.epil, 4294967295
  %165 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = icmp sgt i32 %163, %166
  %168 = zext i1 %167 to i32
  %169 = or disjoint i32 %161, %168
  br label %._crit_edge.1

._crit_edge.1:                                    ; preds = %.lr.ph98.1.epil, %._crit_edge.1.loopexit.unr-lcssa, %122, %.preheader88.1
  %.074.lcssa.1 = phi i32 [ 0, %.preheader88.1 ], [ 0, %122 ], [ %.lcssa201.ph, %._crit_edge.1.loopexit.unr-lcssa ], [ %169, %.lr.ph98.1.epil ]
  %170 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 1, i64 %94
  store i32 %.074.lcssa.1, ptr %170, align 4, !tbaa !5
  %171 = sext i32 %.074.lcssa.1 to i64
  %172 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE3nxt, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = icmp eq i32 %173, -1
  br i1 %174, label %175, label %180

175:                                              ; preds = %._crit_edge.1
  store i32 0, ptr %172, align 4, !tbaa !5
  %176 = load ptr, ptr @_ZZ4mainE3que, align 8, !tbaa !13
  %177 = add nsw i32 %.2, 1
  %178 = sext i32 %.2 to i64
  %179 = getelementptr inbounds i32, ptr %176, i64 %178
  store i32 %.074.lcssa.1, ptr %179, align 4, !tbaa !5
  br label %180

180:                                              ; preds = %175, %._crit_edge.1
  %.2.1 = phi i32 [ %177, %175 ], [ %.2, %._crit_edge.1 ]
  store i32 0, ptr @_ZZ4mainE1g, align 16, !tbaa !5
  br i1 %.not120, label %._crit_edge.2, label %.lr.ph95.2

.lr.ph95.2:                                       ; preds = %180
  %.pre183 = load ptr, ptr @pat, align 8, !tbaa !13
  br label %181

181:                                              ; preds = %198, %.lr.ph95.2
  %182 = phi ptr [ %.pre183, %.lr.ph95.2 ], [ %199, %198 ]
  %indvars.iv135.2 = phi i64 [ 0, %.lr.ph95.2 ], [ %indvars.iv.next136.2.pre-phi, %198 ]
  %183 = getelementptr inbounds [17 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv135.2
  %184 = load i8, ptr %183, align 1, !tbaa !11
  %185 = getelementptr inbounds i8, ptr %182, i64 2
  %186 = load i8, ptr %185, align 1, !tbaa !11
  %187 = icmp eq i8 %184, %186
  br i1 %187, label %194, label %188

188:                                              ; preds = %181
  %189 = add nuw nsw i64 %indvars.iv135.2, 1
  %190 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %189
  %191 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv135.2
  %192 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %190, ptr noundef nonnull align 4 dereferenceable(4) %191)
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %.pre182 = load ptr, ptr @pat, align 8, !tbaa !13
  br label %198

194:                                              ; preds = %181
  %195 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %indvars.iv135.2
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  %.pre190 = add nuw nsw i64 %indvars.iv135.2, 1
  br label %198

198:                                              ; preds = %194, %188
  %indvars.iv.next136.2.pre-phi = phi i64 [ %.pre190, %194 ], [ %189, %188 ]
  %199 = phi ptr [ %182, %194 ], [ %.pre182, %188 ]
  %200 = phi i32 [ %197, %194 ], [ %193, %188 ]
  %201 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv.next136.2.pre-phi
  store i32 %200, ptr %201, align 4, !tbaa !5
  %exitcond140.2.not = icmp eq i64 %indvars.iv.next136.2.pre-phi, %wide.trip.count139.2
  br i1 %exitcond140.2.not, label %.preheader88.2, label %181, !llvm.loop !18

.preheader88.2:                                   ; preds = %198
  br i1 %.not120, label %._crit_edge.2, label %.lr.ph98.2.preheader

.lr.ph98.2.preheader:                             ; preds = %.preheader88.2
  br i1 %31, label %._crit_edge.2.loopexit.unr-lcssa, label %.lr.ph98.2

.lr.ph98.2:                                       ; preds = %.lr.ph98.2.preheader, %.lr.ph98.2
  %indvars.iv141.2 = phi i64 [ %indvars.iv.next142.2.1, %.lr.ph98.2 ], [ %indvars.iv126, %.lr.ph98.2.preheader ]
  %.07496.2 = phi i32 [ %218, %.lr.ph98.2 ], [ 0, %.lr.ph98.2.preheader ]
  %niter226 = phi i64 [ %niter226.next.1, %.lr.ph98.2 ], [ 0, %.lr.ph98.2.preheader ]
  %202 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv141.2
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %indvars.iv.next142.2 = add nsw i64 %indvars.iv141.2, -1
  %204 = and i64 %indvars.iv.next142.2, 4294967295
  %205 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = icmp sgt i32 %203, %206
  %208 = shl i32 %.07496.2, 2
  %209 = select i1 %207, i32 2, i32 0
  %210 = or disjoint i32 %208, %209
  %211 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv.next142.2
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %indvars.iv.next142.2.1 = add nsw i64 %indvars.iv141.2, -2
  %213 = and i64 %indvars.iv.next142.2.1, 4294967295
  %214 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !5
  %216 = icmp sgt i32 %212, %215
  %217 = zext i1 %216 to i32
  %218 = or disjoint i32 %210, %217
  %niter226.next.1 = add i64 %niter226, 2
  %niter226.ncmp.1.not = icmp eq i64 %niter226.next.1, %unroll_iter225
  br i1 %niter226.ncmp.1.not, label %._crit_edge.2.loopexit.unr-lcssa, label %.lr.ph98.2, !llvm.loop !19

._crit_edge.2.loopexit.unr-lcssa:                 ; preds = %.lr.ph98.2, %.lr.ph98.2.preheader
  %.lcssa202.ph = phi i32 [ poison, %.lr.ph98.2.preheader ], [ %218, %.lr.ph98.2 ]
  %indvars.iv141.2.unr = phi i64 [ %indvars.iv126, %.lr.ph98.2.preheader ], [ %indvars.iv.next142.2.1, %.lr.ph98.2 ]
  %.07496.2.unr = phi i32 [ 0, %.lr.ph98.2.preheader ], [ %218, %.lr.ph98.2 ]
  br i1 %lcmp.mod223.not, label %._crit_edge.2, label %.lr.ph98.2.epil

.lr.ph98.2.epil:                                  ; preds = %._crit_edge.2.loopexit.unr-lcssa
  %219 = shl i32 %.07496.2.unr, 1
  %220 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv141.2.unr
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %indvars.iv.next142.2.epil = add i64 %indvars.iv141.2.unr, 4294967295
  %222 = and i64 %indvars.iv.next142.2.epil, 4294967295
  %223 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = icmp sgt i32 %221, %224
  %226 = zext i1 %225 to i32
  %227 = or disjoint i32 %219, %226
  br label %._crit_edge.2

._crit_edge.2:                                    ; preds = %.lr.ph98.2.epil, %._crit_edge.2.loopexit.unr-lcssa, %180, %.preheader88.2
  %.074.lcssa.2 = phi i32 [ 0, %.preheader88.2 ], [ 0, %180 ], [ %.lcssa202.ph, %._crit_edge.2.loopexit.unr-lcssa ], [ %227, %.lr.ph98.2.epil ]
  %228 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 2, i64 %94
  store i32 %.074.lcssa.2, ptr %228, align 4, !tbaa !5
  %229 = sext i32 %.074.lcssa.2 to i64
  %230 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE3nxt, i64 0, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !5
  %232 = icmp eq i32 %231, -1
  br i1 %232, label %233, label %238

233:                                              ; preds = %._crit_edge.2
  store i32 0, ptr %230, align 4, !tbaa !5
  %234 = load ptr, ptr @_ZZ4mainE3que, align 8, !tbaa !13
  %235 = add nsw i32 %.2.1, 1
  %236 = sext i32 %.2.1 to i64
  %237 = getelementptr inbounds i32, ptr %234, i64 %236
  store i32 %.074.lcssa.2, ptr %237, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %233, %._crit_edge.2
  %.2.2 = phi i32 [ %235, %233 ], [ %.2.1, %._crit_edge.2 ]
  store i32 0, ptr @_ZZ4mainE1g, align 16, !tbaa !5
  br i1 %.not120, label %._crit_edge.3, label %.lr.ph95.3

.lr.ph95.3:                                       ; preds = %238
  %.pre185 = load ptr, ptr @pat, align 8, !tbaa !13
  br label %239

239:                                              ; preds = %256, %.lr.ph95.3
  %240 = phi ptr [ %.pre185, %.lr.ph95.3 ], [ %257, %256 ]
  %indvars.iv135.3 = phi i64 [ 0, %.lr.ph95.3 ], [ %indvars.iv.next136.3.pre-phi, %256 ]
  %241 = getelementptr inbounds [17 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv135.3
  %242 = load i8, ptr %241, align 1, !tbaa !11
  %243 = getelementptr inbounds i8, ptr %240, i64 3
  %244 = load i8, ptr %243, align 1, !tbaa !11
  %245 = icmp eq i8 %242, %244
  br i1 %245, label %252, label %246

246:                                              ; preds = %239
  %247 = add nuw nsw i64 %indvars.iv135.3, 1
  %248 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %247
  %249 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv135.3
  %250 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %248, ptr noundef nonnull align 4 dereferenceable(4) %249)
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %.pre184 = load ptr, ptr @pat, align 8, !tbaa !13
  br label %256

252:                                              ; preds = %239
  %253 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1f, i64 0, i64 %indvars.iv135.3
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = add nsw i32 %254, 1
  %.pre189 = add nuw nsw i64 %indvars.iv135.3, 1
  br label %256

256:                                              ; preds = %252, %246
  %indvars.iv.next136.3.pre-phi = phi i64 [ %.pre189, %252 ], [ %247, %246 ]
  %257 = phi ptr [ %240, %252 ], [ %.pre184, %246 ]
  %258 = phi i32 [ %255, %252 ], [ %251, %246 ]
  %259 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv.next136.3.pre-phi
  store i32 %258, ptr %259, align 4, !tbaa !5
  %exitcond140.3.not = icmp eq i64 %indvars.iv.next136.3.pre-phi, %wide.trip.count139.3
  br i1 %exitcond140.3.not, label %.preheader88.3, label %239, !llvm.loop !18

.preheader88.3:                                   ; preds = %256
  br i1 %.not120, label %._crit_edge.3, label %.lr.ph98.3.preheader

.lr.ph98.3.preheader:                             ; preds = %.preheader88.3
  br i1 %32, label %._crit_edge.3.loopexit.unr-lcssa, label %.lr.ph98.3

.lr.ph98.3:                                       ; preds = %.lr.ph98.3.preheader, %.lr.ph98.3
  %indvars.iv141.3 = phi i64 [ %indvars.iv.next142.3.1, %.lr.ph98.3 ], [ %indvars.iv126, %.lr.ph98.3.preheader ]
  %.07496.3 = phi i32 [ %276, %.lr.ph98.3 ], [ 0, %.lr.ph98.3.preheader ]
  %niter232 = phi i64 [ %niter232.next.1, %.lr.ph98.3 ], [ 0, %.lr.ph98.3.preheader ]
  %260 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv141.3
  %261 = load i32, ptr %260, align 4, !tbaa !5
  %indvars.iv.next142.3 = add nsw i64 %indvars.iv141.3, -1
  %262 = and i64 %indvars.iv.next142.3, 4294967295
  %263 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !5
  %265 = icmp sgt i32 %261, %264
  %266 = shl i32 %.07496.3, 2
  %267 = select i1 %265, i32 2, i32 0
  %268 = or disjoint i32 %266, %267
  %269 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv.next142.3
  %270 = load i32, ptr %269, align 4, !tbaa !5
  %indvars.iv.next142.3.1 = add nsw i64 %indvars.iv141.3, -2
  %271 = and i64 %indvars.iv.next142.3.1, 4294967295
  %272 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  %274 = icmp sgt i32 %270, %273
  %275 = zext i1 %274 to i32
  %276 = or disjoint i32 %268, %275
  %niter232.next.1 = add i64 %niter232, 2
  %niter232.ncmp.1.not = icmp eq i64 %niter232.next.1, %unroll_iter231
  br i1 %niter232.ncmp.1.not, label %._crit_edge.3.loopexit.unr-lcssa, label %.lr.ph98.3, !llvm.loop !19

._crit_edge.3.loopexit.unr-lcssa:                 ; preds = %.lr.ph98.3, %.lr.ph98.3.preheader
  %.lcssa203.ph = phi i32 [ poison, %.lr.ph98.3.preheader ], [ %276, %.lr.ph98.3 ]
  %indvars.iv141.3.unr = phi i64 [ %indvars.iv126, %.lr.ph98.3.preheader ], [ %indvars.iv.next142.3.1, %.lr.ph98.3 ]
  %.07496.3.unr = phi i32 [ 0, %.lr.ph98.3.preheader ], [ %276, %.lr.ph98.3 ]
  br i1 %lcmp.mod229.not, label %._crit_edge.3, label %.lr.ph98.3.epil

.lr.ph98.3.epil:                                  ; preds = %._crit_edge.3.loopexit.unr-lcssa
  %277 = shl i32 %.07496.3.unr, 1
  %278 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv141.3.unr
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %indvars.iv.next142.3.epil = add i64 %indvars.iv141.3.unr, 4294967295
  %280 = and i64 %indvars.iv.next142.3.epil, 4294967295
  %281 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !5
  %283 = icmp sgt i32 %279, %282
  %284 = zext i1 %283 to i32
  %285 = or disjoint i32 %277, %284
  br label %._crit_edge.3

._crit_edge.3:                                    ; preds = %.lr.ph98.3.epil, %._crit_edge.3.loopexit.unr-lcssa, %238, %.preheader88.3
  %.074.lcssa.3 = phi i32 [ 0, %.preheader88.3 ], [ 0, %238 ], [ %.lcssa203.ph, %._crit_edge.3.loopexit.unr-lcssa ], [ %285, %.lr.ph98.3.epil ]
  %286 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 3, i64 %94
  store i32 %.074.lcssa.3, ptr %286, align 4, !tbaa !5
  %287 = sext i32 %.074.lcssa.3 to i64
  %288 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE3nxt, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = icmp eq i32 %289, -1
  br i1 %290, label %291, label %296

291:                                              ; preds = %._crit_edge.3
  store i32 0, ptr %288, align 4, !tbaa !5
  %292 = load ptr, ptr @_ZZ4mainE3que, align 8, !tbaa !13
  %293 = add nsw i32 %.2.2, 1
  %294 = sext i32 %.2.2 to i64
  %295 = getelementptr inbounds i32, ptr %292, i64 %294
  store i32 %.074.lcssa.3, ptr %295, align 4, !tbaa !5
  br label %296

296:                                              ; preds = %291, %._crit_edge.3
  %.2.3 = phi i32 [ %293, %291 ], [ %.2.2, %._crit_edge.3 ]
  %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
  %297 = sext i32 %.2.3 to i64
  %298 = icmp slt i64 %indvars.iv.next150, %297
  br i1 %298, label %39, label %33, !llvm.loop !20

._crit_edge111:                                   ; preds = %._crit_edge107, %33
  %299 = shl i64 %indvars.iv126, 2
  %300 = add i64 %299, 4
  %301 = and i64 %300, 17179869180
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @_ZZ4mainE3ans, i8 0, i64 %301, i1 false)
  %.not124 = icmp eq i64 %indvars.iv126, 31
  br i1 %.not124, label %.preheader90, label %.lr.ph114.preheader

.lr.ph114.preheader:                              ; preds = %._crit_edge111
  %smax168 = call i32 @llvm.smax.i32(i32 %23, i32 1)
  %wide.trip.count169 = zext nneg i32 %smax168 to i64
  br label %.lr.ph114

302:                                              ; preds = %.lr.ph110, %._crit_edge107
  %303 = phi i32 [ %34, %.lr.ph110 ], [ %308, %._crit_edge107 ]
  %304 = phi i32 [ %37, %.lr.ph110 ], [ %309, %._crit_edge107 ]
  %.071108 = phi i32 [ 0, %.lr.ph110 ], [ %310, %._crit_edge107 ]
  %.not84 = icmp eq i32 %303, 0
  %305 = zext i1 %.not84 to i32
  store i32 %305, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %306 = zext i1 %.not84 to i64
  %307 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %306
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %307, i8 0, i64 %25, i1 false)
  br i1 %.not123, label %._crit_edge107, label %.lr.ph106

._crit_edge107.loopexit:                          ; preds = %.loopexit
  %.pre188 = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge107

._crit_edge107:                                   ; preds = %._crit_edge107.loopexit, %302
  %308 = phi i32 [ %348, %._crit_edge107.loopexit ], [ %305, %302 ]
  %309 = phi i32 [ %.pre188, %._crit_edge107.loopexit ], [ %304, %302 ]
  %310 = add nuw nsw i32 %.071108, 1
  %311 = icmp slt i32 %310, %309
  br i1 %311, label %302, label %._crit_edge111, !llvm.loop !21

.lr.ph106:                                        ; preds = %302, %.loopexit
  %312 = phi i32 [ %348, %.loopexit ], [ %305, %302 ]
  %indvars.iv158 = phi i64 [ %indvars.iv.next159, %.loopexit ], [ 0, %302 ]
  %.not85 = icmp eq i32 %312, 0
  %313 = zext i1 %.not85 to i64
  %314 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %313, i64 %indvars.iv158
  %315 = load i32, ptr %314, align 4, !tbaa !5
  %.not86 = icmp eq i32 %315, 0
  br i1 %.not86, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.lr.ph106
  %316 = sext i32 %312 to i64
  %317 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 0, i64 %indvars.iv158
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %316, i64 %319
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %320, i32 noundef %315)
  %321 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 1, i64 %indvars.iv158
  %324 = load i32, ptr %323, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %322, i64 %325
  %.not87.1 = icmp eq i32 %321, 0
  %327 = zext i1 %.not87.1 to i64
  %328 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %327, i64 %indvars.iv158
  %329 = load i32, ptr %328, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %326, i32 noundef %329)
  %330 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 2, i64 %indvars.iv158
  %333 = load i32, ptr %332, align 4, !tbaa !5
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %331, i64 %334
  %.not87.2 = icmp eq i32 %330, 0
  %336 = zext i1 %.not87.2 to i64
  %337 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %336, i64 %indvars.iv158
  %338 = load i32, ptr %337, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %335, i32 noundef %338)
  %339 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds [5 x [32769 x i32]], ptr @_ZZ4mainE3nxt, i64 0, i64 3, i64 %indvars.iv158
  %342 = load i32, ptr %341, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %340, i64 %343
  %.not87.3 = icmp eq i32 %339, 0
  %345 = zext i1 %.not87.3 to i64
  %346 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %345, i64 %indvars.iv158
  %347 = load i32, ptr %346, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %344, i32 noundef %347)
  %.pre186 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader.preheader, %.lr.ph106
  %348 = phi i32 [ %.pre186, %.preheader.preheader ], [ %312, %.lr.ph106 ]
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %exitcond163.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count162
  br i1 %exitcond163.not, label %._crit_edge107.loopexit, label %.lr.ph106, !llvm.loop !22

.preheader90:                                     ; preds = %.lr.ph114, %._crit_edge111
  %wide.trip.count177 = zext i32 %indvars.iv175 to i64
  br label %360

.lr.ph114:                                        ; preds = %.lr.ph114.preheader, %.lr.ph114
  %indvars.iv164 = phi i64 [ 0, %.lr.ph114.preheader ], [ %indvars.iv.next165, %.lr.ph114 ]
  %349 = getelementptr inbounds [32769 x i32], ptr @_ZZ4mainE4bits, i64 0, i64 %indvars.iv164
  %350 = load i32, ptr %349, align 4, !tbaa !5
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %351
  %353 = load i32, ptr @_ZZ4mainE1o, align 4, !tbaa !5
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds [2 x [32769 x i32]], ptr @_ZZ4mainE2dp, i64 0, i64 %354, i64 %indvars.iv164
  %356 = load i32, ptr %355, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %352, i32 noundef %356)
  %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
  %exitcond170.not = icmp eq i64 %indvars.iv.next165, %wide.trip.count169
  br i1 %exitcond170.not, label %.preheader90, label %.lr.ph114, !llvm.loop !23

357:                                              ; preds = %360
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %358 = load i32, ptr %1, align 4, !tbaa !5
  %359 = add nsw i32 %358, -1
  store i32 %359, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %358, 0
  br i1 %.not, label %._crit_edge119, label %.lr.ph118, !llvm.loop !24

360:                                              ; preds = %.preheader90, %360
  %indvars.iv171 = phi i64 [ 0, %.preheader90 ], [ %indvars.iv.next172, %360 ]
  %361 = getelementptr inbounds [17 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %indvars.iv171
  %362 = load i32, ptr %361, align 4, !tbaa !5
  %363 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %362)
  %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
  %exitcond178.not = icmp eq i64 %indvars.iv.next172, %wide.trip.count177
  br i1 %exitcond178.not, label %357, label %360, !llvm.loop !25

._crit_edge119:                                   ; preds = %357, %3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

; 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: 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 #4

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass