; LLVM IR from ravireddy07/cpp-book :: src/Subsequences (LongestPalindromicSubSeq)

; 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"

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3LPSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %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 i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %13 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %14 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %13, i64 8)
  %15 = extractvalue { i64, i1 } %14, 1
  %16 = extractvalue { i64, i1 } %14, 0
  %17 = select i1 %15, i64 -1, i64 %16
  %18 = call noalias noundef nonnull ptr @_Znam(i64 noundef %17) #7
  store ptr %18, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %36, %1
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %23 = icmp ult i64 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %19
  %26 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %27 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %26, i64 4)
  %28 = extractvalue { i64, i1 } %27, 1
  %29 = extractvalue { i64, i1 } %27, 0
  %30 = select i1 %28, i64 -1, i64 %29
  %31 = call noalias noundef nonnull ptr @_Znam(i64 noundef %30) #7
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = load i32, ptr %4, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds ptr, ptr %32, i64 %34
  store ptr %31, ptr %35, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %25
  %37 = load i32, ptr %4, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %4, align 4, !tbaa !9
  br label %19, !llvm.loop !11

39:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %40 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %41 = trunc i64 %40 to i32
  store i32 %41, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %66, %39
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %69

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %62, %47
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = load i32, ptr %5, align 4, !tbaa !9
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %65

53:                                               ; preds = %48
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds ptr, ptr %54, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i32, ptr %58, i64 %60
  store i32 0, ptr %61, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %53
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !9
  br label %48, !llvm.loop !13

65:                                               ; preds = %52
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %6, align 4, !tbaa !9
  br label %42, !llvm.loop !14

69:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %84, %69
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

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

75:                                               ; preds = %70
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = load i32, ptr %9, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %76, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = load i32, ptr %9, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr %80, i64 %82
  store i32 1, ptr %83, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %75
  %85 = load i32, ptr %9, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %9, align 4, !tbaa !9
  br label %70, !llvm.loop !15

87:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 2, ptr %10, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %197, %87
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = load i32, ptr %5, align 4, !tbaa !9
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %200

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %193, %93
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = load i32, ptr %5, align 4, !tbaa !9
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = sub nsw i32 %96, %97
  %99 = icmp sle i32 %95, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %94
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %196

101:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %102 = load i32, ptr %11, align 4, !tbaa !9
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = add nsw i32 %102, %103
  %105 = sub nsw i32 %104, 1
  store i32 %105, ptr %12, align 4, !tbaa !9
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %107)
  %109 = load i8, ptr %108, align 1, !tbaa !16
  %110 = sext i8 %109 to i32
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %112)
  %114 = load i8, ptr %113, align 1, !tbaa !16
  %115 = sext i8 %114 to i32
  %116 = icmp eq i32 %110, %115
  br i1 %116, label %117, label %129

117:                                              ; preds = %101
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = icmp eq i32 %118, 2
  br i1 %119, label %120, label %129

120:                                              ; preds = %117
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = load i32, ptr %11, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds ptr, ptr %121, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  %126 = load i32, ptr %12, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %125, i64 %127
  store i32 2, ptr %128, align 4, !tbaa !9
  br label %192

129:                                              ; preds = %117, %101
  %130 = load i32, ptr %11, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %131)
  %133 = load i8, ptr %132, align 1, !tbaa !16
  %134 = sext i8 %133 to i32
  %135 = load i32, ptr %12, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %136)
  %138 = load i8, ptr %137, align 1, !tbaa !16
  %139 = sext i8 %138 to i32
  %140 = icmp eq i32 %134, %139
  br i1 %140, label %141, label %162

141:                                              ; preds = %129
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds ptr, ptr %142, i64 %145
  %147 = load ptr, ptr %146, align 8, !tbaa !5
  %148 = load i32, ptr %12, align 4, !tbaa !9
  %149 = sub nsw i32 %148, 1
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i32, ptr %147, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !9
  %153 = add nsw i32 %152, 2
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = load i32, ptr %11, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds ptr, ptr %154, i64 %156
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  %159 = load i32, ptr %12, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds i32, ptr %158, i64 %160
  store i32 %153, ptr %161, align 4, !tbaa !9
  br label %191

162:                                              ; preds = %129
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = load i32, ptr %11, align 4, !tbaa !9
  %165 = add nsw i32 %164, 1
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds ptr, ptr %163, i64 %166
  %168 = load ptr, ptr %167, align 8, !tbaa !5
  %169 = load i32, ptr %12, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i32, ptr %168, i64 %170
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = load i32, ptr %11, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds ptr, ptr %172, i64 %174
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  %177 = load i32, ptr %12, align 4, !tbaa !9
  %178 = sub nsw i32 %177, 1
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i32, ptr %176, i64 %179
  %181 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %171, ptr noundef nonnull align 4 dereferenceable(4) %180)
  %182 = load i32, ptr %181, align 4, !tbaa !9
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = load i32, ptr %11, align 4, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds ptr, ptr %183, i64 %185
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = load i32, ptr %12, align 4, !tbaa !9
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %187, i64 %189
  store i32 %182, ptr %190, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %162, %141
  br label %192

192:                                              ; preds = %191, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %11, align 4, !tbaa !9
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %11, align 4, !tbaa !9
  br label %94, !llvm.loop !17

196:                                              ; preds = %100
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %10, align 4, !tbaa !9
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %10, align 4, !tbaa !9
  br label %88, !llvm.loop !18

200:                                              ; preds = %92
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = getelementptr inbounds ptr, ptr %201, i64 0
  %203 = load ptr, ptr %202, align 8, !tbaa !5
  %204 = load i32, ptr %5, align 4, !tbaa !9
  %205 = sub nsw i32 %204, 1
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds i32, ptr %203, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !9
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret i32 %208
}

; 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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 }
attributes #7 = { builtin allocsize(0) }

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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"

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3LPSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %0) local_unnamed_addr #0 {
  %2 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %3 = icmp ugt i64 %2, 2305843009213693951
  %4 = shl nuw i64 %2, 3
  %5 = select i1 %3, i64 -1, i64 %4
  %6 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %5) #6
  %7 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %.not79 = icmp eq i64 %7, 0
  br i1 %.not79, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %1
  %8 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %9 = trunc i64 %8 to i32
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.preheader63.us.preheader, label %._crit_edge78

.preheader63.us.preheader:                        ; preds = %._crit_edge
  %11 = and i64 %8, 2147483647
  %12 = shl nuw nsw i64 %11, 2
  %13 = add nsw i64 %11, -1
  %xtraiter = and i64 %8, 7
  %14 = icmp ult i64 %13, 7
  br i1 %14, label %.preheader62.unr-lcssa, label %.preheader63.us.preheader.new

.preheader63.us.preheader.new:                    ; preds = %.preheader63.us.preheader
  %unroll_iter = sub nsw i64 %11, %xtraiter
  br label %.preheader63.us

.preheader63.us:                                  ; preds = %.preheader63.us, %.preheader63.us.preheader.new
  %indvars.iv85 = phi i64 [ 0, %.preheader63.us.preheader.new ], [ %indvars.iv.next86.7, %.preheader63.us ]
  %niter = phi i64 [ 0, %.preheader63.us.preheader.new ], [ %niter.next.7, %.preheader63.us ]
  %15 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv85
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr align 4 %16, i8 0, i64 %12, i1 false), !tbaa !9
  %indvars.iv.next86 = or disjoint i64 %indvars.iv85, 1
  %17 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next86
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr align 4 %18, i8 0, i64 %12, i1 false), !tbaa !9
  %indvars.iv.next86.1 = or disjoint i64 %indvars.iv85, 2
  %19 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next86.1
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr align 4 %20, i8 0, i64 %12, i1 false), !tbaa !9
  %indvars.iv.next86.2 = or disjoint i64 %indvars.iv85, 3
  %21 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next86.2
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr align 4 %22, i8 0, i64 %12, i1 false), !tbaa !9
  %indvars.iv.next86.3 = or disjoint i64 %indvars.iv85, 4
  %23 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next86.3
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr align 4 %24, i8 0, i64 %12, i1 false), !tbaa !9
  %indvars.iv.next86.4 = or disjoint i64 %indvars.iv85, 5
  %25 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next86.4
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr align 4 %26, i8 0, i64 %12, i1 false), !tbaa !9
  %indvars.iv.next86.5 = or disjoint i64 %indvars.iv85, 6
  %27 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next86.5
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr align 4 %28, i8 0, i64 %12, i1 false), !tbaa !9
  %indvars.iv.next86.6 = or disjoint i64 %indvars.iv85, 7
  %29 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next86.6
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr align 4 %30, i8 0, i64 %12, i1 false), !tbaa !9
  %indvars.iv.next86.7 = add nuw nsw i64 %indvars.iv85, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.preheader62.unr-lcssa, label %.preheader63.us, !llvm.loop !11

.lr.ph:                                           ; preds = %1, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %1 ]
  %31 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %32 = icmp ugt i64 %31, 4611686018427387903
  %33 = shl nuw i64 %31, 2
  %34 = select i1 %32, i64 -1, i64 %33
  %35 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %34) #6
  %36 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv
  store ptr %35, ptr %36, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %38 = icmp ugt i64 %37, %indvars.iv.next
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader62.unr-lcssa:                           ; preds = %.preheader63.us, %.preheader63.us.preheader
  %indvars.iv85.unr = phi i64 [ 0, %.preheader63.us.preheader ], [ %indvars.iv.next86.7, %.preheader63.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader62, label %.preheader63.us.epil

.preheader63.us.epil:                             ; preds = %.preheader62.unr-lcssa, %.preheader63.us.epil
  %indvars.iv85.epil = phi i64 [ %indvars.iv.next86.epil, %.preheader63.us.epil ], [ %indvars.iv85.unr, %.preheader62.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader63.us.epil ], [ 0, %.preheader62.unr-lcssa ]
  %39 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv85.epil
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr align 4 %40, i8 0, i64 %12, i1 false), !tbaa !9
  %indvars.iv.next86.epil = add nuw nsw i64 %indvars.iv85.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader62, label %.preheader63.us.epil, !llvm.loop !14

.preheader62:                                     ; preds = %.preheader63.us.epil, %.preheader62.unr-lcssa
  br i1 %10, label %.lr.ph70.preheader, label %._crit_edge78

.lr.ph70.preheader:                               ; preds = %.preheader62
  %xtraiter114 = and i64 %8, 3
  %41 = icmp ult i64 %13, 3
  br i1 %41, label %.preheader61.unr-lcssa, label %.lr.ph70.preheader.new

.lr.ph70.preheader.new:                           ; preds = %.lr.ph70.preheader
  %unroll_iter117 = sub nsw i64 %11, %xtraiter114
  br label %.lr.ph70

.preheader61.unr-lcssa:                           ; preds = %.lr.ph70, %.lr.ph70.preheader
  %indvars.iv88.unr = phi i64 [ 0, %.lr.ph70.preheader ], [ %indvars.iv.next89.3, %.lr.ph70 ]
  %lcmp.mod116.not = icmp eq i64 %xtraiter114, 0
  br i1 %lcmp.mod116.not, label %.preheader61, label %.lr.ph70.epil

.lr.ph70.epil:                                    ; preds = %.preheader61.unr-lcssa, %.lr.ph70.epil
  %indvars.iv88.epil = phi i64 [ %indvars.iv.next89.epil, %.lr.ph70.epil ], [ %indvars.iv88.unr, %.preheader61.unr-lcssa ]
  %epil.iter115 = phi i64 [ %epil.iter115.next, %.lr.ph70.epil ], [ 0, %.preheader61.unr-lcssa ]
  %42 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv88.epil
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = getelementptr inbounds i32, ptr %43, i64 %indvars.iv88.epil
  store i32 1, ptr %44, align 4, !tbaa !9
  %indvars.iv.next89.epil = add nuw nsw i64 %indvars.iv88.epil, 1
  %epil.iter115.next = add i64 %epil.iter115, 1
  %epil.iter115.cmp.not = icmp eq i64 %epil.iter115.next, %xtraiter114
  br i1 %epil.iter115.cmp.not, label %.preheader61, label %.lr.ph70.epil, !llvm.loop !16

.preheader61:                                     ; preds = %.lr.ph70.epil, %.preheader61.unr-lcssa
  %.not75 = icmp eq i32 %9, 1
  br i1 %.not75, label %._crit_edge78, label %.preheader

.lr.ph70:                                         ; preds = %.lr.ph70, %.lr.ph70.preheader.new
  %indvars.iv88 = phi i64 [ 0, %.lr.ph70.preheader.new ], [ %indvars.iv.next89.3, %.lr.ph70 ]
  %niter118 = phi i64 [ 0, %.lr.ph70.preheader.new ], [ %niter118.next.3, %.lr.ph70 ]
  %45 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv88
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv88
  store i32 1, ptr %47, align 4, !tbaa !9
  %indvars.iv.next89 = or disjoint i64 %indvars.iv88, 1
  %48 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next89
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = getelementptr inbounds i32, ptr %49, i64 %indvars.iv.next89
  store i32 1, ptr %50, align 4, !tbaa !9
  %indvars.iv.next89.1 = or disjoint i64 %indvars.iv88, 2
  %51 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next89.1
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds i32, ptr %52, i64 %indvars.iv.next89.1
  store i32 1, ptr %53, align 4, !tbaa !9
  %indvars.iv.next89.2 = or disjoint i64 %indvars.iv88, 3
  %54 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next89.2
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  %56 = getelementptr inbounds i32, ptr %55, i64 %indvars.iv.next89.2
  store i32 1, ptr %56, align 4, !tbaa !9
  %indvars.iv.next89.3 = add nuw nsw i64 %indvars.iv88, 4
  %niter118.next.3 = add i64 %niter118, 4
  %niter118.ncmp.3 = icmp eq i64 %niter118.next.3, %unroll_iter117
  br i1 %niter118.ncmp.3, label %.preheader61.unr-lcssa, label %.lr.ph70, !llvm.loop !17

.preheader:                                       ; preds = %.preheader61, %._crit_edge74
  %indvars.iv96.in = phi i32 [ %indvars.iv96, %._crit_edge74 ], [ %9, %.preheader61 ]
  %.05476 = phi i32 [ %91, %._crit_edge74 ], [ 2, %.preheader61 ]
  %indvars.iv96 = add i32 %indvars.iv96.in, -1
  %.not6071 = icmp sgt i32 %.05476, %9
  br i1 %.not6071, label %._crit_edge74, label %.lr.ph73

.lr.ph73:                                         ; preds = %.preheader
  %57 = icmp eq i32 %.05476, 2
  br i1 %57, label %.lr.ph73.split.preheader, label %.lr.ph73.split.us.preheader

.lr.ph73.split.us.preheader:                      ; preds = %.lr.ph73
  %58 = sext i32 %.05476 to i64
  %wide.trip.count98 = zext i32 %indvars.iv96 to i64
  br label %.lr.ph73.split.us

.lr.ph73.split.preheader:                         ; preds = %.lr.ph73
  %wide.trip.count103 = zext i32 %indvars.iv96 to i64
  br label %.lr.ph73.split

.lr.ph73.split.us:                                ; preds = %.lr.ph73.split.us.preheader, %84
  %indvars.iv93 = phi i64 [ 0, %.lr.ph73.split.us.preheader ], [ %indvars.iv.next94, %84 ]
  %59 = add nuw nsw i64 %indvars.iv93, %58
  %60 = add nsw i64 %59, -1
  %61 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv93)
  %62 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %60)
  %63 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv93)
  %64 = load i8, ptr %63, align 1, !tbaa !18
  %65 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %60)
  %66 = load i8, ptr %65, align 1, !tbaa !18
  %67 = icmp eq i8 %64, %66
  %68 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv93
  %69 = getelementptr inbounds i8, ptr %68, i64 8
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  br i1 %67, label %78, label %71

71:                                               ; preds = %.lr.ph73.split.us
  %72 = getelementptr inbounds i32, ptr %70, i64 %60
  %73 = load ptr, ptr %68, align 8, !tbaa !5
  %74 = getelementptr i32, ptr %73, i64 %59
  %75 = getelementptr i8, ptr %74, i64 -8
  %76 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %72, ptr noundef nonnull align 4 dereferenceable(4) %75)
  %77 = load i32, ptr %76, align 4, !tbaa !9
  br label %84

78:                                               ; preds = %.lr.ph73.split.us
  %79 = getelementptr i32, ptr %70, i64 %59
  %80 = getelementptr i8, ptr %79, i64 -8
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = add nsw i32 %81, 2
  %83 = load ptr, ptr %68, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %78, %71
  %.sink108 = phi ptr [ %83, %78 ], [ %73, %71 ]
  %.sink = phi i32 [ %82, %78 ], [ %77, %71 ]
  %85 = getelementptr inbounds i32, ptr %.sink108, i64 %60
  store i32 %.sink, ptr %85, align 4, !tbaa !9
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count98
  br i1 %exitcond99.not, label %._crit_edge74, label %.lr.ph73.split.us, !llvm.loop !19

._crit_edge78:                                    ; preds = %._crit_edge74, %._crit_edge, %.preheader62, %.preheader61
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = shl i64 %8, 32
  %sext = add i64 %87, -4294967296
  %88 = ashr exact i64 %sext, 30
  %89 = getelementptr inbounds i8, ptr %86, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  ret i32 %90

._crit_edge74:                                    ; preds = %84, %124, %.preheader
  %91 = add i32 %.05476, 1
  %.not = icmp sgt i32 %91, %9
  br i1 %.not, label %._crit_edge78, label %.preheader, !llvm.loop !20

.lr.ph73.split:                                   ; preds = %.lr.ph73.split.preheader, %124
  %indvars.iv100 = phi i64 [ 0, %.lr.ph73.split.preheader ], [ %indvars.iv.next101, %124 ]
  %92 = add nuw nsw i64 %indvars.iv100, 2
  %93 = add nuw nsw i64 %indvars.iv100, 1
  %94 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv100)
  %95 = load i8, ptr %94, align 1, !tbaa !18
  %96 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %93)
  %97 = load i8, ptr %96, align 1, !tbaa !18
  %98 = icmp eq i8 %95, %97
  br i1 %98, label %99, label %102

99:                                               ; preds = %.lr.ph73.split
  %100 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv100
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  br label %124

102:                                              ; preds = %.lr.ph73.split
  %103 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv100)
  %104 = load i8, ptr %103, align 1, !tbaa !18
  %105 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %93)
  %106 = load i8, ptr %105, align 1, !tbaa !18
  %107 = icmp eq i8 %104, %106
  %108 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv100
  %109 = getelementptr inbounds i8, ptr %108, i64 8
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  br i1 %107, label %111, label %117

111:                                              ; preds = %102
  %112 = getelementptr i32, ptr %110, i64 %92
  %113 = getelementptr i8, ptr %112, i64 -8
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = add nsw i32 %114, 2
  %116 = load ptr, ptr %108, align 8, !tbaa !5
  br label %124

117:                                              ; preds = %102
  %118 = getelementptr inbounds i32, ptr %110, i64 %93
  %119 = load ptr, ptr %108, align 8, !tbaa !5
  %120 = getelementptr i32, ptr %119, i64 %92
  %121 = getelementptr i8, ptr %120, i64 -8
  %122 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %118, ptr noundef nonnull align 4 dereferenceable(4) %121)
  %123 = load i32, ptr %122, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %111, %117, %99
  %.sink111 = phi ptr [ %116, %111 ], [ %119, %117 ], [ %101, %99 ]
  %.sink109 = phi i32 [ %115, %111 ], [ %123, %117 ], [ 2, %99 ]
  %125 = getelementptr inbounds i32, ptr %.sink111, i64 %93
  store i32 %.sink109, ptr %125, align 4, !tbaa !9
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %exitcond104.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count103
  br i1 %exitcond104.not, label %._crit_edge74, label %.lr.ph73.split, !llvm.loop !19
}

; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !12}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass