; LLVM IR from kazunetakahashi/atcoder :: 2019/0616_ABC130/past (E2)

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@S = external dso_local global [2010 x i32], align 16
@T = external dso_local global [2010 x i32], align 16
@dp0 = external dso_local global [2010 x [2010 x %class.mint]], align 16
@dp1 = external dso_local global [2010 x [2010 x %class.mint]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %class.mint, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %class.mint, align 8
  store i32 0, ptr %1, align 4
  %9 = 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)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %21, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @N, align 4, !tbaa !5
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %11
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [2010 x i32], ptr @S, i64 0, i64 %18
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %19)
  br label %21

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

24:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %35, %24
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = load i32, ptr @M, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [2010 x i32], ptr @T, i64 0, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %33)
  br label %35

35:                                               ; preds = %30
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !5
  br label %25, !llvm.loop !11

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @dp0, ptr align 8 %4, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %130, %38
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = load i32, ptr @N, align 4, !tbaa !5
  %42 = icmp sle i32 %40, %41
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %45

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

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

50:                                               ; preds = %45
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp0, i64 0, i64 %52
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [2010 x %class.mint], ptr %53, i64 0, i64 %55
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp0, i64 0, i64 %59
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [2010 x %class.mint], ptr %60, i64 0, i64 %62
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintpLERKS_(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull align 8 dereferenceable(8) %56)
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp0, i64 0, i64 %66
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2010 x %class.mint], ptr %67, i64 0, i64 %69
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp1, i64 0, i64 %72
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2010 x %class.mint], ptr %73, i64 0, i64 %75
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintpLERKS_(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull align 8 dereferenceable(8) %70)
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp1, i64 0, i64 %79
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [2010 x %class.mint], ptr %80, i64 0, i64 %82
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp1, i64 0, i64 %85
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [2010 x %class.mint], ptr %86, i64 0, i64 %89
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintpLERKS_(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull align 8 dereferenceable(8) %83)
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = load i32, ptr @N, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %95, label %125

95:                                               ; preds = %50
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = load i32, ptr @M, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %99, label %125

99:                                               ; preds = %95
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [2010 x i32], ptr @S, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [2010 x i32], ptr @T, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = icmp eq i32 %103, %107
  br i1 %108, label %109, label %125

109:                                              ; preds = %99
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp1, i64 0, i64 %111
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [2010 x %class.mint], ptr %112, i64 0, i64 %114
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp0, i64 0, i64 %118
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [2010 x %class.mint], ptr %119, i64 0, i64 %122
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintpLERKS_(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef nonnull align 8 dereferenceable(8) %115)
  br label %125

125:                                              ; preds = %109, %99, %95, %50
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %7, align 4, !tbaa !5
  br label %45, !llvm.loop !15

129:                                              ; preds = %49
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %5, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %5, align 4, !tbaa !5
  br label %39, !llvm.loop !16

133:                                              ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %134 = load i32, ptr @N, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp1, i64 0, i64 %135
  %137 = load i32, ptr @M, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [2010 x %class.mint], ptr %136, i64 0, i64 %138
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %139, i64 8, i1 false), !tbaa.struct !12
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %142 = load i32, ptr %1, align 4
  ret i32 %142
}

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { "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 #7 = { 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 = !{i64 0, i64 8, !13}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@S = external dso_local global [2010 x i32], align 16
@T = external dso_local global [2010 x i32], align 16
@dp0 = external dso_local global [2010 x [2010 x %class.mint]], align 16
@dp1 = external dso_local global [2010 x [2010 x %class.mint]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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 #0 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)) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca %class.mint, align 8
  %2 = alloca %class.mint, align 8
  %3 = 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)
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %5 = load i32, ptr @N, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.preheader36

.preheader36:                                     ; preds = %.lr.ph, %0
  %7 = load i32, ptr @M, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph39, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds [2010 x i32], ptr @S, i64 0, i64 %indvars.iv
  %10 = 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) %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr @N, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = icmp slt i64 %indvars.iv.next, %12
  br i1 %13, label %.lr.ph, label %.preheader36, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph39, %.preheader36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @_ZN4mintC2Ex(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef 1)
  %14 = load i64, ptr %1, align 8, !tbaa !11
  store i64 %14, ptr @dp0, align 16, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %15 = load i32, ptr @N, align 4, !tbaa !5
  %.not44 = icmp slt i32 %15, 0
  %.pre60 = load i32, ptr @M, align 4, !tbaa !5
  %16 = icmp slt i32 %.pre60, 0
  %or.cond66 = select i1 %.not44, i1 true, i1 %16
  br i1 %or.cond66, label %._crit_edge46, label %.preheader

.lr.ph39:                                         ; preds = %.preheader36, %.lr.ph39
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %.lr.ph39 ], [ 0, %.preheader36 ]
  %17 = getelementptr inbounds [2010 x i32], ptr @T, i64 0, i64 %indvars.iv50
  %18 = 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) %17)
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %19 = load i32, ptr @M, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next51, %20
  br i1 %21, label %.lr.ph39, label %._crit_edge, !llvm.loop !13

.preheader:                                       ; preds = %._crit_edge, %._crit_edge43
  %22 = phi i32 [ %32, %._crit_edge43 ], [ %15, %._crit_edge ]
  %23 = phi i32 [ %33, %._crit_edge43 ], [ %.pre60, %._crit_edge ]
  %indvars.iv56 = phi i64 [ %.pre62, %._crit_edge43 ], [ 0, %._crit_edge ]
  %.not3440 = icmp slt i32 %23, 0
  %.pre62 = add nuw nsw i64 %indvars.iv56, 1
  br i1 %.not3440, label %._crit_edge43, label %.lr.ph42

.lr.ph42:                                         ; preds = %.preheader
  %24 = getelementptr inbounds [2010 x i32], ptr @S, i64 0, i64 %indvars.iv56
  br label %35

._crit_edge46:                                    ; preds = %._crit_edge43, %._crit_edge
  %25 = phi i32 [ %.pre60, %._crit_edge ], [ %33, %._crit_edge43 ]
  %.lcssa = phi i32 [ %15, %._crit_edge ], [ %32, %._crit_edge43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %26 = sext i32 %.lcssa to i64
  %27 = sext i32 %25 to i64
  %28 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp1, i64 0, i64 %26, i64 %27
  %29 = load i64, ptr %28, align 8, !tbaa !11
  store i64 %29, ptr %2, align 8, !tbaa !11
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK4mint(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  ret i32 0

._crit_edge43.loopexit:                           ; preds = %57
  %.pre59 = load i32, ptr @N, align 4, !tbaa !5
  br label %._crit_edge43

._crit_edge43:                                    ; preds = %.preheader, %._crit_edge43.loopexit
  %32 = phi i32 [ %.pre59, %._crit_edge43.loopexit ], [ %22, %.preheader ]
  %33 = phi i32 [ %58, %._crit_edge43.loopexit ], [ %23, %.preheader ]
  %34 = sext i32 %32 to i64
  %.not.not = icmp slt i64 %indvars.iv56, %34
  br i1 %.not.not, label %.preheader, label %._crit_edge46, !llvm.loop !14

35:                                               ; preds = %.lr.ph42, %57
  %indvars.iv53 = phi i64 [ 0, %.lr.ph42 ], [ %indvars.iv.next54, %57 ]
  %36 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp0, i64 0, i64 %indvars.iv56, i64 %indvars.iv53
  %37 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp0, i64 0, i64 %.pre62, i64 %indvars.iv53
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintpLERKS_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %36)
  %39 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp1, i64 0, i64 %indvars.iv56, i64 %indvars.iv53
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintpLERKS_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %36)
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %41 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp1, i64 0, i64 %indvars.iv56, i64 %indvars.iv.next54
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintpLERKS_(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %43 = load i32, ptr @N, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = icmp slt i64 %indvars.iv56, %44
  %46 = load i32, ptr @M, align 4
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv53, %47
  %or.cond = select i1 %45, i1 %48, i1 false
  br i1 %or.cond, label %49, label %57

49:                                               ; preds = %35
  %50 = load i32, ptr %24, align 4, !tbaa !5
  %51 = getelementptr inbounds [2010 x i32], ptr @T, i64 0, i64 %indvars.iv53
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = icmp eq i32 %50, %52
  br i1 %53, label %54, label %57

54:                                               ; preds = %49
  %55 = getelementptr inbounds [2010 x [2010 x %class.mint]], ptr @dp0, i64 0, i64 %.pre62, i64 %indvars.iv.next54
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4mintpLERKS_(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %.pre = load i32, ptr @M, align 4, !tbaa !5
  %.pre61 = sext i32 %.pre to i64
  br label %57

57:                                               ; preds = %35, %49, %54
  %.pre-phi = phi i64 [ %47, %35 ], [ %47, %49 ], [ %.pre61, %54 ]
  %58 = phi i32 [ %46, %35 ], [ %46, %49 ], [ %.pre, %54 ]
  %.not34.not = icmp slt i64 %indvars.iv53, %.pre-phi
  br i1 %.not34.not, label %35, label %._crit_edge43.loopexit, !llvm.loop !16
}

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 #5

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !10}


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