; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/94 Beta Division 1/Problem C (C)

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

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

20:                                               ; preds = %40, %0
  %21 = load i32, ptr %2, align 4, !tbaa !8
  %22 = icmp slt i32 %21, 1111
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %43

24:                                               ; preds = %20
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %26
  %28 = getelementptr inbounds [1111 x i64], ptr %27, i64 0, i64 1
  store i64 1, ptr %28, align 8, !tbaa !11
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = sub nsw i32 %29, 1
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %31
  %33 = getelementptr inbounds [1111 x i64], ptr %32, i64 0, i64 1
  %34 = load i64, ptr %33, align 8, !tbaa !11
  %35 = add nsw i64 %34, 1
  %36 = load i32, ptr %2, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %37
  %39 = getelementptr inbounds [1111 x i64], ptr %38, i64 0, i64 1
  store i64 %35, ptr %39, align 8, !tbaa !11
  br label %40

40:                                               ; preds = %24
  %41 = load i32, ptr %2, align 4, !tbaa !8
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %2, align 4, !tbaa !8
  br label %20, !llvm.loop !13

43:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 2, ptr %3, align 4, !tbaa !8
  br label %44

44:                                               ; preds = %110, %43
  %45 = load i32, ptr %3, align 4, !tbaa !8
  %46 = load i32, ptr @k, align 4, !tbaa !8
  %47 = add nsw i32 %46, 1
  %48 = icmp sle i32 %45, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %44
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %113

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

51:                                               ; preds = %106, %50
  %52 = load i32, ptr %5, align 4, !tbaa !8
  %53 = icmp slt i32 %52, 1111
  br i1 %53, label %55, label %54

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

55:                                               ; preds = %51
  %56 = load i32, ptr %5, align 4, !tbaa !8
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %58
  %60 = load i32, ptr %3, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1111 x i64], ptr %59, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !11
  %64 = load i32, ptr %5, align 4, !tbaa !8
  %65 = sub nsw i32 %64, 2
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %66
  %68 = load i32, ptr %3, align 4, !tbaa !8
  %69 = sub nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1111 x i64], ptr %67, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !11
  %73 = add nsw i64 %63, %72
  %74 = load i64, ptr @MOD, align 8, !tbaa !11
  %75 = srem i64 %73, %74
  %76 = load i32, ptr %5, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %77
  %79 = load i32, ptr %3, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1111 x i64], ptr %78, i64 0, i64 %80
  store i64 %75, ptr %81, align 8, !tbaa !11
  %82 = load i32, ptr %5, align 4, !tbaa !8
  %83 = sub nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %84
  %86 = load i32, ptr %3, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1111 x i64], ptr %85, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !11
  %90 = load i32, ptr %5, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %91
  %93 = load i32, ptr %3, align 4, !tbaa !8
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1111 x i64], ptr %92, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !11
  %97 = add nsw i64 %89, %96
  %98 = load i64, ptr @MOD, align 8, !tbaa !11
  %99 = srem i64 %97, %98
  %100 = load i32, ptr %5, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %101
  %103 = load i32, ptr %3, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1111 x i64], ptr %102, i64 0, i64 %104
  store i64 %99, ptr %105, align 8, !tbaa !11
  br label %106

106:                                              ; preds = %55
  %107 = load i32, ptr %5, align 4, !tbaa !8
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %5, align 4, !tbaa !8
  br label %51, !llvm.loop !15

109:                                              ; preds = %54
  br label %110

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

113:                                              ; preds = %49
  %114 = load i32, ptr @n, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %115
  %117 = load i32, ptr @k, align 4, !tbaa !8
  %118 = add nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [1111 x i64], ptr %116, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !11
  %122 = load i32, ptr @m, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %123
  %125 = load i32, ptr @k, align 4, !tbaa !8
  %126 = add nsw i32 %125, 1
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1111 x i64], ptr %124, i64 0, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !11
  %130 = mul nsw i64 %121, %129
  %131 = load i64, ptr @MOD, align 8, !tbaa !11
  %132 = srem i64 %130, %131
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %132)
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %133, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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

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.start.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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 = { 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 #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 = !{!"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 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@dp = external dso_local local_unnamed_addr global [1111 x [1111 x i64]], align 16
@sum = external dso_local local_unnamed_addr global [1111 x [1111 x i64]], align 16
@MOD = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", 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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = load ptr, ptr @_ZSt4cerr, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt4cerr, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = 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)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %.pre = load i64, ptr getelementptr inbounds (i8, ptr @sum, i64 8), align 8, !tbaa !8
  br label %17

.preheader24:                                     ; preds = %17
  %15 = load i32, ptr @k, align 4, !tbaa !11
  %.not27 = icmp slt i32 %15, 1
  %.pre41 = load i64, ptr @MOD, align 8, !tbaa !8
  br i1 %.not27, label %._crit_edge, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader24
  %16 = add nuw i32 %15, 2
  %wide.trip.count = zext i32 %16 to i64
  br label %.preheader

17:                                               ; preds = %17, %0
  %18 = phi i64 [ %.pre, %0 ], [ %26, %17 ]
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next.2, %17 ]
  %19 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %indvars.iv, i64 1
  store i64 1, ptr %19, align 8, !tbaa !8
  %20 = add nsw i64 %18, 1
  %21 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %indvars.iv, i64 1
  store i64 %20, ptr %21, align 8, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 1
  store i64 1, ptr %22, align 8, !tbaa !8
  %23 = add nsw i64 %18, 2
  %24 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %indvars.iv.next, i64 1
  store i64 %23, ptr %24, align 8, !tbaa !8
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %25 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next.1, i64 1
  store i64 1, ptr %25, align 8, !tbaa !8
  %26 = add nsw i64 %18, 3
  %27 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %indvars.iv.next.1, i64 1
  store i64 %26, ptr %27, align 8, !tbaa !8
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1111
  br i1 %exitcond.not.2, label %.preheader24, label %17, !llvm.loop !13

.preheader:                                       ; preds = %.preheader.lr.ph, %43
  %indvars.iv34 = phi i64 [ 2, %.preheader.lr.ph ], [ %indvars.iv.next35, %43 ]
  %28 = add nsw i64 %indvars.iv34, -1
  %.phi.trans.insert = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 1, i64 %indvars.iv34
  %.pre38 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !8
  %.phi.trans.insert39 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 1, i64 %indvars.iv34
  %.pre40 = load i64, ptr %.phi.trans.insert39, align 8, !tbaa !8
  br label %44

._crit_edge:                                      ; preds = %43, %.preheader24
  %29 = add nsw i32 %15, 1
  %30 = load i32, ptr @n, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = sext i32 %29 to i64
  %33 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %31, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !8
  %35 = load i32, ptr @m, align 4, !tbaa !11
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %36, i64 %32
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = mul nsw i64 %38, %34
  %40 = srem i64 %39, %.pre41
  %41 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %40)
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

43:                                               ; preds = %44
  %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
  %exitcond37 = icmp eq i64 %indvars.iv.next35, %wide.trip.count
  br i1 %exitcond37, label %._crit_edge, label %.preheader, !llvm.loop !15

44:                                               ; preds = %.preheader, %44
  %45 = phi i64 [ %.pre40, %.preheader ], [ %54, %44 ]
  %46 = phi i64 [ %.pre38, %.preheader ], [ %51, %44 ]
  %indvars.iv30 = phi i64 [ 2, %.preheader ], [ %indvars.iv.next31, %44 ]
  %47 = add nsw i64 %indvars.iv30, -2
  %48 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %47, i64 %28
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = add nsw i64 %49, %46
  %51 = srem i64 %50, %.pre41
  %52 = getelementptr inbounds [1111 x [1111 x i64]], ptr @dp, i64 0, i64 %indvars.iv30, i64 %indvars.iv34
  store i64 %51, ptr %52, align 8, !tbaa !8
  %53 = add nsw i64 %45, %51
  %54 = srem i64 %53, %.pre41
  %55 = getelementptr inbounds [1111 x [1111 x i64]], ptr @sum, i64 0, i64 %indvars.iv30, i64 %indvars.iv34
  store i64 %54, ptr %55, align 8, !tbaa !8
  %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
  %exitcond33.not = icmp eq i64 %indvars.iv.next31, 1111
  br i1 %exitcond33.not, label %43, label %44, !llvm.loop !16
}

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

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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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" }

!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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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