; LLVM IR from ShahjalalShohag/code-library :: Strings (Number of Palindromes in Range)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%struct.wavelet_tree = type { i32, i32, ptr, ptr, ptr, ptr, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"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] }

@d1 = external dso_local global %"class.std::vector", align 8
@d2 = external dso_local global %"class.std::vector", align 8
@oddl = external dso_local global %struct.wavelet_tree, align 8
@oddr = external dso_local global %struct.wavelet_tree, align 8
@evenl = external dso_local global %struct.wavelet_tree, align 8
@evenr = external dso_local global %struct.wavelet_tree, align 8
@a = external dso_local global [100009 x i32], align 16
@b = external dso_local global [100009 x i32], align 16
@c = external dso_local global [100009 x i32], align 16
@d = external dso_local global [100009 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

; 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 noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

declare i32 @__gxx_personality_v0(...)

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

; 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 i32 @_Z3oddii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4evenii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z2scv() #0

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

14:                                               ; preds = %0
  %15 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr %5, align 4, !tbaa !5
  invoke void @_Z9manachersRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %17 unwind label %36

17:                                               ; preds = %14
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %33, %17
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %22, label %40

22:                                               ; preds = %18
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sub nsw i32 %23, 1
  %25 = sext i32 %24 to i64
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d1, i64 noundef %25) #6
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sub nsw i32 %27, %28
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100009 x i32], ptr @a, i64 0, i64 %31
  store i32 %29, ptr %32, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %22
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !9

36:                                               ; preds = %136, %132, %128, %126, %124, %117, %112, %88, %64, %40, %14, %0
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %11, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %144

40:                                               ; preds = %18
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr @a, i64 %42
  %44 = getelementptr inbounds i32, ptr %43, i64 1
  invoke void @_ZN12wavelet_tree4initEPiS0_ii(ptr noundef nonnull align 8 dereferenceable(48) @oddl, ptr noundef getelementptr inbounds (i32, ptr @a, i64 1), ptr noundef %44, i32 noundef -5100, i32 noundef 5100)
          to label %45 unwind label %36

45:                                               ; preds = %40
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %61, %45
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = icmp sle i32 %47, %48
  br i1 %49, label %50, label %64

50:                                               ; preds = %46
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sub nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d1, i64 noundef %53) #6
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = add nsw i32 %55, %56
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100009 x i32], ptr @b, i64 0, i64 %59
  store i32 %57, ptr %60, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %50
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  br label %46, !llvm.loop !11

64:                                               ; preds = %46
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr @b, i64 %66
  %68 = getelementptr inbounds i32, ptr %67, i64 1
  invoke void @_ZN12wavelet_tree4initEPiS0_ii(ptr noundef nonnull align 8 dereferenceable(48) @oddr, ptr noundef getelementptr inbounds (i32, ptr @b, i64 1), ptr noundef %68, i32 noundef -5100, i32 noundef 5100)
          to label %69 unwind label %36

69:                                               ; preds = %64
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %85, %69
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = icmp sle i32 %71, %72
  br i1 %73, label %74, label %88

74:                                               ; preds = %70
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d2, i64 noundef %77) #6
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = sub nsw i32 %79, %80
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100009 x i32], ptr @c, i64 0, i64 %83
  store i32 %81, ptr %84, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %74
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %2, align 4, !tbaa !5
  br label %70, !llvm.loop !12

88:                                               ; preds = %70
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr @c, i64 %90
  %92 = getelementptr inbounds i32, ptr %91, i64 1
  invoke void @_ZN12wavelet_tree4initEPiS0_ii(ptr noundef nonnull align 8 dereferenceable(48) @evenl, ptr noundef getelementptr inbounds (i32, ptr @c, i64 1), ptr noundef %92, i32 noundef -5100, i32 noundef 5100)
          to label %93 unwind label %36

93:                                               ; preds = %88
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %109, %93
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = icmp sle i32 %95, %96
  br i1 %97, label %98, label %112

98:                                               ; preds = %94
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d2, i64 noundef %101) #6
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = load i32, ptr %2, align 4, !tbaa !5
  %105 = add nsw i32 %103, %104
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100009 x i32], ptr @d, i64 0, i64 %107
  store i32 %105, ptr %108, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %98
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %2, align 4, !tbaa !5
  br label %94, !llvm.loop !13

112:                                              ; preds = %94
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr @d, i64 %114
  %116 = getelementptr inbounds i32, ptr %115, i64 1
  invoke void @_ZN12wavelet_tree4initEPiS0_ii(ptr noundef nonnull align 8 dereferenceable(48) @evenr, ptr noundef getelementptr inbounds (i32, ptr @d, i64 1), ptr noundef %116, i32 noundef -5100, i32 noundef 5100)
          to label %117 unwind label %36

117:                                              ; preds = %112
  %118 = invoke noundef i32 @_Z2scv()
          to label %119 unwind label %36

119:                                              ; preds = %117
  store i32 %118, ptr %7, align 4, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %139, %119
  %121 = load i32, ptr %2, align 4, !tbaa !5
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %124, label %142

124:                                              ; preds = %120
  %125 = invoke noundef i32 @_Z2scv()
          to label %126 unwind label %36

126:                                              ; preds = %124
  store i32 %125, ptr %8, align 4, !tbaa !5
  %127 = invoke noundef i32 @_Z2scv()
          to label %128 unwind label %36

128:                                              ; preds = %126
  store i32 %127, ptr %9, align 4, !tbaa !5
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = invoke noundef i32 @_Z3oddii(i32 noundef %129, i32 noundef %130)
          to label %132 unwind label %36

132:                                              ; preds = %128
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = invoke noundef i32 @_Z4evenii(i32 noundef %133, i32 noundef %134)
          to label %136 unwind label %36

136:                                              ; preds = %132
  %137 = add nsw i32 %131, %135
  invoke void @_Z3outi(i32 noundef %137)
          to label %138 unwind label %36

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %2, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %2, align 4, !tbaa !5
  br label %120, !llvm.loop !14

142:                                              ; preds = %120
  store i32 0, ptr %1, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %143 = load i32, ptr %1, align 4
  ret i32 %143

144:                                              ; preds = %36
  %145 = load ptr, ptr %11, align 8
  %146 = load i32, ptr %12, align 4
  %147 = insertvalue { ptr, i32 } poison, ptr %145, 0
  %148 = insertvalue { ptr, i32 } %147, i32 %146, 1
  resume { ptr, i32 } %148
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3outi(i32 noundef) #5

; 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 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 = { 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 = { "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 = { nounwind }

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%struct.wavelet_tree = type { i32, i32, ptr, ptr, ptr, ptr, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"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] }

@d1 = external dso_local global %"class.std::vector", align 8
@d2 = external dso_local global %"class.std::vector", align 8
@oddl = external dso_local global %struct.wavelet_tree, align 8
@oddr = external dso_local global %struct.wavelet_tree, align 8
@evenl = external dso_local global %struct.wavelet_tree, align 8
@evenr = external dso_local global %struct.wavelet_tree, align 8
@a = external dso_local global [100009 x i32], align 16
@b = external dso_local global [100009 x i32], align 16
@c = external dso_local global [100009 x i32], align 16
@d = external dso_local global [100009 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

; 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 noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

; 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 i32 @_Z3oddii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z2scv() local_unnamed_addr #0

; 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
  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
  %2 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %3 unwind label %.loopexit.split-lp

3:                                                ; preds = %0
  %4 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  invoke void @_Z9manachersRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %.preheader44 unwind label %.loopexit.split-lp

.preheader44:                                     ; preds = %3
  %5 = trunc i64 %4 to i32
  %.not45 = icmp slt i32 %5, 1
  br i1 %.not45, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader44
  %6 = add nuw nsw i64 %4, 1
  %wide.trip.count = and i64 %6, 4294967295
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %7 = add nsw i64 %indvars.iv, -1
  %8 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d1, i64 noundef %7) #6
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = trunc nuw nsw i64 %indvars.iv to i32
  %11 = sub nsw i32 %9, %10
  %12 = getelementptr inbounds [100009 x i32], ptr @a, i64 0, i64 %indvars.iv
  store i32 %11, ptr %12, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

.loopexit:                                        ; preds = %.lr.ph60, %48, %50, %52, %54
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %13

.loopexit.split-lp:                               ; preds = %0, %3, %._crit_edge, %._crit_edge50, %._crit_edge54, %._crit_edge58, %44
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %13

13:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  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 } %lpad.phi

._crit_edge:                                      ; preds = %.lr.ph, %.preheader44
  %sext = shl i64 %4, 32
  %14 = ashr exact i64 %sext, 32
  %15 = getelementptr inbounds i32, ptr @a, i64 %14
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  invoke void @_ZN12wavelet_tree4initEPiS0_ii(ptr noundef nonnull align 8 dereferenceable(48) @oddl, ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 4), ptr noundef nonnull %16, i32 noundef -5100, i32 noundef 5100)
          to label %.preheader43 unwind label %.loopexit.split-lp

.preheader43:                                     ; preds = %._crit_edge
  br i1 %.not45, label %._crit_edge50, label %.lr.ph49.preheader

.lr.ph49.preheader:                               ; preds = %.preheader43
  %17 = add nuw nsw i64 %4, 1
  %wide.trip.count66 = and i64 %17, 4294967295
  br label %.lr.ph49

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %.lr.ph49
  %indvars.iv63 = phi i64 [ 1, %.lr.ph49.preheader ], [ %indvars.iv.next64, %.lr.ph49 ]
  %18 = add nsw i64 %indvars.iv63, -1
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d1, i64 noundef %18) #6
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = trunc nuw nsw i64 %indvars.iv63 to i32
  %22 = add nsw i32 %20, %21
  %23 = getelementptr inbounds [100009 x i32], ptr @b, i64 0, i64 %indvars.iv63
  store i32 %22, ptr %23, align 4, !tbaa !5
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count66
  br i1 %exitcond67.not, label %._crit_edge50, label %.lr.ph49, !llvm.loop !11

._crit_edge50:                                    ; preds = %.lr.ph49, %.preheader43
  %24 = getelementptr inbounds i32, ptr @b, i64 %14
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  invoke void @_ZN12wavelet_tree4initEPiS0_ii(ptr noundef nonnull align 8 dereferenceable(48) @oddr, ptr noundef nonnull getelementptr inbounds (i8, ptr @b, i64 4), ptr noundef nonnull %25, i32 noundef -5100, i32 noundef 5100)
          to label %.preheader42 unwind label %.loopexit.split-lp

.preheader42:                                     ; preds = %._crit_edge50
  br i1 %.not45, label %._crit_edge54, label %.lr.ph53.preheader

.lr.ph53.preheader:                               ; preds = %.preheader42
  %26 = add nuw nsw i64 %4, 1
  %wide.trip.count71 = and i64 %26, 4294967295
  br label %.lr.ph53

.lr.ph53:                                         ; preds = %.lr.ph53.preheader, %.lr.ph53
  %indvars.iv68 = phi i64 [ 1, %.lr.ph53.preheader ], [ %indvars.iv.next69, %.lr.ph53 ]
  %27 = add nsw i64 %indvars.iv68, -1
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d2, i64 noundef %27) #6
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = trunc nuw nsw i64 %indvars.iv68 to i32
  %31 = sub nsw i32 %29, %30
  %32 = getelementptr inbounds [100009 x i32], ptr @c, i64 0, i64 %indvars.iv68
  store i32 %31, ptr %32, align 4, !tbaa !5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count71
  br i1 %exitcond72.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !12

._crit_edge54:                                    ; preds = %.lr.ph53, %.preheader42
  %33 = getelementptr inbounds i32, ptr @c, i64 %14
  %34 = getelementptr inbounds i8, ptr %33, i64 4
  invoke void @_ZN12wavelet_tree4initEPiS0_ii(ptr noundef nonnull align 8 dereferenceable(48) @evenl, ptr noundef nonnull getelementptr inbounds (i8, ptr @c, i64 4), ptr noundef nonnull %34, i32 noundef -5100, i32 noundef 5100)
          to label %.preheader41 unwind label %.loopexit.split-lp

.preheader41:                                     ; preds = %._crit_edge54
  br i1 %.not45, label %._crit_edge58, label %.lr.ph57.preheader

.lr.ph57.preheader:                               ; preds = %.preheader41
  %35 = add nuw nsw i64 %4, 1
  %wide.trip.count76 = and i64 %35, 4294967295
  br label %.lr.ph57

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %.lr.ph57
  %indvars.iv73 = phi i64 [ 1, %.lr.ph57.preheader ], [ %indvars.iv.next74, %.lr.ph57 ]
  %36 = add nsw i64 %indvars.iv73, -1
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d2, i64 noundef %36) #6
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = trunc nuw nsw i64 %indvars.iv73 to i32
  %40 = add nsw i32 %38, %39
  %41 = getelementptr inbounds [100009 x i32], ptr @d, i64 0, i64 %indvars.iv73
  store i32 %40, ptr %41, align 4, !tbaa !5
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count76
  br i1 %exitcond77.not, label %._crit_edge58, label %.lr.ph57, !llvm.loop !13

._crit_edge58:                                    ; preds = %.lr.ph57, %.preheader41
  %42 = getelementptr inbounds i32, ptr @d, i64 %14
  %43 = getelementptr inbounds i8, ptr %42, i64 4
  invoke void @_ZN12wavelet_tree4initEPiS0_ii(ptr noundef nonnull align 8 dereferenceable(48) @evenr, ptr noundef nonnull getelementptr inbounds (i8, ptr @d, i64 4), ptr noundef nonnull %43, i32 noundef -5100, i32 noundef 5100)
          to label %44 unwind label %.loopexit.split-lp

44:                                               ; preds = %._crit_edge58
  %45 = invoke noundef i32 @_Z2scv()
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %44
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph60, label %._crit_edge61

.lr.ph60:                                         ; preds = %.preheader, %56
  %.459 = phi i32 [ %57, %56 ], [ 0, %.preheader ]
  %47 = invoke noundef i32 @_Z2scv()
          to label %48 unwind label %.loopexit

48:                                               ; preds = %.lr.ph60
  %49 = invoke noundef i32 @_Z2scv()
          to label %50 unwind label %.loopexit

50:                                               ; preds = %48
  %51 = invoke noundef i32 @_Z3oddii(i32 noundef %47, i32 noundef %49)
          to label %52 unwind label %.loopexit

52:                                               ; preds = %50
  %53 = invoke noundef i32 @_Z4evenii(i32 noundef %47, i32 noundef %49)
          to label %54 unwind label %.loopexit

54:                                               ; preds = %52
  %55 = add nsw i32 %53, %51
  invoke void @_Z3outi(i32 noundef %55)
          to label %56 unwind label %.loopexit

56:                                               ; preds = %54
  %57 = add nuw nsw i32 %.459, 1
  %exitcond78.not = icmp eq i32 %57, %45
  br i1 %exitcond78.not, label %._crit_edge61, label %.lr.ph60, !llvm.loop !14

._crit_edge61:                                    ; preds = %56, %.preheader
  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
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3outi(i32 noundef) local_unnamed_addr #5

; 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 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 = { 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 = { "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 = { nounwind }

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

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


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