; LLVM IR from ayush-tulsyan/ACM-ICPC-Handbook :: code/ahoCorasick.ll (Z5matchv)

; 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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@a = external dso_local global [100005 x i8], align 16
@b = external dso_local global [10005 x [105 x i8]], align 16
@nb = external dso_local global i32, align 4
@cnt = external dso_local global [10005 x i32], align 16
@lenb = external dso_local global [10005 x i32], align 16
@alen = external dso_local global i32, align 4
@g = external dso_local global [500005 x [26 x i32]], align 16
@ng = external dso_local global i32, align 4
@f = external dso_local global [500005 x i32], align 16
@marked = external dso_local global [500005 x i32], align 16
@output = external dso_local global [500005 x i32], align 16
@pre = external dso_local global [500005 x i32], align 16

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5matchv() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::queue", align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  store i32 0, ptr @ng, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  store i64 0, ptr %1, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  store i64 26, ptr %2, align 8, !tbaa !9
  br label %26

26:                                               ; preds = %34, %0
  %27 = load i64, ptr %1, align 8, !tbaa !9
  %28 = load i64, ptr %2, align 8, !tbaa !9
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  br label %37

31:                                               ; preds = %26
  %32 = load i64, ptr %1, align 8, !tbaa !9
  %33 = getelementptr inbounds [26 x i32], ptr @g, i64 0, i64 %32
  store i32 -1, ptr %33, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %31
  %35 = load i64, ptr %1, align 8, !tbaa !9
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %1, align 8, !tbaa !9
  br label %26, !llvm.loop !11

37:                                               ; preds = %30
  store i32 0, ptr @marked, align 16, !tbaa !5
  store i32 0, ptr @f, align 16, !tbaa !5
  store i32 -1, ptr @pre, align 16, !tbaa !5
  store i32 -1, ptr @output, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %38 = load i32, ptr @nb, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  store i64 %39, ptr %4, align 8, !tbaa !9
  br label %40

40:                                               ; preds = %142, %37
  %41 = load i64, ptr %3, align 8, !tbaa !9
  %42 = load i64, ptr %4, align 8, !tbaa !9
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %145

45:                                               ; preds = %40
  %46 = load i64, ptr %3, align 8, !tbaa !9
  %47 = getelementptr inbounds [10005 x i32], ptr @cnt, i64 0, i64 %46
  store i32 0, ptr %47, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %70, %45
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %50
  %52 = load i64, ptr %3, align 8, !tbaa !9
  %53 = getelementptr inbounds [10005 x [105 x i8]], ptr @b, i64 0, i64 %52
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [105 x i8], ptr %53, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !13
  %58 = sext i8 %57 to i64
  %59 = getelementptr inbounds [26 x i32], ptr %51, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp ne i32 %60, -1
  br i1 %61, label %62, label %68

62:                                               ; preds = %48
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = load i64, ptr %3, align 8, !tbaa !9
  %65 = getelementptr inbounds [10005 x i32], ptr @lenb, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp slt i32 %63, %66
  br label %68

68:                                               ; preds = %62, %48
  %69 = phi i1 [ false, %48 ], [ %67, %62 ]
  br i1 %69, label %70, label %85

70:                                               ; preds = %68
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %72
  %74 = load i64, ptr %3, align 8, !tbaa !9
  %75 = getelementptr inbounds [10005 x [105 x i8]], ptr @b, i64 0, i64 %74
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [105 x i8], ptr %75, i64 0, i64 %77
  %79 = load i8, ptr %78, align 1, !tbaa !13
  %80 = sext i8 %79 to i64
  %81 = getelementptr inbounds [26 x i32], ptr %73, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  store i32 %82, ptr %6, align 4, !tbaa !5
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %7, align 4, !tbaa !5
  br label %48, !llvm.loop !14

85:                                               ; preds = %68
  br label %86

86:                                               ; preds = %121, %85
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = load i64, ptr %3, align 8, !tbaa !9
  %89 = getelementptr inbounds [10005 x i32], ptr @lenb, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp slt i32 %87, %90
  br i1 %91, label %92, label %136

92:                                               ; preds = %86
  %93 = load i32, ptr @ng, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr @ng, align 4, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %96
  %98 = load i64, ptr %3, align 8, !tbaa !9
  %99 = getelementptr inbounds [10005 x [105 x i8]], ptr @b, i64 0, i64 %98
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [105 x i8], ptr %99, i64 0, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !13
  %104 = sext i8 %103 to i64
  %105 = getelementptr inbounds [26 x i32], ptr %97, i64 0, i64 %104
  store i32 %94, ptr %105, align 4, !tbaa !5
  %106 = load i32, ptr @ng, align 4, !tbaa !5
  store i32 %106, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 26, ptr %9, align 8, !tbaa !9
  br label %107

107:                                              ; preds = %118, %92
  %108 = load i64, ptr %8, align 8, !tbaa !9
  %109 = load i64, ptr %9, align 8, !tbaa !9
  %110 = icmp slt i64 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 12, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %121

112:                                              ; preds = %107
  %113 = load i32, ptr @ng, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %114
  %116 = load i64, ptr %8, align 8, !tbaa !9
  %117 = getelementptr inbounds [26 x i32], ptr %115, i64 0, i64 %116
  store i32 -1, ptr %117, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %112
  %119 = load i64, ptr %8, align 8, !tbaa !9
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %8, align 8, !tbaa !9
  br label %107, !llvm.loop !15

121:                                              ; preds = %111
  %122 = load i32, ptr @ng, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [500005 x i32], ptr @marked, i64 0, i64 %123
  store i32 0, ptr %124, align 4, !tbaa !5
  %125 = load i32, ptr @ng, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %126
  store i32 0, ptr %127, align 4, !tbaa !5
  %128 = load i32, ptr @ng, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [500005 x i32], ptr @pre, i64 0, i64 %129
  store i32 -1, ptr %130, align 4, !tbaa !5
  %131 = load i32, ptr @ng, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [500005 x i32], ptr @output, i64 0, i64 %132
  store i32 -1, ptr %133, align 4, !tbaa !5
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %7, align 4, !tbaa !5
  br label %86, !llvm.loop !16

136:                                              ; preds = %86
  %137 = load i64, ptr %3, align 8, !tbaa !9
  %138 = trunc i64 %137 to i32
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [500005 x i32], ptr @output, i64 0, i64 %140
  store i32 %138, ptr %141, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %142

142:                                              ; preds = %136
  %143 = load i64, ptr %3, align 8, !tbaa !9
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %3, align 8, !tbaa !9
  br label %40, !llvm.loop !17

145:                                              ; preds = %44
  call void @llvm.lifetime.start.p0(i64 80, ptr %10) #4
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 26, ptr %12, align 8, !tbaa !9
  br label %146

146:                                              ; preds = %165, %145
  %147 = load i64, ptr %11, align 8, !tbaa !9
  %148 = load i64, ptr %12, align 8, !tbaa !9
  %149 = icmp slt i64 %147, %148
  br i1 %149, label %151, label %150

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

151:                                              ; preds = %146
  %152 = load i64, ptr %11, align 8, !tbaa !9
  %153 = getelementptr inbounds [26 x i32], ptr @g, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = icmp ne i32 %154, -1
  br i1 %155, label %156, label %164

156:                                              ; preds = %151
  %157 = load i64, ptr %11, align 8, !tbaa !9
  %158 = getelementptr inbounds [26 x i32], ptr @g, i64 0, i64 %157
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 4 dereferenceable(4) %158)
          to label %159 unwind label %160

159:                                              ; preds = %156
  br label %164

160:                                              ; preds = %156
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %13, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %376

164:                                              ; preds = %159, %151
  br label %165

165:                                              ; preds = %164
  %166 = load i64, ptr %11, align 8, !tbaa !9
  %167 = add nsw i64 %166, 1
  store i64 %167, ptr %11, align 8, !tbaa !9
  br label %146, !llvm.loop !18

168:                                              ; preds = %150
  br label %169

169:                                              ; preds = %258, %168
  %170 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %171 unwind label %183

171:                                              ; preds = %169
  %172 = xor i1 %170, true
  br i1 %172, label %173, label %260

173:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %174 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %175 unwind label %187

175:                                              ; preds = %173
  %176 = load i32, ptr %174, align 4, !tbaa !5
  store i32 %176, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %177 unwind label %187

177:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store i64 0, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store i64 26, ptr %17, align 8, !tbaa !9
  br label %178

178:                                              ; preds = %255, %177
  %179 = load i64, ptr %16, align 8, !tbaa !9
  %180 = load i64, ptr %17, align 8, !tbaa !9
  %181 = icmp slt i64 %179, %180
  br i1 %181, label %191, label %182

182:                                              ; preds = %178
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %258

183:                                              ; preds = %169
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %13, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %14, align 4
  br label %376

187:                                              ; preds = %175, %173
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %13, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %14, align 4
  br label %259

191:                                              ; preds = %178
  %192 = load i32, ptr %15, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %193
  %195 = load i64, ptr %16, align 8, !tbaa !9
  %196 = getelementptr inbounds [26 x i32], ptr %194, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = icmp ne i32 %197, -1
  br i1 %198, label %199, label %254

199:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %200 = load i32, ptr %15, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %201
  %203 = load i64, ptr %16, align 8, !tbaa !9
  %204 = getelementptr inbounds [26 x i32], ptr %202, i64 0, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !5
  store i32 %205, ptr %18, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %206 unwind label %229

206:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %207 = load i32, ptr %15, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  store i32 %210, ptr %19, align 4, !tbaa !5
  br label %211

211:                                              ; preds = %224, %206
  %212 = load i32, ptr %19, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %213
  %215 = load i64, ptr %16, align 8, !tbaa !9
  %216 = getelementptr inbounds [26 x i32], ptr %214, i64 0, i64 %215
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = icmp eq i32 %217, -1
  br i1 %218, label %219, label %222

219:                                              ; preds = %211
  %220 = load i32, ptr %19, align 4, !tbaa !5
  %221 = icmp ne i32 %220, 0
  br label %222

222:                                              ; preds = %219, %211
  %223 = phi i1 [ false, %211 ], [ %221, %219 ]
  br i1 %223, label %224, label %233

224:                                              ; preds = %222
  %225 = load i32, ptr %19, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !5
  store i32 %228, ptr %19, align 4, !tbaa !5
  br label %211, !llvm.loop !19

229:                                              ; preds = %199
  %230 = landingpad { ptr, i32 }
          cleanup
  %231 = extractvalue { ptr, i32 } %230, 0
  store ptr %231, ptr %13, align 8
  %232 = extractvalue { ptr, i32 } %230, 1
  store i32 %232, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %259

233:                                              ; preds = %222
  %234 = load i32, ptr %19, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %235
  %237 = load i64, ptr %16, align 8, !tbaa !9
  %238 = getelementptr inbounds [26 x i32], ptr %236, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = icmp eq i32 %239, -1
  br i1 %240, label %241, label %242

241:                                              ; preds = %233
  br label %249

242:                                              ; preds = %233
  %243 = load i32, ptr %19, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %244
  %246 = load i64, ptr %16, align 8, !tbaa !9
  %247 = getelementptr inbounds [26 x i32], ptr %245, i64 0, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !5
  br label %249

249:                                              ; preds = %242, %241
  %250 = phi i32 [ 0, %241 ], [ %248, %242 ]
  %251 = load i32, ptr %18, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %252
  store i32 %250, ptr %253, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %254

254:                                              ; preds = %249, %191
  br label %255

255:                                              ; preds = %254
  %256 = load i64, ptr %16, align 8, !tbaa !9
  %257 = add nsw i64 %256, 1
  store i64 %257, ptr %16, align 8, !tbaa !9
  br label %178, !llvm.loop !20

258:                                              ; preds = %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %169, !llvm.loop !21

259:                                              ; preds = %229, %187
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %376

260:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store i64 0, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %261 = load i32, ptr @alen, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  store i64 %262, ptr %22, align 8, !tbaa !9
  br label %263

263:                                              ; preds = %328, %260
  %264 = load i64, ptr %21, align 8, !tbaa !9
  %265 = load i64, ptr %22, align 8, !tbaa !9
  %266 = icmp slt i64 %264, %265
  br i1 %266, label %268, label %267

267:                                              ; preds = %263
  store i32 25, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %331

268:                                              ; preds = %263
  br label %269

269:                                              ; preds = %288, %268
  %270 = load i32, ptr %20, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %271
  %273 = load i64, ptr %21, align 8, !tbaa !9
  %274 = getelementptr inbounds [100005 x i8], ptr @a, i64 0, i64 %273
  %275 = load i8, ptr %274, align 1, !tbaa !13
  %276 = sext i8 %275 to i64
  %277 = getelementptr inbounds [26 x i32], ptr %272, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = icmp eq i32 %278, -1
  br i1 %279, label %280, label %289

280:                                              ; preds = %269
  %281 = load i32, ptr %20, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %282
  %284 = load i32, ptr %283, align 4, !tbaa !5
  store i32 %284, ptr %20, align 4, !tbaa !5
  %285 = load i32, ptr %20, align 4, !tbaa !5
  %286 = icmp ne i32 %285, 0
  br i1 %286, label %288, label %287

287:                                              ; preds = %280
  br label %289

288:                                              ; preds = %280
  br label %269, !llvm.loop !22

289:                                              ; preds = %287, %269
  %290 = load i32, ptr %20, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %291
  %293 = load i64, ptr %21, align 8, !tbaa !9
  %294 = getelementptr inbounds [100005 x i8], ptr @a, i64 0, i64 %293
  %295 = load i8, ptr %294, align 1, !tbaa !13
  %296 = sext i8 %295 to i64
  %297 = getelementptr inbounds [26 x i32], ptr %292, i64 0, i64 %296
  %298 = load i32, ptr %297, align 4, !tbaa !5
  %299 = icmp eq i32 %298, -1
  br i1 %299, label %300, label %301

300:                                              ; preds = %289
  br label %311

301:                                              ; preds = %289
  %302 = load i32, ptr %20, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %303
  %305 = load i64, ptr %21, align 8, !tbaa !9
  %306 = getelementptr inbounds [100005 x i8], ptr @a, i64 0, i64 %305
  %307 = load i8, ptr %306, align 1, !tbaa !13
  %308 = sext i8 %307 to i64
  %309 = getelementptr inbounds [26 x i32], ptr %304, i64 0, i64 %308
  %310 = load i32, ptr %309, align 4, !tbaa !5
  br label %311

311:                                              ; preds = %301, %300
  %312 = phi i32 [ 0, %300 ], [ %310, %301 ]
  store i32 %312, ptr %20, align 4, !tbaa !5
  %313 = load i32, ptr %20, align 4, !tbaa !5
  %314 = icmp ne i32 %313, 0
  br i1 %314, label %315, label %327

315:                                              ; preds = %311
  %316 = load i32, ptr %20, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [500005 x i32], ptr @output, i64 0, i64 %317
  %319 = load i32, ptr %318, align 4, !tbaa !5
  %320 = icmp ne i32 %319, -1
  br i1 %320, label %321, label %327

321:                                              ; preds = %315
  %322 = load i32, ptr %20, align 4, !tbaa !5
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [500005 x i32], ptr @marked, i64 0, i64 %323
  %325 = load i32, ptr %324, align 4, !tbaa !5
  %326 = add nsw i32 %325, 1
  store i32 %326, ptr %324, align 4, !tbaa !5
  br label %327

327:                                              ; preds = %321, %315, %311
  br label %328

328:                                              ; preds = %327
  %329 = load i64, ptr %21, align 8, !tbaa !9
  %330 = add nsw i64 %329, 1
  store i64 %330, ptr %21, align 8, !tbaa !9
  br label %263, !llvm.loop !23

331:                                              ; preds = %267
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  store i64 0, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %332 = load i32, ptr @ng, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = add nsw i64 %333, 1
  store i64 %334, ptr %24, align 8, !tbaa !9
  br label %335

335:                                              ; preds = %372, %331
  %336 = load i64, ptr %23, align 8, !tbaa !9
  %337 = load i64, ptr %24, align 8, !tbaa !9
  %338 = icmp slt i64 %336, %337
  br i1 %338, label %340, label %339

339:                                              ; preds = %335
  store i32 30, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  br label %375

340:                                              ; preds = %335
  %341 = load i64, ptr %23, align 8, !tbaa !9
  %342 = icmp ne i64 %341, 0
  br i1 %342, label %343, label %371

343:                                              ; preds = %340
  %344 = load i64, ptr %23, align 8, !tbaa !9
  %345 = getelementptr inbounds [500005 x i32], ptr @marked, i64 0, i64 %344
  %346 = load i32, ptr %345, align 4, !tbaa !5
  %347 = icmp ne i32 %346, 0
  br i1 %347, label %348, label %371

348:                                              ; preds = %343
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %349 = load i64, ptr %23, align 8, !tbaa !9
  %350 = trunc i64 %349 to i32
  store i32 %350, ptr %25, align 4, !tbaa !5
  br label %351

351:                                              ; preds = %354, %348
  %352 = load i32, ptr %25, align 4, !tbaa !5
  %353 = icmp ne i32 %352, 0
  br i1 %353, label %354, label %370

354:                                              ; preds = %351
  %355 = load i64, ptr %23, align 8, !tbaa !9
  %356 = getelementptr inbounds [500005 x i32], ptr @marked, i64 0, i64 %355
  %357 = load i32, ptr %356, align 4, !tbaa !5
  %358 = load i32, ptr %25, align 4, !tbaa !5
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [500005 x i32], ptr @output, i64 0, i64 %359
  %361 = load i32, ptr %360, align 4, !tbaa !5
  %362 = sext i32 %361 to i64
  %363 = getelementptr inbounds [10005 x i32], ptr @cnt, i64 0, i64 %362
  %364 = load i32, ptr %363, align 4, !tbaa !5
  %365 = add nsw i32 %364, %357
  store i32 %365, ptr %363, align 4, !tbaa !5
  %366 = load i32, ptr %25, align 4, !tbaa !5
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %367
  %369 = load i32, ptr %368, align 4, !tbaa !5
  store i32 %369, ptr %25, align 4, !tbaa !5
  br label %351, !llvm.loop !24

370:                                              ; preds = %351
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  br label %371

371:                                              ; preds = %370, %343, %340
  br label %372

372:                                              ; preds = %371
  %373 = load i64, ptr %23, align 8, !tbaa !9
  %374 = add nsw i64 %373, 1
  store i64 %374, ptr %23, align 8, !tbaa !9
  br label %335, !llvm.loop !25

375:                                              ; preds = %339
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #4
  ret void

376:                                              ; preds = %259, %183, %160
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #4
  br label %377

377:                                              ; preds = %376
  %378 = load ptr, ptr %13, align 8
  %379 = load i32, ptr %14, align 4
  %380 = insertvalue { ptr, i32 } poison, ptr %378, 0
  %381 = insertvalue { ptr, i32 } %380, i32 %379, 1
  resume { ptr, i32 } %381
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


; 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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@a = external dso_local local_unnamed_addr global [100005 x i8], align 16
@b = external dso_local local_unnamed_addr global [10005 x [105 x i8]], align 16
@nb = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global [10005 x i32], align 16
@lenb = external dso_local local_unnamed_addr global [10005 x i32], align 16
@alen = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local global [500005 x [26 x i32]], align 16
@ng = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [500005 x i32], align 16
@marked = external dso_local local_unnamed_addr global [500005 x i32], align 16
@output = external dso_local local_unnamed_addr global [500005 x i32], align 16
@pre = external dso_local local_unnamed_addr global [500005 x i32], align 16

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5matchv() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca i32, align 4
  store i32 0, ptr @ng, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @g, i8 -1, i64 104, i1 false), !tbaa !5
  store i32 0, ptr @marked, align 16, !tbaa !5
  store i32 0, ptr @f, align 16, !tbaa !5
  store i32 -1, ptr @pre, align 16, !tbaa !5
  store i32 -1, ptr @output, align 16, !tbaa !5
  %3 = load i32, ptr @nb, align 4, !tbaa !5
  %4 = sext i32 %3 to i64
  %5 = icmp sgt i32 %3, 0
  br i1 %5, label %.lr.ph133.preheader, label %._crit_edge134

.lr.ph133.preheader:                              ; preds = %0
  %6 = shl nuw nsw i64 %4, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @cnt, i8 0, i64 %6, i1 false), !tbaa !5
  br label %.lr.ph133

._crit_edge134:                                   ; preds = %.critedge.thread, %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %7 = load i32, ptr @g, align 16, !tbaa !5
  %.not103 = icmp eq i32 %7, -1
  br i1 %.not103, label %67, label %64

.lr.ph133:                                        ; preds = %.lr.ph133.preheader, %.critedge.thread
  %.077131 = phi i64 [ %63, %.critedge.thread ], [ 0, %.lr.ph133.preheader ]
  %.lcssa126129130 = phi i32 [ %.lcssa126128, %.critedge.thread ], [ 0, %.lr.ph133.preheader ]
  %8 = getelementptr inbounds [10005 x [105 x i8]], ptr @b, i64 0, i64 %.077131, i64 0
  %9 = load i8, ptr %8, align 1, !tbaa !9
  %10 = sext i8 %9 to i64
  %11 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %.not106114 = icmp eq i32 %12, -1
  %.phi.trans.insert = getelementptr inbounds [10005 x i32], ptr @lenb, i64 0, i64 %.077131
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  br i1 %.not106114, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph133
  %smax = tail call i32 @llvm.smax.i32(i32 %.pre, i32 0)
  %wide.trip.count = zext nneg i32 %smax to i64
  %exitcond.not192 = icmp slt i32 %.pre, 1
  br i1 %exitcond.not192, label %.critedge.thread, label %.lr.ph194

13:                                               ; preds = %.lr.ph194
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge.thread, label %.lr.ph194, !llvm.loop !10

.lr.ph194:                                        ; preds = %.lr.ph, %13
  %14 = phi i32 [ %20, %13 ], [ %12, %.lr.ph ]
  %indvars.iv193 = phi i64 [ %indvars.iv.next, %13 ], [ 0, %.lr.ph ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv193, 1
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [10005 x [105 x i8]], ptr @b, i64 0, i64 %.077131, i64 %indvars.iv.next
  %17 = load i8, ptr %16, align 1, !tbaa !9
  %18 = sext i8 %17 to i64
  %19 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %15, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %.not106 = icmp eq i32 %20, -1
  br i1 %.not106, label %.critedge.loopexit, label %13, !llvm.loop !10

.critedge.loopexit:                               ; preds = %.lr.ph194
  %indvars.le = trunc i64 %indvars.iv.next to i32
  br label %.critedge

.critedge:                                        ; preds = %.lr.ph133, %.critedge.loopexit
  %.086.lcssa = phi i32 [ %indvars.le, %.critedge.loopexit ], [ 0, %.lr.ph133 ]
  %.082.lcssa = phi i32 [ %14, %.critedge.loopexit ], [ 0, %.lr.ph133 ]
  %21 = icmp slt i32 %.086.lcssa, %.pre
  br i1 %21, label %.lr.ph124.preheader, label %.critedge.thread

.lr.ph124.preheader:                              ; preds = %.critedge
  %22 = add i32 %.lcssa126129130, 1
  %23 = sext i32 %22 to i64
  %24 = shl nsw i64 %23, 2
  %scevgep155 = getelementptr i8, ptr @marked, i64 %24
  %25 = xor i32 %.086.lcssa, -1
  %26 = add i32 %.pre, %25
  %27 = zext i32 %26 to i64
  %28 = shl nuw nsw i64 %27, 2
  %29 = add nuw nsw i64 %28, 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep155, i8 0, i64 %29, i1 false), !tbaa !5
  %scevgep156 = getelementptr i8, ptr @f, i64 %24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep156, i8 0, i64 %29, i1 false), !tbaa !5
  %scevgep157 = getelementptr i8, ptr @pre, i64 %24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep157, i8 -1, i64 %29, i1 false), !tbaa !5
  %scevgep158 = getelementptr i8, ptr @output, i64 %24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep158, i8 -1, i64 %29, i1 false), !tbaa !5
  %30 = zext i32 %.086.lcssa to i64
  %31 = zext i32 %.lcssa126129130 to i64
  %32 = sub i32 %.pre, %.086.lcssa
  %.neg = add i32 %.086.lcssa, 1
  %xtraiter = and i32 %32, 1
  %33 = icmp eq i32 %.pre, %.neg
  br i1 %33, label %._crit_edge.unr-lcssa, label %.lr.ph124.preheader.new

.lr.ph124.preheader.new:                          ; preds = %.lr.ph124.preheader
  %unroll_iter = and i32 %32, -2
  br label %.lr.ph124

.lr.ph124:                                        ; preds = %.lr.ph124, %.lr.ph124.preheader.new
  %indvars.iv161 = phi i64 [ %31, %.lr.ph124.preheader.new ], [ %indvars.iv.next162.1, %.lr.ph124 ]
  %indvars.iv159 = phi i64 [ %30, %.lr.ph124.preheader.new ], [ %indvars.iv.next160.1, %.lr.ph124 ]
  %indvar = phi i64 [ 0, %.lr.ph124.preheader.new ], [ %indvar.next.1, %.lr.ph124 ]
  %.183123 = phi i32 [ %.082.lcssa, %.lr.ph124.preheader.new ], [ %50, %.lr.ph124 ]
  %niter = phi i32 [ 0, %.lr.ph124.preheader.new ], [ %niter.next.1, %.lr.ph124 ]
  %34 = add i64 %indvar, %23
  %35 = mul i64 %34, 104
  %scevgep = getelementptr i8, ptr @g, i64 %35
  %36 = sext i32 %.183123 to i64
  %37 = getelementptr inbounds [10005 x [105 x i8]], ptr @b, i64 0, i64 %.077131, i64 %indvars.iv159
  %38 = load i8, ptr %37, align 1, !tbaa !9
  %39 = sext i8 %38 to i64
  %40 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %36, i64 %39
  %41 = trunc i64 %indvars.iv161 to i32
  %42 = add i32 %41, 1
  store i32 %42, ptr %40, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %scevgep, i8 -1, i64 104, i1 false), !tbaa !5
  %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
  %indvar.next = or disjoint i64 %indvar, 1
  %43 = add i64 %indvar.next, %23
  %44 = mul i64 %43, 104
  %scevgep.1 = getelementptr i8, ptr @g, i64 %44
  %indvars.iv.next162.1 = add i64 %indvars.iv161, 2
  %45 = sext i32 %42 to i64
  %46 = getelementptr inbounds [10005 x [105 x i8]], ptr @b, i64 0, i64 %.077131, i64 %indvars.iv.next160
  %47 = load i8, ptr %46, align 1, !tbaa !9
  %48 = sext i8 %47 to i64
  %49 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %45, i64 %48
  %50 = trunc i64 %indvars.iv.next162.1 to i32
  store i32 %50, ptr %49, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %scevgep.1, i8 -1, i64 104, i1 false), !tbaa !5
  %indvars.iv.next160.1 = add nuw nsw i64 %indvars.iv159, 2
  %indvar.next.1 = add nuw nsw i64 %indvar, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.unr-lcssa, label %.lr.ph124, !llvm.loop !12

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph124, %.lr.ph124.preheader
  %.lcssa202.ph = phi i32 [ poison, %.lr.ph124.preheader ], [ %50, %.lr.ph124 ]
  %indvars.iv161.unr = phi i64 [ %31, %.lr.ph124.preheader ], [ %indvars.iv.next162.1, %.lr.ph124 ]
  %indvars.iv159.unr = phi i64 [ %30, %.lr.ph124.preheader ], [ %indvars.iv.next160.1, %.lr.ph124 ]
  %indvar.unr = phi i64 [ 0, %.lr.ph124.preheader ], [ %indvar.next.1, %.lr.ph124 ]
  %.183123.unr = phi i32 [ %.082.lcssa, %.lr.ph124.preheader ], [ %50, %.lr.ph124 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph124.epil

.lr.ph124.epil:                                   ; preds = %._crit_edge.unr-lcssa
  %51 = add i64 %indvar.unr, %23
  %52 = mul i64 %51, 104
  %scevgep.epil = getelementptr i8, ptr @g, i64 %52
  %53 = sext i32 %.183123.unr to i64
  %54 = getelementptr inbounds [10005 x [105 x i8]], ptr @b, i64 0, i64 %.077131, i64 %indvars.iv159.unr
  %55 = load i8, ptr %54, align 1, !tbaa !9
  %56 = sext i8 %55 to i64
  %57 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %53, i64 %56
  %58 = trunc i64 %indvars.iv161.unr to i32
  %59 = add i32 %58, 1
  store i32 %59, ptr %57, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %scevgep.epil, i8 -1, i64 104, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %.lr.ph124.epil
  %.lcssa202 = phi i32 [ %.lcssa202.ph, %._crit_edge.unr-lcssa ], [ %59, %.lr.ph124.epil ]
  store i32 %.lcssa202, ptr @ng, align 4, !tbaa !5
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %13, %.lr.ph, %._crit_edge, %.critedge
  %.lcssa126128 = phi i32 [ %.lcssa202, %._crit_edge ], [ %.lcssa126129130, %.critedge ], [ %.lcssa126129130, %.lr.ph ], [ %.lcssa126129130, %13 ]
  %.183.lcssa = phi i32 [ %.lcssa202, %._crit_edge ], [ %.082.lcssa, %.critedge ], [ 0, %.lr.ph ], [ %14, %13 ]
  %60 = trunc i64 %.077131 to i32
  %61 = sext i32 %.183.lcssa to i64
  %62 = getelementptr inbounds [500005 x i32], ptr @output, i64 0, i64 %61
  store i32 %60, ptr %62, align 4, !tbaa !5
  %63 = add nuw nsw i64 %.077131, 1
  %exitcond168.not = icmp eq i64 %63, %4
  br i1 %exitcond168.not, label %._crit_edge134, label %.lr.ph133, !llvm.loop !13

64:                                               ; preds = %._crit_edge134
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) @g)
          to label %67 unwind label %65

65:                                               ; preds = %141, %138, %135, %132, %129, %126, %123, %120, %117, %114, %111, %108, %105, %102, %99, %96, %93, %90, %87, %84, %81, %78, %75, %72, %69, %64
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %207

67:                                               ; preds = %._crit_edge134, %64
  %68 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 4), align 4, !tbaa !5
  %.not103.1 = icmp eq i32 %68, -1
  br i1 %.not103.1, label %70, label %69

69:                                               ; preds = %67
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 4))
          to label %70 unwind label %65

70:                                               ; preds = %69, %67
  %71 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 8), align 8, !tbaa !5
  %.not103.2 = icmp eq i32 %71, -1
  br i1 %.not103.2, label %73, label %72

72:                                               ; preds = %70
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 8))
          to label %73 unwind label %65

73:                                               ; preds = %72, %70
  %74 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 12), align 4, !tbaa !5
  %.not103.3 = icmp eq i32 %74, -1
  br i1 %.not103.3, label %76, label %75

75:                                               ; preds = %73
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 12))
          to label %76 unwind label %65

76:                                               ; preds = %75, %73
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 16), align 16, !tbaa !5
  %.not103.4 = icmp eq i32 %77, -1
  br i1 %.not103.4, label %79, label %78

78:                                               ; preds = %76
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 16))
          to label %79 unwind label %65

79:                                               ; preds = %78, %76
  %80 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 20), align 4, !tbaa !5
  %.not103.5 = icmp eq i32 %80, -1
  br i1 %.not103.5, label %82, label %81

81:                                               ; preds = %79
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 20))
          to label %82 unwind label %65

82:                                               ; preds = %81, %79
  %83 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 24), align 8, !tbaa !5
  %.not103.6 = icmp eq i32 %83, -1
  br i1 %.not103.6, label %85, label %84

84:                                               ; preds = %82
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 24))
          to label %85 unwind label %65

85:                                               ; preds = %84, %82
  %86 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 28), align 4, !tbaa !5
  %.not103.7 = icmp eq i32 %86, -1
  br i1 %.not103.7, label %88, label %87

87:                                               ; preds = %85
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 28))
          to label %88 unwind label %65

88:                                               ; preds = %87, %85
  %89 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 32), align 16, !tbaa !5
  %.not103.8 = icmp eq i32 %89, -1
  br i1 %.not103.8, label %91, label %90

90:                                               ; preds = %88
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 32))
          to label %91 unwind label %65

91:                                               ; preds = %90, %88
  %92 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 36), align 4, !tbaa !5
  %.not103.9 = icmp eq i32 %92, -1
  br i1 %.not103.9, label %94, label %93

93:                                               ; preds = %91
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 36))
          to label %94 unwind label %65

94:                                               ; preds = %93, %91
  %95 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 40), align 8, !tbaa !5
  %.not103.10 = icmp eq i32 %95, -1
  br i1 %.not103.10, label %97, label %96

96:                                               ; preds = %94
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 40))
          to label %97 unwind label %65

97:                                               ; preds = %96, %94
  %98 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 44), align 4, !tbaa !5
  %.not103.11 = icmp eq i32 %98, -1
  br i1 %.not103.11, label %100, label %99

99:                                               ; preds = %97
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 44))
          to label %100 unwind label %65

100:                                              ; preds = %99, %97
  %101 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 48), align 16, !tbaa !5
  %.not103.12 = icmp eq i32 %101, -1
  br i1 %.not103.12, label %103, label %102

102:                                              ; preds = %100
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 48))
          to label %103 unwind label %65

103:                                              ; preds = %102, %100
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 52), align 4, !tbaa !5
  %.not103.13 = icmp eq i32 %104, -1
  br i1 %.not103.13, label %106, label %105

105:                                              ; preds = %103
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 52))
          to label %106 unwind label %65

106:                                              ; preds = %105, %103
  %107 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 56), align 8, !tbaa !5
  %.not103.14 = icmp eq i32 %107, -1
  br i1 %.not103.14, label %109, label %108

108:                                              ; preds = %106
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 56))
          to label %109 unwind label %65

109:                                              ; preds = %108, %106
  %110 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 60), align 4, !tbaa !5
  %.not103.15 = icmp eq i32 %110, -1
  br i1 %.not103.15, label %112, label %111

111:                                              ; preds = %109
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 60))
          to label %112 unwind label %65

112:                                              ; preds = %111, %109
  %113 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 64), align 16, !tbaa !5
  %.not103.16 = icmp eq i32 %113, -1
  br i1 %.not103.16, label %115, label %114

114:                                              ; preds = %112
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 64))
          to label %115 unwind label %65

115:                                              ; preds = %114, %112
  %116 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 68), align 4, !tbaa !5
  %.not103.17 = icmp eq i32 %116, -1
  br i1 %.not103.17, label %118, label %117

117:                                              ; preds = %115
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 68))
          to label %118 unwind label %65

118:                                              ; preds = %117, %115
  %119 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 72), align 8, !tbaa !5
  %.not103.18 = icmp eq i32 %119, -1
  br i1 %.not103.18, label %121, label %120

120:                                              ; preds = %118
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 72))
          to label %121 unwind label %65

121:                                              ; preds = %120, %118
  %122 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 76), align 4, !tbaa !5
  %.not103.19 = icmp eq i32 %122, -1
  br i1 %.not103.19, label %124, label %123

123:                                              ; preds = %121
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 76))
          to label %124 unwind label %65

124:                                              ; preds = %123, %121
  %125 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 80), align 16, !tbaa !5
  %.not103.20 = icmp eq i32 %125, -1
  br i1 %.not103.20, label %127, label %126

126:                                              ; preds = %124
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 80))
          to label %127 unwind label %65

127:                                              ; preds = %126, %124
  %128 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 84), align 4, !tbaa !5
  %.not103.21 = icmp eq i32 %128, -1
  br i1 %.not103.21, label %130, label %129

129:                                              ; preds = %127
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 84))
          to label %130 unwind label %65

130:                                              ; preds = %129, %127
  %131 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 88), align 8, !tbaa !5
  %.not103.22 = icmp eq i32 %131, -1
  br i1 %.not103.22, label %133, label %132

132:                                              ; preds = %130
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 88))
          to label %133 unwind label %65

133:                                              ; preds = %132, %130
  %134 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 92), align 4, !tbaa !5
  %.not103.23 = icmp eq i32 %134, -1
  br i1 %.not103.23, label %136, label %135

135:                                              ; preds = %133
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 92))
          to label %136 unwind label %65

136:                                              ; preds = %135, %133
  %137 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 96), align 16, !tbaa !5
  %.not103.24 = icmp eq i32 %137, -1
  br i1 %.not103.24, label %139, label %138

138:                                              ; preds = %136
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 96))
          to label %139 unwind label %65

139:                                              ; preds = %138, %136
  %140 = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 100), align 4, !tbaa !5
  %.not103.25 = icmp eq i32 %140, -1
  br i1 %.not103.25, label %.preheader110, label %141

141:                                              ; preds = %139
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @g, i64 100))
          to label %.preheader110 unwind label %65

.preheader110:                                    ; preds = %141, %139
  %142 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %142, label %._crit_edge138, label %.lr.ph137

.loopexit109:                                     ; preds = %163
  %143 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %143, label %._crit_edge138, label %.lr.ph137, !llvm.loop !14

.lr.ph137:                                        ; preds = %.preheader110, %.loopexit109
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %145 = load i32, ptr %144, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %146 = sext i32 %145 to i64
  br label %147

147:                                              ; preds = %.lr.ph137, %163
  %.081136 = phi i64 [ 0, %.lr.ph137 ], [ %164, %163 ]
  %148 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %146, i64 %.081136
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %.not102 = icmp eq i32 %149, -1
  br i1 %.not102, label %163, label %150

150:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 %149, ptr %2, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %.preheader108 unwind label %157

.preheader108:                                    ; preds = %150, %.preheader108
  %.pn = phi i64 [ %151, %.preheader108 ], [ %146, %150 ]
  %.080.in = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %.pn
  %.080 = load i32, ptr %.080.in, align 4, !tbaa !5
  %151 = sext i32 %.080 to i64
  %152 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %151, i64 %.081136
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp eq i32 %153, -1
  %155 = icmp ne i32 %.080, 0
  %156 = and i1 %155, %154
  br i1 %156, label %.preheader108, label %159, !llvm.loop !15

157:                                              ; preds = %150
  %158 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %207

159:                                              ; preds = %.preheader108
  %spec.select = select i1 %154, i32 0, i32 %153
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %161
  store i32 %spec.select, ptr %162, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %163

163:                                              ; preds = %147, %159
  %164 = add nuw nsw i64 %.081136, 1
  %exitcond170.not = icmp eq i64 %164, 26
  br i1 %exitcond170.not, label %.loopexit109, label %147, !llvm.loop !16

._crit_edge138:                                   ; preds = %.loopexit109, %.preheader110
  %165 = load i32, ptr @alen, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = icmp sgt i32 %165, 0
  br i1 %167, label %.preheader, label %._crit_edge141

.preheader:                                       ; preds = %._crit_edge138, %191
  %.078140 = phi i64 [ %192, %191 ], [ 0, %._crit_edge138 ]
  %.079139 = phi i32 [ %spec.select107, %191 ], [ 0, %._crit_edge138 ]
  %168 = getelementptr inbounds [100005 x i8], ptr @a, i64 0, i64 %.078140
  %169 = load i8, ptr %168, align 1, !tbaa !9
  %170 = sext i8 %169 to i64
  br label %173

._crit_edge141:                                   ; preds = %191, %._crit_edge138
  %171 = load i32, ptr @ng, align 4, !tbaa !5
  %.not146 = icmp slt i32 %171, 0
  br i1 %.not146, label %._crit_edge150, label %.lr.ph149.preheader

.lr.ph149.preheader:                              ; preds = %._crit_edge141
  %172 = zext nneg i32 %171 to i64
  br label %.lr.ph149

173:                                              ; preds = %.preheader, %178
  %.1 = phi i32 [ %180, %178 ], [ %.079139, %.preheader ]
  %174 = sext i32 %.1 to i64
  %175 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 %174, i64 %170
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = icmp eq i32 %176, -1
  br i1 %177, label %178, label %split

178:                                              ; preds = %173
  %179 = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %174
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %.not99 = icmp eq i32 %180, 0
  br i1 %.not99, label %._crit_edge173, label %173, !llvm.loop !17

._crit_edge173:                                   ; preds = %178
  %.phi.trans.insert174 = getelementptr inbounds [500005 x [26 x i32]], ptr @g, i64 0, i64 0, i64 %170
  %.pre175 = load i32, ptr %.phi.trans.insert174, align 4, !tbaa !5
  br label %split

split:                                            ; preds = %173, %._crit_edge173
  %181 = phi i32 [ %.pre175, %._crit_edge173 ], [ %176, %173 ]
  %182 = icmp eq i32 %181, -1
  %spec.select107 = select i1 %182, i32 0, i32 %181
  %.not100 = icmp eq i32 %spec.select107, 0
  br i1 %.not100, label %191, label %183

183:                                              ; preds = %split
  %184 = sext i32 %spec.select107 to i64
  %185 = getelementptr inbounds [500005 x i32], ptr @output, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %.not101 = icmp eq i32 %186, -1
  br i1 %.not101, label %191, label %187

187:                                              ; preds = %183
  %188 = getelementptr inbounds [500005 x i32], ptr @marked, i64 0, i64 %184
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %188, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %split, %183, %187
  %192 = add nuw nsw i64 %.078140, 1
  %exitcond171.not = icmp eq i64 %192, %166
  br i1 %exitcond171.not, label %._crit_edge141, label %.preheader, !llvm.loop !18

._crit_edge150:                                   ; preds = %.loopexit, %._crit_edge141
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #6
  ret void

.lr.ph149:                                        ; preds = %.lr.ph149.preheader, %.loopexit
  %.076147 = phi i64 [ %206, %.loopexit ], [ 0, %.lr.ph149.preheader ]
  %.not96 = icmp eq i64 %.076147, 0
  br i1 %.not96, label %.loopexit, label %193

193:                                              ; preds = %.lr.ph149
  %194 = getelementptr inbounds [500005 x i32], ptr @marked, i64 0, i64 %.076147
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %.not97 = icmp eq i32 %195, 0
  %196 = trunc i64 %.076147 to i32
  %.not98142 = icmp eq i32 %196, 0
  %or.cond = or i1 %.not97, %.not98142
  br i1 %or.cond, label %.loopexit, label %.lr.ph145

.lr.ph145:                                        ; preds = %193, %.lr.ph145
  %.0143 = phi i32 [ %205, %.lr.ph145 ], [ %196, %193 ]
  %197 = sext i32 %.0143 to i64
  %198 = getelementptr inbounds [500005 x i32], ptr @output, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [10005 x i32], ptr @cnt, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = add nsw i32 %202, %195
  store i32 %203, ptr %201, align 4, !tbaa !5
  %204 = getelementptr inbounds [500005 x i32], ptr @f, i64 0, i64 %197
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %.not98 = icmp eq i32 %205, 0
  br i1 %.not98, label %.loopexit, label %.lr.ph145, !llvm.loop !19

.loopexit:                                        ; preds = %.lr.ph145, %.lr.ph149, %193
  %206 = add nuw nsw i64 %.076147, 1
  %exitcond172.not = icmp eq i64 %.076147, %172
  br i1 %exitcond172.not, label %._crit_edge150, label %.lr.ph149, !llvm.loop !20

207:                                              ; preds = %157, %65
  %.pn104 = phi { ptr, i32 } [ %66, %65 ], [ %158, %157 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn104
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!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}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}


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