; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2017-18/Dec 2017/Plat (standingout_automaton)

; 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.SuffixAutomaton = type { %"class.std::vector.3", %"class.std::vector.7", %"class.std::vector" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<SuffixAutomaton::state, std::allocator<SuffixAutomaton::state>>::_Vector_impl" }
%"struct.std::_Vector_base<SuffixAutomaton::state, std::allocator<SuffixAutomaton::state>>::_Vector_impl" = type { %"struct.std::_Vector_base<SuffixAutomaton::state, std::allocator<SuffixAutomaton::state>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SuffixAutomaton::state, std::allocator<SuffixAutomaton::state>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::allocator.9" = type { i8 }
%"class.__gnu_cxx::__normal_iterator.25" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.SuffixAutomaton::state" = type { i32, i32, i32, %"class.std::map", %"class.std::vector.7" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type { i8, i32 }

@S = external dso_local global %struct.SuffixAutomaton, align 8
@N = external dso_local global i32, align 4
@ways = external dso_local global %"class.std::vector.12", align 8
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [125 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4combii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::vector.7", align 8
  %15 = alloca %"class.std::allocator.9", align 1
  %16 = alloca i32, align 4
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.25", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.25", align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %26 unwind label %33

26:                                               ; preds = %0
  invoke void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %27 unwind label %37

27:                                               ; preds = %26
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @_Z2reIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %83, %27
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = load i32, ptr @N, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %42, label %32

32:                                               ; preds = %28
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %87

33:                                               ; preds = %0
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %4, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %5, align 4
  br label %41

37:                                               ; preds = %26
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  br label %41

41:                                               ; preds = %37, %33
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %236

42:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  invoke void @_Z2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %43 unwind label %53

43:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr %8, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %44 = load ptr, ptr %10, align 8, !tbaa !9
  %45 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %44) #7
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %47 = load ptr, ptr %10, align 8, !tbaa !9
  %48 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %47) #7
  %49 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %48, ptr %49, align 8
  br label %50

50:                                               ; preds = %76, %43
  %51 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br i1 %51, label %57, label %52

52:                                               ; preds = %50
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %82

53:                                               ; preds = %42
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %4, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %5, align 4
  br label %86

57:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %58 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  store ptr %58, ptr %13, align 8, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = load ptr, ptr %13, align 8, !tbaa !9
  %61 = load i8, ptr %60, align 1, !tbaa !11
  %62 = invoke noundef i32 @_ZN15SuffixAutomaton3addEic(ptr noundef nonnull align 8 dereferenceable(88) @S, i32 noundef %59, i8 noundef signext %61)
          to label %63 unwind label %78

63:                                               ; preds = %57
  store i32 %62, ptr %9, align 4, !tbaa !5
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %65) #7
  %67 = getelementptr inbounds %"struct.SuffixAutomaton::state", ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !12
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = invoke noundef i32 @_Z4combii(i32 noundef %68, i32 noundef %69)
          to label %71 unwind label %78

71:                                               ; preds = %63
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %73) #7
  %75 = getelementptr inbounds %"struct.SuffixAutomaton::state", ptr %74, i32 0, i32 2
  store i32 %70, ptr %75, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %76

76:                                               ; preds = %71
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br label %50

78:                                               ; preds = %63, %57
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %4, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %86

82:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !5
  br label %28, !llvm.loop !27

86:                                               ; preds = %78, %53
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %236

87:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #7
  %88 = load i32, ptr @N, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %89, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %90 unwind label %97

90:                                               ; preds = %87
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %111, %90
  %92 = load i32, ptr %16, align 4, !tbaa !5
  %93 = call noundef i64 @_ZNKSt6vectorIN15SuffixAutomaton5stateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @S) #7
  %94 = trunc i64 %93 to i32
  %95 = icmp slt i32 %92, %94
  br i1 %95, label %101, label %96

96:                                               ; preds = %91
  store i32 7, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %118

97:                                               ; preds = %87
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %4, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %5, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  br label %235

101:                                              ; preds = %91
  %102 = load i32, ptr %16, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %103) #7
  %105 = getelementptr inbounds %"struct.SuffixAutomaton::state", ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !29
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %107) #7
  %109 = getelementptr inbounds %"struct.SuffixAutomaton::state", ptr %108, i32 0, i32 4
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %109, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %110 unwind label %114

110:                                              ; preds = %101
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %16, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %16, align 4, !tbaa !5
  br label %91, !llvm.loop !30

114:                                              ; preds = %101
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %4, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %234

118:                                              ; preds = %96
  invoke void @_ZN15SuffixAutomaton3dfsEi(ptr noundef nonnull align 8 dereferenceable(88) @S, i32 noundef 0)
          to label %119 unwind label %137

119:                                              ; preds = %118
  invoke void @_ZN15SuffixAutomaton4dfs2Ei(ptr noundef nonnull align 8 dereferenceable(88) @S, i32 noundef 0)
          to label %120 unwind label %137

120:                                              ; preds = %119
  %121 = invoke ptr @_ZSt5beginISt6vectorIiSaIiEEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%struct.SuffixAutomaton, ptr @S, i32 0, i32 1))
          to label %122 unwind label %137

122:                                              ; preds = %120
  %123 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.25", ptr %17, i32 0, i32 0
  store ptr %121, ptr %123, align 8
  %124 = invoke ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%struct.SuffixAutomaton, ptr @S, i32 0, i32 1))
          to label %125 unwind label %137

125:                                              ; preds = %122
  %126 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.25", ptr %18, i32 0, i32 0
  store ptr %124, ptr %126, align 8
  %127 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.25", ptr %17, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8
  %129 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.25", ptr %18, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %128, ptr %130)
          to label %131 unwind label %137

131:                                              ; preds = %125
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%struct.SuffixAutomaton, ptr @S, i32 0, i32 1), i64 noundef 0) #7
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %135, label %136

135:                                              ; preds = %131
  br label %142

136:                                              ; preds = %131
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.15, i32 noundef 279, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

137:                                              ; preds = %142, %125, %122, %120, %119, %118
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %4, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %5, align 4
  br label %234

141:                                              ; No predecessors!
  br label %142

142:                                              ; preds = %141, %135
  %143 = call noundef i64 @_ZNKSt6vectorIN15SuffixAutomaton5stateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @S) #7
  %144 = trunc i64 %143 to i32
  %145 = sext i32 %144 to i64
  invoke void @_ZNSt6vectorIxSaIxEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef %145)
          to label %146 unwind label %137

146:                                              ; preds = %142
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef 0) #7
  store i64 1, ptr %147, align 8, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %211, %146
  %149 = load i32, ptr %19, align 4, !tbaa !5
  %150 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%struct.SuffixAutomaton, ptr @S, i32 0, i32 1)) #7
  %151 = trunc i64 %150 to i32
  %152 = icmp slt i32 %149, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %148
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %214

154:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %155 = load i32, ptr %19, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%struct.SuffixAutomaton, ptr @S, i32 0, i32 1), i64 noundef %156) #7
  %158 = load i32, ptr %157, align 4, !tbaa !5
  store i32 %158, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %159 = load i32, ptr %20, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %160) #7
  %162 = getelementptr inbounds %"struct.SuffixAutomaton::state", ptr %161, i32 0, i32 3
  store ptr %162, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %163 = load ptr, ptr %21, align 8, !tbaa !9
  %164 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %163) #7
  %165 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %22, i32 0, i32 0
  store ptr %164, ptr %165, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %166 = load ptr, ptr %21, align 8, !tbaa !9
  %167 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %166) #7
  %168 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %23, i32 0, i32 0
  store ptr %167, ptr %168, align 8
  br label %169

169:                                              ; preds = %185, %154
  %170 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKciEES5_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  br i1 %170, label %172, label %171

171:                                              ; preds = %169
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %187

172:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %173 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  store ptr %173, ptr %24, align 8, !tbaa !9
  %174 = load i32, ptr %20, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef %175) #7
  %177 = load i64, ptr %176, align 8, !tbaa !31
  %178 = load ptr, ptr %24, align 8, !tbaa !9
  %179 = getelementptr inbounds %"struct.std::pair", ptr %178, i32 0, i32 1
  %180 = load i32, ptr %179, align 4, !tbaa !33
  %181 = sext i32 %180 to i64
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef %181) #7
  %183 = load i64, ptr %182, align 8, !tbaa !31
  %184 = add nsw i64 %183, %177
  store i64 %184, ptr %182, align 8, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %185

185:                                              ; preds = %172
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKciEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  br label %169

187:                                              ; preds = %171
  %188 = load i32, ptr %20, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %189) #7
  %191 = getelementptr inbounds %"struct.SuffixAutomaton::state", ptr %190, i32 0, i32 2
  %192 = load i32, ptr %191, align 8, !tbaa !12
  %193 = icmp ne i32 %192, 1000000007
  br i1 %193, label %194, label %210

194:                                              ; preds = %187
  %195 = load i32, ptr %20, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef %196) #7
  %198 = load i64, ptr %197, align 8, !tbaa !31
  %199 = load i32, ptr %20, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %200) #7
  %202 = getelementptr inbounds %"struct.SuffixAutomaton::state", ptr %201, i32 0, i32 2
  %203 = load i32, ptr %202, align 8, !tbaa !12
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %204) #7
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = add nsw i64 %207, %198
  %209 = trunc i64 %208 to i32
  store i32 %209, ptr %205, align 4, !tbaa !5
  br label %210

210:                                              ; preds = %194, %187
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %19, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %19, align 4, !tbaa !5
  br label %148, !llvm.loop !35

214:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %215

215:                                              ; preds = %225, %214
  %216 = load i32, ptr %25, align 4, !tbaa !5
  %217 = load i32, ptr @N, align 4, !tbaa !5
  %218 = icmp slt i32 %216, %217
  br i1 %218, label %220, label %219

219:                                              ; preds = %215
  store i32 15, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %232

220:                                              ; preds = %215
  %221 = load i32, ptr %25, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %222) #7
  invoke void @_Z2psIiJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %223)
          to label %224 unwind label %228

224:                                              ; preds = %220
  br label %225

225:                                              ; preds = %224
  %226 = load i32, ptr %25, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %25, align 4, !tbaa !5
  br label %215, !llvm.loop !36

228:                                              ; preds = %220
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %4, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %234

232:                                              ; preds = %219
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  %233 = load i32, ptr %1, align 4
  ret i32 %233

234:                                              ; preds = %228, %137, %114
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  br label %235

235:                                              ; preds = %234, %97
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  br label %236

236:                                              ; preds = %235, %86, %41
  %237 = load ptr, ptr %4, align 8
  %238 = load i32, ptr %5, align 4
  %239 = insertvalue { ptr, i32 } poison, ptr %237, 0
  %240 = insertvalue { ptr, i32 } %239, i32 %238, 1
  resume { ptr, i32 } %240
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2reIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress nounwind uwtable
declare ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN15SuffixAutomaton3addEic(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i8 noundef signext) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN15SuffixAutomaton5stateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15SuffixAutomaton3dfsEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15SuffixAutomaton4dfs2Ei(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @_ZSt5beginISt6vectorIiSaIiEEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKciEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2psIiJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint 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 #6 = { noreturn 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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 8}
!13 = !{!"_ZTSN15SuffixAutomaton5stateE", !6, i64 0, !6, i64 4, !6, i64 8, !14, i64 16, !23, i64 64}
!14 = !{!"_ZTSSt3mapIciSt4lessIcESaISt4pairIKciEEE", !15, i64 0}
!15 = !{!"_ZTSSt8_Rb_treeIcSt4pairIKciESt10_Select1stIS2_ESt4lessIcESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSNSt8_Rb_treeIcSt4pairIKciESt10_Select1stIS2_ESt4lessIcESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !18, i64 0}
!18 = !{!"_ZTSSt4lessIcE"}
!19 = !{!"_ZTSSt15_Rb_tree_header", !20, i64 0, !22, i64 32}
!20 = !{!"_ZTSSt18_Rb_tree_node_base", !21, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!21 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSSt6vectorIiSaIiEE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!13, !6, i64 4}
!30 = distinct !{!30, !28}
!31 = !{!32, !32, i64 0}
!32 = !{!"long long", !7, i64 0}
!33 = !{!34, !6, i64 4}
!34 = !{!"_ZTSSt4pairIKciE", !7, i64 0, !6, i64 4}
!35 = distinct !{!35, !28}
!36 = distinct !{!36, !28}


; 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.SuffixAutomaton = type { %"class.std::vector.3", %"class.std::vector.7", %"class.std::vector" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<SuffixAutomaton::state, std::allocator<SuffixAutomaton::state>>::_Vector_impl" }
%"struct.std::_Vector_base<SuffixAutomaton::state, std::allocator<SuffixAutomaton::state>>::_Vector_impl" = type { %"struct.std::_Vector_base<SuffixAutomaton::state, std::allocator<SuffixAutomaton::state>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SuffixAutomaton::state, std::allocator<SuffixAutomaton::state>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::allocator.9" = type { i8 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@S = external dso_local global %struct.SuffixAutomaton, align 8
@N = external dso_local global i32, align 4
@ways = external dso_local global %"class.std::vector.12", align 8
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [125 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

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

; 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4combii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.std::vector.7", align 8
  %7 = alloca %"class.std::allocator.9", align 1
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  tail call void @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %11 unwind label %16

11:                                               ; preds = %0
  invoke void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %1)
          to label %12 unwind label %18

12:                                               ; preds = %11
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  call void @_Z2reIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  %13 = load i32, ptr @N, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph47, label %._crit_edge48

._crit_edge48:                                    ; preds = %._crit_edge, %12
  %.lcssa = phi i32 [ %13, %12 ], [ %26, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  %15 = sext i32 %.lcssa to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %15, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %47 unwind label %51

16:                                               ; preds = %0
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %20

18:                                               ; preds = %11
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  br label %20

20:                                               ; preds = %18, %16
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %17, %16 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  br label %136

.lr.ph47:                                         ; preds = %12, %._crit_edge
  %.03245 = phi i32 [ %25, %._crit_edge ], [ 0, %12 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  invoke void @_Z2reINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEvRT_(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %21 unwind label %28

21:                                               ; preds = %.lr.ph47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %22 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  store ptr %22, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %23 = call ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  store ptr %23, ptr %5, align 8
  %24 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %39, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  %25 = add nuw nsw i32 %.03245, 1
  %26 = load i32, ptr @N, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.lr.ph47, label %._crit_edge48, !llvm.loop !9

28:                                               ; preds = %.lr.ph47
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %46

.lr.ph:                                           ; preds = %21, %39
  %.03444 = phi i32 [ %32, %39 ], [ 0, %21 ]
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = invoke noundef i32 @_ZN15SuffixAutomaton3addEic(ptr noundef nonnull align 8 dereferenceable(88) @S, i32 noundef %.03444, i8 noundef signext %31)
          to label %33 unwind label %44

33:                                               ; preds = %.lr.ph
  %34 = sext i32 %32 to i64
  %35 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %34) #7
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load i32, ptr %36, align 8, !tbaa !12
  %38 = invoke noundef i32 @_Z4combii(i32 noundef %37, i32 noundef %.03245)
          to label %39 unwind label %44

39:                                               ; preds = %33
  %40 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %34) #7
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  store i32 %38, ptr %41, align 8, !tbaa !12
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %43 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br i1 %43, label %.lr.ph, label %._crit_edge

44:                                               ; preds = %33, %.lr.ph
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %46

46:                                               ; preds = %44, %28
  %.pn39 = phi { ptr, i32 } [ %45, %44 ], [ %29, %28 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %136

47:                                               ; preds = %._crit_edge48
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  %48 = call noundef i64 @_ZNKSt6vectorIN15SuffixAutomaton5stateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @S) #7
  %49 = trunc i64 %48 to i32
  %50 = icmp sgt i32 %49, 1
  br i1 %50, label %.lr.ph50, label %._crit_edge51

._crit_edge51:                                    ; preds = %61, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  invoke void @_ZN15SuffixAutomaton3dfsEi(ptr noundef nonnull align 8 dereferenceable(88) @S, i32 noundef 0)
          to label %69 unwind label %78

51:                                               ; preds = %._crit_edge48
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  br label %135

.lr.ph50:                                         ; preds = %47, %61
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %54) #7
  %56 = getelementptr inbounds i8, ptr %55, i64 4
  %57 = load i32, ptr %56, align 4, !tbaa !28
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %58) #7
  %60 = getelementptr inbounds i8, ptr %59, i64 64
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %61 unwind label %67

61:                                               ; preds = %.lr.ph50
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %8, align 4, !tbaa !5
  %64 = call noundef i64 @_ZNKSt6vectorIN15SuffixAutomaton5stateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @S) #7
  %65 = trunc i64 %64 to i32
  %66 = icmp slt i32 %63, %65
  br i1 %66, label %.lr.ph50, label %._crit_edge51, !llvm.loop !29

67:                                               ; preds = %.lr.ph50
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %134

69:                                               ; preds = %._crit_edge51
  invoke void @_ZN15SuffixAutomaton4dfs2Ei(ptr noundef nonnull align 8 dereferenceable(88) @S, i32 noundef 0)
          to label %70 unwind label %78

70:                                               ; preds = %69
  %71 = call ptr @_ZSt5beginISt6vectorIiSaIiEEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @S, i64 24))
  %72 = call ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @S, i64 24))
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %71, ptr %72)
          to label %73 unwind label %78

73:                                               ; preds = %70
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @S, i64 24), i64 noundef 0) #7
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %80, label %77

77:                                               ; preds = %73
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.15, i32 noundef 279, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

78:                                               ; preds = %80, %70, %69, %._crit_edge51
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %134

80:                                               ; preds = %73
  %81 = call noundef i64 @_ZNKSt6vectorIN15SuffixAutomaton5stateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @S) #7
  %sext = shl i64 %81, 32
  %82 = ashr exact i64 %sext, 32
  invoke void @_ZNSt6vectorIxSaIxEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef %82)
          to label %83 unwind label %78

83:                                               ; preds = %80
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef 0) #7
  store i64 1, ptr %84, align 8, !tbaa !30
  %85 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @S, i64 24)) #7
  %86 = trunc i64 %85 to i32
  %87 = icmp sgt i32 %86, 0
  br i1 %87, label %.lr.ph57, label %.preheader

.preheader:                                       ; preds = %123, %83
  %88 = load i32, ptr @N, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %.lr.ph59, label %._crit_edge60

.lr.ph57:                                         ; preds = %83, %123
  %indvars.iv = phi i64 [ %indvars.iv.next, %123 ], [ 0, %83 ]
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @S, i64 24), i64 noundef %indvars.iv) #7
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %92) #7
  %94 = getelementptr inbounds i8, ptr %93, i64 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %95 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %94) #7
  store ptr %95, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %96 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %94) #7
  store ptr %96, ptr %10, align 8
  %97 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKciEES5_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %97, label %.lr.ph53, label %._crit_edge54

._crit_edge54:                                    ; preds = %.lr.ph53, %.lr.ph57
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  %98 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %92) #7
  %99 = getelementptr inbounds i8, ptr %98, i64 8
  %100 = load i32, ptr %99, align 8, !tbaa !12
  %.not = icmp eq i32 %100, 1000000007
  br i1 %.not, label %123, label %112

.lr.ph53:                                         ; preds = %.lr.ph57, %.lr.ph53
  %101 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef %92) #7
  %103 = load i64, ptr %102, align 8, !tbaa !30
  %104 = getelementptr inbounds i8, ptr %101, i64 4
  %105 = load i32, ptr %104, align 4, !tbaa !32
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef %106) #7
  %108 = load i64, ptr %107, align 8, !tbaa !30
  %109 = add nsw i64 %108, %103
  store i64 %109, ptr %107, align 8, !tbaa !30
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKciEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %111 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKciEES5_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %111, label %.lr.ph53, label %._crit_edge54

112:                                              ; preds = %._crit_edge54
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ways, i64 noundef %92) #7
  %114 = load i64, ptr %113, align 8, !tbaa !30
  %115 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @S, i64 noundef %92) #7
  %116 = getelementptr inbounds i8, ptr %115, i64 8
  %117 = load i32, ptr %116, align 8, !tbaa !12
  %118 = sext i32 %117 to i64
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %118) #7
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = trunc i64 %114 to i32
  %122 = add i32 %120, %121
  store i32 %122, ptr %119, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %112, %._crit_edge54
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %124 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @S, i64 24)) #7
  %sext66 = shl i64 %124, 32
  %125 = ashr exact i64 %sext66, 32
  %126 = icmp slt i64 %indvars.iv.next, %125
  br i1 %126, label %.lr.ph57, label %.preheader, !llvm.loop !34

._crit_edge60:                                    ; preds = %128, %.preheader
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  ret i32 0

.lr.ph59:                                         ; preds = %.preheader, %128
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %128 ], [ 0, %.preheader ]
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv63) #7
  invoke void @_Z2psIiJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %127)
          to label %128 unwind label %132

128:                                              ; preds = %.lr.ph59
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %129 = load i32, ptr @N, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = icmp slt i64 %indvars.iv.next64, %130
  br i1 %131, label %.lr.ph59, label %._crit_edge60, !llvm.loop !35

132:                                              ; preds = %.lr.ph59
  %133 = landingpad { ptr, i32 }
          cleanup
  br label %134

134:                                              ; preds = %132, %78, %67
  %.pn36 = phi { ptr, i32 } [ %68, %67 ], [ %133, %132 ], [ %79, %78 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  br label %135

135:                                              ; preds = %134, %51
  %.pn36.pn = phi { ptr, i32 } [ %.pn36, %134 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %136

136:                                              ; preds = %135, %46, %20
  %.pn39.pn = phi { ptr, i32 } [ %.pn39, %46 ], [ %.pn36.pn, %135 ], [ %.pn, %20 ]
  resume { ptr, i32 } %.pn39.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2reIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN15SuffixAutomaton3addEic(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i8 noundef signext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(88) ptr @_ZNSt6vectorIN15SuffixAutomaton5stateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN15SuffixAutomaton5stateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15SuffixAutomaton3dfsEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15SuffixAutomaton4dfs2Ei(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @_ZSt5beginISt6vectorIiSaIiEEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @_ZSt3endISt6vectorIiSaIiEEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKciEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2psIiJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 8}
!13 = !{!"_ZTSN15SuffixAutomaton5stateE", !6, i64 0, !6, i64 4, !6, i64 8, !14, i64 16, !24, i64 64}
!14 = !{!"_ZTSSt3mapIciSt4lessIcESaISt4pairIKciEEE", !15, i64 0}
!15 = !{!"_ZTSSt8_Rb_treeIcSt4pairIKciESt10_Select1stIS2_ESt4lessIcESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSNSt8_Rb_treeIcSt4pairIKciESt10_Select1stIS2_ESt4lessIcESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !18, i64 0}
!18 = !{!"_ZTSSt4lessIcE"}
!19 = !{!"_ZTSSt15_Rb_tree_header", !20, i64 0, !23, i64 32}
!20 = !{!"_ZTSSt18_Rb_tree_node_base", !21, i64 0, !22, i64 8, !22, i64 16, !22, i64 24}
!21 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTSSt6vectorIiSaIiEE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !22, i64 0, !22, i64 8, !22, i64 16}
!28 = !{!13, !6, i64 4}
!29 = distinct !{!29, !10}
!30 = !{!31, !31, i64 0}
!31 = !{!"long long", !7, i64 0}
!32 = !{!33, !6, i64 4}
!33 = !{!"_ZTSSt4pairIKciE", !7, i64 0, !6, i64 4}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass