; LLVM IR from Tunghohin/Competitive_Coding :: Luogu/p3047.ll (Z5dfs_2xx)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@k = external dso_local global i64, align 8
@dp = external dso_local global [100010 x [30 x i64]], align 16
@G = external dso_local global [100010 x %"class.std::vector"], align 16

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5dfs_2xx(i64 noundef %0, i64 noundef %1) #3 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %11 = load i64, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @G, i64 0, i64 %11
  store ptr %12, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %13 = load ptr, ptr %5, align 8, !tbaa !9
  %14 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  %15 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %14, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %16 = load ptr, ptr %5, align 8, !tbaa !9
  %17 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %18 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %17, ptr %18, align 8
  br label %19

19:                                               ; preds = %79, %2
  %20 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %24 = load i64, ptr %23, align 8, !tbaa !5
  store i64 %24, ptr %9, align 8, !tbaa !5
  %25 = load i64, ptr %9, align 8, !tbaa !5
  %26 = load i64, ptr %4, align 8, !tbaa !5
  %27 = icmp eq i64 %25, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %22
  store i32 3, ptr %8, align 4
  br label %76

29:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %30 = load i64, ptr @k, align 8, !tbaa !5
  store i64 %30, ptr %10, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %70, %29
  %32 = load i64, ptr %10, align 8, !tbaa !5
  %33 = icmp sge i64 %32, 1
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %73

35:                                               ; preds = %31
  %36 = load i64, ptr %10, align 8, !tbaa !5
  %37 = icmp eq i64 %36, 1
  br i1 %37, label %38, label %49

38:                                               ; preds = %35
  %39 = load i64, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %39
  %41 = getelementptr inbounds [30 x i64], ptr %40, i64 0, i64 0
  %42 = load i64, ptr %41, align 16, !tbaa !5
  %43 = load i64, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %43
  %45 = load i64, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds [30 x i64], ptr %44, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = add nsw i64 %47, %42
  store i64 %48, ptr %46, align 8, !tbaa !5
  br label %69

49:                                               ; preds = %35
  %50 = load i64, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %50
  %52 = load i64, ptr %10, align 8, !tbaa !5
  %53 = sub nsw i64 %52, 1
  %54 = getelementptr inbounds [30 x i64], ptr %51, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = load i64, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %56
  %58 = load i64, ptr %10, align 8, !tbaa !5
  %59 = sub nsw i64 %58, 2
  %60 = getelementptr inbounds [30 x i64], ptr %57, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = sub nsw i64 %55, %61
  %63 = load i64, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %63
  %65 = load i64, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds [30 x i64], ptr %64, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = add nsw i64 %67, %62
  store i64 %68, ptr %66, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %49, %38
  br label %70

70:                                               ; preds = %69
  %71 = load i64, ptr %10, align 8, !tbaa !5
  %72 = add nsw i64 %71, -1
  store i64 %72, ptr %10, align 8, !tbaa !5
  br label %31, !llvm.loop !11

73:                                               ; preds = %34
  %74 = load i64, ptr %9, align 8, !tbaa !5
  %75 = load i64, ptr %3, align 8, !tbaa !5
  call void @_Z5dfs_2xx(i64 noundef %74, i64 noundef %75)
  store i32 0, ptr %8, align 4
  br label %76

76:                                               ; preds = %73, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %77 = load i32, ptr %8, align 4
  switch i32 %77, label %82 [
    i32 0, label %78
    i32 3, label %79
  ]

78:                                               ; preds = %76
  br label %79

79:                                               ; preds = %78, %76
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br label %19

81:                                               ; preds = %21
  ret void

82:                                               ; preds = %76
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@k = external dso_local local_unnamed_addr global i64, align 8
@dp = external dso_local local_unnamed_addr global [100010 x [30 x i64]], align 16
@G = external dso_local global [100010 x %"class.std::vector"], align 16

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5dfs_2xx(i64 noundef %0, i64 noundef %1) local_unnamed_addr #1 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @G, i64 0, i64 %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %6 = tail call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  store ptr %6, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %7 = tail call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  store ptr %7, ptr %4, align 8
  %8 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br i1 %8, label %.lr.ph21, label %._crit_edge22

.lr.ph21:                                         ; preds = %2
  %9 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %0
  %10 = mul i64 %0, 240
  %11 = getelementptr i8, ptr @dp, i64 %10
  %scevgep24 = getelementptr i8, ptr %11, i64 -8
  %scevgep35 = getelementptr i8, ptr @dp, i64 %10
  %scevgep36 = getelementptr i8, ptr @dp, i64 %10
  br label %12

._crit_edge22:                                    ; preds = %70, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret void

12:                                               ; preds = %.lr.ph21, %70
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %15 = icmp eq i64 %14, %1
  br i1 %15, label %70, label %16

16:                                               ; preds = %12
  %17 = load i64, ptr @k, align 8, !tbaa !5
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %19 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %14, i64 1
  %min.iters.check = icmp ult i64 %17, 29
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

scalar.ph.preheader:                              ; preds = %vector.body, %vector.memcheck, %vector.scevcheck, %.lr.ph
  %.019.ph = phi i64 [ %17, %vector.memcheck ], [ %17, %vector.scevcheck ], [ %17, %.lr.ph ], [ %37, %vector.body ]
  br label %scalar.ph

vector.scevcheck:                                 ; preds = %.lr.ph
  %20 = add nsw i64 %17, -1
  %21 = mul i64 %14, 240
  %22 = shl i64 %17, 3
  %23 = add i64 %21, %22
  %scevgep = getelementptr i8, ptr @dp, i64 %23
  %mul.result.neg = mul i64 %20, -8
  %24 = getelementptr i8, ptr %scevgep, i64 %mul.result.neg
  %25 = icmp ugt ptr %24, %scevgep
  %scevgep25 = getelementptr i8, ptr %scevgep24, i64 %22
  %mul.result27.neg = mul i64 %20, -8
  %mul.overflow28 = icmp ugt i64 %20, 2305843009213693951
  %26 = getelementptr i8, ptr %scevgep25, i64 %mul.result27.neg
  %27 = icmp ugt ptr %26, %scevgep25
  %28 = or i1 %27, %mul.overflow28
  %scevgep29 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 -16), i64 %23
  %mul.result31.neg = mul i64 %20, -8
  %29 = getelementptr i8, ptr %scevgep29, i64 %mul.result31.neg
  %30 = icmp ugt ptr %29, %scevgep29
  %31 = or i1 %25, %28
  %32 = or i1 %30, %31
  br i1 %32, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %33 = mul i64 %14, 240
  %scevgep33 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @dp, i64 8), i64 %33
  %34 = shl i64 %17, 3
  %35 = add i64 %33, %34
  %scevgep34 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @dp, i64 8), i64 %35
  %scevgep37 = getelementptr i8, ptr %scevgep36, i64 %34
  %scevgep38 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 -8), i64 %33
  %scevgep39 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 -8), i64 %35
  %bound0 = icmp ult ptr %scevgep33, %scevgep37
  %bound1 = icmp ult ptr %scevgep35, %scevgep34
  %found.conflict = and i1 %bound0, %bound1
  %bound040 = icmp ult ptr %scevgep33, %scevgep39
  %bound141 = icmp ult ptr %scevgep38, %scevgep34
  %found.conflict42 = and i1 %bound040, %bound141
  %conflict.rdx = or i1 %found.conflict, %found.conflict42
  br i1 %conflict.rdx, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.mod.vf = and i64 %17, 3
  %36 = icmp eq i64 %n.mod.vf, 0
  %37 = select i1 %36, i64 4, i64 %n.mod.vf
  %n.vec = sub nsw i64 %17, %37
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %17, %index
  %38 = add nsw i64 %offset.idx, -1
  %39 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %0, i64 %38
  %40 = getelementptr inbounds i8, ptr %39, i64 -8
  %41 = getelementptr inbounds i8, ptr %39, i64 -24
  %wide.load = load <2 x i64>, ptr %40, align 8, !tbaa !5, !alias.scope !9
  %wide.load43 = load <2 x i64>, ptr %41, align 8, !tbaa !5, !alias.scope !9
  %42 = add nsw i64 %offset.idx, -2
  %43 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %14, i64 %42
  %44 = getelementptr inbounds i8, ptr %43, i64 -8
  %45 = getelementptr inbounds i8, ptr %43, i64 -24
  %wide.load45 = load <2 x i64>, ptr %44, align 8, !tbaa !5, !alias.scope !12
  %wide.load47 = load <2 x i64>, ptr %45, align 8, !tbaa !5, !alias.scope !12
  %46 = sub <2 x i64> %wide.load, %wide.load45
  %47 = sub <2 x i64> %wide.load43, %wide.load47
  %48 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %14, i64 %offset.idx
  %49 = getelementptr inbounds i8, ptr %48, i64 -8
  %50 = getelementptr inbounds i8, ptr %48, i64 -24
  %wide.load49 = load <2 x i64>, ptr %49, align 8, !tbaa !5, !alias.scope !14, !noalias !16
  %wide.load51 = load <2 x i64>, ptr %50, align 8, !tbaa !5, !alias.scope !14, !noalias !16
  %51 = add nsw <2 x i64> %46, %wide.load49
  %52 = add nsw <2 x i64> %47, %wide.load51
  store <2 x i64> %51, ptr %49, align 8, !tbaa !5, !alias.scope !14, !noalias !16
  store <2 x i64> %52, ptr %50, align 8, !tbaa !5, !alias.scope !14, !noalias !16
  %index.next = add nuw i64 %index, 4
  %53 = icmp eq i64 %index.next, %n.vec
  br i1 %53, label %scalar.ph.preheader, label %vector.body, !llvm.loop !17

._crit_edge:                                      ; preds = %58, %.thread, %16
  call void @_Z5dfs_2xx(i64 noundef %14, i64 noundef %0)
  br label %70

scalar.ph:                                        ; preds = %scalar.ph.preheader, %58
  %.019 = phi i64 [ %59, %58 ], [ %.019.ph, %scalar.ph.preheader ]
  %54 = icmp eq i64 %.019, 1
  br i1 %54, label %.thread, label %58

.thread:                                          ; preds = %scalar.ph
  %55 = load i64, ptr %9, align 16, !tbaa !5
  %56 = load i64, ptr %19, align 8, !tbaa !5
  %57 = add nsw i64 %56, %55
  store i64 %57, ptr %19, align 8, !tbaa !5
  br label %._crit_edge

58:                                               ; preds = %scalar.ph
  %59 = add nsw i64 %.019, -1
  %60 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = add nsw i64 %.019, -2
  %63 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %14, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = sub i64 %61, %64
  %66 = getelementptr inbounds [100010 x [30 x i64]], ptr @dp, i64 0, i64 %14, i64 %.019
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = add nsw i64 %65, %67
  store i64 %68, ptr %66, align 8, !tbaa !5
  %69 = icmp sgt i64 %.019, 1
  br i1 %69, label %scalar.ph, label %._crit_edge, !llvm.loop !21

70:                                               ; preds = %12, %._crit_edge
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %72 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br i1 %72, label %12, label %._crit_edge22
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10}
!10 = distinct !{!10, !11}
!11 = distinct !{!11, !"LVerDomain"}
!12 = !{!13}
!13 = distinct !{!13, !11}
!14 = !{!15}
!15 = distinct !{!15, !11}
!16 = !{!10, !13}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !18, !19}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass