; LLVM IR from Tunghohin/Competitive_Coding :: Luogu/p1273.ll (Z5solvev)

; 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.tree = type <{ [3010 x %"struct.tree<long long>::edge"], [3010 x i32], i32, [4 x i8] }>
%"struct.tree<long long>::edge" = type { i32, i32, i64 }
%"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" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@val = external dso_local global [3010 x i32], align 16
@dp = external dso_local global [3010 x [3010 x i64]], align 16
@tr = external dso_local global %class.tree, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfsi(i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #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 i32, align 4
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 -63, i64 72480800, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %37, %0
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = sub nsw i32 %14, %15
  %17 = icmp sle i32 %13, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %33, %19
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  call void @_ZN4treeIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(60204) @tr, i32 noundef %29, i32 noundef %30, i64 noundef %32)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %33

33:                                               ; preds = %26
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %4, align 4, !tbaa !5
  br label %21, !llvm.loop !9

36:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %37

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

40:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = sub nsw i32 %41, %42
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %7, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %55, %40
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [3010 x i32], ptr @val, i64 0, i64 %52
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %53)
  br label %55

55:                                               ; preds = %50
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %7, align 4, !tbaa !5
  br label %45, !llvm.loop !12

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

59:                                               ; preds = %69, %58
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = icmp sle i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 11, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %72

64:                                               ; preds = %59
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [3010 x [3010 x i64]], ptr @dp, i64 0, i64 %66
  %68 = getelementptr inbounds [3010 x i64], ptr %67, i64 0, i64 0
  store i64 0, ptr %68, align 16, !tbaa !13
  br label %69

69:                                               ; preds = %64
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %8, align 4, !tbaa !5
  br label %59, !llvm.loop !15

72:                                               ; preds = %63
  %73 = call noundef i32 @_Z3dfsi(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %74 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %74, ptr %9, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %90, %72
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = icmp sge i32 %76, 1
  br i1 %77, label %79, label %78

78:                                               ; preds = %75
  store i32 14, ptr %2, align 4
  br label %93

79:                                               ; preds = %75
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [3010 x i64], ptr getelementptr inbounds ([3010 x [3010 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !13
  %84 = icmp sge i64 %83, 0
  br i1 %84, label %85, label %89

85:                                               ; preds = %79
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %86)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %87, i8 noundef signext 10)
  store i32 14, ptr %2, align 4
  br label %93

89:                                               ; preds = %79
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr %9, align 4, !tbaa !5
  br label %75, !llvm.loop !16

93:                                               ; preds = %85, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %94

94:                                               ; preds = %93
  ret void
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4treeIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(60204), i32 noundef, i32 noundef, i64 noundef) #4 align 2

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

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

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 = { "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) }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


; 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.tree = type <{ [3010 x %"struct.tree<long long>::edge"], [3010 x i32], i32, [4 x i8] }>
%"struct.tree<long long>::edge" = type { i32, i32, i64 }
%"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" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@val = external dso_local global [3010 x i32], align 16
@dp = external dso_local local_unnamed_addr global [3010 x [3010 x i64]], align 16
@tr = external dso_local global %class.tree, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfsi(i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) @m)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(72480800) @dp, i8 -63, i64 72480800, i1 false)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %8 = sub nsw i32 %6, %7
  %.not28 = icmp slt i32 %8, 1
  br i1 %.not28, label %.preheader23, label %.lr.ph31

.preheader23:                                     ; preds = %._crit_edge, %0
  %9 = phi i32 [ %6, %0 ], [ %14, %._crit_edge ]
  %.lcssa25 = phi i32 [ %8, %0 ], [ %16, %._crit_edge ]
  %.not20.not32 = icmp slt i32 %.lcssa25, %9
  br i1 %.not20.not32, label %.lr.ph34.preheader, label %.preheader

.lr.ph34.preheader:                               ; preds = %.preheader23
  %10 = sext i32 %.lcssa25 to i64
  br label %.lr.ph34

.lr.ph31:                                         ; preds = %0, %._crit_edge
  %.01829 = phi i32 [ %13, %._crit_edge ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %.not2226 = icmp slt i32 %12, 1
  br i1 %.not2226, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %13 = add nuw nsw i32 %.01829, 1
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = sub nsw i32 %14, %15
  %.not.not = icmp slt i32 %.01829, %16
  br i1 %.not.not, label %.lr.ph31, label %.preheader23, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph31, %.lr.ph
  %.01727 = phi i32 [ %22, %.lr.ph ], [ 1, %.lr.ph31 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  call void @_ZN4treeIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(60204) @tr, i32 noundef %.01829, i32 noundef %19, i64 noundef %21)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %22 = add nuw nsw i32 %.01727, 1
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %.not22.not = icmp slt i32 %.01727, %23
  br i1 %.not22.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph34, %.preheader23
  %.lcssa = phi i32 [ %9, %.preheader23 ], [ %28, %.lr.ph34 ]
  %.not2136 = icmp slt i32 %.lcssa, 1
  br i1 %.not2136, label %._crit_edge39, label %.lr.ph38.preheader

.lr.ph38.preheader:                               ; preds = %.preheader
  %24 = zext nneg i32 %.lcssa to i64
  %xtraiter = and i64 %24, 3
  %25 = icmp ult i32 %.lcssa, 4
  br i1 %25, label %._crit_edge39.loopexit.unr-lcssa, label %.lr.ph38.preheader.new

.lr.ph38.preheader.new:                           ; preds = %.lr.ph38.preheader
  %unroll_iter = and i64 %24, 2147483644
  br label %.lr.ph38

.lr.ph34:                                         ; preds = %.lr.ph34.preheader, %.lr.ph34
  %indvars.iv = phi i64 [ %10, %.lr.ph34.preheader ], [ %indvars.iv.next, %.lr.ph34 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %26 = getelementptr inbounds [3010 x i32], ptr @val, i64 0, i64 %indvars.iv.next
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %.not20.not = icmp slt i64 %indvars.iv.next, %29
  br i1 %.not20.not, label %.lr.ph34, label %.preheader, !llvm.loop !12

._crit_edge39.loopexit.unr-lcssa:                 ; preds = %.lr.ph38, %.lr.ph38.preheader
  %indvars.iv47.unr = phi i64 [ 1, %.lr.ph38.preheader ], [ %indvars.iv.next48.3, %.lr.ph38 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge39, label %.lr.ph38.epil

.lr.ph38.epil:                                    ; preds = %._crit_edge39.loopexit.unr-lcssa, %.lr.ph38.epil
  %indvars.iv47.epil = phi i64 [ %indvars.iv.next48.epil, %.lr.ph38.epil ], [ %indvars.iv47.unr, %._crit_edge39.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph38.epil ], [ 0, %._crit_edge39.loopexit.unr-lcssa ]
  %30 = getelementptr inbounds [3010 x [3010 x i64]], ptr @dp, i64 0, i64 %indvars.iv47.epil
  store i64 0, ptr %30, align 16, !tbaa !13
  %indvars.iv.next48.epil = add nuw nsw i64 %indvars.iv47.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 %._crit_edge39, label %.lr.ph38.epil, !llvm.loop !15

._crit_edge39:                                    ; preds = %._crit_edge39.loopexit.unr-lcssa, %.lr.ph38.epil, %.preheader
  %31 = call noundef i32 @_Z3dfsi(i32 noundef 1)
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph42, label %.loopexit

.lr.ph38:                                         ; preds = %.lr.ph38, %.lr.ph38.preheader.new
  %indvars.iv47 = phi i64 [ 1, %.lr.ph38.preheader.new ], [ %indvars.iv.next48.3, %.lr.ph38 ]
  %niter = phi i64 [ 0, %.lr.ph38.preheader.new ], [ %niter.next.3, %.lr.ph38 ]
  %34 = getelementptr inbounds [3010 x [3010 x i64]], ptr @dp, i64 0, i64 %indvars.iv47
  store i64 0, ptr %34, align 16, !tbaa !13
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %35 = getelementptr inbounds [3010 x [3010 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next48
  store i64 0, ptr %35, align 16, !tbaa !13
  %indvars.iv.next48.1 = add nuw nsw i64 %indvars.iv47, 2
  %36 = getelementptr inbounds [3010 x [3010 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next48.1
  store i64 0, ptr %36, align 16, !tbaa !13
  %indvars.iv.next48.2 = add nuw nsw i64 %indvars.iv47, 3
  %37 = getelementptr inbounds [3010 x [3010 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next48.2
  store i64 0, ptr %37, align 16, !tbaa !13
  %indvars.iv.next48.3 = add nuw nsw i64 %indvars.iv47, 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 %._crit_edge39.loopexit.unr-lcssa, label %.lr.ph38, !llvm.loop !17

.lr.ph42:                                         ; preds = %._crit_edge39, %45
  %.040 = phi i32 [ %46, %45 ], [ %32, %._crit_edge39 ]
  %38 = zext nneg i32 %.040 to i64
  %39 = getelementptr inbounds [3010 x i64], ptr getelementptr inbounds (i8, ptr @dp, i64 24080), i64 0, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !13
  %41 = icmp sgt i64 %40, -1
  br i1 %41, label %42, label %45

42:                                               ; preds = %.lr.ph42
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.040)
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %43, i8 noundef signext 10)
  br label %.loopexit

45:                                               ; preds = %.lr.ph42
  %46 = add nsw i32 %.040, -1
  %47 = icmp sgt i32 %.040, 1
  br i1 %47, label %.lr.ph42, label %.loopexit, !llvm.loop !18

.loopexit:                                        ; preds = %45, %._crit_edge39, %42
  ret void
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4treeIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(60204), i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #4 align 2

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass