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

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

%struct.Trie = type { i32, [26 x i32], i8 }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [625 x i64] }
%"class.std::bitset<40000>::reference" = type { ptr, i64 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@que = external dso_local global [10001 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@e = external dso_local global [10001 x %struct.Trie], align 16
@str = external dso_local global [40001 x i8], align 16
@tmp = external dso_local global [10002 x i8], align 16
@f = external dso_local global [40000 x %"class.std::bitset"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %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 ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::bitset<40000>::reference", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::bitset", align 8
  %19 = alloca %"class.std::bitset", align 8
  %20 = alloca %"class.std::bitset", align 8
  %21 = alloca %"class.std::bitset<40000>::reference", align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %25

25:                                               ; preds = %366, %0
  %26 = load i32, ptr @t, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr @t, align 4, !tbaa !5
  %28 = icmp ne i32 %26, 0
  br i1 %28, label %29, label %367

29:                                               ; preds = %25
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m, ptr noundef @q, ptr noundef @str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %41, %29
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %31
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %38
  %40 = call noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE5resetEv(ptr noundef nonnull align 8 dereferenceable(5000) %39) #6
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %31, !llvm.loop !9

44:                                               ; preds = %35
  store i32 0, ptr @tot, align 4, !tbaa !5
  %45 = load i32, ptr @tot, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr @tot, align 4, !tbaa !5
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds %struct.Trie, ptr @e, i64 %47
  call void @llvm.memset.p0.i64(ptr align 4 %48, i8 0, i64 112, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %119, %44
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = load i32, ptr @m, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %122

54:                                               ; preds = %49
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @tmp)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %111, %54
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [10002 x i8], ptr @tmp, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !11
  %61 = icmp ne i8 %60, 0
  br i1 %61, label %63, label %62

62:                                               ; preds = %56
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %114

63:                                               ; preds = %56
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10002 x i8], ptr @tmp, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !11
  %68 = sext i8 %67 to i32
  %69 = sub nsw i32 %68, 97
  %70 = trunc i32 %69 to i8
  store i8 %70, ptr %66, align 1, !tbaa !11
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.Trie, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [10002 x i8], ptr @tmp, i64 0, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !11
  %79 = sext i8 %78 to i64
  %80 = getelementptr inbounds [26 x i32], ptr %74, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %99, label %83

83:                                               ; preds = %63
  %84 = load i32, ptr @tot, align 4, !tbaa !5
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %86
  %88 = getelementptr inbounds %struct.Trie, ptr %87, i32 0, i32 1
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [10002 x i8], ptr @tmp, i64 0, i64 %90
  %92 = load i8, ptr %91, align 1, !tbaa !11
  %93 = sext i8 %92 to i64
  %94 = getelementptr inbounds [26 x i32], ptr %88, i64 0, i64 %93
  store i32 %84, ptr %94, align 4, !tbaa !5
  %95 = load i32, ptr @tot, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr @tot, align 4, !tbaa !5
  %97 = sext i32 %95 to i64
  %98 = getelementptr inbounds %struct.Trie, ptr @e, i64 %97
  call void @llvm.memset.p0.i64(ptr align 4 %98, i8 0, i64 112, i1 false)
  br label %99

99:                                               ; preds = %83, %63
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %101
  %103 = getelementptr inbounds %struct.Trie, ptr %102, i32 0, i32 1
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [10002 x i8], ptr @tmp, i64 0, i64 %105
  %107 = load i8, ptr %106, align 1, !tbaa !11
  %108 = sext i8 %107 to i64
  %109 = getelementptr inbounds [26 x i32], ptr %103, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  store i32 %110, ptr %5, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %99
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %6, align 4, !tbaa !5
  br label %56, !llvm.loop !12

114:                                              ; preds = %62
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %116
  %118 = getelementptr inbounds %struct.Trie, ptr %117, i32 0, i32 2
  store i8 1, ptr %118, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %119

119:                                              ; preds = %114
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %3, align 4, !tbaa !5
  br label %49, !llvm.loop !16

122:                                              ; preds = %53
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %143, %122
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = icmp slt i32 %124, 26
  br i1 %125, label %127, label %126

126:                                              ; preds = %123
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %146

127:                                              ; preds = %123
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [26 x i32], ptr getelementptr inbounds (%struct.Trie, ptr @e, i32 0, i32 1), i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %142

133:                                              ; preds = %127
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [26 x i32], ptr getelementptr inbounds (%struct.Trie, ptr @e, i32 0, i32 1), i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = load i32, ptr @R, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr @R, align 4, !tbaa !5
  %140 = sext i32 %138 to i64
  %141 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %140
  store i32 %137, ptr %141, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %133, %127
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %7, align 4, !tbaa !5
  br label %123, !llvm.loop !17

146:                                              ; preds = %126
  br label %147

147:                                              ; preds = %232, %146
  %148 = load i32, ptr @L, align 4, !tbaa !5
  %149 = load i32, ptr @R, align 4, !tbaa !5
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %151, label %233

151:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %152 = load i32, ptr @L, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr @L, align 4, !tbaa !5
  %154 = sext i32 %152 to i64
  %155 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %154
  store ptr %155, ptr %8, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %229, %151
  %157 = load i32, ptr %9, align 4, !tbaa !5
  %158 = icmp slt i32 %157, 26
  br i1 %158, label %160, label %159

159:                                              ; preds = %156
  store i32 18, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %232

160:                                              ; preds = %156
  %161 = load ptr, ptr %8, align 8, !tbaa !18
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %163
  %165 = getelementptr inbounds %struct.Trie, ptr %164, i32 0, i32 1
  %166 = load i32, ptr %9, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [26 x i32], ptr %165, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %228

171:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %172 = load ptr, ptr %8, align 8, !tbaa !18
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %174
  %176 = getelementptr inbounds %struct.Trie, ptr %175, i32 0, i32 1
  %177 = load i32, ptr %9, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [26 x i32], ptr %176, i64 0, i64 %178
  store ptr %179, ptr %10, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %180 = load ptr, ptr %8, align 8, !tbaa !18
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %182
  %184 = getelementptr inbounds %struct.Trie, ptr %183, i32 0, i32 0
  %185 = load i32, ptr %184, align 16, !tbaa !20
  store i32 %185, ptr %11, align 4, !tbaa !5
  %186 = load ptr, ptr %10, align 8, !tbaa !18
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = load i32, ptr @R, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr @R, align 4, !tbaa !5
  %190 = sext i32 %188 to i64
  %191 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %190
  store i32 %187, ptr %191, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %208, %171
  %193 = load i32, ptr %11, align 4, !tbaa !5
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %195, label %206

195:                                              ; preds = %192
  %196 = load i32, ptr %11, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %197
  %199 = getelementptr inbounds %struct.Trie, ptr %198, i32 0, i32 1
  %200 = load i32, ptr %9, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [26 x i32], ptr %199, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = icmp ne i32 %203, 0
  %205 = xor i1 %204, true
  br label %206

206:                                              ; preds = %195, %192
  %207 = phi i1 [ false, %192 ], [ %205, %195 ]
  br i1 %207, label %208, label %214

208:                                              ; preds = %206
  %209 = load i32, ptr %11, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %210
  %212 = getelementptr inbounds %struct.Trie, ptr %211, i32 0, i32 0
  %213 = load i32, ptr %212, align 16, !tbaa !20
  store i32 %213, ptr %11, align 4, !tbaa !5
  br label %192, !llvm.loop !21

214:                                              ; preds = %206
  %215 = load i32, ptr %11, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %216
  %218 = getelementptr inbounds %struct.Trie, ptr %217, i32 0, i32 1
  %219 = load i32, ptr %9, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [26 x i32], ptr %218, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !5
  store i32 %222, ptr %11, align 4, !tbaa !5
  %223 = load ptr, ptr %10, align 8, !tbaa !18
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %225
  %227 = getelementptr inbounds %struct.Trie, ptr %226, i32 0, i32 0
  store i32 %222, ptr %227, align 16, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %228

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

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

232:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %147, !llvm.loop !23

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

234:                                              ; preds = %247, %233
  %235 = load i32, ptr %12, align 4, !tbaa !5
  %236 = load i32, ptr @n, align 4, !tbaa !5
  %237 = icmp slt i32 %235, %236
  br i1 %237, label %239, label %238

238:                                              ; preds = %234
  store i32 23, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %250

239:                                              ; preds = %234
  %240 = load i32, ptr %12, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [40001 x i8], ptr @str, i64 0, i64 %241
  %243 = load i8, ptr %242, align 1, !tbaa !11
  %244 = sext i8 %243 to i32
  %245 = sub nsw i32 %244, 97
  %246 = trunc i32 %245 to i8
  store i8 %246, ptr %242, align 1, !tbaa !11
  br label %247

247:                                              ; preds = %239
  %248 = load i32, ptr %12, align 4, !tbaa !5
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %12, align 4, !tbaa !5
  br label %234, !llvm.loop !24

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

251:                                              ; preds = %310, %250
  %252 = load i32, ptr %13, align 4, !tbaa !5
  %253 = load i32, ptr @n, align 4, !tbaa !5
  %254 = icmp slt i32 %252, %253
  br i1 %254, label %256, label %255

255:                                              ; preds = %251
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %313

256:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %257 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %257, ptr %15, align 4, !tbaa !5
  br label %258

258:                                              ; preds = %305, %256
  %259 = load i32, ptr %15, align 4, !tbaa !5
  %260 = load i32, ptr @n, align 4, !tbaa !5
  %261 = icmp slt i32 %259, %260
  br i1 %261, label %263, label %262

262:                                              ; preds = %258
  store i32 29, ptr %4, align 4
  br label %308

263:                                              ; preds = %258
  %264 = load i32, ptr %14, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %265
  %267 = getelementptr inbounds %struct.Trie, ptr %266, i32 0, i32 1
  %268 = load i32, ptr %15, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [40001 x i8], ptr @str, i64 0, i64 %269
  %271 = load i8, ptr %270, align 1, !tbaa !11
  %272 = sext i8 %271 to i64
  %273 = getelementptr inbounds [26 x i32], ptr %267, i64 0, i64 %272
  %274 = load i32, ptr %273, align 4, !tbaa !5
  %275 = icmp ne i32 %274, 0
  br i1 %275, label %277, label %276

276:                                              ; preds = %263
  store i32 29, ptr %4, align 4
  br label %308

277:                                              ; preds = %263
  %278 = load i32, ptr %14, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %279
  %281 = getelementptr inbounds %struct.Trie, ptr %280, i32 0, i32 1
  %282 = load i32, ptr %15, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [40001 x i8], ptr @str, i64 0, i64 %283
  %285 = load i8, ptr %284, align 1, !tbaa !11
  %286 = sext i8 %285 to i64
  %287 = getelementptr inbounds [26 x i32], ptr %281, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  store i32 %288, ptr %14, align 4, !tbaa !5
  %289 = load i32, ptr %14, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %290
  %292 = getelementptr inbounds %struct.Trie, ptr %291, i32 0, i32 2
  %293 = load i8, ptr %292, align 4, !tbaa !13, !range !25, !noundef !26
  %294 = trunc i8 %293 to i1
  br i1 %294, label %295, label %304

295:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  %296 = load i32, ptr %15, align 4, !tbaa !5
  %297 = load i32, ptr %13, align 4, !tbaa !5
  %298 = sub nsw i32 %296, %297
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %299
  %301 = load i32, ptr %13, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  call void @_ZNSt6bitsetILm40000EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<40000>::reference") align 8 %16, ptr noundef nonnull align 8 dereferenceable(5000) %300, i64 noundef %302)
  %303 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm40000EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %16, i1 noundef zeroext true) #6
  call void @_ZNSt6bitsetILm40000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  br label %304

304:                                              ; preds = %295, %277
  br label %305

305:                                              ; preds = %304
  %306 = load i32, ptr %15, align 4, !tbaa !5
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %15, align 4, !tbaa !5
  br label %258, !llvm.loop !27

308:                                              ; preds = %276, %262
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %309

309:                                              ; preds = %308
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %310

310:                                              ; preds = %309
  %311 = load i32, ptr %13, align 4, !tbaa !5
  %312 = add nsw i32 %311, 1
  store i32 %312, ptr %13, align 4, !tbaa !5
  br label %251, !llvm.loop !28

313:                                              ; preds = %255
  %314 = call noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE4flipEv(ptr noundef nonnull align 8 dereferenceable(5000) @f) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %315

315:                                              ; preds = %340, %313
  %316 = load i32, ptr %17, align 4, !tbaa !5
  %317 = load i32, ptr @n, align 4, !tbaa !5
  %318 = icmp slt i32 %316, %317
  br i1 %318, label %320, label %319

319:                                              ; preds = %315
  store i32 32, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %343

320:                                              ; preds = %315
  call void @llvm.lifetime.start.p0(i64 5000, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 5000, ptr %19) #6
  %321 = load i32, ptr %17, align 4, !tbaa !5
  %322 = sub nsw i32 %321, 1
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %323
  call void @llvm.lifetime.start.p0(i64 5000, ptr %20) #6
  %325 = load i32, ptr %17, align 4, !tbaa !5
  %326 = sub nsw i32 %325, 1
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %327
  call void @_ZNKSt6bitsetILm40000EErsEm(ptr dead_on_unwind writable sret(%"class.std::bitset") align 8 %20, ptr noundef nonnull align 8 dereferenceable(5000) %328, i64 noundef 1) #6
  call void @_ZStanILm40000EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind writable sret(%"class.std::bitset") align 8 %19, ptr noundef nonnull align 8 dereferenceable(5000) %324, ptr noundef nonnull align 8 dereferenceable(5000) %20) #6
  %329 = load i32, ptr %17, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %330
  call void @_ZStorILm40000EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind writable sret(%"class.std::bitset") align 8 %18, ptr noundef nonnull align 8 dereferenceable(5000) %19, ptr noundef nonnull align 8 dereferenceable(5000) %331) #6
  %332 = load i32, ptr %17, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %333
  %335 = call noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(5000) %334, ptr noundef nonnull align 8 dereferenceable(5000) %18) #6
  call void @llvm.lifetime.end.p0(i64 5000, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 5000, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 5000, ptr %18) #6
  %336 = load i32, ptr %17, align 4, !tbaa !5
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %337
  %339 = call noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE4flipEv(ptr noundef nonnull align 8 dereferenceable(5000) %338) #6
  br label %340

340:                                              ; preds = %320
  %341 = load i32, ptr %17, align 4, !tbaa !5
  %342 = add nsw i32 %341, 1
  store i32 %342, ptr %17, align 4, !tbaa !5
  br label %315, !llvm.loop !29

343:                                              ; preds = %319
  br label %344

344:                                              ; preds = %361, %343
  %345 = load i32, ptr @q, align 4, !tbaa !5
  %346 = add nsw i32 %345, -1
  store i32 %346, ptr @q, align 4, !tbaa !5
  %347 = icmp ne i32 %345, 0
  br i1 %347, label %348, label %366

348:                                              ; preds = %344
  %349 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @L, ptr noundef @R)
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  %350 = load i32, ptr @R, align 4, !tbaa !5
  %351 = load i32, ptr @L, align 4, !tbaa !5
  %352 = sub nsw i32 %350, %351
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %353
  %355 = load i32, ptr @L, align 4, !tbaa !5
  %356 = sub nsw i32 %355, 1
  %357 = sext i32 %356 to i64
  call void @_ZNSt6bitsetILm40000EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<40000>::reference") align 8 %21, ptr noundef nonnull align 8 dereferenceable(5000) %354, i64 noundef %357)
  %358 = call noundef zeroext i1 @_ZNKSt6bitsetILm40000EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %21) #6
  %359 = zext i1 %358 to i32
  %360 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %359)
          to label %361 unwind label %362

361:                                              ; preds = %348
  call void @_ZNSt6bitsetILm40000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br label %344, !llvm.loop !30

362:                                              ; preds = %348
  %363 = landingpad { ptr, i32 }
          cleanup
  %364 = extractvalue { ptr, i32 } %363, 0
  store ptr %364, ptr %22, align 8
  %365 = extractvalue { ptr, i32 } %363, 1
  store i32 %365, ptr %23, align 4
  call void @_ZNSt6bitsetILm40000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br label %368

366:                                              ; preds = %344
  br label %25, !llvm.loop !31

367:                                              ; preds = %25
  ret i32 0

368:                                              ; preds = %362
  %369 = load ptr, ptr %22, align 8
  %370 = load i32, ptr %23, align 4
  %371 = insertvalue { ptr, i32 } poison, ptr %369, 0
  %372 = insertvalue { ptr, i32 } %371, i32 %370, 1
  resume { ptr, i32 } %372
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE5resetEv(ptr noundef nonnull align 8 dereferenceable(5000)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm40000EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<40000>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(5000), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm40000EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm40000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE4flipEv(ptr noundef nonnull align 8 dereferenceable(5000)) #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(5000), ptr noundef nonnull align 8 dereferenceable(5000)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm40000EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = !{!14, !15, i64 108}
!14 = !{!"_ZTS4Trie", !6, i64 0, !7, i64 4, !15, i64 108}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = !{!19, !19, i64 0}
!19 = !{!"any pointer", !7, i64 0}
!20 = !{!14, !6, i64 0}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !10}
!31 = distinct !{!31, !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"

%struct.Trie = type { i32, [26 x i32], i8 }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [625 x i64] }
%"class.std::bitset<40000>::reference" = type { ptr, i64 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local local_unnamed_addr global [10001 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@e = external dso_local local_unnamed_addr global [10001 x %struct.Trie], align 16
@str = external dso_local global [40001 x i8], align 16
@tmp = external dso_local global [10002 x i8], align 16
@f = external dso_local global [40000 x %"class.std::bitset"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::bitset<40000>::reference", align 8
  %2 = alloca %"class.std::bitset", align 8
  %3 = alloca %"class.std::bitset", align 8
  %4 = alloca %"class.std::bitset", align 8
  %5 = alloca %"class.std::bitset<40000>::reference", align 8
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %7 = load i32, ptr @t, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr @t, align 4, !tbaa !5
  %.not126 = icmp eq i32 %7, 0
  br i1 %.not126, label %._crit_edge129, label %.lr.ph128

.loopexit81:                                      ; preds = %.lr.ph125, %.preheader80
  %9 = load i32, ptr @t, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %._crit_edge129, label %.lr.ph128, !llvm.loop !9

.lr.ph128:                                        ; preds = %0, %.loopexit81
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @q, ptr noundef nonnull @str)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph128
  store i32 1, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(112) @e, i8 0, i64 112, i1 false)
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph94, label %._crit_edge95.thread

._crit_edge95.thread:                             ; preds = %._crit_edge
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  br label %46

.lr.ph:                                           ; preds = %.lr.ph128, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph128 ]
  %16 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %indvars.iv
  %17 = call noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE5resetEv(ptr noundef nonnull align 8 dereferenceable(5000) %16) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge95:                                    ; preds = %._crit_edge91
  %.pre156 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 4), align 4, !tbaa !5
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  %.not77 = icmp eq i32 %.pre156, 0
  br i1 %.not77, label %46, label %45

.lr.ph94:                                         ; preds = %._crit_edge, %._crit_edge91
  %.06392 = phi i32 [ %25, %._crit_edge91 ], [ 0, %._crit_edge ]
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @tmp)
  %22 = load i8, ptr @tmp, align 16, !tbaa !12
  %.not7886 = icmp eq i8 %22, 0
  br i1 %.not7886, label %._crit_edge91, label %.lr.ph90.preheader

.lr.ph90.preheader:                               ; preds = %.lr.ph94
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br label %.lr.ph90

._crit_edge91:                                    ; preds = %40, %.lr.ph94
  %.066.lcssa = phi i32 [ 0, %.lr.ph94 ], [ %41, %40 ]
  %23 = sext i32 %.066.lcssa to i64
  %24 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %23, i32 2
  store i8 1, ptr %24, align 4, !tbaa !13
  %25 = add nuw nsw i32 %.06392, 1
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.lr.ph94, label %._crit_edge95, !llvm.loop !16

.lr.ph90:                                         ; preds = %.lr.ph90.preheader, %40
  %indvars.iv132 = phi i64 [ 0, %.lr.ph90.preheader ], [ %indvars.iv.next133, %40 ]
  %28 = phi i8 [ %22, %.lr.ph90.preheader ], [ %44, %40 ]
  %29 = phi ptr [ @tmp, %.lr.ph90.preheader ], [ %43, %40 ]
  %.06687 = phi i32 [ 0, %.lr.ph90.preheader ], [ %41, %40 ]
  %30 = phi i32 [ %tot.promoted, %.lr.ph90.preheader ], [ %42, %40 ]
  %31 = add i8 %28, -97
  store i8 %31, ptr %29, align 1, !tbaa !12
  %32 = sext i32 %.06687 to i64
  %33 = sext i8 %31 to i64
  %34 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %32, i32 1, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %.not79 = icmp eq i32 %35, 0
  br i1 %.not79, label %36, label %40

36:                                               ; preds = %.lr.ph90
  store i32 %30, ptr %34, align 4, !tbaa !5
  %37 = add nsw i32 %30, 1
  store i32 %37, ptr @tot, align 4, !tbaa !5
  %38 = sext i32 %30 to i64
  %39 = getelementptr inbounds %struct.Trie, ptr @e, i64 %38
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(112) %39, i8 0, i64 112, i1 false)
  %.pre = load i32, ptr %34, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %36, %.lr.ph90
  %41 = phi i32 [ %.pre, %36 ], [ %35, %.lr.ph90 ]
  %42 = phi i32 [ %37, %36 ], [ %30, %.lr.ph90 ]
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %43 = getelementptr inbounds [10002 x i8], ptr @tmp, i64 0, i64 %indvars.iv.next133
  %44 = load i8, ptr %43, align 1, !tbaa !12
  %.not78 = icmp eq i8 %44, 0
  br i1 %.not78, label %._crit_edge91, label %.lr.ph90, !llvm.loop !17

45:                                               ; preds = %._crit_edge95
  store i32 1, ptr @R, align 4, !tbaa !5
  store i32 %.pre156, ptr @que, align 16, !tbaa !5
  br label %46

46:                                               ; preds = %._crit_edge95.thread, %._crit_edge95, %45
  %47 = phi i32 [ 0, %._crit_edge95 ], [ 1, %45 ], [ 0, %._crit_edge95.thread ]
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 8), align 8, !tbaa !5
  %.not77.1 = icmp eq i32 %48, 0
  br i1 %.not77.1, label %53, label %49

49:                                               ; preds = %46
  %50 = add nuw nsw i32 %47, 1
  store i32 %50, ptr @R, align 4, !tbaa !5
  %51 = zext nneg i32 %47 to i64
  %52 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %51
  store i32 %48, ptr %52, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %49, %46
  %54 = phi i32 [ %47, %46 ], [ %50, %49 ]
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 12), align 4, !tbaa !5
  %.not77.2 = icmp eq i32 %55, 0
  br i1 %.not77.2, label %60, label %56

56:                                               ; preds = %53
  %57 = add nuw nsw i32 %54, 1
  store i32 %57, ptr @R, align 4, !tbaa !5
  %58 = zext nneg i32 %54 to i64
  %59 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %58
  store i32 %55, ptr %59, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %56, %53
  %61 = phi i32 [ %54, %53 ], [ %57, %56 ]
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 16), align 16, !tbaa !5
  %.not77.3 = icmp eq i32 %62, 0
  br i1 %.not77.3, label %67, label %63

63:                                               ; preds = %60
  %64 = add nuw nsw i32 %61, 1
  store i32 %64, ptr @R, align 4, !tbaa !5
  %65 = zext nneg i32 %61 to i64
  %66 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %65
  store i32 %62, ptr %66, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %63, %60
  %68 = phi i32 [ %61, %60 ], [ %64, %63 ]
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 20), align 4, !tbaa !5
  %.not77.4 = icmp eq i32 %69, 0
  br i1 %.not77.4, label %74, label %70

70:                                               ; preds = %67
  %71 = add nuw nsw i32 %68, 1
  store i32 %71, ptr @R, align 4, !tbaa !5
  %72 = zext nneg i32 %68 to i64
  %73 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %72
  store i32 %69, ptr %73, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %70, %67
  %75 = phi i32 [ %68, %67 ], [ %71, %70 ]
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 24), align 8, !tbaa !5
  %.not77.5 = icmp eq i32 %76, 0
  br i1 %.not77.5, label %81, label %77

77:                                               ; preds = %74
  %78 = add nuw nsw i32 %75, 1
  store i32 %78, ptr @R, align 4, !tbaa !5
  %79 = zext nneg i32 %75 to i64
  %80 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %79
  store i32 %76, ptr %80, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %77, %74
  %82 = phi i32 [ %75, %74 ], [ %78, %77 ]
  %83 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 28), align 4, !tbaa !5
  %.not77.6 = icmp eq i32 %83, 0
  br i1 %.not77.6, label %88, label %84

84:                                               ; preds = %81
  %85 = add nuw nsw i32 %82, 1
  store i32 %85, ptr @R, align 4, !tbaa !5
  %86 = zext nneg i32 %82 to i64
  %87 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %86
  store i32 %83, ptr %87, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %84, %81
  %89 = phi i32 [ %82, %81 ], [ %85, %84 ]
  %90 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 32), align 16, !tbaa !5
  %.not77.7 = icmp eq i32 %90, 0
  br i1 %.not77.7, label %95, label %91

91:                                               ; preds = %88
  %92 = add nuw nsw i32 %89, 1
  store i32 %92, ptr @R, align 4, !tbaa !5
  %93 = zext nneg i32 %89 to i64
  %94 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %93
  store i32 %90, ptr %94, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %91, %88
  %96 = phi i32 [ %89, %88 ], [ %92, %91 ]
  %97 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 36), align 4, !tbaa !5
  %.not77.8 = icmp eq i32 %97, 0
  br i1 %.not77.8, label %102, label %98

98:                                               ; preds = %95
  %99 = add nuw nsw i32 %96, 1
  store i32 %99, ptr @R, align 4, !tbaa !5
  %100 = zext nneg i32 %96 to i64
  %101 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %100
  store i32 %97, ptr %101, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %98, %95
  %103 = phi i32 [ %96, %95 ], [ %99, %98 ]
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 40), align 8, !tbaa !5
  %.not77.9 = icmp eq i32 %104, 0
  br i1 %.not77.9, label %109, label %105

105:                                              ; preds = %102
  %106 = add nuw nsw i32 %103, 1
  store i32 %106, ptr @R, align 4, !tbaa !5
  %107 = zext nneg i32 %103 to i64
  %108 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %107
  store i32 %104, ptr %108, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %105, %102
  %110 = phi i32 [ %103, %102 ], [ %106, %105 ]
  %111 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 44), align 4, !tbaa !5
  %.not77.10 = icmp eq i32 %111, 0
  br i1 %.not77.10, label %116, label %112

112:                                              ; preds = %109
  %113 = add nuw nsw i32 %110, 1
  store i32 %113, ptr @R, align 4, !tbaa !5
  %114 = zext nneg i32 %110 to i64
  %115 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %114
  store i32 %111, ptr %115, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %112, %109
  %117 = phi i32 [ %110, %109 ], [ %113, %112 ]
  %118 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 48), align 16, !tbaa !5
  %.not77.11 = icmp eq i32 %118, 0
  br i1 %.not77.11, label %123, label %119

119:                                              ; preds = %116
  %120 = add nuw nsw i32 %117, 1
  store i32 %120, ptr @R, align 4, !tbaa !5
  %121 = zext nneg i32 %117 to i64
  %122 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %121
  store i32 %118, ptr %122, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %119, %116
  %124 = phi i32 [ %117, %116 ], [ %120, %119 ]
  %125 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 52), align 4, !tbaa !5
  %.not77.12 = icmp eq i32 %125, 0
  br i1 %.not77.12, label %130, label %126

126:                                              ; preds = %123
  %127 = add nuw nsw i32 %124, 1
  store i32 %127, ptr @R, align 4, !tbaa !5
  %128 = zext nneg i32 %124 to i64
  %129 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %128
  store i32 %125, ptr %129, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %126, %123
  %131 = phi i32 [ %124, %123 ], [ %127, %126 ]
  %132 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 56), align 8, !tbaa !5
  %.not77.13 = icmp eq i32 %132, 0
  br i1 %.not77.13, label %137, label %133

133:                                              ; preds = %130
  %134 = add nuw nsw i32 %131, 1
  store i32 %134, ptr @R, align 4, !tbaa !5
  %135 = zext nneg i32 %131 to i64
  %136 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %135
  store i32 %132, ptr %136, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %133, %130
  %138 = phi i32 [ %131, %130 ], [ %134, %133 ]
  %139 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 60), align 4, !tbaa !5
  %.not77.14 = icmp eq i32 %139, 0
  br i1 %.not77.14, label %144, label %140

140:                                              ; preds = %137
  %141 = add nuw nsw i32 %138, 1
  store i32 %141, ptr @R, align 4, !tbaa !5
  %142 = zext nneg i32 %138 to i64
  %143 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %142
  store i32 %139, ptr %143, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %140, %137
  %145 = phi i32 [ %138, %137 ], [ %141, %140 ]
  %146 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 64), align 16, !tbaa !5
  %.not77.15 = icmp eq i32 %146, 0
  br i1 %.not77.15, label %151, label %147

147:                                              ; preds = %144
  %148 = add nuw nsw i32 %145, 1
  store i32 %148, ptr @R, align 4, !tbaa !5
  %149 = zext nneg i32 %145 to i64
  %150 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %149
  store i32 %146, ptr %150, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %147, %144
  %152 = phi i32 [ %145, %144 ], [ %148, %147 ]
  %153 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 68), align 4, !tbaa !5
  %.not77.16 = icmp eq i32 %153, 0
  br i1 %.not77.16, label %158, label %154

154:                                              ; preds = %151
  %155 = add nuw nsw i32 %152, 1
  store i32 %155, ptr @R, align 4, !tbaa !5
  %156 = zext nneg i32 %152 to i64
  %157 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %156
  store i32 %153, ptr %157, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %154, %151
  %159 = phi i32 [ %152, %151 ], [ %155, %154 ]
  %160 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 72), align 8, !tbaa !5
  %.not77.17 = icmp eq i32 %160, 0
  br i1 %.not77.17, label %165, label %161

161:                                              ; preds = %158
  %162 = add nuw nsw i32 %159, 1
  store i32 %162, ptr @R, align 4, !tbaa !5
  %163 = zext nneg i32 %159 to i64
  %164 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %163
  store i32 %160, ptr %164, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %161, %158
  %166 = phi i32 [ %159, %158 ], [ %162, %161 ]
  %167 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 76), align 4, !tbaa !5
  %.not77.18 = icmp eq i32 %167, 0
  br i1 %.not77.18, label %172, label %168

168:                                              ; preds = %165
  %169 = add nuw nsw i32 %166, 1
  store i32 %169, ptr @R, align 4, !tbaa !5
  %170 = zext nneg i32 %166 to i64
  %171 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %170
  store i32 %167, ptr %171, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %168, %165
  %173 = phi i32 [ %166, %165 ], [ %169, %168 ]
  %174 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 80), align 16, !tbaa !5
  %.not77.19 = icmp eq i32 %174, 0
  br i1 %.not77.19, label %179, label %175

175:                                              ; preds = %172
  %176 = add nuw nsw i32 %173, 1
  store i32 %176, ptr @R, align 4, !tbaa !5
  %177 = zext nneg i32 %173 to i64
  %178 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %177
  store i32 %174, ptr %178, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %175, %172
  %180 = phi i32 [ %173, %172 ], [ %176, %175 ]
  %181 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 84), align 4, !tbaa !5
  %.not77.20 = icmp eq i32 %181, 0
  br i1 %.not77.20, label %186, label %182

182:                                              ; preds = %179
  %183 = add nuw nsw i32 %180, 1
  store i32 %183, ptr @R, align 4, !tbaa !5
  %184 = zext nneg i32 %180 to i64
  %185 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %184
  store i32 %181, ptr %185, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %182, %179
  %187 = phi i32 [ %180, %179 ], [ %183, %182 ]
  %188 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 88), align 8, !tbaa !5
  %.not77.21 = icmp eq i32 %188, 0
  br i1 %.not77.21, label %193, label %189

189:                                              ; preds = %186
  %190 = add nuw nsw i32 %187, 1
  store i32 %190, ptr @R, align 4, !tbaa !5
  %191 = zext nneg i32 %187 to i64
  %192 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %191
  store i32 %188, ptr %192, align 4, !tbaa !5
  br label %193

193:                                              ; preds = %189, %186
  %194 = phi i32 [ %187, %186 ], [ %190, %189 ]
  %195 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 92), align 4, !tbaa !5
  %.not77.22 = icmp eq i32 %195, 0
  br i1 %.not77.22, label %200, label %196

196:                                              ; preds = %193
  %197 = add nuw nsw i32 %194, 1
  store i32 %197, ptr @R, align 4, !tbaa !5
  %198 = zext nneg i32 %194 to i64
  %199 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %198
  store i32 %195, ptr %199, align 4, !tbaa !5
  br label %200

200:                                              ; preds = %196, %193
  %201 = phi i32 [ %194, %193 ], [ %197, %196 ]
  %202 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 96), align 16, !tbaa !5
  %.not77.23 = icmp eq i32 %202, 0
  br i1 %.not77.23, label %207, label %203

203:                                              ; preds = %200
  %204 = add nuw nsw i32 %201, 1
  store i32 %204, ptr @R, align 4, !tbaa !5
  %205 = zext nneg i32 %201 to i64
  %206 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %205
  store i32 %202, ptr %206, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %203, %200
  %208 = phi i32 [ %201, %200 ], [ %204, %203 ]
  %209 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 100), align 4, !tbaa !5
  %.not77.24 = icmp eq i32 %209, 0
  br i1 %.not77.24, label %214, label %210

210:                                              ; preds = %207
  %211 = add nuw nsw i32 %208, 1
  store i32 %211, ptr @R, align 4, !tbaa !5
  %212 = zext nneg i32 %208 to i64
  %213 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %212
  store i32 %209, ptr %213, align 4, !tbaa !5
  br label %214

214:                                              ; preds = %210, %207
  %215 = phi i32 [ %208, %207 ], [ %211, %210 ]
  %216 = load i32, ptr getelementptr inbounds (i8, ptr @e, i64 104), align 8, !tbaa !5
  %.not77.25 = icmp eq i32 %216, 0
  br i1 %.not77.25, label %.preheader84, label %.preheader84.thread

.preheader84.thread:                              ; preds = %214
  %217 = add nuw nsw i32 %215, 1
  store i32 %217, ptr @R, align 4, !tbaa !5
  %218 = zext nneg i32 %215 to i64
  %219 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %218
  store i32 %216, ptr %219, align 4, !tbaa !5
  br label %.lr.ph111.preheader

.preheader84:                                     ; preds = %214
  %.not163 = icmp eq i32 %215, 0
  br i1 %.not163, label %.preheader83, label %.lr.ph111.preheader

.lr.ph111.preheader:                              ; preds = %.preheader84.thread, %.preheader84
  %R.promoted104109110.ph = phi i32 [ %215, %.preheader84 ], [ %217, %.preheader84.thread ]
  br label %.lr.ph111

.loopexit:                                        ; preds = %259
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %220 = sext i32 %R.promoted104107 to i64
  %221 = icmp slt i64 %indvars.iv.next141, %220
  br i1 %221, label %.lr.ph111, label %..preheader83_crit_edge, !llvm.loop !18

..preheader83_crit_edge:                          ; preds = %.loopexit
  %222 = trunc nsw i64 %indvars.iv.next141 to i32
  store i32 %222, ptr @L, align 4, !tbaa !5
  br label %.preheader83

.preheader83:                                     ; preds = %..preheader83_crit_edge, %.preheader84
  %223 = load i32, ptr @n, align 4, !tbaa !5
  %224 = icmp sgt i32 %223, 0
  br i1 %224, label %iter.check, label %._crit_edge120

iter.check:                                       ; preds = %.preheader83
  %wide.trip.count = zext nneg i32 %223 to i64
  %min.iters.check = icmp ult i32 %223, 8
  br i1 %min.iters.check, label %.lr.ph113.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check164 = icmp ult i32 %223, 32
  br i1 %min.iters.check164, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %wide.trip.count, 2147483616
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %225 = getelementptr inbounds [40001 x i8], ptr @str, i64 0, i64 %index
  %226 = getelementptr inbounds i8, ptr %225, i64 16
  %wide.load = load <16 x i8>, ptr %225, align 16, !tbaa !12
  %wide.load165 = load <16 x i8>, ptr %226, align 16, !tbaa !12
  %227 = add <16 x i8> %wide.load, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97>
  %228 = add <16 x i8> %wide.load165, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97>
  store <16 x i8> %227, ptr %225, align 16, !tbaa !12
  store <16 x i8> %228, ptr %226, align 16, !tbaa !12
  %index.next = add nuw i64 %index, 32
  %229 = icmp eq i64 %index.next, %n.vec
  br i1 %229, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader82, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %wide.trip.count, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph113.preheader, label %vec.epilog.ph

.lr.ph113.preheader:                              ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv143.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec167, %vec.epilog.middle.block ]
  br label %.lr.ph113

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec167 = and i64 %wide.trip.count, 2147483640
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index168 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next170, %vec.epilog.vector.body ]
  %230 = getelementptr inbounds [40001 x i8], ptr @str, i64 0, i64 %index168
  %wide.load169 = load <8 x i8>, ptr %230, align 8, !tbaa !12
  %231 = add <8 x i8> %wide.load169, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97>
  store <8 x i8> %231, ptr %230, align 8, !tbaa !12
  %index.next170 = add nuw i64 %index168, 8
  %232 = icmp eq i64 %index.next170, %n.vec167
  br i1 %232, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !22

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n171 = icmp eq i64 %n.vec167, %wide.trip.count
  br i1 %cmp.n171, label %.preheader82, label %.lr.ph113.preheader

.lr.ph111:                                        ; preds = %.lr.ph111.preheader, %.loopexit
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %.loopexit ], [ 0, %.lr.ph111.preheader ]
  %R.promoted104109110 = phi i32 [ %R.promoted104107, %.loopexit ], [ %R.promoted104109110.ph, %.lr.ph111.preheader ]
  %233 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %indvars.iv140
  br label %234

234:                                              ; preds = %.lr.ph111, %259
  %indvars.iv137 = phi i64 [ 0, %.lr.ph111 ], [ %indvars.iv.next138, %259 ]
  %R.promoted104108 = phi i32 [ %R.promoted104109110, %.lr.ph111 ], [ %R.promoted104107, %259 ]
  %235 = phi i32 [ %R.promoted104109110, %.lr.ph111 ], [ %260, %259 ]
  %236 = load i32, ptr %233, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %237
  %239 = getelementptr inbounds i8, ptr %238, i64 4
  %240 = getelementptr inbounds [26 x i32], ptr %239, i64 0, i64 %indvars.iv137
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %.not74 = icmp eq i32 %241, 0
  br i1 %.not74, label %259, label %242

242:                                              ; preds = %234
  %243 = load i32, ptr %238, align 16, !tbaa !23
  %244 = add nsw i32 %235, 1
  store i32 %244, ptr @R, align 4, !tbaa !5
  %245 = sext i32 %235 to i64
  %246 = getelementptr inbounds [10001 x i32], ptr @que, i64 0, i64 %245
  store i32 %241, ptr %246, align 4, !tbaa !5
  %.not7597 = icmp eq i32 %243, 0
  br i1 %.not7597, label %.critedge, label %.lr.ph100

.lr.ph100:                                        ; preds = %242, %252
  %.06098 = phi i32 [ %253, %252 ], [ %243, %242 ]
  %247 = sext i32 %.06098 to i64
  %248 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %247
  %249 = getelementptr inbounds i8, ptr %248, i64 4
  %250 = getelementptr inbounds [26 x i32], ptr %249, i64 0, i64 %indvars.iv137
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %.not76 = icmp eq i32 %251, 0
  br i1 %.not76, label %252, label %.critedge

252:                                              ; preds = %.lr.ph100
  %253 = load i32, ptr %248, align 16, !tbaa !23
  %.not75 = icmp eq i32 %253, 0
  br i1 %.not75, label %.critedge, label %.lr.ph100, !llvm.loop !24

.critedge:                                        ; preds = %.lr.ph100, %252, %242
  %.060.lcssa = phi i32 [ 0, %242 ], [ 0, %252 ], [ %.06098, %.lr.ph100 ]
  %254 = sext i32 %.060.lcssa to i64
  %255 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %254, i32 1, i64 %indvars.iv137
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = sext i32 %241 to i64
  %258 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %257
  store i32 %256, ptr %258, align 16, !tbaa !23
  br label %259

259:                                              ; preds = %234, %.critedge
  %R.promoted104107 = phi i32 [ %R.promoted104108, %234 ], [ %244, %.critedge ]
  %260 = phi i32 [ %235, %234 ], [ %244, %.critedge ]
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next138, 26
  br i1 %exitcond.not, label %.loopexit, label %234, !llvm.loop !25

.preheader82:                                     ; preds = %.lr.ph113, %vec.epilog.middle.block, %middle.block
  br i1 %224, label %.preheader, label %._crit_edge120

.lr.ph113:                                        ; preds = %.lr.ph113.preheader, %.lr.ph113
  %indvars.iv143 = phi i64 [ %indvars.iv.next144, %.lr.ph113 ], [ %indvars.iv143.ph, %.lr.ph113.preheader ]
  %261 = getelementptr inbounds [40001 x i8], ptr @str, i64 0, i64 %indvars.iv143
  %262 = load i8, ptr %261, align 1, !tbaa !12
  %263 = add i8 %262, -97
  store i8 %263, ptr %261, align 1, !tbaa !12
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %exitcond146.not = icmp eq i64 %indvars.iv.next144, %wide.trip.count
  br i1 %exitcond146.not, label %.preheader82, label %.lr.ph113, !llvm.loop !26

.preheader:                                       ; preds = %.preheader82, %._crit_edge117
  %264 = phi i32 [ %293, %._crit_edge117 ], [ %223, %.preheader82 ]
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %._crit_edge117 ], [ 0, %.preheader82 ]
  %265 = sext i32 %264 to i64
  %266 = icmp slt i64 %indvars.iv147, %265
  br i1 %266, label %.lr.ph116, label %._crit_edge117

._crit_edge120:                                   ; preds = %._crit_edge117, %.preheader83, %.preheader82
  %267 = call noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE4flipEv(ptr noundef nonnull align 8 dereferenceable(5000) @f) #6
  %268 = load i32, ptr @n, align 4, !tbaa !5
  %269 = icmp sgt i32 %268, 1
  br i1 %269, label %.lr.ph123, label %.preheader80

.lr.ph116:                                        ; preds = %.preheader, %287
  %270 = phi i32 [ %288, %287 ], [ %264, %.preheader ]
  %271 = phi i32 [ %289, %287 ], [ %264, %.preheader ]
  %indvars.iv149 = phi i64 [ %indvars.iv.next150, %287 ], [ %indvars.iv147, %.preheader ]
  %.057114 = phi i32 [ %277, %287 ], [ 0, %.preheader ]
  %272 = sext i32 %.057114 to i64
  %273 = getelementptr inbounds [40001 x i8], ptr @str, i64 0, i64 %indvars.iv149
  %274 = load i8, ptr %273, align 1, !tbaa !12
  %275 = sext i8 %274 to i64
  %276 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %272, i32 1, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !5
  %.not73 = icmp eq i32 %277, 0
  br i1 %.not73, label %._crit_edge117.loopexit, label %278

278:                                              ; preds = %.lr.ph116
  %279 = sext i32 %277 to i64
  %280 = getelementptr inbounds [10001 x %struct.Trie], ptr @e, i64 0, i64 %279, i32 2
  %281 = load i8, ptr %280, align 4, !tbaa !13, !range !27, !noundef !28
  %282 = trunc nuw i8 %281 to i1
  br i1 %282, label %283, label %287

283:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #6
  %284 = sub nuw nsw i64 %indvars.iv149, %indvars.iv147
  %285 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %284
  call void @_ZNSt6bitsetILm40000EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<40000>::reference") align 8 %1, ptr noundef nonnull align 8 dereferenceable(5000) %285, i64 noundef %indvars.iv147)
  %286 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm40000EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext true) #6
  call void @_ZNSt6bitsetILm40000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #6
  %.pre158 = load i32, ptr @n, align 4, !tbaa !5
  br label %287

287:                                              ; preds = %278, %283
  %288 = phi i32 [ %270, %278 ], [ %.pre158, %283 ]
  %289 = phi i32 [ %271, %278 ], [ %.pre158, %283 ]
  %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
  %290 = sext i32 %289 to i64
  %291 = icmp slt i64 %indvars.iv.next150, %290
  br i1 %291, label %.lr.ph116, label %._crit_edge117.loopexit, !llvm.loop !29

._crit_edge117.loopexit:                          ; preds = %.lr.ph116, %287
  %292 = phi i32 [ %270, %.lr.ph116 ], [ %288, %287 ]
  %.pre159 = sext i32 %292 to i64
  br label %._crit_edge117

._crit_edge117:                                   ; preds = %._crit_edge117.loopexit, %.preheader
  %.pre-phi = phi i64 [ %.pre159, %._crit_edge117.loopexit ], [ %265, %.preheader ]
  %293 = phi i32 [ %292, %._crit_edge117.loopexit ], [ %264, %.preheader ]
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %294 = icmp slt i64 %indvars.iv.next148, %.pre-phi
  br i1 %294, label %.preheader, label %._crit_edge120, !llvm.loop !30

.preheader80:                                     ; preds = %.lr.ph123, %._crit_edge120
  %295 = load i32, ptr @q, align 4, !tbaa !5
  %296 = add nsw i32 %295, -1
  store i32 %296, ptr @q, align 4, !tbaa !5
  %.not72124 = icmp eq i32 %295, 0
  br i1 %.not72124, label %.loopexit81, label %.lr.ph125

.lr.ph123:                                        ; preds = %._crit_edge120, %.lr.ph123
  %indvars.iv153 = phi i64 [ %indvars.iv.next154, %.lr.ph123 ], [ 1, %._crit_edge120 ]
  call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %3) #6
  %297 = add nsw i64 %indvars.iv153, -1
  %298 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %297
  call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %4) #6
  call void @_ZNKSt6bitsetILm40000EErsEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset") align 8 %4, ptr noundef nonnull align 8 dereferenceable(5000) %298, i64 noundef 1) #6
  call void @_ZStanILm40000EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset") align 8 %3, ptr noundef nonnull align 8 dereferenceable(5000) %298, ptr noundef nonnull align 8 dereferenceable(5000) %4) #6
  %299 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %indvars.iv153
  call void @_ZStorILm40000EESt6bitsetIXT_EERKS1_S3_(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset") align 8 %2, ptr noundef nonnull align 8 dereferenceable(5000) %3, ptr noundef nonnull align 8 dereferenceable(5000) %299) #6
  %300 = call noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(5000) %299, ptr noundef nonnull align 8 dereferenceable(5000) %2) #6
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %2) #6
  %301 = call noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE4flipEv(ptr noundef nonnull align 8 dereferenceable(5000) %299) #6
  %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1
  %302 = load i32, ptr @n, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = icmp slt i64 %indvars.iv.next154, %303
  br i1 %304, label %.lr.ph123, label %.preheader80, !llvm.loop !31

.lr.ph125:                                        ; preds = %.preheader80, %.lr.ph125
  %305 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @L, ptr noundef nonnull @R)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  %306 = load i32, ptr @R, align 4, !tbaa !5
  %307 = load i32, ptr @L, align 4, !tbaa !5
  %308 = sub nsw i32 %306, %307
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [40000 x %"class.std::bitset"], ptr @f, i64 0, i64 %309
  %311 = add nsw i32 %307, -1
  %312 = sext i32 %311 to i64
  call void @_ZNSt6bitsetILm40000EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<40000>::reference") align 8 %5, ptr noundef nonnull align 8 dereferenceable(5000) %310, i64 noundef %312)
  %313 = call noundef zeroext i1 @_ZNKSt6bitsetILm40000EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  %314 = zext i1 %313 to i32
  %315 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %314)
  call void @_ZNSt6bitsetILm40000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  %316 = load i32, ptr @q, align 4, !tbaa !5
  %317 = add nsw i32 %316, -1
  store i32 %317, ptr @q, align 4, !tbaa !5
  %.not72 = icmp eq i32 %316, 0
  br i1 %.not72, label %.loopexit81, label %.lr.ph125, !llvm.loop !32

._crit_edge129:                                   ; preds = %.loopexit81, %0
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE5resetEv(ptr noundef nonnull align 8 dereferenceable(5000)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm40000EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<40000>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(5000), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm40000EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm40000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EE4flipEv(ptr noundef nonnull align 8 dereferenceable(5000)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(5000) ptr @_ZNSt6bitsetILm40000EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(5000), ptr noundef nonnull align 8 dereferenceable(5000)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm40000EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !15, i64 108}
!14 = !{!"_ZTS4Trie", !6, i64 0, !7, i64 4, !15, i64 108}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !10, !20, !21}
!23 = !{!14, !6, i64 0}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10, !21, !20}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !10}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}


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