; LLVM IR from Lakhankumawat/LearnCPP :: D-DynamicProgramming/LongestCommonSubsequence.ll (Z7lcsAlgoPcS_ii)

; 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 [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

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

28:                                               ; preds = %120, %4
  %29 = load i32, ptr %12, align 4, !tbaa !9
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %123

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %116, %33
  %35 = load i32, ptr %14, align 4, !tbaa !9
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %119

39:                                               ; preds = %34
  %40 = load i32, ptr %12, align 4, !tbaa !9
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %45, label %42

42:                                               ; preds = %39
  %43 = load i32, ptr %14, align 4, !tbaa !9
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %53

45:                                               ; preds = %42, %39
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = mul nsw i64 %47, %24
  %49 = getelementptr inbounds i32, ptr %27, i64 %48
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  store i32 0, ptr %52, align 4, !tbaa !9
  br label %115

53:                                               ; preds = %42
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %54, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !11
  %60 = sext i8 %59 to i32
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i8, ptr %61, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !11
  %67 = sext i8 %66 to i32
  %68 = icmp eq i32 %60, %67
  br i1 %68, label %69, label %88

69:                                               ; preds = %53
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = sub nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = mul nsw i64 %72, %24
  %74 = getelementptr inbounds i32, ptr %27, i64 %73
  %75 = load i32, ptr %14, 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 %12, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = mul nsw i64 %82, %24
  %84 = getelementptr inbounds i32, ptr %27, i64 %83
  %85 = load i32, ptr %14, 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 = %53
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = sub nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = mul nsw i64 %91, %24
  %93 = getelementptr inbounds i32, ptr %27, i64 %92
  %94 = load i32, ptr %14, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %93, i64 %95
  %97 = load i32, ptr %12, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = mul nsw i64 %98, %24
  %100 = getelementptr inbounds i32, ptr %27, i64 %99
  %101 = load i32, ptr %14, 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 %12, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = mul nsw i64 %108, %24
  %110 = getelementptr inbounds i32, ptr %27, i64 %109
  %111 = load i32, ptr %14, 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, %45
  br label %116

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

119:                                              ; preds = %38
  br label %120

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

123:                                              ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %124 = load i32, ptr %7, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = mul nsw i64 %125, %24
  %127 = getelementptr inbounds i32, ptr %27, i64 %126
  %128 = load i32, ptr %8, 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 %15, align 4, !tbaa !9
  %132 = load i32, ptr %15, 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 %16, align 8
  %136 = load i32, ptr %15, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i8, ptr %135, i64 %137
  store i8 0, ptr %138, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %139 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %139, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %140 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %140, ptr %18, align 4, !tbaa !9
  br label %141

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

144:                                              ; preds = %141
  %145 = load i32, ptr %18, 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 %210

149:                                              ; preds = %147
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = load i32, ptr %17, align 4, !tbaa !9
  %152 = sub nsw i32 %151, 1
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i8, ptr %150, i64 %153
  %155 = load i8, ptr %154, align 1, !tbaa !11
  %156 = sext i8 %155 to i32
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = load i32, ptr %18, align 4, !tbaa !9
  %159 = sub nsw i32 %158, 1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds i8, ptr %157, i64 %160
  %162 = load i8, ptr %161, align 1, !tbaa !11
  %163 = sext i8 %162 to i32
  %164 = icmp eq i32 %156, %163
  br i1 %164, label %165, label %182

165:                                              ; preds = %149
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = load i32, ptr %17, align 4, !tbaa !9
  %168 = sub nsw i32 %167, 1
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds i8, ptr %166, i64 %169
  %171 = load i8, ptr %170, align 1, !tbaa !11
  %172 = load i32, ptr %15, align 4, !tbaa !9
  %173 = sub nsw i32 %172, 1
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i8, ptr %135, i64 %174
  store i8 %171, ptr %175, align 1, !tbaa !11
  %176 = load i32, ptr %17, align 4, !tbaa !9
  %177 = add nsw i32 %176, -1
  store i32 %177, ptr %17, align 4, !tbaa !9
  %178 = load i32, ptr %18, align 4, !tbaa !9
  %179 = add nsw i32 %178, -1
  store i32 %179, ptr %18, align 4, !tbaa !9
  %180 = load i32, ptr %15, align 4, !tbaa !9
  %181 = add nsw i32 %180, -1
  store i32 %181, ptr %15, align 4, !tbaa !9
  br label %209

182:                                              ; preds = %149
  %183 = load i32, ptr %17, align 4, !tbaa !9
  %184 = sub nsw i32 %183, 1
  %185 = sext i32 %184 to i64
  %186 = mul nsw i64 %185, %24
  %187 = getelementptr inbounds i32, ptr %27, i64 %186
  %188 = load i32, ptr %18, align 4, !tbaa !9
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %187, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !9
  %192 = load i32, ptr %17, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = mul nsw i64 %193, %24
  %195 = getelementptr inbounds i32, ptr %27, i64 %194
  %196 = load i32, ptr %18, align 4, !tbaa !9
  %197 = sub nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds i32, ptr %195, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !9
  %201 = icmp sgt i32 %191, %200
  br i1 %201, label %202, label %205

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

205:                                              ; preds = %182
  %206 = load i32, ptr %18, align 4, !tbaa !9
  %207 = add nsw i32 %206, -1
  store i32 %207, ptr %18, align 4, !tbaa !9
  br label %208

208:                                              ; preds = %205, %202
  br label %209

209:                                              ; preds = %208, %165
  br label %141, !llvm.loop !15

210:                                              ; preds = %147
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %212 = load ptr, ptr %5, align 8, !tbaa !5
  %213 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %211, ptr noundef %212)
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %213, ptr noundef @.str.1)
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %214, ptr noundef %215)
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %216, ptr noundef @.str.2)
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %217, ptr noundef %135)
  %219 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %218, ptr noundef @.str.3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  %220 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %220)
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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)) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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) #4

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

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 }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = !{!"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 [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7lcsAlgoPcS_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = add nsw i32 %2, 1
  %6 = zext i32 %5 to i64
  %7 = add i32 %3, 1
  %8 = zext i32 %7 to i64
  %9 = mul nuw i64 %8, %6
  %10 = alloca i32, i64 %9, align 16
  %11 = or i32 %2, %3
  %or.cond.not = icmp sgt i32 %11, -1
  br i1 %or.cond.not, label %.preheader.preheader, label %._crit_edge66

.preheader.preheader:                             ; preds = %4
  %12 = shl nuw nsw i64 %8, 2
  %exitcond.peel.not = icmp eq i32 %3, 0
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %.05565 = phi i32 [ %38, %._crit_edge ], [ 0, %.preheader.preheader ]
  %13 = zext i32 %.05565 to i64
  %14 = icmp eq i32 %.05565, 0
  %15 = add nsw i32 %.05565, -1
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds i8, ptr %0, i64 %16
  %18 = mul nsw i64 %16, %8
  %19 = getelementptr inbounds i32, ptr %10, i64 %18
  %20 = mul nuw nsw i64 %13, %8
  %21 = getelementptr inbounds i32, ptr %10, i64 %20
  br i1 %14, label %.lr.ph.split.us.preheader, label %22

22:                                               ; preds = %.preheader
  store i32 0, ptr %21, 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
  %23 = mul nuw nsw i64 %12, %13
  %scevgep = getelementptr i8, ptr %10, i64 %23
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %12, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge66:                                    ; preds = %._crit_edge, %4
  %24 = sext i32 %2 to i64
  %25 = mul nsw i64 %8, %24
  %26 = getelementptr inbounds i32, ptr %10, i64 %25
  %27 = sext i32 %3 to i64
  %28 = getelementptr inbounds i32, ptr %26, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  %31 = zext i32 %30 to i64
  %32 = alloca i8, i64 %31, align 16
  %33 = sext i32 %29 to i64
  %34 = getelementptr inbounds i8, ptr %32, i64 %33
  store i8 0, ptr %34, align 1, !tbaa !9
  %invariant.gep = getelementptr i8, ptr %32, i64 -1
  %35 = icmp sgt i32 %2, 0
  %36 = icmp sgt i32 %3, 0
  %37 = and i1 %35, %36
  br i1 %37, label %.lr.ph, label %._crit_edge71

._crit_edge:                                      ; preds = %53, %22, %.lr.ph.split.us.preheader
  %38 = add i32 %.05565, 1
  %.not = icmp sgt i32 %38, %2
  br i1 %.not, label %._crit_edge66, label %.preheader, !llvm.loop !10

.lr.ph.split.peel.next:                           ; preds = %22, %53
  %indvars.iv = phi i64 [ %indvars.iv.next, %53 ], [ 1, %22 ]
  %39 = load i8, ptr %17, align 1, !tbaa !9
  %40 = add nsw i64 %indvars.iv, -1
  %41 = getelementptr inbounds i8, ptr %1, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = icmp eq i8 %39, %42
  br i1 %43, label %44, label %48

44:                                               ; preds = %.lr.ph.split.peel.next
  %45 = getelementptr inbounds i32, ptr %19, i64 %40
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  br label %53

48:                                               ; preds = %.lr.ph.split.peel.next
  %49 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv
  %50 = getelementptr inbounds i32, ptr %21, i64 %40
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %49, ptr noundef nonnull align 4 dereferenceable(4) %50)
  %52 = load i32, ptr %51, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %48, %44
  %.sink = phi i32 [ %52, %48 ], [ %47, %44 ]
  %54 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv
  store i32 %.sink, ptr %54, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %8
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split.peel.next, !llvm.loop !12

.lr.ph:                                           ; preds = %._crit_edge66, %79
  %.069 = phi i32 [ %.1, %79 ], [ %3, %._crit_edge66 ]
  %.05368 = phi i32 [ %.154, %79 ], [ %2, %._crit_edge66 ]
  %.05667 = phi i32 [ %.157, %79 ], [ %29, %._crit_edge66 ]
  %55 = add nsw i32 %.05368, -1
  %56 = zext nneg i32 %55 to i64
  %57 = getelementptr inbounds i8, ptr %0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !9
  %59 = add nsw i32 %.069, -1
  %60 = zext nneg i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %1, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !9
  %63 = icmp eq i8 %58, %62
  br i1 %63, label %64, label %67

64:                                               ; preds = %.lr.ph
  %65 = sext i32 %.05667 to i64
  %gep = getelementptr i8, ptr %invariant.gep, i64 %65
  store i8 %58, ptr %gep, align 1, !tbaa !9
  %66 = add nsw i32 %.05667, -1
  br label %79

67:                                               ; preds = %.lr.ph
  %68 = mul nuw nsw i64 %56, %8
  %69 = getelementptr inbounds i32, ptr %10, i64 %68
  %70 = zext nneg i32 %.069 to i64
  %71 = getelementptr inbounds i32, ptr %69, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = zext nneg i32 %.05368 to i64
  %74 = mul nuw nsw i64 %73, %8
  %75 = getelementptr inbounds i32, ptr %10, i64 %74
  %76 = getelementptr inbounds i32, ptr %75, i64 %60
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp sgt i32 %72, %77
  %spec.select = select i1 %78, i32 %55, i32 %.05368
  %spec.select61 = select i1 %78, i32 %.069, i32 %59
  br label %79

79:                                               ; preds = %67, %64
  %.157 = phi i32 [ %66, %64 ], [ %.05667, %67 ]
  %.154 = phi i32 [ %55, %64 ], [ %spec.select, %67 ]
  %.1 = phi i32 [ %59, %64 ], [ %spec.select61, %67 ]
  %80 = icmp sgt i32 %.154, 0
  %81 = icmp sgt i32 %.1, 0
  %82 = select i1 %80, i1 %81, i1 false
  br i1 %82, label %.lr.ph, label %._crit_edge71, !llvm.loop !14

._crit_edge71:                                    ; preds = %79, %._crit_edge66
  %83 = 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)
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef %0)
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull @.str.1)
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef %1)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull @.str.2)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef nonnull %32)
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef nonnull @.str.3)
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass