; LLVM IR from xtaci/algorithms :: src/suffix_tree_demo.ll (ZN10SuffixTree9constructEv)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { 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.SuffixTree = type { %"class.std::__cxx11::basic_string", %"struct.SuffixTree::Node", %"class.SuffixTree::ActivePoint", i32, i32, i32, %"class.SuffixTree::LinkState" }
%"struct.SuffixTree::Node" = type { ptr, %"class.std::map", %"class.std::map.3", %"class.std::map.9", ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_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 }
%"class.std::map.3" = type { %"class.std::_Rb_tree.4" }
%"class.std::_Rb_tree.4" = type { %"struct.std::_Rb_tree<SuffixTree::Edge *, std::pair<SuffixTree::Edge *const, bool>, std::_Select1st<std::pair<SuffixTree::Edge *const, bool>>, std::less<SuffixTree::Edge *>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<SuffixTree::Edge *, std::pair<SuffixTree::Edge *const, bool>, std::_Select1st<std::pair<SuffixTree::Edge *const, bool>>, std::less<SuffixTree::Edge *>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::map.9" = type { %"class.std::_Rb_tree.10" }
%"class.std::_Rb_tree.10" = type { %"struct.std::_Rb_tree<char, std::pair<const char, SuffixTree::Edge *>, std::_Select1st<std::pair<const char, SuffixTree::Edge *>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, SuffixTree::Edge *>, std::_Select1st<std::pair<const char, SuffixTree::Edge *>>, std::less<char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.SuffixTree::ActivePoint" = type { ptr, i8, i32 }
%"class.SuffixTree::LinkState" = type { i8, ptr, ptr }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [8 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: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

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

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

; 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 noundef i32 @_ZN10SuffixTree9constructEv(ptr noundef nonnull align 8 dereferenceable(248) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #6
  %16 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 0
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str)
  %17 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 0
  %18 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  br label %19

19:                                               ; preds = %150, %1
  %20 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 4
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = zext i32 %21 to i64
  %23 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 0
  %24 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %23) #6
  %25 = icmp ult i64 %22, %24
  br i1 %25, label %26, label %154

26:                                               ; preds = %19
  %27 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 6
  call void @_ZN10SuffixTree9LinkState5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %28 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 3
  %29 = load i32, ptr %28, align 8, !tbaa !37
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %28, align 8, !tbaa !37
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %32 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 0
  %33 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 4
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = zext i32 %34 to i64
  %36 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %32, i64 noundef %35)
  %37 = load i8, ptr %36, align 1, !tbaa !38
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %31, i8 noundef signext %37)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %40

40:                                               ; preds = %148, %146, %26
  %41 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 3
  %42 = load i32, ptr %41, align 8, !tbaa !37
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %150

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %45 = call noundef i32 @_ZN10SuffixTree17get_active_lengthEv(ptr noundef nonnull align 8 dereferenceable(248) %15)
  store i32 %45, ptr %4, align 4, !tbaa !39
  %46 = load i32, ptr %4, align 4, !tbaa !39
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %52

48:                                               ; preds = %44
  %49 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 4
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 5
  store i32 %50, ptr %51, align 8, !tbaa !40
  br label %52

52:                                               ; preds = %48, %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %53 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 2
  %54 = getelementptr inbounds %"class.SuffixTree::ActivePoint", ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !41
  store ptr %55, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  %56 = call noundef signext i8 @_ZN10SuffixTree15get_active_edgeEv(ptr noundef nonnull align 8 dereferenceable(248) %15)
  store i8 %56, ptr %6, align 1, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load i8, ptr %6, align 1, !tbaa !38
  %59 = call noundef ptr @_ZN10SuffixTree4Node9find_edgeEc(ptr noundef nonnull align 8 dereferenceable(160) %57, i8 noundef signext %58)
  store ptr %59, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %77

62:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %63 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #7
  %64 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 4
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = call noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() #6
  %67 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 0
  invoke void @_ZN10SuffixTree4EdgeC2EjjRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(24) %63, i32 noundef %65, i32 noundef %66, ptr noundef nonnull align 8 dereferenceable(32) %67)
          to label %68 unwind label %73

68:                                               ; preds = %62
  store ptr %63, ptr %8, align 8, !tbaa !5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN10SuffixTree4Node8add_edgeEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(160) %69, ptr noundef %70)
  %71 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 6
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN10SuffixTree9LinkState8ins_linkEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(24) %71, ptr noundef %72)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %115

73:                                               ; preds = %62
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %9, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %63, i64 noundef 24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %149

77:                                               ; preds = %52
  %78 = call noundef zeroext i1 @_ZN10SuffixTree17check_active_nodeEv(ptr noundef nonnull align 8 dereferenceable(248) %15)
  br i1 %78, label %79, label %80

79:                                               ; preds = %77
  store i32 4, ptr %11, align 4
  br label %146, !llvm.loop !42

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = call noundef i32 @_ZN10SuffixTree17get_active_lengthEv(ptr noundef nonnull align 8 dereferenceable(248) %15)
  %83 = call noundef signext i8 @_ZN10SuffixTree4EdgeixEj(ptr noundef nonnull align 8 dereferenceable(24) %81, i32 noundef %82)
  store i8 %83, ptr %12, align 1, !tbaa !38
  %84 = load i8, ptr %12, align 1, !tbaa !38
  %85 = sext i8 %84 to i32
  %86 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 4
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = call noundef signext i8 @_ZN10SuffixTree7get_eleEi(ptr noundef nonnull align 8 dereferenceable(248) %15, i32 noundef %87)
  %89 = sext i8 %88 to i32
  %90 = icmp eq i32 %85, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %80
  call void @_ZN10SuffixTree14inc_active_lenEv(ptr noundef nonnull align 8 dereferenceable(248) %15)
  %92 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 6
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN10SuffixTree9LinkState8ins_linkEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef %93)
  store i32 5, ptr %11, align 4
  br label %108

94:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = call noundef ptr @_ZN10SuffixTree13separate_edgeEPNS_4NodeEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(248) %15, ptr noundef %95, ptr noundef %96)
  store ptr %97, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %98 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #7
  %99 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 4
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = call noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() #6
  %102 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 0
  invoke void @_ZN10SuffixTree4EdgeC2EjjRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(24) %98, i32 noundef %100, i32 noundef %101, ptr noundef nonnull align 8 dereferenceable(32) %102)
          to label %103 unwind label %111

103:                                              ; preds = %94
  store ptr %98, ptr %14, align 8, !tbaa !5
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN10SuffixTree4Node8add_edgeEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(160) %104, ptr noundef %105)
  %106 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 6
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN10SuffixTree9LinkState8ins_linkEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(24) %106, ptr noundef %107)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  store i32 0, ptr %11, align 4
  br label %108

108:                                              ; preds = %103, %91
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  %109 = load i32, ptr %11, align 4
  switch i32 %109, label %146 [
    i32 0, label %110
  ]

110:                                              ; preds = %108
  br label %115

111:                                              ; preds = %94
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %9, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %98, i64 noundef 24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  br label %149

115:                                              ; preds = %110, %68
  %116 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 3
  %117 = load i32, ptr %116, align 8, !tbaa !37
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr %116, align 8, !tbaa !37
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 1
  %121 = icmp eq ptr %119, %120
  br i1 %121, label %122, label %133

122:                                              ; preds = %115
  %123 = call noundef i32 @_ZN10SuffixTree17get_active_lengthEv(ptr noundef nonnull align 8 dereferenceable(248) %15)
  %124 = icmp sgt i32 %123, 0
  br i1 %124, label %125, label %133

125:                                              ; preds = %122
  call void @_ZN10SuffixTree14dec_active_lenEv(ptr noundef nonnull align 8 dereferenceable(248) %15)
  %126 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 4
  %127 = load i32, ptr %126, align 4, !tbaa !9
  %128 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 3
  %129 = load i32, ptr %128, align 8, !tbaa !37
  %130 = sub i32 %127, %129
  %131 = add i32 %130, 1
  %132 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 5
  store i32 %131, ptr %132, align 8, !tbaa !40
  br label %145

133:                                              ; preds = %122, %115
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %"struct.SuffixTree::Node", ptr %134, i32 0, i32 4
  %136 = load ptr, ptr %135, align 8, !tbaa !44
  %137 = icmp ne ptr %136, null
  br i1 %137, label %138, label %142

138:                                              ; preds = %133
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %"struct.SuffixTree::Node", ptr %139, i32 0, i32 4
  %141 = load ptr, ptr %140, align 8, !tbaa !44
  call void @_ZN10SuffixTree15set_active_nodeEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(248) %15, ptr noundef %141)
  br label %144

142:                                              ; preds = %133
  %143 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 1
  call void @_ZN10SuffixTree15set_active_nodeEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(248) %15, ptr noundef %143)
  br label %144

144:                                              ; preds = %142, %138
  br label %145

145:                                              ; preds = %144, %125
  store i32 0, ptr %11, align 4
  br label %146

146:                                              ; preds = %145, %108, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %147 = load i32, ptr %11, align 4
  switch i32 %147, label %160 [
    i32 0, label %148
    i32 4, label %40
    i32 5, label %150
  ]

148:                                              ; preds = %146
  br label %40, !llvm.loop !42

149:                                              ; preds = %111, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %155

150:                                              ; preds = %146, %40
  %151 = getelementptr inbounds %class.SuffixTree, ptr %15, i32 0, i32 4
  %152 = load i32, ptr %151, align 4, !tbaa !9
  %153 = add i32 %152, 1
  store i32 %153, ptr %151, align 4, !tbaa !9
  br label %19, !llvm.loop !45

154:                                              ; preds = %19
  ret i32 0

155:                                              ; preds = %149
  %156 = load ptr, ptr %9, align 8
  %157 = load i32, ptr %10, align 4
  %158 = insertvalue { ptr, i32 } poison, ptr %156, 0
  %159 = insertvalue { ptr, i32 } %158, i32 %157, 1
  resume { ptr, i32 } %159

160:                                              ; preds = %146
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #3

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

; 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 dso_local void @_ZN10SuffixTree9LinkState5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN10SuffixTree15get_active_edgeEv(ptr noundef nonnull align 8 dereferenceable(248)) #2 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() #1 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #5

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10SuffixTree13separate_edgeEPNS_4NodeEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SuffixTree15set_active_nodeEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef) #2 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 = { 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 #4 = { nobuiltin allocsize(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 = { nobuiltin 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !34, i64 212}
!10 = !{!"_ZTS10SuffixTree", !11, i64 0, !14, i64 32, !33, i64 192, !34, i64 208, !34, i64 212, !34, i64 216, !35, i64 224}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !13, i64 8, !7, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN10SuffixTree4NodeE", !6, i64 0, !15, i64 8, !23, i64 56, !28, i64 104, !6, i64 152}
!15 = !{!"_ZTSSt3mapIiiSt4lessIiESaISt4pairIKiiEEE", !16, i64 0}
!16 = !{!"_ZTSSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !18, i64 0, !20, i64 8}
!18 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !19, i64 0}
!19 = !{!"_ZTSSt4lessIiE"}
!20 = !{!"_ZTSSt15_Rb_tree_header", !21, i64 0, !13, i64 32}
!21 = !{!"_ZTSSt18_Rb_tree_node_base", !22, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!23 = !{!"_ZTSSt3mapIPN10SuffixTree4EdgeEbSt4lessIS2_ESaISt4pairIKS2_bEEE", !24, i64 0}
!24 = !{!"_ZTSSt8_Rb_treeIPN10SuffixTree4EdgeESt4pairIKS2_bESt10_Select1stIS5_ESt4lessIS2_ESaIS5_EE", !25, i64 0}
!25 = !{!"_ZTSNSt8_Rb_treeIPN10SuffixTree4EdgeESt4pairIKS2_bESt10_Select1stIS5_ESt4lessIS2_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !26, i64 0, !20, i64 8}
!26 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIPN10SuffixTree4EdgeEEE", !27, i64 0}
!27 = !{!"_ZTSSt4lessIPN10SuffixTree4EdgeEE"}
!28 = !{!"_ZTSSt3mapIcPN10SuffixTree4EdgeESt4lessIcESaISt4pairIKcS2_EEE", !29, i64 0}
!29 = !{!"_ZTSSt8_Rb_treeIcSt4pairIKcPN10SuffixTree4EdgeEESt10_Select1stIS5_ESt4lessIcESaIS5_EE", !30, i64 0}
!30 = !{!"_ZTSNSt8_Rb_treeIcSt4pairIKcPN10SuffixTree4EdgeEESt10_Select1stIS5_ESt4lessIcESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !31, i64 0, !20, i64 8}
!31 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !32, i64 0}
!32 = !{!"_ZTSSt4lessIcE"}
!33 = !{!"_ZTSN10SuffixTree11ActivePointE", !6, i64 0, !7, i64 8, !34, i64 12}
!34 = !{!"int", !7, i64 0}
!35 = !{!"_ZTSN10SuffixTree9LinkStateE", !36, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!"bool", !7, i64 0}
!37 = !{!10, !34, i64 208}
!38 = !{!7, !7, i64 0}
!39 = !{!34, !34, i64 0}
!40 = !{!10, !34, i64 216}
!41 = !{!10, !6, i64 192}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = !{!14, !6, i64 152}
!45 = distinct !{!45, !43}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { 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] }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [8 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 nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

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

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

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

; 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 noundef i32 @_ZN10SuffixTree9constructEv(ptr noundef nonnull align 8 dereferenceable(248) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %2, ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str)
  %3 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  %4 = getelementptr inbounds i8, ptr %0, i64 212
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = zext i32 %5 to i64
  %7 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %8 = icmp ugt i64 %7, %6
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 224
  %10 = getelementptr inbounds i8, ptr %0, i64 208
  %11 = getelementptr inbounds i8, ptr %0, i64 216
  %12 = getelementptr inbounds i8, ptr %0, i64 192
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  br label %14

14:                                               ; preds = %.lr.ph, %.loopexit
  call void @_ZN10SuffixTree9LinkState5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %15 = load i32, ptr %10, align 8, !tbaa !36
  %16 = add nsw i32 %15, 1
  store i32 %16, ptr %10, align 8, !tbaa !36
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = zext i32 %18 to i64
  %20 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %19)
  %21 = load i8, ptr %20, align 1, !tbaa !37
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %17, i8 noundef signext %21)
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %.old = load i32, ptr %10, align 8, !tbaa !36
  %.not.old = icmp eq i32 %.old, 0
  br i1 %.not.old, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %14, %69
  %24 = call noundef i32 @_ZN10SuffixTree17get_active_lengthEv(ptr noundef nonnull align 8 dereferenceable(248) %0)
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %.preheader
  %27 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %27, ptr %11, align 8, !tbaa !38
  br label %28

28:                                               ; preds = %26, %.preheader
  %29 = load ptr, ptr %12, align 8, !tbaa !39
  %30 = call noundef signext i8 @_ZN10SuffixTree15get_active_edgeEv(ptr noundef nonnull align 8 dereferenceable(248) %0)
  %31 = call noundef ptr @_ZN10SuffixTree4Node9find_edgeEc(ptr noundef nonnull align 8 dereferenceable(160) %29, i8 noundef signext %30)
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %40

33:                                               ; preds = %28
  %34 = call noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #7
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = call noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() #6
  invoke void @_ZN10SuffixTree4EdgeC2EjjRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(24) %34, i32 noundef %35, i32 noundef %36, ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %37 unwind label %38

37:                                               ; preds = %33
  call void @_ZN10SuffixTree4Node8add_edgeEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(160) %29, ptr noundef nonnull %34)
  br label %55

38:                                               ; preds = %33
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %71

40:                                               ; preds = %28
  %41 = call noundef zeroext i1 @_ZN10SuffixTree17check_active_nodeEv(ptr noundef nonnull align 8 dereferenceable(248) %0)
  br i1 %41, label %thread-pre-split, label %42, !llvm.loop !40

42:                                               ; preds = %40
  %43 = call noundef i32 @_ZN10SuffixTree17get_active_lengthEv(ptr noundef nonnull align 8 dereferenceable(248) %0)
  %44 = call noundef signext i8 @_ZN10SuffixTree4EdgeixEj(ptr noundef nonnull align 8 dereferenceable(24) %31, i32 noundef %43)
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = call noundef signext i8 @_ZN10SuffixTree7get_eleEi(ptr noundef nonnull align 8 dereferenceable(248) %0, i32 noundef %45)
  %.not26 = icmp eq i8 %44, %46
  br i1 %.not26, label %.thread30, label %47

.thread30:                                        ; preds = %42
  call void @_ZN10SuffixTree14inc_active_lenEv(ptr noundef nonnull align 8 dereferenceable(248) %0)
  call void @_ZN10SuffixTree9LinkState8ins_linkEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull %29)
  br label %.loopexit

47:                                               ; preds = %42
  %48 = call noundef ptr @_ZN10SuffixTree13separate_edgeEPNS_4NodeEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef nonnull %29, ptr noundef nonnull %31)
  %49 = call noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #7
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = call noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() #6
  invoke void @_ZN10SuffixTree4EdgeC2EjjRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(24) %49, i32 noundef %50, i32 noundef %51, ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %52 unwind label %53

52:                                               ; preds = %47
  call void @_ZN10SuffixTree4Node8add_edgeEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(160) %48, ptr noundef nonnull %49)
  br label %55

53:                                               ; preds = %47
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %71

55:                                               ; preds = %52, %37
  %.sink = phi ptr [ %48, %52 ], [ %29, %37 ]
  call void @_ZN10SuffixTree9LinkState8ins_linkEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull %.sink)
  %56 = load i32, ptr %10, align 8, !tbaa !36
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %10, align 8, !tbaa !36
  %58 = icmp eq ptr %29, %13
  br i1 %58, label %59, label %thread-pre-split.sink.split

59:                                               ; preds = %55
  %60 = call noundef i32 @_ZN10SuffixTree17get_active_lengthEv(ptr noundef nonnull align 8 dereferenceable(248) %0)
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %62, label %thread-pre-split.sink.split

62:                                               ; preds = %59
  call void @_ZN10SuffixTree14dec_active_lenEv(ptr noundef nonnull align 8 dereferenceable(248) %0)
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = load i32, ptr %10, align 8
  %65 = add i32 %63, 1
  %66 = sub i32 %65, %64
  store i32 %66, ptr %11, align 8, !tbaa !38
  br label %69

thread-pre-split.sink.split:                      ; preds = %59, %55
  %67 = getelementptr inbounds i8, ptr %29, i64 152
  %68 = load ptr, ptr %67, align 8, !tbaa !42
  %.not28 = icmp eq ptr %68, null
  %. = select i1 %.not28, ptr %13, ptr %68
  call void @_ZN10SuffixTree15set_active_nodeEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef nonnull %.)
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %thread-pre-split.sink.split, %40
  %.pr = load i32, ptr %10, align 8
  br label %69

69:                                               ; preds = %thread-pre-split, %62
  %70 = phi i32 [ %.pr, %thread-pre-split ], [ %64, %62 ]
  %.not = icmp eq i32 %70, 0
  br i1 %.not, label %.loopexit, label %.preheader

71:                                               ; preds = %53, %38
  %.lcssa.sink = phi ptr [ %49, %53 ], [ %34, %38 ]
  %.pn = phi { ptr, i32 } [ %54, %53 ], [ %39, %38 ]
  call void @_ZdlPvm(ptr noundef nonnull %.lcssa.sink, i64 noundef 24) #8
  resume { ptr, i32 } %.pn

.loopexit:                                        ; preds = %69, %.thread30, %14
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = add i32 %72, 1
  store i32 %73, ptr %4, align 4, !tbaa !5
  %74 = zext i32 %73 to i64
  %75 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %76 = icmp ugt i64 %75, %74
  br i1 %76, label %14, label %._crit_edge, !llvm.loop !43

._crit_edge:                                      ; preds = %.loopexit, %1
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #3

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

; 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 dso_local void @_ZN10SuffixTree9LinkState5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN10SuffixTree15get_active_edgeEv(ptr noundef nonnull align 8 dereferenceable(248)) local_unnamed_addr #2 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() local_unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #5

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10SuffixTree13separate_edgeEPNS_4NodeEPNS_4EdgeE(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SuffixTree15set_active_nodeEPNS_4NodeE(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef) local_unnamed_addr #2 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 = { 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 #4 = { nobuiltin allocsize(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 = { nobuiltin 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !33, i64 212}
!6 = !{!"_ZTS10SuffixTree", !7, i64 0, !13, i64 32, !32, i64 192, !33, i64 208, !33, i64 212, !33, i64 216, !34, i64 224}
!7 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !8, i64 0, !12, i64 8, !10, i64 16}
!8 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"long", !10, i64 0}
!13 = !{!"_ZTSN10SuffixTree4NodeE", !9, i64 0, !14, i64 8, !22, i64 56, !27, i64 104, !9, i64 152}
!14 = !{!"_ZTSSt3mapIiiSt4lessIiESaISt4pairIKiiEEE", !15, i64 0}
!15 = !{!"_ZTSSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSNSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !18, i64 0}
!18 = !{!"_ZTSSt4lessIiE"}
!19 = !{!"_ZTSSt15_Rb_tree_header", !20, i64 0, !12, i64 32}
!20 = !{!"_ZTSSt18_Rb_tree_node_base", !21, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!21 = !{!"_ZTSSt14_Rb_tree_color", !10, i64 0}
!22 = !{!"_ZTSSt3mapIPN10SuffixTree4EdgeEbSt4lessIS2_ESaISt4pairIKS2_bEEE", !23, i64 0}
!23 = !{!"_ZTSSt8_Rb_treeIPN10SuffixTree4EdgeESt4pairIKS2_bESt10_Select1stIS5_ESt4lessIS2_ESaIS5_EE", !24, i64 0}
!24 = !{!"_ZTSNSt8_Rb_treeIPN10SuffixTree4EdgeESt4pairIKS2_bESt10_Select1stIS5_ESt4lessIS2_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !25, i64 0, !19, i64 8}
!25 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIPN10SuffixTree4EdgeEEE", !26, i64 0}
!26 = !{!"_ZTSSt4lessIPN10SuffixTree4EdgeEE"}
!27 = !{!"_ZTSSt3mapIcPN10SuffixTree4EdgeESt4lessIcESaISt4pairIKcS2_EEE", !28, i64 0}
!28 = !{!"_ZTSSt8_Rb_treeIcSt4pairIKcPN10SuffixTree4EdgeEESt10_Select1stIS5_ESt4lessIcESaIS5_EE", !29, i64 0}
!29 = !{!"_ZTSNSt8_Rb_treeIcSt4pairIKcPN10SuffixTree4EdgeEESt10_Select1stIS5_ESt4lessIcESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !30, i64 0, !19, i64 8}
!30 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIcEE", !31, i64 0}
!31 = !{!"_ZTSSt4lessIcE"}
!32 = !{!"_ZTSN10SuffixTree11ActivePointE", !9, i64 0, !10, i64 8, !33, i64 12}
!33 = !{!"int", !10, i64 0}
!34 = !{!"_ZTSN10SuffixTree9LinkStateE", !35, i64 0, !9, i64 8, !9, i64 16}
!35 = !{!"bool", !10, i64 0}
!36 = !{!6, !33, i64 208}
!37 = !{!10, !10, i64 0}
!38 = !{!6, !33, i64 216}
!39 = !{!6, !9, i64 192}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!13, !9, i64 152}
!43 = distinct !{!43, !41}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass