; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan (221)

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

@w = external dso_local global [510 x [510 x i32]], align 16
@dp = external dso_local global [510 x [510 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_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
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %14
  %16 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %22 = 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)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %24

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

28:                                               ; preds = %24
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %50

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

30:                                               ; preds = %43, %29
  %31 = load i32, ptr %6, align 4, !tbaa !8
  %32 = load i32, ptr %3, align 4, !tbaa !8
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %46

35:                                               ; preds = %30
  %36 = load i32, ptr %4, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %37
  %39 = load i32, ptr %6, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [510 x i32], ptr %38, i64 0, i64 %40
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %41)
  br label %43

43:                                               ; preds = %35
  %44 = load i32, ptr %6, align 4, !tbaa !8
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %6, align 4, !tbaa !8
  br label %30, !llvm.loop !11

46:                                               ; preds = %34
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %4, align 4, !tbaa !8
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %4, align 4, !tbaa !8
  br label %24, !llvm.loop !13

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

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

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

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

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

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

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

63:                                               ; preds = %101, %62
  %64 = load i32, ptr %9, align 4, !tbaa !8
  %65 = load i32, ptr %8, align 4, !tbaa !8
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %104

68:                                               ; preds = %63
  %69 = load i32, ptr %7, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [510 x [510 x i32]], ptr @dp, i64 0, i64 %70
  %72 = load i32, ptr %8, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [510 x i32], ptr %71, i64 0, i64 %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %75 = load i32, ptr %7, align 4, !tbaa !8
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [510 x [510 x i32]], ptr @dp, i64 0, i64 %77
  %79 = load i32, ptr %8, align 4, !tbaa !8
  %80 = load i32, ptr %9, align 4, !tbaa !8
  %81 = sub nsw i32 %79, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [510 x i32], ptr %78, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !8
  %85 = load i32, ptr %7, align 4, !tbaa !8
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %86
  %88 = load i32, ptr %9, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [510 x i32], ptr %87, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !8
  %92 = add nsw i32 %84, %91
  store i32 %92, ptr %10, align 4, !tbaa !8
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %74, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %94 = load i32, ptr %93, align 4, !tbaa !8
  %95 = load i32, ptr %7, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [510 x [510 x i32]], ptr @dp, i64 0, i64 %96
  %98 = load i32, ptr %8, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [510 x i32], ptr %97, i64 0, i64 %99
  store i32 %94, ptr %100, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %101

101:                                              ; preds = %68
  %102 = load i32, ptr %9, align 4, !tbaa !8
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %9, align 4, !tbaa !8
  br label %63, !llvm.loop !14

104:                                              ; preds = %67
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %8, align 4, !tbaa !8
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %8, align 4, !tbaa !8
  br label %57, !llvm.loop !15

108:                                              ; preds = %61
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %7, align 4, !tbaa !8
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %7, align 4, !tbaa !8
  br label %51, !llvm.loop !16

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 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)) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

@w = external dso_local global [510 x [510 x i32]], align 16
@dp = external dso_local global [510 x [510 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #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) %1)
  %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) %2)
  %17 = load i32, ptr %1, align 4, !tbaa !8
  %.not37 = icmp slt i32 %17, 1
  %.pre69.pre = load i32, ptr %2, align 4, !tbaa !8
  br i1 %.not37, label %._crit_edge45, label %.preheader34.lr.ph

.preheader34.lr.ph:                               ; preds = %0
  %18 = icmp slt i32 %.pre69.pre, 1
  br i1 %18, label %.preheader32.lr.ph, label %.preheader34

.preheader34:                                     ; preds = %.preheader34.lr.ph, %._crit_edge
  %19 = phi i32 [ %23, %._crit_edge ], [ %17, %.preheader34.lr.ph ]
  %20 = phi i32 [ %24, %._crit_edge ], [ %.pre69.pre, %.preheader34.lr.ph ]
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %._crit_edge ], [ 1, %.preheader34.lr.ph ]
  %.not3135 = icmp slt i32 %20, 1
  br i1 %.not3135, label %._crit_edge, label %.lr.ph

.preheader33:                                     ; preds = %._crit_edge
  %.not2843 = icmp slt i32 %23, 1
  br i1 %.not2843, label %._crit_edge45, label %.preheader32.lr.ph

.preheader32.lr.ph:                               ; preds = %.preheader34.lr.ph, %.preheader33
  %21 = phi i32 [ %23, %.preheader33 ], [ %17, %.preheader34.lr.ph ]
  %.pre6976 = phi i32 [ %24, %.preheader33 ], [ %.pre69.pre, %.preheader34.lr.ph ]
  %22 = icmp slt i32 %.pre6976, 0
  br i1 %22, label %._crit_edge45, label %.preheader32

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader34
  %23 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %19, %.preheader34 ]
  %24 = phi i32 [ %28, %._crit_edge.loopexit ], [ %20, %.preheader34 ]
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %25 = sext i32 %23 to i64
  %.not.not = icmp slt i64 %indvars.iv50, %25
  br i1 %.not.not, label %.preheader34, label %.preheader33, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader34, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader34 ]
  %26 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %indvars.iv50, i64 %indvars.iv
  %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)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr %2, align 4, !tbaa !8
  %29 = sext i32 %28 to i64
  %.not31.not = icmp slt i64 %indvars.iv, %29
  br i1 %.not31.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !14

.preheader32:                                     ; preds = %.preheader32.lr.ph, %._crit_edge42
  %30 = phi i32 [ %40, %._crit_edge42 ], [ %21, %.preheader32.lr.ph ]
  %31 = phi i32 [ %41, %._crit_edge42 ], [ %.pre6976, %.preheader32.lr.ph ]
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %._crit_edge42 ], [ 1, %.preheader32.lr.ph ]
  %.not2940 = icmp slt i32 %31, 0
  br i1 %.not2940, label %._crit_edge42, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader32
  %32 = add nsw i64 %indvars.iv65, -1
  br label %.preheader

._crit_edge45:                                    ; preds = %._crit_edge42, %0, %.preheader32.lr.ph, %.preheader33
  %33 = phi i32 [ %24, %.preheader33 ], [ %.pre6976, %.preheader32.lr.ph ], [ %.pre69.pre, %0 ], [ %41, %._crit_edge42 ]
  %.lcssa = phi i32 [ %23, %.preheader33 ], [ %21, %.preheader32.lr.ph ], [ %17, %0 ], [ %40, %._crit_edge42 ]
  %34 = sext i32 %.lcssa to i64
  %35 = sext i32 %33 to i64
  %36 = getelementptr inbounds [510 x [510 x i32]], ptr @dp, i64 0, i64 %34, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !8
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %37)
  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

.preheader:                                       ; preds = %.preheader.lr.ph, %43
  %indvars.iv60 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next61, %43 ]
  %indvars.iv58 = phi i64 [ 1, %.preheader.lr.ph ], [ %indvars.iv.next59, %43 ]
  %39 = getelementptr inbounds [510 x [510 x i32]], ptr @dp, i64 0, i64 %indvars.iv65, i64 %indvars.iv60
  br label %46

._crit_edge42.loopexit:                           ; preds = %43
  %.pre68 = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge42

._crit_edge42:                                    ; preds = %._crit_edge42.loopexit, %.preheader32
  %40 = phi i32 [ %.pre68, %._crit_edge42.loopexit ], [ %30, %.preheader32 ]
  %41 = phi i32 [ %44, %._crit_edge42.loopexit ], [ %31, %.preheader32 ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %42 = sext i32 %40 to i64
  %.not28.not = icmp slt i64 %indvars.iv65, %42
  br i1 %.not28.not, label %.preheader32, label %._crit_edge45, !llvm.loop !15

43:                                               ; preds = %46
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %44 = load i32, ptr %2, align 4, !tbaa !8
  %45 = sext i32 %44 to i64
  %.not29.not = icmp slt i64 %indvars.iv60, %45
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  br i1 %.not29.not, label %.preheader, label %._crit_edge42.loopexit, !llvm.loop !16

46:                                               ; preds = %.preheader, %46
  %indvars.iv53 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next54, %46 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %47 = sub nsw i64 %indvars.iv60, %indvars.iv53
  %48 = getelementptr inbounds [510 x [510 x i32]], ptr @dp, i64 0, i64 %32, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !8
  %50 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %indvars.iv65, i64 %indvars.iv53
  %51 = load i32, ptr %50, align 4, !tbaa !8
  %52 = add nsw i32 %51, %49
  store i32 %52, ptr %3, align 4, !tbaa !8
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %54 = load i32, ptr %53, align 4, !tbaa !8
  store i32 %54, ptr %39, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next54, %indvars.iv58
  br i1 %exitcond.not, label %43, label %46, !llvm.loop !17
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 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 #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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


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