; LLVM IR from codemistic/Data-Structures-and-Algorithms :: CPP/Dynamic Programming/number_of_dice_rolls_with_target_sum.ll (Z16numRollsToTargetiii)

; 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"

@dp = external dso_local global [31 x [1001 x i32]], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z16numRollsToTargetiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %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 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  store i32 1, ptr @dp, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %23, %3
  %15 = load i32, ptr %7, align 4, !tbaa !5
  %16 = load i32, ptr %6, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  br label %26

19:                                               ; preds = %14
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [1001 x i32], ptr @dp, i64 0, i64 %21
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %19
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %7, align 4, !tbaa !5
  br label %14, !llvm.loop !9

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

27:                                               ; preds = %37, %26
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  br label %40

32:                                               ; preds = %27
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %34
  %36 = getelementptr inbounds [1001 x i32], ptr %35, i64 0, i64 0
  store i32 0, ptr %36, align 4, !tbaa !5
  br label %37

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

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %95, %40
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = icmp sle i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  br label %98

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %91, %46
  %48 = load i32, ptr %11, align 4, !tbaa !5
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = icmp sle i32 %48, %49
  br i1 %50, label %52, label %51

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

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #2
  store i64 0, ptr %12, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %79, %52
  %54 = load i32, ptr %13, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = icmp sle i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  br label %82

58:                                               ; preds = %53
  %59 = load i32, ptr %11, align 4, !tbaa !5
  %60 = load i32, ptr %13, align 4, !tbaa !5
  %61 = icmp sge i32 %59, %60
  br i1 %61, label %62, label %78

62:                                               ; preds = %58
  %63 = load i64, ptr %12, align 8, !tbaa !12
  %64 = srem i64 %63, 1000000007
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %67
  %69 = load i32, ptr %11, align 4, !tbaa !5
  %70 = load i32, ptr %13, align 4, !tbaa !5
  %71 = sub nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1001 x i32], ptr %68, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = srem i32 %74, 1000000007
  %76 = sext i32 %75 to i64
  %77 = add nsw i64 %64, %76
  store i64 %77, ptr %12, align 8, !tbaa !12
  br label %78

78:                                               ; preds = %62, %58
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %13, align 4, !tbaa !5
  br label %53, !llvm.loop !14

82:                                               ; preds = %57
  %83 = load i64, ptr %12, align 8, !tbaa !12
  %84 = trunc i64 %83 to i32
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %86
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1001 x i32], ptr %87, i64 0, i64 %89
  store i32 %84, ptr %90, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #2
  br label %91

91:                                               ; preds = %82
  %92 = load i32, ptr %11, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %11, align 4, !tbaa !5
  br label %47, !llvm.loop !15

94:                                               ; preds = %51
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %9, align 4, !tbaa !5
  br label %41, !llvm.loop !16

98:                                               ; preds = %45
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %100
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [1001 x i32], ptr %101, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = srem i32 %105, 1000000007
  ret i32 %106
}

; 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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!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"

@dp = external dso_local local_unnamed_addr global [31 x [1001 x i32]], align 16

; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local noundef range(i32 -1000000006, 1000000007) i32 @_Z16numRollsToTargetiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  store i32 1, ptr @dp, align 16, !tbaa !5
  %.not43 = icmp slt i32 %2, 1
  br i1 %.not43, label %.preheader42, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %3
  %4 = zext nneg i32 %2 to i64
  %5 = shl nuw nsw i64 %4, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @dp, i64 4), i8 0, i64 %5, i1 false), !tbaa !5
  br label %.preheader42

.preheader42:                                     ; preds = %.lr.ph.preheader, %3
  %.not3545 = icmp slt i32 %0, 1
  br i1 %.not3545, label %._crit_edge57, label %.lr.ph47.preheader

.lr.ph47.preheader:                               ; preds = %.preheader42
  %6 = zext nneg i32 %0 to i64
  %xtraiter = and i64 %6, 3
  %7 = icmp ult i32 %0, 4
  br i1 %7, label %.preheader41.unr-lcssa, label %.lr.ph47.preheader.new

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

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

.lr.ph47.epil:                                    ; preds = %.preheader41.unr-lcssa, %.lr.ph47.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph47.epil ], [ %indvars.iv.unr, %.preheader41.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph47.epil ], [ 0, %.preheader41.unr-lcssa ]
  %8 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv.epil
  store i32 0, ptr %8, align 4, !tbaa !5
  %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 %.preheader41, label %.lr.ph47.epil, !llvm.loop !9

.preheader41:                                     ; preds = %.lr.ph47.epil, %.preheader41.unr-lcssa
  %brmerge = or i1 %.not3545, %.not43
  br i1 %brmerge, label %._crit_edge57, label %.preheader40.lr.ph.split

.preheader40.lr.ph.split:                         ; preds = %.preheader41
  %.not3848 = icmp slt i32 %1, 1
  br i1 %.not3848, label %.preheader40.us58.preheader, label %.preheader40.preheader

.preheader40.preheader:                           ; preds = %.preheader40.lr.ph.split
  %9 = add nuw i32 %1, 1
  %10 = add nuw i32 %2, 1
  %11 = add nuw i32 %0, 1
  %wide.trip.count78 = zext i32 %11 to i64
  %wide.trip.count73 = zext i32 %10 to i64
  %wide.trip.count68 = zext i32 %9 to i64
  br label %.preheader40

.preheader40.us58.preheader:                      ; preds = %.preheader40.lr.ph.split
  %12 = zext nneg i32 %2 to i64
  %13 = shl nuw nsw i64 %12, 2
  %wide.trip.count83 = zext nneg i32 %0 to i64
  %xtraiter88 = and i64 %wide.trip.count83, 7
  %14 = icmp ult i32 %0, 8
  br i1 %14, label %._crit_edge57.loopexit.unr-lcssa, label %.preheader40.us58.preheader.new

.preheader40.us58.preheader.new:                  ; preds = %.preheader40.us58.preheader
  %unroll_iter91 = and i64 %wide.trip.count83, 2147483640
  br label %.preheader40.us58

.preheader40.us58:                                ; preds = %.preheader40.us58, %.preheader40.us58.preheader.new
  %indvar = phi i64 [ 0, %.preheader40.us58.preheader.new ], [ %indvar.next.7, %.preheader40.us58 ]
  %niter92 = phi i64 [ 0, %.preheader40.us58.preheader.new ], [ %niter92.next.7, %.preheader40.us58 ]
  %15 = mul nuw nsw i64 %indvar, 4004
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @dp, i64 4008), i64 %15
  tail call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %13, i1 false), !tbaa !5
  %16 = mul nuw i64 %indvar, 4004
  %gep93 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @dp, i64 4008), i64 4004), i64 %16
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep93, i8 0, i64 %13, i1 false), !tbaa !5
  %17 = mul nuw i64 %indvar, 4004
  %gep94 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @dp, i64 4008), i64 8008), i64 %17
  tail call void @llvm.memset.p0.i64(ptr align 16 %gep94, i8 0, i64 %13, i1 false), !tbaa !5
  %18 = mul nuw i64 %indvar, 4004
  %gep95 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @dp, i64 4008), i64 12012), i64 %18
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep95, i8 0, i64 %13, i1 false), !tbaa !5
  %19 = mul nuw i64 %indvar, 4004
  %gep96 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @dp, i64 4008), i64 16016), i64 %19
  tail call void @llvm.memset.p0.i64(ptr align 8 %gep96, i8 0, i64 %13, i1 false), !tbaa !5
  %20 = mul nuw i64 %indvar, 4004
  %gep97 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @dp, i64 4008), i64 20020), i64 %20
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep97, i8 0, i64 %13, i1 false), !tbaa !5
  %21 = mul nuw i64 %indvar, 4004
  %gep98 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @dp, i64 4008), i64 24024), i64 %21
  tail call void @llvm.memset.p0.i64(ptr align 16 %gep98, i8 0, i64 %13, i1 false), !tbaa !5
  %22 = mul nuw i64 %indvar, 4004
  %gep99 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @dp, i64 4008), i64 28028), i64 %22
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep99, i8 0, i64 %13, i1 false), !tbaa !5
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter92.next.7 = add i64 %niter92, 8
  %niter92.ncmp.7 = icmp eq i64 %niter92.next.7, %unroll_iter91
  br i1 %niter92.ncmp.7, label %._crit_edge57.loopexit.unr-lcssa, label %.preheader40.us58, !llvm.loop !11

.lr.ph47:                                         ; preds = %.lr.ph47, %.lr.ph47.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph47.preheader.new ], [ %indvars.iv.next.3, %.lr.ph47 ]
  %niter = phi i64 [ 0, %.lr.ph47.preheader.new ], [ %niter.next.3, %.lr.ph47 ]
  %23 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv
  store i32 0, ptr %23, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next
  store i32 0, ptr %24, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %25 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next.1
  store i32 0, ptr %25, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %26 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next.2
  store i32 0, ptr %26, align 4, !tbaa !5
  %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 %.preheader41.unr-lcssa, label %.lr.ph47, !llvm.loop !13

.preheader40:                                     ; preds = %.preheader40.preheader, %._crit_edge54.split
  %indvars.iv75 = phi i64 [ 1, %.preheader40.preheader ], [ %indvars.iv.next76, %._crit_edge54.split ]
  %27 = add nsw i64 %indvars.iv75, -1
  br label %.preheader

._crit_edge57.loopexit.unr-lcssa:                 ; preds = %.preheader40.us58, %.preheader40.us58.preheader
  %indvar.unr = phi i64 [ 0, %.preheader40.us58.preheader ], [ %indvar.next.7, %.preheader40.us58 ]
  %lcmp.mod90.not = icmp eq i64 %xtraiter88, 0
  br i1 %lcmp.mod90.not, label %._crit_edge57, label %.preheader40.us58.epil

.preheader40.us58.epil:                           ; preds = %._crit_edge57.loopexit.unr-lcssa, %.preheader40.us58.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.preheader40.us58.epil ], [ %indvar.unr, %._crit_edge57.loopexit.unr-lcssa ]
  %epil.iter89 = phi i64 [ %epil.iter89.next, %.preheader40.us58.epil ], [ 0, %._crit_edge57.loopexit.unr-lcssa ]
  %28 = mul nuw nsw i64 %indvar.epil, 4004
  %gep.epil = getelementptr i8, ptr getelementptr inbounds (i8, ptr @dp, i64 4008), i64 %28
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep.epil, i8 0, i64 %13, i1 false), !tbaa !5
  %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
  %epil.iter89.next = add i64 %epil.iter89, 1
  %epil.iter89.cmp.not = icmp eq i64 %epil.iter89.next, %xtraiter88
  br i1 %epil.iter89.cmp.not, label %._crit_edge57, label %.preheader40.us58.epil, !llvm.loop !14

._crit_edge57:                                    ; preds = %._crit_edge54.split, %._crit_edge57.loopexit.unr-lcssa, %.preheader40.us58.epil, %.preheader41, %.preheader42
  %29 = sext i32 %0 to i64
  %30 = sext i32 %2 to i64
  %31 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %29, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = srem i32 %32, 1000000007
  ret i32 %33

.preheader:                                       ; preds = %.preheader40, %._crit_edge
  %indvars.iv70 = phi i64 [ 1, %.preheader40 ], [ %indvars.iv.next71, %._crit_edge ]
  br label %36

._crit_edge54.split:                              ; preds = %._crit_edge
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %._crit_edge57, label %.preheader40, !llvm.loop !11

._crit_edge:                                      ; preds = %45
  %34 = trunc nsw i64 %.1 to i32
  %35 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv75, i64 %indvars.iv70
  store i32 %34, ptr %35, align 4, !tbaa !5
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count73
  br i1 %exitcond74.not, label %._crit_edge54.split, label %.preheader, !llvm.loop !15

36:                                               ; preds = %.preheader, %45
  %indvars.iv65 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next66, %45 ]
  %.02849 = phi i64 [ 0, %.preheader ], [ %.1, %45 ]
  %.not39 = icmp ult i64 %indvars.iv70, %indvars.iv65
  br i1 %.not39, label %45, label %37

37:                                               ; preds = %36
  %38 = srem i64 %.02849, 1000000007
  %39 = sub nsw i64 %indvars.iv70, %indvars.iv65
  %40 = getelementptr inbounds [31 x [1001 x i32]], ptr @dp, i64 0, i64 %27, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = srem i32 %41, 1000000007
  %43 = sext i32 %42 to i64
  %44 = add nsw i64 %38, %43
  br label %45

45:                                               ; preds = %36, %37
  %.1 = phi i64 [ %44, %37 ], [ %.02849, %36 ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count68
  br i1 %exitcond69.not, label %._crit_edge, label %36, !llvm.loop !16
}

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

attributes #0 = { mustprogress nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) 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 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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