; LLVM IR from VAR-solutions/Algorithms :: Dynamic Programming/common sub sequence/cpp (CommonSubSeq)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3lcsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %17 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %19 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %6, align 4, !tbaa !9
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = add nsw i32 %21, 1
  %23 = zext i32 %22 to i64
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  %26 = zext i32 %25 to i64
  %27 = call ptr @llvm.stacksave.p0()
  store ptr %27, ptr %7, align 8
  %28 = mul nuw i64 %23, %26
  %29 = alloca i32, i64 %28, align 16
  store i64 %23, ptr %8, align 8
  store i64 %26, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %120, %2
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = load i32, ptr %5, align 4, !tbaa !9
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %123

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

36:                                               ; preds = %116, %35
  %37 = load i32, ptr %12, align 4, !tbaa !9
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = icmp sle i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %119

41:                                               ; preds = %36
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %47, label %44

44:                                               ; preds = %41
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %55

47:                                               ; preds = %44, %41
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = mul nsw i64 %49, %26
  %51 = getelementptr inbounds i32, ptr %29, i64 %50
  %52 = load i32, ptr %12, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %51, i64 %53
  store i32 0, ptr %54, align 4, !tbaa !9
  br label %115

55:                                               ; preds = %44
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %58)
  %60 = load i8, ptr %59, align 1, !tbaa !11
  %61 = sext i8 %60 to i32
  %62 = load i32, ptr %12, align 4, !tbaa !9
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %64)
  %66 = load i8, ptr %65, align 1, !tbaa !11
  %67 = sext i8 %66 to i32
  %68 = icmp eq i32 %61, %67
  br i1 %68, label %69, label %88

69:                                               ; preds = %55
  %70 = load i32, ptr %10, align 4, !tbaa !9
  %71 = sub nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = mul nsw i64 %72, %26
  %74 = getelementptr inbounds i32, ptr %29, i64 %73
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %74, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = mul nsw i64 %82, %26
  %84 = getelementptr inbounds i32, ptr %29, i64 %83
  %85 = load i32, ptr %12, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i32, ptr %84, i64 %86
  store i32 %80, ptr %87, align 4, !tbaa !9
  br label %114

88:                                               ; preds = %55
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = sub nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = mul nsw i64 %91, %26
  %93 = getelementptr inbounds i32, ptr %29, i64 %92
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %93, i64 %95
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = mul nsw i64 %98, %26
  %100 = getelementptr inbounds i32, ptr %29, i64 %99
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = sub nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %100, i64 %103
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %96, ptr noundef nonnull align 4 dereferenceable(4) %104)
  %106 = load i32, ptr %105, align 4, !tbaa !9
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = mul nsw i64 %108, %26
  %110 = getelementptr inbounds i32, ptr %29, i64 %109
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %110, i64 %112
  store i32 %106, ptr %113, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %88, %69
  br label %115

115:                                              ; preds = %114, %47
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %12, align 4, !tbaa !9
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %12, align 4, !tbaa !9
  br label %36, !llvm.loop !12

119:                                              ; preds = %40
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %10, align 4, !tbaa !9
  br label %30, !llvm.loop !14

123:                                              ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %124 = load i32, ptr %5, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = mul nsw i64 %125, %26
  %127 = getelementptr inbounds i32, ptr %29, i64 %126
  %128 = load i32, ptr %6, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %127, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !9
  store i32 %131, ptr %13, align 4, !tbaa !9
  %132 = load i32, ptr %13, align 4, !tbaa !9
  %133 = add nsw i32 %132, 1
  %134 = zext i32 %133 to i64
  %135 = alloca i8, i64 %134, align 16
  store i64 %134, ptr %14, align 8
  %136 = load i32, ptr %13, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i8, ptr %135, i64 %137
  store i8 32, ptr %138, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %139 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %139, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %140 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %140, ptr %16, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %206, %123
  %142 = load i32, ptr %15, align 4, !tbaa !9
  %143 = icmp sgt i32 %142, 0
  br i1 %143, label %144, label %147

144:                                              ; preds = %141
  %145 = load i32, ptr %16, align 4, !tbaa !9
  %146 = icmp sgt i32 %145, 0
  br label %147

147:                                              ; preds = %144, %141
  %148 = phi i1 [ false, %141 ], [ %146, %144 ]
  br i1 %148, label %149, label %207

149:                                              ; preds = %147
  %150 = load i32, ptr %15, align 4, !tbaa !9
  %151 = sub nsw i32 %150, 1
  %152 = sext i32 %151 to i64
  %153 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %152)
  %154 = load i8, ptr %153, align 1, !tbaa !11
  %155 = sext i8 %154 to i32
  %156 = load i32, ptr %16, align 4, !tbaa !9
  %157 = sub nsw i32 %156, 1
  %158 = sext i32 %157 to i64
  %159 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %158)
  %160 = load i8, ptr %159, align 1, !tbaa !11
  %161 = sext i8 %160 to i32
  %162 = icmp eq i32 %155, %161
  br i1 %162, label %163, label %179

163:                                              ; preds = %149
  %164 = load i32, ptr %15, align 4, !tbaa !9
  %165 = sub nsw i32 %164, 1
  %166 = sext i32 %165 to i64
  %167 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %166)
  %168 = load i8, ptr %167, align 1, !tbaa !11
  %169 = load i32, ptr %13, align 4, !tbaa !9
  %170 = sub nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i8, ptr %135, i64 %171
  store i8 %168, ptr %172, align 1, !tbaa !11
  %173 = load i32, ptr %15, align 4, !tbaa !9
  %174 = add nsw i32 %173, -1
  store i32 %174, ptr %15, align 4, !tbaa !9
  %175 = load i32, ptr %16, align 4, !tbaa !9
  %176 = add nsw i32 %175, -1
  store i32 %176, ptr %16, align 4, !tbaa !9
  %177 = load i32, ptr %13, align 4, !tbaa !9
  %178 = add nsw i32 %177, -1
  store i32 %178, ptr %13, align 4, !tbaa !9
  br label %206

179:                                              ; preds = %149
  %180 = load i32, ptr %15, align 4, !tbaa !9
  %181 = sub nsw i32 %180, 1
  %182 = sext i32 %181 to i64
  %183 = mul nsw i64 %182, %26
  %184 = getelementptr inbounds i32, ptr %29, i64 %183
  %185 = load i32, ptr %16, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds i32, ptr %184, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !9
  %189 = load i32, ptr %15, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = mul nsw i64 %190, %26
  %192 = getelementptr inbounds i32, ptr %29, i64 %191
  %193 = load i32, ptr %16, align 4, !tbaa !9
  %194 = sub nsw i32 %193, 1
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds i32, ptr %192, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !9
  %198 = icmp sgt i32 %188, %197
  br i1 %198, label %199, label %202

199:                                              ; preds = %179
  %200 = load i32, ptr %15, align 4, !tbaa !9
  %201 = add nsw i32 %200, -1
  store i32 %201, ptr %15, align 4, !tbaa !9
  br label %205

202:                                              ; preds = %179
  %203 = load i32, ptr %16, align 4, !tbaa !9
  %204 = add nsw i32 %203, -1
  store i32 %204, ptr %16, align 4, !tbaa !9
  br label %205

205:                                              ; preds = %202, %199
  br label %206

206:                                              ; preds = %205, %163
  br label %141, !llvm.loop !15

207:                                              ; preds = %147
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %208, ptr noundef nonnull align 8 dereferenceable(32) %0)
  %210 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %209, ptr noundef @.str.1)
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %210, ptr noundef nonnull align 8 dereferenceable(32) %1)
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %211, ptr noundef @.str.2)
  %213 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %212, ptr noundef %135)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %214 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %214)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; 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)) #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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

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

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


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3lcsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef nonnull %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %4 = trunc i64 %3 to i32
  %5 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  %6 = trunc i64 %5 to i32
  %7 = add i64 %3, 1
  %8 = and i64 %7, 4294967295
  %9 = add i64 %5, 1
  %10 = and i64 %9, 4294967295
  %11 = mul nuw i64 %10, %8
  %12 = alloca i32, i64 %11, align 16
  %13 = or i64 %3, %5
  %14 = and i64 %13, 2147483648
  %or.cond.not = icmp eq i64 %14, 0
  br i1 %or.cond.not, label %.preheader.preheader, label %._crit_edge60

.preheader.preheader:                             ; preds = %2
  %15 = add nuw nsw i64 %5, 1
  %16 = shl nuw nsw i64 %10, 2
  %wide.trip.count = and i64 %15, 4294967295
  %exitcond.peel.not = icmp eq i64 %wide.trip.count, 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %.04859 = phi i32 [ %41, %._crit_edge ], [ 0, %.preheader.preheader ]
  %17 = zext i32 %.04859 to i64
  %18 = icmp eq i32 %.04859, 0
  %19 = add nsw i32 %.04859, -1
  %20 = sext i32 %19 to i64
  %21 = mul nsw i64 %10, %20
  %22 = getelementptr inbounds i32, ptr %12, i64 %21
  %23 = mul nuw nsw i64 %10, %17
  %24 = getelementptr inbounds i32, ptr %12, i64 %23
  br i1 %18, label %.lr.ph.split.us.preheader, label %25

25:                                               ; preds = %.preheader
  store i32 0, ptr %24, align 4, !tbaa !5
  br i1 %exitcond.peel.not, label %._crit_edge, label %.lr.ph.split.peel.next

.lr.ph.split.us.preheader:                        ; preds = %.preheader
  %26 = mul nuw nsw i64 %16, %17
  %scevgep = getelementptr i8, ptr %12, i64 %26
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %16, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge60:                                    ; preds = %._crit_edge, %2
  %sext = shl i64 %3, 32
  %27 = ashr exact i64 %sext, 32
  %28 = mul nsw i64 %10, %27
  %29 = getelementptr inbounds i32, ptr %12, i64 %28
  %sext53 = shl i64 %5, 32
  %30 = ashr exact i64 %sext53, 30
  %31 = getelementptr inbounds i8, ptr %29, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  %34 = zext i32 %33 to i64
  %35 = alloca i8, i64 %34, align 16
  %36 = sext i32 %32 to i64
  %37 = getelementptr inbounds i8, ptr %35, i64 %36
  store i8 32, ptr %37, align 1, !tbaa !9
  %invariant.gep = getelementptr i8, ptr %35, i64 -1
  %38 = icmp sgt i32 %4, 0
  %39 = icmp sgt i32 %6, 0
  %40 = and i1 %38, %39
  br i1 %40, label %.lr.ph, label %._crit_edge65

._crit_edge:                                      ; preds = %57, %25, %.lr.ph.split.us.preheader
  %41 = add i32 %.04859, 1
  %.not = icmp sgt i32 %41, %4
  br i1 %.not, label %._crit_edge60, label %.preheader, !llvm.loop !10

.lr.ph.split.peel.next:                           ; preds = %25, %57
  %indvars.iv = phi i64 [ %indvars.iv.next, %57 ], [ 1, %25 ]
  %42 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %20)
  %43 = load i8, ptr %42, align 1, !tbaa !9
  %44 = add nsw i64 %indvars.iv, -1
  %45 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %44)
  %46 = load i8, ptr %45, align 1, !tbaa !9
  %47 = icmp eq i8 %43, %46
  br i1 %47, label %48, label %52

48:                                               ; preds = %.lr.ph.split.peel.next
  %49 = getelementptr inbounds i32, ptr %22, i64 %44
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  br label %57

52:                                               ; preds = %.lr.ph.split.peel.next
  %53 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv
  %54 = getelementptr inbounds i32, ptr %24, i64 %44
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %53, ptr noundef nonnull align 4 dereferenceable(4) %54)
  %56 = load i32, ptr %55, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %52, %48
  %.sink = phi i32 [ %56, %52 ], [ %51, %48 ]
  %58 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv
  store i32 %.sink, ptr %58, 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.split.peel.next, !llvm.loop !12

.lr.ph:                                           ; preds = %._crit_edge60, %85
  %.063 = phi i32 [ %.1, %85 ], [ %6, %._crit_edge60 ]
  %.04662 = phi i32 [ %.147, %85 ], [ %4, %._crit_edge60 ]
  %.04961 = phi i32 [ %.150, %85 ], [ %32, %._crit_edge60 ]
  %59 = add nsw i32 %.04662, -1
  %60 = zext nneg i32 %59 to i64
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %60)
  %62 = load i8, ptr %61, align 1, !tbaa !9
  %63 = add nsw i32 %.063, -1
  %64 = zext nneg i32 %63 to i64
  %65 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %64)
  %66 = load i8, ptr %65, align 1, !tbaa !9
  %67 = icmp eq i8 %62, %66
  br i1 %67, label %68, label %73

68:                                               ; preds = %.lr.ph
  %69 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %60)
  %70 = load i8, ptr %69, align 1, !tbaa !9
  %71 = sext i32 %.04961 to i64
  %gep = getelementptr i8, ptr %invariant.gep, i64 %71
  store i8 %70, ptr %gep, align 1, !tbaa !9
  %72 = add nsw i32 %.04961, -1
  br label %85

73:                                               ; preds = %.lr.ph
  %74 = mul nuw nsw i64 %10, %60
  %75 = getelementptr inbounds i32, ptr %12, i64 %74
  %76 = zext nneg i32 %.063 to i64
  %77 = getelementptr inbounds i32, ptr %75, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = zext nneg i32 %.04662 to i64
  %80 = mul nuw nsw i64 %10, %79
  %81 = getelementptr inbounds i32, ptr %12, i64 %80
  %82 = getelementptr inbounds i32, ptr %81, i64 %64
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = icmp sgt i32 %78, %83
  %spec.select = select i1 %84, i32 %59, i32 %.04662
  %spec.select55 = select i1 %84, i32 %.063, i32 %63
  br label %85

85:                                               ; preds = %73, %68
  %.150 = phi i32 [ %72, %68 ], [ %.04961, %73 ]
  %.147 = phi i32 [ %59, %68 ], [ %spec.select, %73 ]
  %.1 = phi i32 [ %63, %68 ], [ %spec.select55, %73 ]
  %86 = icmp sgt i32 %.147, 0
  %87 = icmp sgt i32 %.1, 0
  %88 = select i1 %86, i1 %87, i1 false
  br i1 %88, label %.lr.ph, label %._crit_edge65, !llvm.loop !14

._crit_edge65:                                    ; preds = %85, %._crit_edge60
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull align 8 dereferenceable(32) %0)
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull @.str.1)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %91, ptr noundef nonnull align 8 dereferenceable(32) %1)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @.str.2)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull %35)
  ret void
}

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

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

; Function Attrs: 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 #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) 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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !11}


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