; LLVM IR from the-hyp0cr1t3/CC :: CSES/Dynamic Programming (Rectangle Cutting)

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

%"class.std::basic_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.anon = type { i8 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@dp = external dso_local global [505 x [505 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@chmin = external hidden global %class.anon, align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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
  store i32 0, ptr %1, align 4
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %15 = 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)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %17

17:                                               ; preds = %110, %0
  %18 = load i32, ptr %2, align 4, !tbaa !8
  %19 = load i32, ptr %5, align 4, !tbaa !8
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %21, label %113

21:                                               ; preds = %17
  store i32 1, ptr %3, align 4, !tbaa !8
  br label %22

22:                                               ; preds = %106, %21
  %23 = load i32, ptr %3, align 4, !tbaa !8
  %24 = load i32, ptr %6, align 4, !tbaa !8
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %26, label %109

26:                                               ; preds = %22
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = load i32, ptr %3, align 4, !tbaa !8
  %29 = icmp eq i32 %27, %28
  br i1 %29, label %30, label %31

30:                                               ; preds = %26
  br label %106

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !8
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %33
  %35 = load i32, ptr %3, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [505 x i32], ptr %34, i64 0, i64 %36
  store i32 2000000000, ptr %37, align 4, !tbaa !8
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %68, %31
  %39 = load i32, ptr %4, align 4, !tbaa !8
  %40 = load i32, ptr %2, align 4, !tbaa !8
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %42, label %71

42:                                               ; preds = %38
  %43 = load i32, ptr %2, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %44
  %46 = load i32, ptr %3, align 4, !tbaa !8
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [505 x i32], ptr %45, i64 0, i64 %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %49 = load i32, ptr %4, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %50
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [505 x i32], ptr %51, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !8
  %56 = load i32, ptr %2, align 4, !tbaa !8
  %57 = load i32, ptr %4, align 4, !tbaa !8
  %58 = sub nsw i32 %56, %57
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %59
  %61 = load i32, ptr %3, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [505 x i32], ptr %60, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !8
  %65 = add nsw i32 %55, %64
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %7, align 4, !tbaa !8
  %67 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %48, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %68

68:                                               ; preds = %42
  %69 = load i32, ptr %4, align 4, !tbaa !8
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %4, align 4, !tbaa !8
  br label %38, !llvm.loop !11

71:                                               ; preds = %38
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %72

72:                                               ; preds = %102, %71
  %73 = load i32, ptr %4, align 4, !tbaa !8
  %74 = load i32, ptr %3, align 4, !tbaa !8
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %76, label %105

76:                                               ; preds = %72
  %77 = load i32, ptr %2, align 4, !tbaa !8
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %78
  %80 = load i32, ptr %3, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [505 x i32], ptr %79, i64 0, i64 %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %83 = load i32, ptr %2, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %84
  %86 = load i32, ptr %4, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [505 x i32], ptr %85, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %90 = load i32, ptr %2, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %91
  %93 = load i32, ptr %3, align 4, !tbaa !8
  %94 = load i32, ptr %4, align 4, !tbaa !8
  %95 = sub nsw i32 %93, %94
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [505 x i32], ptr %92, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !8
  %99 = add nsw i32 %89, %98
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %8, align 4, !tbaa !8
  %101 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %82, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %102

102:                                              ; preds = %76
  %103 = load i32, ptr %4, align 4, !tbaa !8
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %4, align 4, !tbaa !8
  br label %72, !llvm.loop !13

105:                                              ; preds = %72
  br label %106

106:                                              ; preds = %105, %30
  %107 = load i32, ptr %3, align 4, !tbaa !8
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %3, align 4, !tbaa !8
  br label %22, !llvm.loop !14

109:                                              ; preds = %22
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %2, align 4, !tbaa !8
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %2, align 4, !tbaa !8
  br label %17, !llvm.loop !15

113:                                              ; preds = %17
  %114 = load i32, ptr %5, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %115
  %117 = load i32, ptr %6, align 4, !tbaa !8
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [505 x i32], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !8
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %120)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %122 = load i32, ptr %1, align 4
  ret i32 %122
}

; 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

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

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: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

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 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 = { 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 = distinct !{!14, !12}
!15 = distinct !{!15, !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::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.anon = type { i8 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@dp = external dso_local global [505 x [505 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@chmin = external hidden global %class.anon, align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = load i32, ptr %1, align 4, !tbaa !8
  %.not41 = icmp slt i32 %13, 1
  %.pre64 = load i32, ptr %2, align 4, !tbaa !8
  %14 = icmp slt i32 %.pre64, 1
  %or.cond = select i1 %.not41, i1 true, i1 %14
  br i1 %or.cond, label %._crit_edge44, label %.preheader33

.preheader33:                                     ; preds = %0, %._crit_edge
  %15 = phi i32 [ %56, %._crit_edge ], [ %.pre64, %0 ]
  %16 = phi i32 [ %57, %._crit_edge ], [ %.pre64, %0 ]
  %.03042 = phi i32 [ %58, %._crit_edge ], [ 1, %0 ]
  %.not3237 = icmp slt i32 %16, 1
  br i1 %.not3237, label %._crit_edge, label %.lr.ph40

.lr.ph40:                                         ; preds = %.preheader33
  %17 = zext i32 %.03042 to i64
  %18 = icmp ugt i32 %.03042, 1
  br i1 %18, label %.lr.ph40.split.us.preheader, label %.lr.ph40.split

.lr.ph40.split.us.preheader:                      ; preds = %.lr.ph40
  %19 = sext i32 %.03042 to i64
  br label %.lr.ph40.split.us

.lr.ph40.split.us:                                ; preds = %.lr.ph40.split.us.preheader, %.loopexit.us
  %indvars.iv61 = phi i64 [ 1, %.lr.ph40.split.us.preheader ], [ %indvars.iv.next62, %.loopexit.us ]
  %20 = icmp eq i64 %indvars.iv61, %17
  br i1 %20, label %.loopexit.us, label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph40.split.us
  %21 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %17, i64 %indvars.iv61
  store i32 2000000000, ptr %21, align 4, !tbaa !8
  br label %30

.lr.ph36.us:                                      ; preds = %..preheader_crit_edge.us, %.lr.ph36.us
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.lr.ph36.us ], [ 1, %..preheader_crit_edge.us ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %22 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %17, i64 %indvars.iv56
  %23 = load i32, ptr %22, align 4, !tbaa !8
  %24 = sub nsw i64 %indvars.iv61, %indvars.iv56
  %25 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %17, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !8
  %27 = add i32 %23, 1
  %28 = add i32 %27, %26
  store i32 %28, ptr %4, align 4, !tbaa !8
  %29 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond60.not = icmp eq i64 %indvars.iv.next57, %indvars.iv61
  br i1 %exitcond60.not, label %.loopexit.us, label %.lr.ph36.us, !llvm.loop !11

30:                                               ; preds = %.lr.ph.us, %30
  %indvars.iv52 = phi i64 [ 1, %.lr.ph.us ], [ %indvars.iv.next53, %30 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %31 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %indvars.iv52, i64 %indvars.iv61
  %32 = load i32, ptr %31, align 4, !tbaa !8
  %33 = sub nsw i64 %19, %indvars.iv52
  %34 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %33, i64 %indvars.iv61
  %35 = load i32, ptr %34, align 4, !tbaa !8
  %36 = add i32 %32, 1
  %37 = add i32 %36, %35
  store i32 %37, ptr %3, align 4, !tbaa !8
  %38 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next53, %17
  br i1 %exitcond55.not, label %..preheader_crit_edge.us, label %30, !llvm.loop !13

.loopexit.us:                                     ; preds = %.lr.ph36.us, %..preheader_crit_edge.us, %.lr.ph40.split.us
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %39 = load i32, ptr %2, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %.not32.us.not = icmp slt i64 %indvars.iv61, %40
  br i1 %.not32.us.not, label %.lr.ph40.split.us, label %._crit_edge, !llvm.loop !14

..preheader_crit_edge.us:                         ; preds = %30
  %41 = icmp ugt i64 %indvars.iv61, 1
  br i1 %41, label %.lr.ph36.us, label %.loopexit.us

.lr.ph40.split:                                   ; preds = %.lr.ph40, %.loopexit
  %42 = phi i32 [ %54, %.loopexit ], [ %15, %.lr.ph40 ]
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %.loopexit ], [ 1, %.lr.ph40 ]
  %43 = icmp eq i64 %indvars.iv49, %17
  br i1 %43, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.lr.ph40.split
  %44 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %17, i64 %indvars.iv49
  store i32 2000000000, ptr %44, align 4, !tbaa !8
  %45 = icmp ugt i64 %indvars.iv49, 1
  br i1 %45, label %.lr.ph36, label %.loopexit

.lr.ph36:                                         ; preds = %.preheader, %.lr.ph36
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph36 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %46 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %17, i64 %indvars.iv
  %47 = load i32, ptr %46, align 4, !tbaa !8
  %48 = sub nsw i64 %indvars.iv49, %indvars.iv
  %49 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %17, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = add i32 %47, 1
  %52 = add i32 %51, %50
  store i32 %52, ptr %4, align 4, !tbaa !8
  %53 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv49
  br i1 %exitcond.not, label %.loopexit.loopexit, label %.lr.ph36, !llvm.loop !11

.loopexit.loopexit:                               ; preds = %.lr.ph36
  %.pre = load i32, ptr %2, align 4, !tbaa !8
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader, %.lr.ph40.split
  %54 = phi i32 [ %.pre, %.loopexit.loopexit ], [ %42, %.preheader ], [ %42, %.lr.ph40.split ]
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %55 = sext i32 %54 to i64
  %.not32.not = icmp slt i64 %indvars.iv49, %55
  br i1 %.not32.not, label %.lr.ph40.split, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %.loopexit, %.loopexit.us, %.preheader33
  %56 = phi i32 [ %15, %.preheader33 ], [ %39, %.loopexit.us ], [ %54, %.loopexit ]
  %57 = phi i32 [ %16, %.preheader33 ], [ %39, %.loopexit.us ], [ %54, %.loopexit ]
  %58 = add i32 %.03042, 1
  %59 = load i32, ptr %1, align 4, !tbaa !8
  %.not = icmp sgt i32 %58, %59
  br i1 %.not, label %._crit_edge44, label %.preheader33, !llvm.loop !15

._crit_edge44:                                    ; preds = %._crit_edge, %0
  %60 = phi i32 [ %.pre64, %0 ], [ %56, %._crit_edge ]
  %.lcssa = phi i32 [ %13, %0 ], [ %59, %._crit_edge ]
  %61 = sext i32 %.lcssa to i64
  %62 = sext i32 %60 to i64
  %63 = getelementptr inbounds [505 x [505 x i32]], ptr @dp, i64 0, i64 %61, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !8
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %64)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

; 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

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

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: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

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 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 = { 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 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}


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