; LLVM IR from Aryansh-S/USACO :: algo_ds/DP (EditDist)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::initializer_list" = type { ptr, i64 }

@_Z1aB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1bB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@dp = external dso_local global [5005 x [5005 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::initializer_list", align 8
  %10 = alloca [3 x i32], align 4
  store i32 0, ptr %1, align 4
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1aB5cxx11)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(32) @_Z1bB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %19 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1aB5cxx11) #5
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %2, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %21 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1bB5cxx11) #5
  %22 = trunc i64 %21 to i32
  store i32 %22, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %23

23:                                               ; preds = %34, %0
  %24 = load i32, ptr %4, align 4, !tbaa !8
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %37

28:                                               ; preds = %23
  %29 = load i32, ptr %4, align 4, !tbaa !8
  %30 = load i32, ptr %4, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %31
  %33 = getelementptr inbounds [5005 x i32], ptr %32, i64 0, i64 0
  store i32 %29, ptr %33, align 4, !tbaa !8
  br label %34

34:                                               ; preds = %28
  %35 = load i32, ptr %4, align 4, !tbaa !8
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %4, align 4, !tbaa !8
  br label %23, !llvm.loop !11

37:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %48, %37
  %39 = load i32, ptr %5, align 4, !tbaa !8
  %40 = load i32, ptr %3, align 4, !tbaa !8
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %51

43:                                               ; preds = %38
  %44 = load i32, ptr %5, align 4, !tbaa !8
  %45 = load i32, ptr %5, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [5005 x i32], ptr @dp, i64 0, i64 %46
  store i32 %44, ptr %47, align 4, !tbaa !8
  br label %48

48:                                               ; preds = %43
  %49 = load i32, ptr %5, align 4, !tbaa !8
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %5, align 4, !tbaa !8
  br label %38, !llvm.loop !13

51:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %52

52:                                               ; preds = %140, %51
  %53 = load i32, ptr %6, align 4, !tbaa !8
  %54 = load i32, ptr %2, align 4, !tbaa !8
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %136, %57
  %59 = load i32, ptr %8, align 4, !tbaa !8
  %60 = load i32, ptr %3, align 4, !tbaa !8
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %139

63:                                               ; preds = %58
  %64 = load i32, ptr %6, align 4, !tbaa !8
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1aB5cxx11, i64 noundef %66)
  %68 = load i8, ptr %67, align 1, !tbaa !14
  %69 = sext i8 %68 to i32
  %70 = load i32, ptr %8, align 4, !tbaa !8
  %71 = sub nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1bB5cxx11, i64 noundef %72)
  %74 = load i8, ptr %73, align 1, !tbaa !14
  %75 = sext i8 %74 to i32
  %76 = icmp eq i32 %69, %75
  br i1 %76, label %77, label %93

77:                                               ; preds = %63
  %78 = load i32, ptr %6, align 4, !tbaa !8
  %79 = sub nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %80
  %82 = load i32, ptr %8, align 4, !tbaa !8
  %83 = sub nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [5005 x i32], ptr %81, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !8
  %87 = load i32, ptr %6, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %88
  %90 = load i32, ptr %8, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [5005 x i32], ptr %89, i64 0, i64 %91
  store i32 %86, ptr %92, align 4, !tbaa !8
  br label %135

93:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #5
  %94 = load i32, ptr %6, align 4, !tbaa !8
  %95 = sub nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %96
  %98 = load i32, ptr %8, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [5005 x i32], ptr %97, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !8
  store i32 %101, ptr %10, align 4, !tbaa !8
  %102 = getelementptr inbounds i32, ptr %10, i64 1
  %103 = load i32, ptr %6, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %104
  %106 = load i32, ptr %8, align 4, !tbaa !8
  %107 = sub nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [5005 x i32], ptr %105, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !8
  store i32 %110, ptr %102, align 4, !tbaa !8
  %111 = getelementptr inbounds i32, ptr %10, i64 2
  %112 = load i32, ptr %6, align 4, !tbaa !8
  %113 = sub nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %114
  %116 = load i32, ptr %8, align 4, !tbaa !8
  %117 = sub nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [5005 x i32], ptr %115, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !8
  store i32 %120, ptr %111, align 4, !tbaa !8
  %121 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 0
  store ptr %10, ptr %121, align 8, !tbaa !15
  %122 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 1
  store i64 3, ptr %122, align 8, !tbaa !19
  %123 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8
  %125 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %126 = load i64, ptr %125, align 8
  %127 = call noundef i32 @_ZSt3minIiET_St16initializer_listIS0_E(ptr %124, i64 %126)
  %128 = add nsw i32 1, %127
  %129 = load i32, ptr %6, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %130
  %132 = load i32, ptr %8, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [5005 x i32], ptr %131, i64 0, i64 %133
  store i32 %128, ptr %134, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #5
  br label %135

135:                                              ; preds = %93, %77
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %8, align 4, !tbaa !8
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %8, align 4, !tbaa !8
  br label %58, !llvm.loop !20

139:                                              ; preds = %62
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %6, align 4, !tbaa !8
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %6, align 4, !tbaa !8
  br label %52, !llvm.loop !21

143:                                              ; preds = %56
  %144 = load i32, ptr %2, align 4, !tbaa !8
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %145
  %147 = load i32, ptr %3, align 4, !tbaa !8
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [5005 x i32], ptr %146, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !8
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %150)
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %151, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %153 = load i32, ptr %1, align 4
  ret i32 %153
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZSt3minIiET_St16initializer_listIS0_E(ptr, i64) #4

; 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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { "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 memory(argmem: readwrite) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTSSt16initializer_listIiE", !17, i64 0, !18, i64 8}
!17 = !{!"any pointer", !10, i64 0}
!18 = !{!"long", !10, i64 0}
!19 = !{!16, !18, i64 8}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !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"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_Z1aB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1bB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@dp = external dso_local local_unnamed_addr global [5005 x [5005 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [3 x i32], align 4
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1aB5cxx11)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(32) @_Z1bB5cxx11)
  %10 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1aB5cxx11) #5
  %11 = trunc i64 %10 to i32
  %12 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1bB5cxx11) #5
  %13 = trunc i64 %12 to i32
  %.not44 = icmp slt i32 %11, 0
  br i1 %.not44, label %.preheader43, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %14 = add nuw nsw i64 %10, 1
  %wide.trip.count = and i64 %14, 4294967295
  %15 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %14, 3
  %16 = icmp ult i64 %15, 3
  br i1 %16, label %.preheader43.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
  br label %.lr.ph

.preheader43.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader43, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader43.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader43.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader43.loopexit.unr-lcssa ]
  %17 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %indvars.iv.epil
  %18 = trunc nuw nsw i64 %indvars.iv.epil to i32
  store i32 %18, ptr %17, align 4, !tbaa !8
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.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 %.preheader43, label %.lr.ph.epil, !llvm.loop !11

.preheader43:                                     ; preds = %.preheader43.loopexit.unr-lcssa, %.lr.ph.epil, %0
  %.not3846 = icmp slt i32 %13, 0
  br i1 %.not3846, label %.preheader42, label %.lr.ph48.preheader

.lr.ph48.preheader:                               ; preds = %.preheader43
  %19 = add nuw nsw i64 %12, 1
  %wide.trip.count60 = and i64 %19, 4294967295
  %min.iters.check = icmp ult i64 %wide.trip.count60, 8
  br i1 %min.iters.check, label %.lr.ph48.preheader73, label %vector.ph

.lr.ph48.preheader73:                             ; preds = %middle.block, %.lr.ph48.preheader
  %indvars.iv57.ph = phi i64 [ 0, %.lr.ph48.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph48

vector.ph:                                        ; preds = %.lr.ph48.preheader
  %n.mod.vf = and i64 %19, 7
  %n.vec = sub nsw i64 %wide.trip.count60, %n.mod.vf
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %20 = getelementptr inbounds [5005 x i32], ptr @dp, i64 0, i64 %index
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  store <4 x i32> %vec.ind, ptr %20, align 16, !tbaa !8
  store <4 x i32> %step.add, ptr %21, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %22 = icmp eq i64 %index.next, %n.vec
  br i1 %22, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  br i1 %cmp.n, label %.preheader42, label %.lr.ph48.preheader73

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %23 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %indvars.iv
  %24 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %24, ptr %23, align 16, !tbaa !8
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %25 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next
  %26 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %26, ptr %25, align 4, !tbaa !8
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %27 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next.1
  %28 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  store i32 %28, ptr %27, align 8, !tbaa !8
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %29 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next.2
  %30 = trunc nuw nsw i64 %indvars.iv.next.2 to i32
  store i32 %30, ptr %29, align 4, !tbaa !8
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader43.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !17

.preheader42:                                     ; preds = %.lr.ph48, %middle.block, %.preheader43
  %.not3952 = icmp slt i32 %11, 1
  br i1 %.not3952, label %._crit_edge54, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader42
  %.not4149 = icmp slt i32 %13, 1
  %31 = getelementptr inbounds i8, ptr %1, i64 4
  %32 = getelementptr inbounds i8, ptr %1, i64 8
  br i1 %.not4149, label %._crit_edge54, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %33 = add nuw nsw i64 %12, 1
  %34 = add nuw nsw i64 %10, 1
  %wide.trip.count70 = and i64 %34, 4294967295
  %wide.trip.count65 = and i64 %33, 4294967295
  br label %.preheader

.lr.ph48:                                         ; preds = %.lr.ph48.preheader73, %.lr.ph48
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %.lr.ph48 ], [ %indvars.iv57.ph, %.lr.ph48.preheader73 ]
  %35 = getelementptr inbounds [5005 x i32], ptr @dp, i64 0, i64 %indvars.iv57
  %36 = trunc nuw nsw i64 %indvars.iv57 to i32
  store i32 %36, ptr %35, align 4, !tbaa !8
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
  br i1 %exitcond61.not, label %.preheader42, label %.lr.ph48, !llvm.loop !18

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %indvars.iv67 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next68, %._crit_edge ]
  %37 = add nsw i64 %indvars.iv67, -1
  br label %44

._crit_edge54:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %.preheader42
  %sext = shl i64 %10, 32
  %38 = ashr exact i64 %sext, 32
  %sext40 = shl i64 %12, 32
  %39 = ashr exact i64 %sext40, 32
  %40 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %38, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !8
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %41)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @.str)
  ret i32 0

._crit_edge:                                      ; preds = %63
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70
  br i1 %exitcond71.not, label %._crit_edge54, label %.preheader, !llvm.loop !19

44:                                               ; preds = %.preheader, %63
  %indvars.iv62 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next63, %63 ]
  %45 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1aB5cxx11, i64 noundef %37)
  %46 = load i8, ptr %45, align 1, !tbaa !20
  %47 = add nsw i64 %indvars.iv62, -1
  %48 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1bB5cxx11, i64 noundef %47)
  %49 = load i8, ptr %48, align 1, !tbaa !20
  %50 = icmp eq i8 %46, %49
  br i1 %50, label %51, label %54

51:                                               ; preds = %44
  %52 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %37, i64 %47
  %53 = load i32, ptr %52, align 4, !tbaa !8
  br label %63

54:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %1) #5
  %55 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %37, i64 %indvars.iv62
  %56 = load i32, ptr %55, align 4, !tbaa !8
  store i32 %56, ptr %1, align 4, !tbaa !8
  %57 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %indvars.iv67, i64 %47
  %58 = load i32, ptr %57, align 4, !tbaa !8
  store i32 %58, ptr %31, align 4, !tbaa !8
  %59 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %37, i64 %47
  %60 = load i32, ptr %59, align 4, !tbaa !8
  store i32 %60, ptr %32, align 4, !tbaa !8
  %61 = call noundef i32 @_ZSt3minIiET_St16initializer_listIS0_E(ptr nonnull %1, i64 3)
  %62 = add nsw i32 %61, 1
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %1) #5
  br label %63

63:                                               ; preds = %51, %54
  %.sink = phi i32 [ %53, %51 ], [ %62, %54 ]
  %64 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %indvars.iv67, i64 %indvars.iv62
  store i32 %.sink, ptr %64, align 4
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65
  br i1 %exitcond66.not, label %._crit_edge, label %44, !llvm.loop !21
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZSt3minIiET_St16initializer_listIS0_E(ptr, i64) local_unnamed_addr #4

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14, !16, !15}
!19 = distinct !{!19, !14}
!20 = !{!10, !10, i64 0}
!21 = distinct !{!21, !14}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MergedLoadStoreMotionPass,SROAPass,SimplifyCFGPass,TailCallElimPass