; LLVM IR from MtSaka/library :: test/yosupo/string/eertree.test (main)

; 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.fastio::Printer" = type { i32, [131072 x i8], i32, i64 }
%"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] }
%struct.Eertree = type { i32, %"class.std::vector", %"class.std::vector.4" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Eertree<char>::Node, std::allocator<Eertree<char>::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Eertree<char>::Node, std::allocator<Eertree<char>::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Eertree<char>::Node, std::allocator<Eertree<char>::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Eertree<char>::Node, std::allocator<Eertree<char>::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = 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 }

@_ZN6fastio2prE = external dso_local global %"struct.fastio::Printer", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %struct.Eertree, align 8
  %6 = alloca %"class.std::vector.6", align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  invoke void @_Z4scanINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJEEvRT_DpRT0_(ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %13 unwind label %25

13:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 56, ptr %5) #6
  invoke void @_ZN7EertreeIcEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5)
          to label %14 unwind label %29

14:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  invoke void @_ZN7EertreeIcE10add_stringINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESt6vectorIiSaIiEERKT_(ptr dead_on_unwind writable sret(%"class.std::vector.6") align 8 %6, ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %15 unwind label %33

15:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %16 = invoke noundef i32 @_ZNK7EertreeIcE19distinct_palindromeEv(ptr noundef nonnull align 8 dereferenceable(56) %5)
          to label %17 unwind label %37

17:                                               ; preds = %15
  store i32 %16, ptr %7, align 4, !tbaa !5
  invoke void @_Z5printIiEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %18 unwind label %37

18:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 2, ptr %8, align 8, !tbaa !9
  br label %19

19:                                               ; preds = %55, %18
  %20 = load i64, ptr %8, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.Eertree, ptr %5, i32 0, i32 1
  %22 = call noundef i64 @_ZNKSt6vectorIN7EertreeIcE4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  %23 = icmp slt i64 %20, %22
  br i1 %23, label %41, label %24

24:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %67

25:                                               ; preds = %0
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %3, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %4, align 4
  br label %100

29:                                               ; preds = %13
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %3, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %4, align 4
  br label %99

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

37:                                               ; preds = %17, %15
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %3, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %97

41:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %42 = getelementptr inbounds %struct.Eertree, ptr %5, i32 0, i32 1
  %43 = load i64, ptr %8, align 8, !tbaa !9
  %44 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7EertreeIcE4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %43) #6
  %45 = invoke noundef i32 @_ZNK7EertreeIcE4Node3parEv(ptr noundef nonnull align 8 dereferenceable(64) %44)
          to label %46 unwind label %58

46:                                               ; preds = %41
  %47 = sub nsw i32 %45, 1
  store i32 %47, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %48 = getelementptr inbounds %struct.Eertree, ptr %5, i32 0, i32 1
  %49 = load i64, ptr %8, align 8, !tbaa !9
  %50 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7EertreeIcE4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %49) #6
  %51 = invoke noundef i32 @_ZNK7EertreeIcE4Node11suffix_linkEv(ptr noundef nonnull align 8 dereferenceable(64) %50)
          to label %52 unwind label %62

52:                                               ; preds = %46
  %53 = sub nsw i32 %51, 1
  store i32 %53, ptr %10, align 4, !tbaa !5
  invoke void @_Z5printIiJiEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %54 unwind label %62

54:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %55

55:                                               ; preds = %54
  %56 = load i64, ptr %8, align 8, !tbaa !9
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %8, align 8, !tbaa !9
  br label %19, !llvm.loop !11

58:                                               ; preds = %41
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %3, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %4, align 4
  br label %66

62:                                               ; preds = %52, %46
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %3, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %66

66:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %97

67:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %68

68:                                               ; preds = %88, %67
  %69 = load i64, ptr %11, align 8, !tbaa !9
  %70 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %71 = icmp slt i64 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %95

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %74 = load i64, ptr %11, align 8, !tbaa !9
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %74) #6
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  store i32 %77, ptr %12, align 4, !tbaa !5
  %78 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIiEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) @_ZN6fastio2prE, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %79 unwind label %91

79:                                               ; preds = %73
  %80 = load i64, ptr %11, align 8, !tbaa !9
  %81 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %82 = sub i64 %81, 1
  %83 = icmp eq i64 %80, %82
  %84 = zext i1 %83 to i64
  %85 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %84
  %86 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIcEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) %78, ptr noundef nonnull align 1 dereferenceable(1) %85)
          to label %87 unwind label %91

87:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %88

88:                                               ; preds = %87
  %89 = load i64, ptr %11, align 8, !tbaa !9
  %90 = add nsw i64 %89, 1
  store i64 %90, ptr %11, align 8, !tbaa !9
  br label %68, !llvm.loop !13

91:                                               ; preds = %79, %73
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %3, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %97

95:                                               ; preds = %72
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @_ZN7EertreeIcED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #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 %2) #6
  %96 = load i32, ptr %1, align 4
  ret i32 %96

97:                                               ; preds = %91, %66, %37
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br label %98

98:                                               ; preds = %97, %33
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @_ZN7EertreeIcED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #6
  br label %99

99:                                               ; preds = %98, %29
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #6
  br label %100

100:                                              ; preds = %99, %25
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #6
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr %3, align 8
  %103 = load i32, ptr %4, align 4
  %104 = insertvalue { ptr, i32 } poison, ptr %102, 0
  %105 = insertvalue { ptr, i32 } %104, i32 %103, 1
  resume { ptr, i32 } %105
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7EertreeIcE10add_stringINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESt6vectorIiSaIiEERKT_(ptr dead_on_unwind noalias writable sret(%"class.std::vector.6") align 8, ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIiEvRKT_(ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIiJiEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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

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

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

; 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) #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7EertreeIcED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.fastio::Printer" = type { i32, [131072 x i8], i32, i64 }
%"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] }
%struct.Eertree = type { i32, %"class.std::vector", %"class.std::vector.4" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Eertree<char>::Node, std::allocator<Eertree<char>::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Eertree<char>::Node, std::allocator<Eertree<char>::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Eertree<char>::Node, std::allocator<Eertree<char>::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Eertree<char>::Node, std::allocator<Eertree<char>::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = 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 }

@_ZN6fastio2prE = external dso_local global %"struct.fastio::Printer", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %struct.Eertree, align 8
  %3 = alloca %"class.std::vector.6", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  invoke void @_Z4scanINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJEEvRT_DpRT0_(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %8 unwind label %18

8:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %2) #6
  invoke void @_ZN7EertreeIcEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2)
          to label %9 unwind label %20

9:                                                ; preds = %8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  invoke void @_ZN7EertreeIcE10add_stringINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESt6vectorIiSaIiEERKT_(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.6") align 8 %3, ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %10 unwind label %22

10:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %11 = call noundef i32 @_ZNK7EertreeIcE19distinct_palindromeEv(ptr noundef nonnull align 8 dereferenceable(56) %2)
  store i32 %11, ptr %4, align 4, !tbaa !5
  invoke void @_Z5printIiEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %12 unwind label %24

12:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  %14 = call noundef i64 @_ZNKSt6vectorIN7EertreeIcE4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  %15 = icmp sgt i64 %14, 2
  br i1 %15, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %32, %12
  %16 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph22, label %._crit_edge

18:                                               ; preds = %0
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %58

20:                                               ; preds = %8
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %57

22:                                               ; preds = %9
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %56

24:                                               ; preds = %10
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %55

.lr.ph:                                           ; preds = %12, %32
  %.01020 = phi i64 [ %33, %32 ], [ 2, %12 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %26 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7EertreeIcE4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %.01020) #6
  %27 = call noundef i32 @_ZNK7EertreeIcE4Node3parEv(ptr noundef nonnull align 8 dereferenceable(64) %26)
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %29 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorIN7EertreeIcE4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %.01020) #6
  %30 = call noundef i32 @_ZNK7EertreeIcE4Node11suffix_linkEv(ptr noundef nonnull align 8 dereferenceable(64) %29)
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr %6, align 4, !tbaa !5
  invoke void @_Z5printIiJiEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %32 unwind label %36

32:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %33 = add nuw nsw i64 %.01020, 1
  %34 = call noundef i64 @_ZNKSt6vectorIN7EertreeIcE4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %.lr.ph, label %.preheader, !llvm.loop !9

36:                                               ; preds = %.lr.ph
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %55

._crit_edge:                                      ; preds = %49, %.preheader
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @_ZN7EertreeIcED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  ret i32 0

.lr.ph22:                                         ; preds = %.preheader, %49
  %.021 = phi i64 [ %50, %49 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.021) #6
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %7, align 4, !tbaa !5
  %41 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIiEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) @_ZN6fastio2prE, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %42 unwind label %53

42:                                               ; preds = %.lr.ph22
  %43 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %44 = add i64 %43, -1
  %45 = icmp eq i64 %.021, %44
  %46 = zext i1 %45 to i64
  %47 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %46
  %48 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIcEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) %41, ptr noundef nonnull align 1 dereferenceable(1) %47)
          to label %49 unwind label %53

49:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %50 = add nuw nsw i64 %.021, 1
  %51 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %.lr.ph22, label %._crit_edge, !llvm.loop !11

53:                                               ; preds = %42, %.lr.ph22
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %55

55:                                               ; preds = %53, %36, %24
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %54, %53 ], [ %25, %24 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %56

56:                                               ; preds = %55, %22
  %.pn.pn = phi { ptr, i32 } [ %.pn, %55 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @_ZN7EertreeIcED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #6
  br label %57

57:                                               ; preds = %56, %20
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %56 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #6
  br label %58

58:                                               ; preds = %57, %18
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %57 ], [ %19, %18 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn.pn.pn
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7EertreeIcE10add_stringINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESt6vectorIiSaIiEERKT_(ptr dead_on_unwind noalias writable sret(%"class.std::vector.6") align 8, ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7EertreeIcE19distinct_palindromeEv(ptr noundef nonnull align 8 dereferenceable(56)) 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) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIiJiEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

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

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

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

; 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 #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7EertreeIcED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5 align 2

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass