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

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

%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [9 x i64] }

@n = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@f = external dso_local global [151 x i32], align 16
@buf = external dso_local global [151 x i8], align 16
@pat = external dso_local global [571 x i8], align 16
@fst = external dso_local global [27 x %"class.std::bitset"], align 16
@mid = external dso_local global [27 x %"class.std::bitset"], align 16
@lst = external dso_local global [27 x %"class.std::bitset"], align 16
@g = external dso_local global [151 x [151 x %"class.std::bitset"]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

19:                                               ; preds = %82, %0
  %20 = load i32, ptr @tot, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr @tot, align 4, !tbaa !5
  %22 = icmp ne i32 %20, 0
  br i1 %22, label %23, label %83

23:                                               ; preds = %19
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @pat)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %79, %23
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [571 x i8], ptr @pat, i64 0, i64 %27
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = icmp ne i8 %29, 0
  br i1 %30, label %32, label %31

31:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %82

32:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [571 x i8], ptr @pat, i64 0, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = sext i8 %36 to i32
  %38 = sub nsw i32 %37, 97
  store i32 %38, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [571 x i8], ptr @pat, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !9
  %44 = icmp ne i8 %43, 0
  br i1 %44, label %58, label %45

45:                                               ; preds = %32
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @lst, i64 0, i64 %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %53

51:                                               ; preds = %45
  %52 = load i32, ptr @cnt, align 4, !tbaa !5
  br label %54

53:                                               ; preds = %45
  br label %54

54:                                               ; preds = %53, %51
  %55 = phi i32 [ %52, %51 ], [ 0, %53 ]
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %48, i64 noundef %56, i1 noundef zeroext true)
  br label %78

58:                                               ; preds = %32
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %69, label %61

61:                                               ; preds = %58
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @fst, i64 0, i64 %63
  %65 = load i32, ptr @cnt, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr @cnt, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %64, i64 noundef %67, i1 noundef zeroext true)
  br label %77

69:                                               ; preds = %58
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @mid, i64 0, i64 %71
  %73 = load i32, ptr @cnt, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr @cnt, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %72, i64 noundef %75, i1 noundef zeroext true)
  br label %77

77:                                               ; preds = %69, %61
  br label %78

78:                                               ; preds = %77, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !10

82:                                               ; preds = %31
  br label %19, !llvm.loop !12

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

84:                                               ; preds = %118, %83
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %121

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [151 x i8], ptr @buf, i64 0, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !9
  %94 = sext i8 %93 to i32
  %95 = sub nsw i32 %94, 97
  store i32 %95, ptr %5, align 4, !tbaa !5
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @fst, i64 0, i64 %97
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %100
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %101, i64 0, i64 %103
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %104, ptr align 8 %98, i64 72, i1 false)
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @lst, i64 0, i64 %106
  %108 = call noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72) %107, i64 noundef 0)
  br i1 %108, label %109, label %117

109:                                              ; preds = %89
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %111
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %112, i64 0, i64 %114
  %116 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %115, i64 noundef 0, i1 noundef zeroext true)
  br label %117

117:                                              ; preds = %109, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %4, align 4, !tbaa !5
  br label %84, !llvm.loop !13

121:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %122 = load i32, ptr @n, align 4, !tbaa !5
  %123 = sub nsw i32 %122, 1
  store i32 %123, ptr %6, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %237, %121
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = icmp sge i32 %125, 0
  br i1 %126, label %128, label %127

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

128:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %8, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %233, %128
  %132 = load i32, ptr %8, align 4, !tbaa !5
  %133 = load i32, ptr @n, align 4, !tbaa !5
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %236

136:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %137 = load i32, ptr %8, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [151 x i8], ptr @buf, i64 0, i64 %138
  %140 = load i8, ptr %139, align 1, !tbaa !9
  %141 = sext i8 %140 to i32
  %142 = sub nsw i32 %141, 97
  store i32 %142, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr %11) #9
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %144
  %146 = load i32, ptr %8, align 4, !tbaa !5
  %147 = sub nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %145, i64 0, i64 %148
  call void @_ZNKSt6bitsetILm571EElsEm(ptr dead_on_unwind writable sret(%"class.std::bitset") align 8 %11, ptr noundef nonnull align 8 dereferenceable(72) %149, i64 noundef 1) #9
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @mid, i64 0, i64 %151
  call void @_ZStanILm571EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind writable sret(%"class.std::bitset") align 8 %10, ptr noundef nonnull align 8 dereferenceable(72) %11, ptr noundef nonnull align 8 dereferenceable(72) %152) #9
  %153 = load i32, ptr %6, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %154
  %156 = load i32, ptr %8, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %155, i64 0, i64 %157
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %158, ptr align 8 %10, i64 72, i1 false)
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr %10) #9
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %160
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = sub nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %161, i64 0, i64 %164
  %166 = call noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72) %165, i64 noundef 0)
  br i1 %166, label %167, label %178

167:                                              ; preds = %136
  %168 = load i32, ptr %9, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @fst, i64 0, i64 %169
  %171 = load i32, ptr %6, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %172
  %174 = load i32, ptr %8, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %173, i64 0, i64 %175
  %177 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(72) %176, ptr noundef nonnull align 8 dereferenceable(72) %170) #9
  br label %178

178:                                              ; preds = %167, %136
  call void @llvm.lifetime.start.p0(i64 72, ptr %12) #9
  %179 = load i32, ptr %6, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %180
  %182 = load i32, ptr %8, align 4, !tbaa !5
  %183 = sub nsw i32 %182, 1
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %181, i64 0, i64 %184
  %186 = load i32, ptr %9, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @lst, i64 0, i64 %187
  call void @_ZStanILm571EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind writable sret(%"class.std::bitset") align 8 %12, ptr noundef nonnull align 8 dereferenceable(72) %185, ptr noundef nonnull align 8 dereferenceable(72) %188) #9
  %189 = call noundef zeroext i1 @_ZNKSt6bitsetILm571EE3anyEv(ptr noundef nonnull align 8 dereferenceable(72) %12) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr %12) #9
  br i1 %189, label %190, label %198

190:                                              ; preds = %178
  %191 = load i32, ptr %6, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %192
  %194 = load i32, ptr %8, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %193, i64 0, i64 %195
  %197 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %196, i64 noundef 0, i1 noundef zeroext true)
  br label %198

198:                                              ; preds = %190, %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %199 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %199, ptr %13, align 4, !tbaa !5
  br label %200

200:                                              ; preds = %229, %198
  %201 = load i32, ptr %13, align 4, !tbaa !5
  %202 = load i32, ptr %8, align 4, !tbaa !5
  %203 = icmp slt i32 %201, %202
  br i1 %203, label %205, label %204

204:                                              ; preds = %200
  store i32 16, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %232

205:                                              ; preds = %200
  %206 = load i32, ptr %13, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %208
  %210 = load i32, ptr %8, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %209, i64 0, i64 %211
  %213 = call noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72) %212, i64 noundef 0)
  br i1 %213, label %214, label %228

214:                                              ; preds = %205
  %215 = load i32, ptr %6, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %216
  %218 = load i32, ptr %13, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %217, i64 0, i64 %219
  %221 = load i32, ptr %6, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %222
  %224 = load i32, ptr %8, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %223, i64 0, i64 %225
  %227 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(72) %226, ptr noundef nonnull align 8 dereferenceable(72) %220) #9
  br label %228

228:                                              ; preds = %214, %205
  br label %229

229:                                              ; preds = %228
  %230 = load i32, ptr %13, align 4, !tbaa !5
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %13, align 4, !tbaa !5
  br label %200, !llvm.loop !14

232:                                              ; preds = %204
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %233

233:                                              ; preds = %232
  %234 = load i32, ptr %8, align 4, !tbaa !5
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %8, align 4, !tbaa !5
  br label %131, !llvm.loop !15

236:                                              ; preds = %135
  br label %237

237:                                              ; preds = %236
  %238 = load i32, ptr %6, align 4, !tbaa !5
  %239 = add nsw i32 %238, -1
  store i32 %239, ptr %6, align 4, !tbaa !5
  br label %124, !llvm.loop !16

240:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %283, %240
  %242 = load i32, ptr %14, align 4, !tbaa !5
  %243 = load i32, ptr @n, align 4, !tbaa !5
  %244 = icmp sle i32 %242, %243
  br i1 %244, label %246, label %245

245:                                              ; preds = %241
  store i32 19, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %286

246:                                              ; preds = %241
  %247 = load i32, ptr %14, align 4, !tbaa !5
  %248 = sub nsw i32 %247, 1
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [151 x i32], ptr @f, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  %253 = load i32, ptr %14, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [151 x i32], ptr @f, i64 0, i64 %254
  store i32 %252, ptr %255, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %279, %246
  %257 = load i32, ptr %15, align 4, !tbaa !5
  %258 = load i32, ptr %14, align 4, !tbaa !5
  %259 = icmp slt i32 %257, %258
  br i1 %259, label %261, label %260

260:                                              ; preds = %256
  store i32 22, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %282

261:                                              ; preds = %256
  %262 = load i32, ptr %15, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %263
  %265 = load i32, ptr %14, align 4, !tbaa !5
  %266 = sub nsw i32 %265, 1
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [151 x %"class.std::bitset"], ptr %264, i64 0, i64 %267
  %269 = call noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72) %268, i64 noundef 0)
  br i1 %269, label %270, label %278

270:                                              ; preds = %261
  %271 = load i32, ptr %14, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [151 x i32], ptr @f, i64 0, i64 %272
  %274 = load i32, ptr %15, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [151 x i32], ptr @f, i64 0, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %273, i32 noundef %277)
  br label %278

278:                                              ; preds = %270, %261
  br label %279

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

282:                                              ; preds = %260
  br label %283

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

286:                                              ; preds = %245
  %287 = load i32, ptr @n, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [151 x i32], ptr @f, i64 0, i64 %288
  %290 = load i32, ptr %289, align 4, !tbaa !5
  %291 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %290)
  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: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef, i1 noundef zeroext) #4 align 2

; 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZStanILm571EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind noalias writable sret(%"class.std::bitset") align 8, ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt6bitsetILm571EElsEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset") align 8, ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm571EE3anyEv(ptr noundef nonnull align 8 dereferenceable(72)) #7 align 2

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}


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

%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [9 x i64] }

@n = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local global [151 x i32], align 16
@buf = external dso_local global [151 x i8], align 16
@pat = external dso_local global [571 x i8], align 16
@fst = external dso_local global [27 x %"class.std::bitset"], align 16
@mid = external dso_local global [27 x %"class.std::bitset"], align 16
@lst = external dso_local global [27 x %"class.std::bitset"], align 16
@g = external dso_local global [151 x [151 x %"class.std::bitset"]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"class.std::bitset", align 8
  %2 = alloca %"class.std::bitset", align 8
  %3 = alloca %"class.std::bitset", align 8
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @buf, ptr noundef nonnull @tot)
  %5 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @buf) #8
  %6 = trunc i64 %5 to i32
  store i32 %6, ptr @n, align 4, !tbaa !5
  %7 = load i32, ptr @tot, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr @tot, align 4, !tbaa !5
  %.not81 = icmp eq i32 %7, 0
  br i1 %.not81, label %.preheader76, label %.lr.ph82

.loopexit77:                                      ; preds = %37, %27, %.lr.ph82
  %9 = load i32, ptr @tot, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @tot, align 4, !tbaa !5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %.preheader76.loopexit, label %.lr.ph82, !llvm.loop !9

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

.preheader76:                                     ; preds = %.preheader76.loopexit, %0
  %11 = phi i32 [ %.pre, %.preheader76.loopexit ], [ %6, %0 ]
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph84, label %.preheader.._crit_edge96_crit_edge

.lr.ph82:                                         ; preds = %0, %.loopexit77
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @pat)
  %14 = load i8, ptr @pat, align 16, !tbaa !11
  %.not7079 = icmp eq i8 %14, 0
  br i1 %.not7079, label %.loopexit77, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph82
  %15 = sext i8 %14 to i64
  %16 = add nsw i64 %15, -97
  %17 = load i8, ptr getelementptr inbounds (i8, ptr @pat, i64 1), align 1, !tbaa !11
  %.not71.peel = icmp eq i8 %17, 0
  br i1 %.not71.peel, label %24, label %18

18:                                               ; preds = %.lr.ph.preheader
  %19 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @fst, i64 0, i64 %16
  %20 = load i32, ptr @cnt, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @cnt, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = tail call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %19, i64 noundef %22, i1 noundef zeroext true)
  br label %27

24:                                               ; preds = %.lr.ph.preheader
  %25 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @lst, i64 0, i64 %16
  %26 = tail call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %25, i64 noundef 0, i1 noundef zeroext true)
  br label %27

27:                                               ; preds = %24, %18
  %28 = load i8, ptr getelementptr inbounds (i8, ptr @pat, i64 1), align 1, !tbaa !11
  %.not70.peel = icmp eq i8 %28, 0
  br i1 %.not70.peel, label %.loopexit77, label %.lr.ph

.lr.ph:                                           ; preds = %27, %37
  %indvars.iv = phi i64 [ %indvars.iv.next, %37 ], [ 1, %27 ]
  %29 = phi i8 [ %40, %37 ], [ %28, %27 ]
  %30 = sext i8 %29 to i64
  %31 = add nsw i64 %30, -97
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = getelementptr inbounds [571 x i8], ptr @pat, i64 0, i64 %indvars.iv.next
  %33 = load i8, ptr %32, align 1, !tbaa !11
  %.not71 = icmp eq i8 %33, 0
  %34 = load i32, ptr @cnt, align 4
  br i1 %.not71, label %37, label %35

35:                                               ; preds = %.lr.ph
  %36 = add nsw i32 %34, 1
  store i32 %36, ptr @cnt, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %.lr.ph, %35
  %.sink129 = phi i32 [ %36, %35 ], [ %34, %.lr.ph ]
  %mid.pn = phi ptr [ @mid, %35 ], [ @lst, %.lr.ph ]
  %.sink = getelementptr inbounds [27 x %"class.std::bitset"], ptr %mid.pn, i64 0, i64 %31
  %38 = sext i32 %.sink129 to i64
  %39 = tail call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %.sink, i64 noundef %38, i1 noundef zeroext true)
  %40 = load i8, ptr %32, align 1, !tbaa !11
  %.not70 = icmp eq i8 %40, 0
  br i1 %.not70, label %.loopexit77, label %.lr.ph, !llvm.loop !12

.preheader75:                                     ; preds = %55
  %41 = icmp sgt i32 %56, 0
  br i1 %41, label %.preheader74.preheader, label %.preheader.._crit_edge96_crit_edge

.preheader74.preheader:                           ; preds = %.preheader75
  %42 = add nsw i32 %56, -1
  %43 = zext nneg i32 %42 to i64
  %44 = zext nneg i32 %56 to i64
  br label %.preheader74

.lr.ph84:                                         ; preds = %.preheader76, %55
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %55 ], [ 0, %.preheader76 ]
  %45 = getelementptr inbounds [151 x i8], ptr @buf, i64 0, i64 %indvars.iv102
  %46 = load i8, ptr %45, align 1, !tbaa !11
  %47 = sext i8 %46 to i64
  %48 = add nsw i64 %47, -97
  %49 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @fst, i64 0, i64 %48
  %50 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %indvars.iv102, i64 %indvars.iv102
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %50, ptr noundef nonnull align 8 dereferenceable(72) %49, i64 72, i1 false)
  %51 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @lst, i64 0, i64 %48
  %52 = tail call noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72) %51, i64 noundef 0)
  br i1 %52, label %53, label %55

53:                                               ; preds = %.lr.ph84
  %54 = tail call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %50, i64 noundef 0, i1 noundef zeroext true)
  br label %55

55:                                               ; preds = %53, %.lr.ph84
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = icmp slt i64 %indvars.iv.next103, %57
  br i1 %58, label %.lr.ph84, label %.preheader75, !llvm.loop !14

.loopexit:                                        ; preds = %._crit_edge, %.preheader74
  %59 = phi i32 [ %61, %.preheader74 ], [ %86, %._crit_edge ]
  %60 = icmp sgt i64 %indvars.iv110, 1
  %indvars.iv.next106 = add nsw i64 %indvars.iv105, -1
  br i1 %60, label %.preheader74, label %.preheader, !llvm.loop !15

.preheader74:                                     ; preds = %.preheader74.preheader, %.loopexit
  %61 = phi i32 [ %56, %.preheader74.preheader ], [ %59, %.loopexit ]
  %indvars.iv110 = phi i64 [ %44, %.preheader74.preheader ], [ %indvars.iv.next111, %.loopexit ]
  %indvars.iv105 = phi i64 [ %43, %.preheader74.preheader ], [ %indvars.iv.next106, %.loopexit ]
  %indvars.iv.next111 = add nsw i64 %indvars.iv110, -1
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv110, %62
  br i1 %63, label %.lr.ph88, label %.loopexit

.preheader:                                       ; preds = %.loopexit
  %.not6993 = icmp slt i32 %59, 1
  br i1 %.not6993, label %.preheader.._crit_edge96_crit_edge, label %.lr.ph95

.preheader.._crit_edge96_crit_edge:               ; preds = %.preheader76, %.preheader75, %.preheader
  %64 = phi i32 [ %59, %.preheader ], [ %56, %.preheader75 ], [ %11, %.preheader76 ]
  %.pre122 = sext i32 %64 to i64
  br label %._crit_edge96

.lr.ph88:                                         ; preds = %.preheader74, %._crit_edge
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %._crit_edge ], [ %indvars.iv110, %.preheader74 ]
  %65 = getelementptr inbounds [151 x i8], ptr @buf, i64 0, i64 %indvars.iv112
  %66 = load i8, ptr %65, align 1, !tbaa !11
  %67 = sext i8 %66 to i64
  %68 = add nsw i64 %67, -97
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %2) #9
  %69 = trunc nuw i64 %indvars.iv112 to i32
  %70 = add i64 %indvars.iv112, 4294967295
  %71 = and i64 %70, 4294967295
  %72 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %indvars.iv.next111, i64 %71
  call void @_ZNKSt6bitsetILm571EElsEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset") align 8 %2, ptr noundef nonnull align 8 dereferenceable(72) %72, i64 noundef 1) #9
  %73 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @mid, i64 0, i64 %68
  call void @_ZStanILm571EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset") align 8 %1, ptr noundef nonnull align 8 dereferenceable(72) %2, ptr noundef nonnull align 8 dereferenceable(72) %73) #9
  %74 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %indvars.iv.next111, i64 %indvars.iv112
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %74, ptr noundef nonnull align 8 dereferenceable(72) %1, i64 72, i1 false)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %1) #9
  %75 = call noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72) %72, i64 noundef 0)
  br i1 %75, label %76, label %79

76:                                               ; preds = %.lr.ph88
  %77 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @fst, i64 0, i64 %68
  %78 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(72) %74, ptr noundef nonnull align 8 dereferenceable(72) %77) #9
  br label %79

79:                                               ; preds = %76, %.lr.ph88
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #9
  %80 = getelementptr inbounds [27 x %"class.std::bitset"], ptr @lst, i64 0, i64 %68
  call void @_ZStanILm571EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset") align 8 %3, ptr noundef nonnull align 8 dereferenceable(72) %72, ptr noundef nonnull align 8 dereferenceable(72) %80) #9
  %81 = call noundef zeroext i1 @_ZNKSt6bitsetILm571EE3anyEv(ptr noundef nonnull align 8 dereferenceable(72) %3) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #9
  br i1 %81, label %82, label %84

82:                                               ; preds = %79
  %83 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72) %74, i64 noundef 0, i1 noundef zeroext true)
  br label %84

84:                                               ; preds = %82, %79
  %sext = shl i64 %indvars.iv112, 32
  %85 = ashr exact i64 %sext, 32
  %.not98 = icmp sgt i64 %indvars.iv110, %85
  br i1 %.not98, label %._crit_edge, label %.lr.ph86

._crit_edge:                                      ; preds = %94, %84
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = trunc nuw i64 %indvars.iv.next113 to i32
  %88 = icmp sgt i32 %86, %87
  br i1 %88, label %.lr.ph88, label %.loopexit, !llvm.loop !16

.lr.ph86:                                         ; preds = %84, %94
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %94 ], [ %indvars.iv105, %84 ]
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %89 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %indvars.iv.next108, i64 %indvars.iv112
  %90 = call noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72) %89, i64 noundef 0)
  br i1 %90, label %91, label %94

91:                                               ; preds = %.lr.ph86
  %92 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %indvars.iv.next111, i64 %indvars.iv107
  %93 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(72) %74, ptr noundef nonnull align 8 dereferenceable(72) %92) #9
  br label %94

94:                                               ; preds = %.lr.ph86, %91
  %95 = trunc nuw i64 %indvars.iv.next108 to i32
  %96 = icmp slt i32 %95, %69
  br i1 %96, label %.lr.ph86, label %._crit_edge, !llvm.loop !17

._crit_edge96:                                    ; preds = %105, %.preheader.._crit_edge96_crit_edge
  %.pre-phi = phi i64 [ %.pre122, %.preheader.._crit_edge96_crit_edge ], [ %107, %105 ]
  %97 = getelementptr inbounds [151 x i32], ptr @f, i64 0, i64 %.pre-phi
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %98)
  ret i32 0

.lr.ph95:                                         ; preds = %.preheader, %105
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %105 ], [ 1, %.preheader ]
  %100 = add nsw i64 %indvars.iv119, -1
  %101 = getelementptr inbounds [151 x i32], ptr @f, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  %104 = getelementptr inbounds [151 x i32], ptr @f, i64 0, i64 %indvars.iv119
  store i32 %103, ptr %104, align 4, !tbaa !5
  br label %108

105:                                              ; preds = %114
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %.not69.not = icmp slt i64 %indvars.iv119, %107
  br i1 %.not69.not, label %.lr.ph95, label %._crit_edge96, !llvm.loop !18

108:                                              ; preds = %.lr.ph95, %114
  %indvars.iv116 = phi i64 [ 0, %.lr.ph95 ], [ %indvars.iv.next117, %114 ]
  %109 = getelementptr inbounds [151 x [151 x %"class.std::bitset"]], ptr @g, i64 0, i64 %indvars.iv116, i64 %100
  %110 = call noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72) %109, i64 noundef 0)
  br i1 %110, label %111, label %114

111:                                              ; preds = %108
  %112 = getelementptr inbounds [151 x i32], ptr @f, i64 0, i64 %indvars.iv116
  %113 = load i32, ptr %112, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %104, i32 noundef %113)
  br label %114

114:                                              ; preds = %108, %111
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next117, %indvars.iv119
  br i1 %exitcond.not, label %105, label %108, !llvm.loop !19
}

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EE3setEmb(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef, i1 noundef zeroext) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm571EE4testEm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZStanILm571EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind noalias writable sret(%"class.std::bitset") align 8, ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt6bitsetILm571EElsEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset") align 8, ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6bitsetILm571EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm571EE3anyEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #7 align 2

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

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

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


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