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

; 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
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@bits = external dso_local global [1025 x i32], align 16
@msk = external dso_local global [4 x i32], align 16
@tr = external dso_local global [4 x [1025 x i32]], align 16
@f = external dso_local global [2 x [1025 x i32]], align 16
@cur = external dso_local global i32, align 4
@pre = external dso_local global i32, align 4
@ans = external dso_local global [11 x i32], align 16
@buf = external dso_local global [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @buf, ptr noundef @n)
  %15 = call i64 @strlen(ptr noundef @buf) #5
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %35, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @m, align 4, !tbaa !5
  %20 = shl i32 1, %19
  %21 = icmp slt i32 %18, %20
  br i1 %21, label %23, label %22

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

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

35:                                               ; preds = %23
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

38:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %75, %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

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

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

45:                                               ; preds = %71, %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = icmp slt i32 %46, 4
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %74

49:                                               ; preds = %45
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !11
  %54 = sext i8 %53 to i32
  %55 = load ptr, ptr @pat, align 8, !tbaa !12
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %55, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !11
  %60 = sext i8 %59 to i32
  %61 = icmp eq i32 %54, %60
  br i1 %61, label %62, label %70

62:                                               ; preds = %49
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = shl i32 1, %63
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [4 x i32], ptr @msk, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = or i32 %68, %64
  store i32 %69, ptr %67, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %62, %49
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %5, align 4, !tbaa !5
  br label %45, !llvm.loop !14

74:                                               ; preds = %48
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %3, align 4, !tbaa !5
  br label %39, !llvm.loop !15

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

79:                                               ; preds = %116, %78
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = icmp slt i32 %80, 4
  br i1 %81, label %83, label %82

82:                                               ; preds = %79
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %119

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

84:                                               ; preds = %112, %83
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr @m, align 4, !tbaa !5
  %87 = shl i32 1, %86
  %88 = icmp slt i32 %85, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %84
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %115

90:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [4 x i32], ptr @msk, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = or i32 %91, %95
  store i32 %96, ptr %8, align 4, !tbaa !5
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = shl i32 %100, 1
  %102 = or i32 %101, 1
  %103 = sub nsw i32 %99, %102
  %104 = xor i32 %98, %103
  %105 = and i32 %97, %104
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 %107
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [1025 x i32], ptr %108, i64 0, i64 %110
  store i32 %105, ptr %111, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %112

112:                                              ; preds = %90
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %7, align 4, !tbaa !5
  br label %84, !llvm.loop !16

115:                                              ; preds = %89
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %6, align 4, !tbaa !5
  br label %79, !llvm.loop !17

119:                                              ; preds = %82
  %120 = load i32, ptr @cur, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %121
  %123 = getelementptr inbounds [1025 x i32], ptr %122, i64 0, i64 0
  store i32 1, ptr %123, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %202, %119
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = load i32, ptr @n, align 4, !tbaa !5
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %205

129:                                              ; preds = %124
  %130 = load i32, ptr @pre, align 4, !tbaa !5
  %131 = xor i32 %130, 1
  store i32 %131, ptr @pre, align 4, !tbaa !5
  %132 = load i32, ptr @cur, align 4, !tbaa !5
  %133 = xor i32 %132, 1
  store i32 %133, ptr @cur, align 4, !tbaa !5
  %134 = load i32, ptr @cur, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %135
  %137 = getelementptr inbounds [1025 x i32], ptr %136, i64 0, i64 0
  %138 = load i32, ptr @m, align 4, !tbaa !5
  %139 = shl i32 1, %138
  %140 = sext i32 %139 to i64
  %141 = mul i64 %140, 4
  call void @llvm.memset.p0.i64(ptr align 4 %137, i8 0, i64 %141, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %198, %129
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = icmp slt i32 %143, 4
  br i1 %144, label %146, label %145

145:                                              ; preds = %142
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %201

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

147:                                              ; preds = %194, %146
  %148 = load i32, ptr %11, align 4, !tbaa !5
  %149 = load i32, ptr @m, align 4, !tbaa !5
  %150 = shl i32 1, %149
  %151 = icmp slt i32 %148, %150
  br i1 %151, label %153, label %152

152:                                              ; preds = %147
  store i32 23, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %197

153:                                              ; preds = %147
  %154 = load i32, ptr @pre, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %155
  %157 = load i32, ptr %11, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [1025 x i32], ptr %156, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = load i32, ptr @cur, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %162
  %164 = load i32, ptr %10, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 %165
  %167 = load i32, ptr %11, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [1025 x i32], ptr %166, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1025 x i32], ptr %163, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = add nsw i32 %173, %160
  store i32 %174, ptr %172, align 4, !tbaa !5
  %175 = icmp sge i32 %174, 1000000007
  br i1 %175, label %176, label %192

176:                                              ; preds = %153
  %177 = load i32, ptr @cur, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %178
  %180 = load i32, ptr %10, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 %181
  %183 = load i32, ptr %11, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1025 x i32], ptr %182, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1025 x i32], ptr %179, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = sub nsw i32 %189, 1000000007
  store i32 %190, ptr %188, align 4, !tbaa !5
  %191 = icmp ne i32 %190, 0
  br label %192

192:                                              ; preds = %176, %153
  %193 = phi i1 [ false, %153 ], [ %191, %176 ]
  br label %194

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

197:                                              ; preds = %152
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %10, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %10, align 4, !tbaa !5
  br label %142, !llvm.loop !19

201:                                              ; preds = %145
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %9, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %9, align 4, !tbaa !5
  br label %124, !llvm.loop !20

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

206:                                              ; preds = %241, %205
  %207 = load i32, ptr %12, align 4, !tbaa !5
  %208 = load i32, ptr @m, align 4, !tbaa !5
  %209 = shl i32 1, %208
  %210 = icmp slt i32 %207, %209
  br i1 %210, label %212, label %211

211:                                              ; preds = %206
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %244

212:                                              ; preds = %206
  %213 = load i32, ptr @cur, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %214
  %216 = load i32, ptr %12, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [1025 x i32], ptr %215, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = load i32, ptr %12, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [11 x i32], ptr @ans, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  %227 = add nsw i32 %226, %219
  store i32 %227, ptr %225, align 4, !tbaa !5
  %228 = icmp sge i32 %227, 1000000007
  br i1 %228, label %229, label %239

229:                                              ; preds = %212
  %230 = load i32, ptr %12, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [11 x i32], ptr @ans, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = sub nsw i32 %236, 1000000007
  store i32 %237, ptr %235, align 4, !tbaa !5
  %238 = icmp ne i32 %237, 0
  br label %239

239:                                              ; preds = %229, %212
  %240 = phi i1 [ false, %212 ], [ %238, %229 ]
  br label %241

241:                                              ; preds = %239
  %242 = load i32, ptr %12, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %12, align 4, !tbaa !5
  br label %206, !llvm.loop !21

244:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %245

245:                                              ; preds = %256, %244
  %246 = load i32, ptr %13, align 4, !tbaa !5
  %247 = load i32, ptr @m, align 4, !tbaa !5
  %248 = icmp sle i32 %246, %247
  br i1 %248, label %250, label %249

249:                                              ; preds = %245
  store i32 29, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %259

250:                                              ; preds = %245
  %251 = load i32, ptr %13, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [11 x i32], ptr @ans, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %254)
  br label %256

256:                                              ; preds = %250
  %257 = load i32, ptr %13, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %13, align 4, !tbaa !5
  br label %245, !llvm.loop !22

259:                                              ; preds = %249
  ret i32 0
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind willreturn memory(read) "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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(read) }
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 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!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}


; 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
@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@bits = external dso_local local_unnamed_addr global [1025 x i32], align 16
@msk = external dso_local local_unnamed_addr global [4 x i32], align 16
@tr = external dso_local local_unnamed_addr global [4 x [1025 x i32]], align 16
@f = external dso_local local_unnamed_addr global [2 x [1025 x i32]], align 16
@cur = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global [11 x i32], align 16
@buf = external dso_local global [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf, ptr noundef nonnull @n)
  %2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @buf) #5
  %3 = trunc i64 %2 to i32
  store i32 %3, ptr @m, align 4, !tbaa !5
  %4 = shl nuw i32 1, %3
  %5 = icmp sgt i32 %4, 1
  br i1 %5, label %.lr.ph.preheader, label %.preheader60

.lr.ph.preheader:                                 ; preds = %0
  %wide.trip.count = zext nneg i32 %4 to i64
  %6 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %6, 1
  %7 = icmp eq i32 %3, 1
  br i1 %7, label %.preheader60.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %6, -2
  br label %.lr.ph

.preheader60.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader60, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader60.loopexit.unr-lcssa
  %8 = trunc nuw nsw i64 %indvars.iv.unr to i32
  %9 = lshr i64 %indvars.iv.unr, 1
  %10 = and i64 %9, 2147483647
  %11 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = and i32 %8, 1
  %14 = add nsw i32 %12, %13
  %15 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %indvars.iv.unr
  store i32 %14, ptr %15, align 4, !tbaa !5
  br label %.preheader60

.preheader60:                                     ; preds = %.lr.ph.epil, %.preheader60.loopexit.unr-lcssa, %0
  %16 = icmp sgt i32 %3, 0
  br i1 %16, label %.preheader59.lr.ph, label %.preheader57.us.preheader

.preheader59.lr.ph:                               ; preds = %.preheader60
  %17 = load ptr, ptr @pat, align 8, !tbaa !9
  %wide.trip.count100 = and i64 %2, 2147483647
  %18 = getelementptr inbounds i8, ptr %17, i64 1
  %19 = getelementptr inbounds i8, ptr %17, i64 2
  %20 = getelementptr inbounds i8, ptr %17, i64 3
  br label %.preheader59

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %21 = lshr i64 %indvars.iv, 1
  %22 = and i64 %21, 2147483647
  %23 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  %26 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %indvars.iv
  store i32 %25, ptr %26, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = lshr i64 %indvars.iv.next, 1
  %28 = and i64 %27, 2147483647
  %29 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %indvars.iv.next
  store i32 %30, ptr %31, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader60.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !11

.preheader59:                                     ; preds = %.preheader59.lr.ph, %187
  %indvars.iv97 = phi i64 [ 0, %.preheader59.lr.ph ], [ %indvars.iv.next98, %187 ]
  %32 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %indvars.iv97
  %33 = load i8, ptr %32, align 1, !tbaa !13
  %34 = trunc nuw nsw i64 %indvars.iv97 to i32
  %35 = shl nuw i32 1, %34
  %36 = load i8, ptr %17, align 1, !tbaa !13
  %37 = icmp eq i8 %33, %36
  br i1 %37, label %166, label %169

.preheader58:                                     ; preds = %187
  %.not84 = icmp eq i32 %3, 31
  br i1 %.not84, label %.split.us, label %.preheader57.us.preheader

.preheader57.us.preheader:                        ; preds = %.preheader60, %.preheader58
  %smax = tail call i32 @llvm.smax.i32(i32 %4, i32 1)
  %38 = load i32, ptr @msk, align 16, !tbaa !5
  %wide.trip.count105 = zext nneg i32 %smax to i64
  %min.iters.check = icmp slt i32 %4, 8
  br i1 %min.iters.check, label %scalar.ph, label %vector.ph

vector.ph:                                        ; preds = %.preheader57.us.preheader
  %n.vec = and i64 %wide.trip.count105, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %38, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.ind144 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next147, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %39 = or <4 x i32> %broadcast.splat, %vec.ind
  %40 = or <4 x i32> %broadcast.splat, %step.add
  %41 = shl <4 x i32> %vec.ind144, <i32 1, i32 1, i32 1, i32 1>
  %step.add145 = shl <4 x i32> %vec.ind144, <i32 1, i32 1, i32 1, i32 1>
  %42 = add <4 x i32> %step.add145, <i32 8, i32 8, i32 8, i32 8>
  %43 = sub <4 x i32> %41, %39
  %44 = sub <4 x i32> %42, %40
  %45 = and <4 x i32> %43, %39
  %46 = and <4 x i32> %44, %40
  %47 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 0, i64 %index
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  store <4 x i32> %45, ptr %47, align 16, !tbaa !5
  store <4 x i32> %46, ptr %48, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %vec.ind.next147 = add <4 x i32> %vec.ind144, <i32 8, i32 8, i32 8, i32 8>
  %49 = icmp eq i64 %index.next, %n.vec
  br i1 %49, label %._crit_edge.us, label %vector.body, !llvm.loop !14

scalar.ph:                                        ; preds = %.preheader57.us.preheader
  %50 = sub i32 0, %38
  %51 = and i32 %38, %50
  store i32 %51, ptr @tr, align 16, !tbaa !5
  %exitcond106.not = icmp slt i32 %4, 2
  br i1 %exitcond106.not, label %._crit_edge.us, label %scalar.ph.1, !llvm.loop !17

scalar.ph.1:                                      ; preds = %scalar.ph
  %52 = or i32 %38, 1
  %53 = sub i32 2, %52
  %54 = and i32 %53, %52
  store i32 %54, ptr getelementptr inbounds (i8, ptr @tr, i64 4), align 4, !tbaa !5
  %exitcond106.not.1 = icmp eq i32 %3, 1
  br i1 %exitcond106.not.1, label %._crit_edge.us, label %scalar.ph.2, !llvm.loop !17

scalar.ph.2:                                      ; preds = %scalar.ph.1
  %55 = or i32 %38, 2
  %56 = sub i32 4, %55
  %57 = and i32 %56, %55
  store i32 %57, ptr getelementptr inbounds (i8, ptr @tr, i64 8), align 8, !tbaa !5
  %58 = or i32 %38, 3
  %59 = sub i32 6, %58
  %60 = and i32 %59, %58
  store i32 %60, ptr getelementptr inbounds (i8, ptr @tr, i64 12), align 4, !tbaa !5
  %exitcond106.not.3 = icmp eq i32 %3, 2
  br i1 %exitcond106.not.3, label %._crit_edge.us, label %scalar.ph.4, !llvm.loop !17

scalar.ph.4:                                      ; preds = %scalar.ph.2
  %61 = or i32 %38, 4
  %62 = sub i32 8, %61
  %63 = and i32 %62, %61
  store i32 %63, ptr getelementptr inbounds (i8, ptr @tr, i64 16), align 16, !tbaa !5
  %64 = or i32 %38, 5
  %65 = sub i32 10, %64
  %66 = and i32 %65, %64
  store i32 %66, ptr getelementptr inbounds (i8, ptr @tr, i64 20), align 4, !tbaa !5
  %67 = or i32 %38, 6
  %68 = sub i32 12, %67
  %69 = and i32 %68, %67
  store i32 %69, ptr getelementptr inbounds (i8, ptr @tr, i64 24), align 8, !tbaa !5
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %vector.body, %scalar.ph, %scalar.ph.1, %scalar.ph.2, %scalar.ph.4
  %70 = load i32, ptr getelementptr inbounds (i8, ptr @msk, i64 4), align 4, !tbaa !5
  %min.iters.check150 = icmp slt i32 %4, 8
  br i1 %min.iters.check150, label %scalar.ph149, label %vector.ph151

vector.ph151:                                     ; preds = %._crit_edge.us
  %n.vec153 = and i64 %wide.trip.count105, 2147483640
  %broadcast.splatinsert165 = insertelement <4 x i32> poison, i32 %70, i64 0
  %broadcast.splat166 = shufflevector <4 x i32> %broadcast.splatinsert165, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body155

vector.body155:                                   ; preds = %vector.body155, %vector.ph151
  %index156 = phi i64 [ 0, %vector.ph151 ], [ %index.next167, %vector.body155 ]
  %vec.ind157 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph151 ], [ %vec.ind.next160, %vector.body155 ]
  %vec.ind161 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph151 ], [ %vec.ind.next164, %vector.body155 ]
  %step.add158 = add <4 x i32> %vec.ind157, <i32 4, i32 4, i32 4, i32 4>
  %71 = or <4 x i32> %broadcast.splat166, %vec.ind157
  %72 = or <4 x i32> %broadcast.splat166, %step.add158
  %73 = shl <4 x i32> %vec.ind161, <i32 1, i32 1, i32 1, i32 1>
  %step.add162 = shl <4 x i32> %vec.ind161, <i32 1, i32 1, i32 1, i32 1>
  %74 = add <4 x i32> %step.add162, <i32 8, i32 8, i32 8, i32 8>
  %75 = sub <4 x i32> %73, %71
  %76 = sub <4 x i32> %74, %72
  %77 = and <4 x i32> %75, %71
  %78 = and <4 x i32> %76, %72
  %79 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 1, i64 %index156
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  store <4 x i32> %77, ptr %79, align 4, !tbaa !5
  store <4 x i32> %78, ptr %80, align 4, !tbaa !5
  %index.next167 = add nuw i64 %index156, 8
  %vec.ind.next160 = add <4 x i32> %vec.ind157, <i32 8, i32 8, i32 8, i32 8>
  %vec.ind.next164 = add <4 x i32> %vec.ind161, <i32 8, i32 8, i32 8, i32 8>
  %81 = icmp eq i64 %index.next167, %n.vec153
  br i1 %81, label %._crit_edge.us.1, label %vector.body155, !llvm.loop !18

scalar.ph149:                                     ; preds = %._crit_edge.us
  %82 = sub i32 0, %70
  %83 = and i32 %70, %82
  store i32 %83, ptr getelementptr inbounds (i8, ptr @tr, i64 4100), align 4, !tbaa !5
  %exitcond106.1.not = icmp slt i32 %4, 2
  br i1 %exitcond106.1.not, label %._crit_edge.us.1, label %scalar.ph149.1, !llvm.loop !19

scalar.ph149.1:                                   ; preds = %scalar.ph149
  %84 = or i32 %70, 1
  %85 = sub i32 2, %84
  %86 = and i32 %85, %84
  store i32 %86, ptr getelementptr inbounds (i8, ptr @tr, i64 4104), align 8, !tbaa !5
  %exitcond106.1.not.1 = icmp eq i32 %3, 1
  br i1 %exitcond106.1.not.1, label %._crit_edge.us.1, label %scalar.ph149.2, !llvm.loop !19

scalar.ph149.2:                                   ; preds = %scalar.ph149.1
  %87 = or i32 %70, 2
  %88 = sub i32 4, %87
  %89 = and i32 %88, %87
  store i32 %89, ptr getelementptr inbounds (i8, ptr @tr, i64 4108), align 4, !tbaa !5
  %90 = or i32 %70, 3
  %91 = sub i32 6, %90
  %92 = and i32 %91, %90
  store i32 %92, ptr getelementptr inbounds (i8, ptr @tr, i64 4112), align 16, !tbaa !5
  %exitcond106.1.not.3 = icmp eq i32 %3, 2
  br i1 %exitcond106.1.not.3, label %._crit_edge.us.1, label %scalar.ph149.4, !llvm.loop !19

scalar.ph149.4:                                   ; preds = %scalar.ph149.2
  %93 = or i32 %70, 4
  %94 = sub i32 8, %93
  %95 = and i32 %94, %93
  store i32 %95, ptr getelementptr inbounds (i8, ptr @tr, i64 4116), align 4, !tbaa !5
  %96 = or i32 %70, 5
  %97 = sub i32 10, %96
  %98 = and i32 %97, %96
  store i32 %98, ptr getelementptr inbounds (i8, ptr @tr, i64 4120), align 8, !tbaa !5
  %99 = or i32 %70, 6
  %100 = sub i32 12, %99
  %101 = and i32 %100, %99
  store i32 %101, ptr getelementptr inbounds (i8, ptr @tr, i64 4124), align 4, !tbaa !5
  br label %._crit_edge.us.1

._crit_edge.us.1:                                 ; preds = %vector.body155, %scalar.ph149, %scalar.ph149.1, %scalar.ph149.2, %scalar.ph149.4
  %102 = load i32, ptr getelementptr inbounds (i8, ptr @msk, i64 8), align 8, !tbaa !5
  %min.iters.check171 = icmp slt i32 %4, 8
  br i1 %min.iters.check171, label %scalar.ph170, label %vector.ph172

vector.ph172:                                     ; preds = %._crit_edge.us.1
  %n.vec174 = and i64 %wide.trip.count105, 2147483640
  %broadcast.splatinsert186 = insertelement <4 x i32> poison, i32 %102, i64 0
  %broadcast.splat187 = shufflevector <4 x i32> %broadcast.splatinsert186, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body176

vector.body176:                                   ; preds = %vector.body176, %vector.ph172
  %index177 = phi i64 [ 0, %vector.ph172 ], [ %index.next188, %vector.body176 ]
  %vec.ind178 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph172 ], [ %vec.ind.next181, %vector.body176 ]
  %vec.ind182 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph172 ], [ %vec.ind.next185, %vector.body176 ]
  %step.add179 = add <4 x i32> %vec.ind178, <i32 4, i32 4, i32 4, i32 4>
  %103 = or <4 x i32> %broadcast.splat187, %vec.ind178
  %104 = or <4 x i32> %broadcast.splat187, %step.add179
  %105 = shl <4 x i32> %vec.ind182, <i32 1, i32 1, i32 1, i32 1>
  %step.add183 = shl <4 x i32> %vec.ind182, <i32 1, i32 1, i32 1, i32 1>
  %106 = add <4 x i32> %step.add183, <i32 8, i32 8, i32 8, i32 8>
  %107 = sub <4 x i32> %105, %103
  %108 = sub <4 x i32> %106, %104
  %109 = and <4 x i32> %107, %103
  %110 = and <4 x i32> %108, %104
  %111 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 2, i64 %index177
  %112 = getelementptr inbounds i8, ptr %111, i64 16
  store <4 x i32> %109, ptr %111, align 8, !tbaa !5
  store <4 x i32> %110, ptr %112, align 8, !tbaa !5
  %index.next188 = add nuw i64 %index177, 8
  %vec.ind.next181 = add <4 x i32> %vec.ind178, <i32 8, i32 8, i32 8, i32 8>
  %vec.ind.next185 = add <4 x i32> %vec.ind182, <i32 8, i32 8, i32 8, i32 8>
  %113 = icmp eq i64 %index.next188, %n.vec174
  br i1 %113, label %._crit_edge.us.2, label %vector.body176, !llvm.loop !20

scalar.ph170:                                     ; preds = %._crit_edge.us.1
  %114 = sub i32 0, %102
  %115 = and i32 %102, %114
  store i32 %115, ptr getelementptr inbounds (i8, ptr @tr, i64 8200), align 8, !tbaa !5
  %exitcond106.2.not = icmp slt i32 %4, 2
  br i1 %exitcond106.2.not, label %._crit_edge.us.2, label %scalar.ph170.1, !llvm.loop !21

scalar.ph170.1:                                   ; preds = %scalar.ph170
  %116 = or i32 %102, 1
  %117 = sub i32 2, %116
  %118 = and i32 %117, %116
  store i32 %118, ptr getelementptr inbounds (i8, ptr @tr, i64 8204), align 4, !tbaa !5
  %exitcond106.2.not.1 = icmp eq i32 %3, 1
  br i1 %exitcond106.2.not.1, label %._crit_edge.us.2, label %scalar.ph170.2, !llvm.loop !21

scalar.ph170.2:                                   ; preds = %scalar.ph170.1
  %119 = or i32 %102, 2
  %120 = sub i32 4, %119
  %121 = and i32 %120, %119
  store i32 %121, ptr getelementptr inbounds (i8, ptr @tr, i64 8208), align 16, !tbaa !5
  %122 = or i32 %102, 3
  %123 = sub i32 6, %122
  %124 = and i32 %123, %122
  store i32 %124, ptr getelementptr inbounds (i8, ptr @tr, i64 8212), align 4, !tbaa !5
  %exitcond106.2.not.3 = icmp eq i32 %3, 2
  br i1 %exitcond106.2.not.3, label %._crit_edge.us.2, label %scalar.ph170.4, !llvm.loop !21

scalar.ph170.4:                                   ; preds = %scalar.ph170.2
  %125 = or i32 %102, 4
  %126 = sub i32 8, %125
  %127 = and i32 %126, %125
  store i32 %127, ptr getelementptr inbounds (i8, ptr @tr, i64 8216), align 8, !tbaa !5
  %128 = or i32 %102, 5
  %129 = sub i32 10, %128
  %130 = and i32 %129, %128
  store i32 %130, ptr getelementptr inbounds (i8, ptr @tr, i64 8220), align 4, !tbaa !5
  %131 = or i32 %102, 6
  %132 = sub i32 12, %131
  %133 = and i32 %132, %131
  store i32 %133, ptr getelementptr inbounds (i8, ptr @tr, i64 8224), align 16, !tbaa !5
  br label %._crit_edge.us.2

._crit_edge.us.2:                                 ; preds = %vector.body176, %scalar.ph170, %scalar.ph170.1, %scalar.ph170.2, %scalar.ph170.4
  %134 = load i32, ptr getelementptr inbounds (i8, ptr @msk, i64 12), align 4, !tbaa !5
  %min.iters.check192 = icmp slt i32 %4, 8
  br i1 %min.iters.check192, label %scalar.ph191, label %vector.ph193

vector.ph193:                                     ; preds = %._crit_edge.us.2
  %n.vec195 = and i64 %wide.trip.count105, 2147483640
  %broadcast.splatinsert207 = insertelement <4 x i32> poison, i32 %134, i64 0
  %broadcast.splat208 = shufflevector <4 x i32> %broadcast.splatinsert207, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body197

vector.body197:                                   ; preds = %vector.body197, %vector.ph193
  %index198 = phi i64 [ 0, %vector.ph193 ], [ %index.next209, %vector.body197 ]
  %vec.ind199 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph193 ], [ %vec.ind.next202, %vector.body197 ]
  %vec.ind203 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph193 ], [ %vec.ind.next206, %vector.body197 ]
  %step.add200 = add <4 x i32> %vec.ind199, <i32 4, i32 4, i32 4, i32 4>
  %135 = or <4 x i32> %broadcast.splat208, %vec.ind199
  %136 = or <4 x i32> %broadcast.splat208, %step.add200
  %137 = shl <4 x i32> %vec.ind203, <i32 1, i32 1, i32 1, i32 1>
  %step.add204 = shl <4 x i32> %vec.ind203, <i32 1, i32 1, i32 1, i32 1>
  %138 = add <4 x i32> %step.add204, <i32 8, i32 8, i32 8, i32 8>
  %139 = sub <4 x i32> %137, %135
  %140 = sub <4 x i32> %138, %136
  %141 = and <4 x i32> %139, %135
  %142 = and <4 x i32> %140, %136
  %143 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 3, i64 %index198
  %144 = getelementptr inbounds i8, ptr %143, i64 16
  store <4 x i32> %141, ptr %143, align 4, !tbaa !5
  store <4 x i32> %142, ptr %144, align 4, !tbaa !5
  %index.next209 = add nuw i64 %index198, 8
  %vec.ind.next202 = add <4 x i32> %vec.ind199, <i32 8, i32 8, i32 8, i32 8>
  %vec.ind.next206 = add <4 x i32> %vec.ind203, <i32 8, i32 8, i32 8, i32 8>
  %145 = icmp eq i64 %index.next209, %n.vec195
  br i1 %145, label %.split.us, label %vector.body197, !llvm.loop !22

scalar.ph191:                                     ; preds = %._crit_edge.us.2
  %146 = sub i32 0, %134
  %147 = and i32 %134, %146
  store i32 %147, ptr getelementptr inbounds (i8, ptr @tr, i64 12300), align 4, !tbaa !5
  %exitcond106.3.not = icmp slt i32 %4, 2
  br i1 %exitcond106.3.not, label %.split.us, label %scalar.ph191.1, !llvm.loop !23

scalar.ph191.1:                                   ; preds = %scalar.ph191
  %148 = or i32 %134, 1
  %149 = sub i32 2, %148
  %150 = and i32 %149, %148
  store i32 %150, ptr getelementptr inbounds (i8, ptr @tr, i64 12304), align 16, !tbaa !5
  %exitcond106.3.not.1 = icmp eq i32 %3, 1
  br i1 %exitcond106.3.not.1, label %.split.us, label %scalar.ph191.2, !llvm.loop !23

scalar.ph191.2:                                   ; preds = %scalar.ph191.1
  %151 = or i32 %134, 2
  %152 = sub i32 4, %151
  %153 = and i32 %152, %151
  store i32 %153, ptr getelementptr inbounds (i8, ptr @tr, i64 12308), align 4, !tbaa !5
  %154 = or i32 %134, 3
  %155 = sub i32 6, %154
  %156 = and i32 %155, %154
  store i32 %156, ptr getelementptr inbounds (i8, ptr @tr, i64 12312), align 8, !tbaa !5
  %exitcond106.3.not.3 = icmp eq i32 %3, 2
  br i1 %exitcond106.3.not.3, label %.split.us, label %scalar.ph191.4, !llvm.loop !23

scalar.ph191.4:                                   ; preds = %scalar.ph191.2
  %157 = or i32 %134, 4
  %158 = sub i32 8, %157
  %159 = and i32 %158, %157
  store i32 %159, ptr getelementptr inbounds (i8, ptr @tr, i64 12316), align 4, !tbaa !5
  %160 = or i32 %134, 5
  %161 = sub i32 10, %160
  %162 = and i32 %161, %160
  store i32 %162, ptr getelementptr inbounds (i8, ptr @tr, i64 12320), align 16, !tbaa !5
  %163 = or i32 %134, 6
  %164 = sub i32 12, %163
  %165 = and i32 %164, %163
  store i32 %165, ptr getelementptr inbounds (i8, ptr @tr, i64 12324), align 4, !tbaa !5
  br label %.split.us

166:                                              ; preds = %.preheader59
  %167 = load i32, ptr @msk, align 16, !tbaa !5
  %168 = or i32 %167, %35
  store i32 %168, ptr @msk, align 16, !tbaa !5
  br label %169

169:                                              ; preds = %.preheader59, %166
  %170 = load i8, ptr %18, align 1, !tbaa !13
  %171 = icmp eq i8 %33, %170
  br i1 %171, label %172, label %175

172:                                              ; preds = %169
  %173 = load i32, ptr getelementptr inbounds (i8, ptr @msk, i64 4), align 4, !tbaa !5
  %174 = or i32 %173, %35
  store i32 %174, ptr getelementptr inbounds (i8, ptr @msk, i64 4), align 4, !tbaa !5
  br label %175

175:                                              ; preds = %172, %169
  %176 = load i8, ptr %19, align 1, !tbaa !13
  %177 = icmp eq i8 %33, %176
  br i1 %177, label %178, label %181

178:                                              ; preds = %175
  %179 = load i32, ptr getelementptr inbounds (i8, ptr @msk, i64 8), align 8, !tbaa !5
  %180 = or i32 %179, %35
  store i32 %180, ptr getelementptr inbounds (i8, ptr @msk, i64 8), align 8, !tbaa !5
  br label %181

181:                                              ; preds = %178, %175
  %182 = load i8, ptr %20, align 1, !tbaa !13
  %183 = icmp eq i8 %33, %182
  br i1 %183, label %184, label %187

184:                                              ; preds = %181
  %185 = load i32, ptr getelementptr inbounds (i8, ptr @msk, i64 12), align 4, !tbaa !5
  %186 = or i32 %185, %35
  store i32 %186, ptr getelementptr inbounds (i8, ptr @msk, i64 12), align 4, !tbaa !5
  br label %187

187:                                              ; preds = %184, %181
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %exitcond101.not = icmp eq i64 %indvars.iv.next98, %wide.trip.count100
  br i1 %exitcond101.not, label %.preheader58, label %.preheader59, !llvm.loop !24

.split.us:                                        ; preds = %vector.body197, %scalar.ph191, %scalar.ph191.1, %scalar.ph191.2, %scalar.ph191.4, %.preheader58
  %.not84133 = phi i1 [ true, %.preheader58 ], [ false, %scalar.ph191.4 ], [ false, %scalar.ph191.2 ], [ false, %scalar.ph191.1 ], [ false, %scalar.ph191 ], [ false, %vector.body197 ]
  %188 = load i32, ptr @cur, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %189
  store i32 1, ptr %190, align 4, !tbaa !5
  %191 = load i32, ptr @n, align 4, !tbaa !5
  %192 = icmp sgt i32 %191, 0
  br i1 %192, label %.lr.ph75, label %.preheader55

.lr.ph75:                                         ; preds = %.split.us
  %pre.promoted = load i32, ptr @pre, align 4, !tbaa !5
  %193 = sext i32 %4 to i64
  %194 = shl nsw i64 %193, 2
  br i1 %.not84133, label %.split70.preheader, label %.split70.us.us.preheader

.split70.preheader:                               ; preds = %.lr.ph75
  %xtraiter245 = and i32 %191, 3
  %195 = icmp ult i32 %191, 4
  br i1 %195, label %..preheader55_crit_edge.loopexit.unr-lcssa, label %.split70.preheader.new

.split70.preheader.new:                           ; preds = %.split70.preheader
  %unroll_iter250 = and i32 %191, 2147483644
  %196 = xor i32 %188, 1
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %197
  %199 = sext i32 %188 to i64
  %200 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %199
  %201 = xor i32 %188, 1
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %202
  %204 = sext i32 %188 to i64
  %205 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %204
  br label %.split70

.split70.us.us.preheader:                         ; preds = %.lr.ph75
  %smax114 = tail call i32 @llvm.smax.i32(i32 %4, i32 1)
  %wide.trip.count115 = zext nneg i32 %smax114 to i64
  %206 = add nsw i64 %wide.trip.count115, -1
  %xtraiter225 = and i64 %wide.trip.count115, 1
  %207 = icmp eq i64 %206, 0
  %unroll_iter227 = and i64 %wide.trip.count115, 2147483646
  %lcmp.mod226.not = icmp eq i64 %xtraiter225, 0
  %xtraiter232 = and i64 %wide.trip.count115, 1
  %208 = icmp eq i64 %206, 0
  %unroll_iter234 = and i64 %wide.trip.count115, 2147483646
  %lcmp.mod233.not = icmp eq i64 %xtraiter232, 0
  %xtraiter237 = and i64 %wide.trip.count115, 1
  %209 = icmp eq i64 %206, 0
  %unroll_iter239 = and i64 %wide.trip.count115, 2147483646
  %lcmp.mod238.not = icmp eq i64 %xtraiter237, 0
  %xtraiter241 = and i64 %wide.trip.count115, 1
  %210 = icmp eq i64 %206, 0
  %unroll_iter243 = and i64 %wide.trip.count115, 2147483646
  %lcmp.mod242.not = icmp eq i64 %xtraiter241, 0
  br label %.split70.us.us

.split70.us.us:                                   ; preds = %.split70.us.us.preheader, %._crit_edge.us71.us.3
  %.04774.us = phi i32 [ %338, %._crit_edge.us71.us.3 ], [ 0, %.split70.us.us.preheader ]
  %211 = phi i32 [ %213, %._crit_edge.us71.us.3 ], [ %pre.promoted, %.split70.us.us.preheader ]
  %212 = phi i32 [ %214, %._crit_edge.us71.us.3 ], [ %188, %.split70.us.us.preheader ]
  %213 = xor i32 %211, 1
  %214 = xor i32 %212, 1
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %216, i8 0, i64 %194, i1 false)
  %217 = sext i32 %213 to i64
  br i1 %207, label %._crit_edge.us71.us.preheader.unr-lcssa, label %.split70.us.us.new

.split70.us.us.new:                               ; preds = %.split70.us.us, %.split70.us.us.new
  %indvars.iv111 = phi i64 [ %indvars.iv.next112.1231, %.split70.us.us.new ], [ 0, %.split70.us.us ]
  %niter228 = phi i64 [ %niter228.next.1, %.split70.us.us.new ], [ 0, %.split70.us.us ]
  %218 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv111
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 0, i64 %indvars.iv111
  %221 = load i32, ptr %220, align 8, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = add nsw i32 %224, %219
  %226 = icmp sgt i32 %225, 1000000006
  %227 = add nsw i32 %225, -1000000007
  %spec.select.us.us = select i1 %226, i32 %227, i32 %225
  store i32 %spec.select.us.us, ptr %223, align 4, !tbaa !5
  %indvars.iv.next112 = or disjoint i64 %indvars.iv111, 1
  %228 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv.next112
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 0, i64 %indvars.iv.next112
  %231 = load i32, ptr %230, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %232
  %234 = load i32, ptr %233, align 4, !tbaa !5
  %235 = add nsw i32 %234, %229
  %236 = icmp sgt i32 %235, 1000000006
  %237 = add nsw i32 %235, -1000000007
  %spec.select.us.us.1230 = select i1 %236, i32 %237, i32 %235
  store i32 %spec.select.us.us.1230, ptr %233, align 4, !tbaa !5
  %indvars.iv.next112.1231 = add nuw nsw i64 %indvars.iv111, 2
  %niter228.next.1 = add i64 %niter228, 2
  %niter228.ncmp.1 = icmp eq i64 %niter228.next.1, %unroll_iter227
  br i1 %niter228.ncmp.1, label %._crit_edge.us71.us.preheader.unr-lcssa, label %.split70.us.us.new, !llvm.loop !25

._crit_edge.us71.us.preheader.unr-lcssa:          ; preds = %.split70.us.us.new, %.split70.us.us
  %indvars.iv111.unr = phi i64 [ 0, %.split70.us.us ], [ %indvars.iv.next112.1231, %.split70.us.us.new ]
  br i1 %lcmp.mod226.not, label %._crit_edge.us71.us.preheader, label %._crit_edge.us71.us.preheader.epilog-lcssa

._crit_edge.us71.us.preheader.epilog-lcssa:       ; preds = %._crit_edge.us71.us.preheader.unr-lcssa
  %238 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv111.unr
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 0, i64 %indvars.iv111.unr
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %242
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %245 = add nsw i32 %244, %239
  %246 = icmp sgt i32 %245, 1000000006
  %247 = add nsw i32 %245, -1000000007
  %spec.select.us.us.epil = select i1 %246, i32 %247, i32 %245
  store i32 %spec.select.us.us.epil, ptr %243, align 4, !tbaa !5
  br label %._crit_edge.us71.us.preheader

._crit_edge.us71.us.preheader:                    ; preds = %._crit_edge.us71.us.preheader.unr-lcssa, %._crit_edge.us71.us.preheader.epilog-lcssa
  br i1 %208, label %._crit_edge.us71.us.1.preheader.unr-lcssa, label %._crit_edge.us71.us

._crit_edge.us71.us:                              ; preds = %._crit_edge.us71.us.preheader, %._crit_edge.us71.us
  %indvars.iv111.1 = phi i64 [ %indvars.iv.next112.1.1, %._crit_edge.us71.us ], [ 0, %._crit_edge.us71.us.preheader ]
  %niter235 = phi i64 [ %niter235.next.1, %._crit_edge.us71.us ], [ 0, %._crit_edge.us71.us.preheader ]
  %248 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv111.1
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 1, i64 %indvars.iv111.1
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = add nsw i32 %254, %249
  %256 = icmp sgt i32 %255, 1000000006
  %257 = add nsw i32 %255, -1000000007
  %spec.select.us.us.1 = select i1 %256, i32 %257, i32 %255
  store i32 %spec.select.us.us.1, ptr %253, align 4, !tbaa !5
  %indvars.iv.next112.1 = or disjoint i64 %indvars.iv111.1, 1
  %258 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv.next112.1
  %259 = load i32, ptr %258, align 4, !tbaa !5
  %260 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 1, i64 %indvars.iv.next112.1
  %261 = load i32, ptr %260, align 8, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !5
  %265 = add nsw i32 %264, %259
  %266 = icmp sgt i32 %265, 1000000006
  %267 = add nsw i32 %265, -1000000007
  %spec.select.us.us.1.1 = select i1 %266, i32 %267, i32 %265
  store i32 %spec.select.us.us.1.1, ptr %263, align 4, !tbaa !5
  %indvars.iv.next112.1.1 = add nuw nsw i64 %indvars.iv111.1, 2
  %niter235.next.1 = add i64 %niter235, 2
  %niter235.ncmp.1 = icmp eq i64 %niter235.next.1, %unroll_iter234
  br i1 %niter235.ncmp.1, label %._crit_edge.us71.us.1.preheader.unr-lcssa, label %._crit_edge.us71.us, !llvm.loop !25

._crit_edge.us71.us.1.preheader.unr-lcssa:        ; preds = %._crit_edge.us71.us, %._crit_edge.us71.us.preheader
  %indvars.iv111.1.unr = phi i64 [ 0, %._crit_edge.us71.us.preheader ], [ %indvars.iv.next112.1.1, %._crit_edge.us71.us ]
  br i1 %lcmp.mod233.not, label %._crit_edge.us71.us.1.preheader, label %._crit_edge.us71.us.epil

._crit_edge.us71.us.epil:                         ; preds = %._crit_edge.us71.us.1.preheader.unr-lcssa
  %268 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv111.1.unr
  %269 = load i32, ptr %268, align 4, !tbaa !5
  %270 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 1, i64 %indvars.iv111.1.unr
  %271 = load i32, ptr %270, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %272
  %274 = load i32, ptr %273, align 4, !tbaa !5
  %275 = add nsw i32 %274, %269
  %276 = icmp sgt i32 %275, 1000000006
  %277 = add nsw i32 %275, -1000000007
  %spec.select.us.us.1.epil = select i1 %276, i32 %277, i32 %275
  store i32 %spec.select.us.us.1.epil, ptr %273, align 4, !tbaa !5
  br label %._crit_edge.us71.us.1.preheader

._crit_edge.us71.us.1.preheader:                  ; preds = %._crit_edge.us71.us.1.preheader.unr-lcssa, %._crit_edge.us71.us.epil
  br i1 %209, label %._crit_edge.us71.us.2.preheader.unr-lcssa, label %._crit_edge.us71.us.1

._crit_edge.us71.us.1:                            ; preds = %._crit_edge.us71.us.1.preheader, %._crit_edge.us71.us.1
  %indvars.iv111.2 = phi i64 [ %indvars.iv.next112.2.1, %._crit_edge.us71.us.1 ], [ 0, %._crit_edge.us71.us.1.preheader ]
  %niter240 = phi i64 [ %niter240.next.1, %._crit_edge.us71.us.1 ], [ 0, %._crit_edge.us71.us.1.preheader ]
  %278 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv111.2
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %280 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 2, i64 %indvars.iv111.2
  %281 = load i32, ptr %280, align 8, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %282
  %284 = load i32, ptr %283, align 4, !tbaa !5
  %285 = add nsw i32 %284, %279
  %286 = icmp sgt i32 %285, 1000000006
  %287 = add nsw i32 %285, -1000000007
  %spec.select.us.us.2 = select i1 %286, i32 %287, i32 %285
  store i32 %spec.select.us.us.2, ptr %283, align 4, !tbaa !5
  %indvars.iv.next112.2 = or disjoint i64 %indvars.iv111.2, 1
  %288 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv.next112.2
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 2, i64 %indvars.iv.next112.2
  %291 = load i32, ptr %290, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %292
  %294 = load i32, ptr %293, align 4, !tbaa !5
  %295 = add nsw i32 %294, %289
  %296 = icmp sgt i32 %295, 1000000006
  %297 = add nsw i32 %295, -1000000007
  %spec.select.us.us.2.1 = select i1 %296, i32 %297, i32 %295
  store i32 %spec.select.us.us.2.1, ptr %293, align 4, !tbaa !5
  %indvars.iv.next112.2.1 = add nuw nsw i64 %indvars.iv111.2, 2
  %niter240.next.1 = add i64 %niter240, 2
  %niter240.ncmp.1 = icmp eq i64 %niter240.next.1, %unroll_iter239
  br i1 %niter240.ncmp.1, label %._crit_edge.us71.us.2.preheader.unr-lcssa, label %._crit_edge.us71.us.1, !llvm.loop !25

._crit_edge.us71.us.2.preheader.unr-lcssa:        ; preds = %._crit_edge.us71.us.1, %._crit_edge.us71.us.1.preheader
  %indvars.iv111.2.unr = phi i64 [ 0, %._crit_edge.us71.us.1.preheader ], [ %indvars.iv.next112.2.1, %._crit_edge.us71.us.1 ]
  br i1 %lcmp.mod238.not, label %._crit_edge.us71.us.2.preheader, label %._crit_edge.us71.us.1.epil

._crit_edge.us71.us.1.epil:                       ; preds = %._crit_edge.us71.us.2.preheader.unr-lcssa
  %298 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv111.2.unr
  %299 = load i32, ptr %298, align 4, !tbaa !5
  %300 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 2, i64 %indvars.iv111.2.unr
  %301 = load i32, ptr %300, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %302
  %304 = load i32, ptr %303, align 4, !tbaa !5
  %305 = add nsw i32 %304, %299
  %306 = icmp sgt i32 %305, 1000000006
  %307 = add nsw i32 %305, -1000000007
  %spec.select.us.us.2.epil = select i1 %306, i32 %307, i32 %305
  store i32 %spec.select.us.us.2.epil, ptr %303, align 4, !tbaa !5
  br label %._crit_edge.us71.us.2.preheader

._crit_edge.us71.us.2.preheader:                  ; preds = %._crit_edge.us71.us.2.preheader.unr-lcssa, %._crit_edge.us71.us.1.epil
  br i1 %210, label %._crit_edge.us71.us.3.unr-lcssa, label %._crit_edge.us71.us.2

._crit_edge.us71.us.2:                            ; preds = %._crit_edge.us71.us.2.preheader, %._crit_edge.us71.us.2
  %indvars.iv111.3 = phi i64 [ %indvars.iv.next112.3.1, %._crit_edge.us71.us.2 ], [ 0, %._crit_edge.us71.us.2.preheader ]
  %niter244 = phi i64 [ %niter244.next.1, %._crit_edge.us71.us.2 ], [ 0, %._crit_edge.us71.us.2.preheader ]
  %308 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv111.3
  %309 = load i32, ptr %308, align 4, !tbaa !5
  %310 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 3, i64 %indvars.iv111.3
  %311 = load i32, ptr %310, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %312
  %314 = load i32, ptr %313, align 4, !tbaa !5
  %315 = add nsw i32 %314, %309
  %316 = icmp sgt i32 %315, 1000000006
  %317 = add nsw i32 %315, -1000000007
  %spec.select.us.us.3 = select i1 %316, i32 %317, i32 %315
  store i32 %spec.select.us.us.3, ptr %313, align 4, !tbaa !5
  %indvars.iv.next112.3 = or disjoint i64 %indvars.iv111.3, 1
  %318 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv.next112.3
  %319 = load i32, ptr %318, align 4, !tbaa !5
  %320 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 3, i64 %indvars.iv.next112.3
  %321 = load i32, ptr %320, align 8, !tbaa !5
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %322
  %324 = load i32, ptr %323, align 4, !tbaa !5
  %325 = add nsw i32 %324, %319
  %326 = icmp sgt i32 %325, 1000000006
  %327 = add nsw i32 %325, -1000000007
  %spec.select.us.us.3.1 = select i1 %326, i32 %327, i32 %325
  store i32 %spec.select.us.us.3.1, ptr %323, align 4, !tbaa !5
  %indvars.iv.next112.3.1 = add nuw nsw i64 %indvars.iv111.3, 2
  %niter244.next.1 = add i64 %niter244, 2
  %niter244.ncmp.1 = icmp eq i64 %niter244.next.1, %unroll_iter243
  br i1 %niter244.ncmp.1, label %._crit_edge.us71.us.3.unr-lcssa, label %._crit_edge.us71.us.2, !llvm.loop !25

._crit_edge.us71.us.3.unr-lcssa:                  ; preds = %._crit_edge.us71.us.2, %._crit_edge.us71.us.2.preheader
  %indvars.iv111.3.unr = phi i64 [ 0, %._crit_edge.us71.us.2.preheader ], [ %indvars.iv.next112.3.1, %._crit_edge.us71.us.2 ]
  br i1 %lcmp.mod242.not, label %._crit_edge.us71.us.3, label %._crit_edge.us71.us.2.epil

._crit_edge.us71.us.2.epil:                       ; preds = %._crit_edge.us71.us.3.unr-lcssa
  %328 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %217, i64 %indvars.iv111.3.unr
  %329 = load i32, ptr %328, align 4, !tbaa !5
  %330 = getelementptr inbounds [4 x [1025 x i32]], ptr @tr, i64 0, i64 3, i64 %indvars.iv111.3.unr
  %331 = load i32, ptr %330, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %215, i64 %332
  %334 = load i32, ptr %333, align 4, !tbaa !5
  %335 = add nsw i32 %334, %329
  %336 = icmp sgt i32 %335, 1000000006
  %337 = add nsw i32 %335, -1000000007
  %spec.select.us.us.3.epil = select i1 %336, i32 %337, i32 %335
  store i32 %spec.select.us.us.3.epil, ptr %333, align 4, !tbaa !5
  br label %._crit_edge.us71.us.3

._crit_edge.us71.us.3:                            ; preds = %._crit_edge.us71.us.3.unr-lcssa, %._crit_edge.us71.us.2.epil
  %338 = add nuw nsw i32 %.04774.us, 1
  %exitcond121.not = icmp eq i32 %338, %191
  br i1 %exitcond121.not, label %..preheader55_crit_edge, label %.split70.us.us, !llvm.loop !26

..preheader55_crit_edge.loopexit.unr-lcssa:       ; preds = %.split70, %.split70.preheader
  %lcmp.mod247.not = icmp eq i32 %xtraiter245, 0
  br i1 %lcmp.mod247.not, label %..preheader55_crit_edge, label %.split70.epil

.split70.epil:                                    ; preds = %..preheader55_crit_edge.loopexit.unr-lcssa, %.split70.epil
  %339 = phi i32 [ %344, %.split70.epil ], [ %pre.promoted, %..preheader55_crit_edge.loopexit.unr-lcssa ]
  %340 = phi i32 [ %341, %.split70.epil ], [ %188, %..preheader55_crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.split70.epil ], [ 0, %..preheader55_crit_edge.loopexit.unr-lcssa ]
  %341 = xor i32 %340, 1
  %342 = sext i32 %341 to i64
  %343 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %342
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %343, i8 0, i64 %194, i1 false)
  %344 = xor i32 %339, 1
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter245
  br i1 %epil.iter.cmp.not, label %..preheader55_crit_edge, label %.split70.epil, !llvm.loop !27

..preheader55_crit_edge:                          ; preds = %._crit_edge.us71.us.3, %..preheader55_crit_edge.loopexit.unr-lcssa, %.split70.epil
  %.us-phi = phi i32 [ %188, %..preheader55_crit_edge.loopexit.unr-lcssa ], [ %341, %.split70.epil ], [ %214, %._crit_edge.us71.us.3 ]
  %.us-phi78 = phi i32 [ %pre.promoted, %..preheader55_crit_edge.loopexit.unr-lcssa ], [ %344, %.split70.epil ], [ %213, %._crit_edge.us71.us.3 ]
  store i32 %.us-phi78, ptr @pre, align 4, !tbaa !5
  store i32 %.us-phi, ptr @cur, align 4, !tbaa !5
  br label %.preheader55

.preheader55:                                     ; preds = %..preheader55_crit_edge, %.split.us
  %345 = phi i32 [ %.us-phi, %..preheader55_crit_edge ], [ %188, %.split.us ]
  br i1 %.not84133, label %.preheader, label %.lr.ph80

.lr.ph80:                                         ; preds = %.preheader55
  %346 = sext i32 %345 to i64
  %smax126 = tail call i32 @llvm.smax.i32(i32 %4, i32 1)
  %wide.trip.count127 = zext nneg i32 %smax126 to i64
  %xtraiter253 = and i64 %wide.trip.count127, 1
  %347 = icmp slt i32 %4, 2
  br i1 %347, label %.preheader.loopexit.unr-lcssa, label %.lr.ph80.new

.lr.ph80.new:                                     ; preds = %.lr.ph80
  %unroll_iter256 = and i64 %wide.trip.count127, 2147483646
  br label %358

.split70:                                         ; preds = %.split70, %.split70.preheader.new
  %niter251 = phi i32 [ 0, %.split70.preheader.new ], [ %niter251.next.3, %.split70 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %198, i8 0, i64 %194, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %200, i8 0, i64 %194, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %203, i8 0, i64 %194, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %205, i8 0, i64 %194, i1 false)
  %niter251.next.3 = add i32 %niter251, 4
  %niter251.ncmp.3 = icmp eq i32 %niter251.next.3, %unroll_iter250
  br i1 %niter251.ncmp.3, label %..preheader55_crit_edge.loopexit.unr-lcssa, label %.split70, !llvm.loop !26

.preheader.loopexit.unr-lcssa:                    ; preds = %358, %.lr.ph80
  %indvars.iv123.unr = phi i64 [ 0, %.lr.ph80 ], [ %indvars.iv.next124.1, %358 ]
  %lcmp.mod255.not = icmp eq i64 %xtraiter253, 0
  br i1 %lcmp.mod255.not, label %.preheader, label %.preheader.loopexit.epilog-lcssa

.preheader.loopexit.epilog-lcssa:                 ; preds = %.preheader.loopexit.unr-lcssa
  %348 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %346, i64 %indvars.iv123.unr
  %349 = load i32, ptr %348, align 4, !tbaa !5
  %350 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %indvars.iv123.unr
  %351 = load i32, ptr %350, align 4, !tbaa !5
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [11 x i32], ptr @ans, i64 0, i64 %352
  %354 = load i32, ptr %353, align 4, !tbaa !5
  %355 = add nsw i32 %354, %349
  %356 = icmp sgt i32 %355, 1000000006
  %357 = add nsw i32 %355, -1000000007
  %spec.select54.epil = select i1 %356, i32 %357, i32 %355
  store i32 %spec.select54.epil, ptr %353, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit.epilog-lcssa, %.preheader.loopexit.unr-lcssa, %.preheader55
  %.not81 = icmp slt i32 %3, 0
  br i1 %.not81, label %._crit_edge, label %.lr.ph83

358:                                              ; preds = %358, %.lr.ph80.new
  %indvars.iv123 = phi i64 [ 0, %.lr.ph80.new ], [ %indvars.iv.next124.1, %358 ]
  %niter257 = phi i64 [ 0, %.lr.ph80.new ], [ %niter257.next.1, %358 ]
  %359 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %346, i64 %indvars.iv123
  %360 = load i32, ptr %359, align 4, !tbaa !5
  %361 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %indvars.iv123
  %362 = load i32, ptr %361, align 8, !tbaa !5
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds [11 x i32], ptr @ans, i64 0, i64 %363
  %365 = load i32, ptr %364, align 4, !tbaa !5
  %366 = add nsw i32 %365, %360
  %367 = icmp sgt i32 %366, 1000000006
  %368 = add nsw i32 %366, -1000000007
  %spec.select54 = select i1 %367, i32 %368, i32 %366
  store i32 %spec.select54, ptr %364, align 4, !tbaa !5
  %indvars.iv.next124 = or disjoint i64 %indvars.iv123, 1
  %369 = getelementptr inbounds [2 x [1025 x i32]], ptr @f, i64 0, i64 %346, i64 %indvars.iv.next124
  %370 = load i32, ptr %369, align 4, !tbaa !5
  %371 = getelementptr inbounds [1025 x i32], ptr @bits, i64 0, i64 %indvars.iv.next124
  %372 = load i32, ptr %371, align 4, !tbaa !5
  %373 = sext i32 %372 to i64
  %374 = getelementptr inbounds [11 x i32], ptr @ans, i64 0, i64 %373
  %375 = load i32, ptr %374, align 4, !tbaa !5
  %376 = add nsw i32 %375, %370
  %377 = icmp sgt i32 %376, 1000000006
  %378 = add nsw i32 %376, -1000000007
  %spec.select54.1 = select i1 %377, i32 %378, i32 %376
  store i32 %spec.select54.1, ptr %374, align 4, !tbaa !5
  %indvars.iv.next124.1 = add nuw nsw i64 %indvars.iv123, 2
  %niter257.next.1 = add i64 %niter257, 2
  %niter257.ncmp.1 = icmp eq i64 %niter257.next.1, %unroll_iter256
  br i1 %niter257.ncmp.1, label %.preheader.loopexit.unr-lcssa, label %358, !llvm.loop !29

._crit_edge:                                      ; preds = %.lr.ph83, %.preheader
  ret i32 0

.lr.ph83:                                         ; preds = %.preheader, %.lr.ph83
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %.lr.ph83 ], [ 0, %.preheader ]
  %379 = getelementptr inbounds [11 x i32], ptr @ans, i64 0, i64 %indvars.iv129
  %380 = load i32, ptr %379, align 4, !tbaa !5
  %381 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %380)
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %382 = load i32, ptr @m, align 4, !tbaa !5
  %383 = sext i32 %382 to i64
  %.not.not = icmp slt i64 %indvars.iv129, %383
  br i1 %.not.not, label %.lr.ph83, label %._crit_edge, !llvm.loop !30
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

attributes #0 = { mustprogress nofree norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12, !16, !15}
!18 = distinct !{!18, !12, !15, !16}
!19 = distinct !{!19, !12, !16, !15}
!20 = distinct !{!20, !12, !15, !16}
!21 = distinct !{!21, !12, !16, !15}
!22 = distinct !{!22, !12, !15, !16}
!23 = distinct !{!23, !12, !16, !15}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.unroll.disable"}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}


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