; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Easy Medium/LEMOVIE/A.ll (Z5solvev)

; 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" }
%"struct.std::greater" = type { i8 }

@dp = external dso_local global [210 x [210 x i64]], align 16
@p = external dso_local global [210 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [107 x i8], align 1
@__PRETTY_FUNCTION__._Z5solvev = external hidden unnamed_addr constant [13 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::greater", align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 0, i64 352800, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %27, %0
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %30

22:                                               ; preds = %17
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [210 x i32], ptr @p, i64 0, i64 %24
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %25)
  br label %27

27:                                               ; preds = %22
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !9

30:                                               ; preds = %21
  %31 = load i32, ptr %1, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr @p, i64 %32
  %34 = getelementptr inbounds i32, ptr %33, i64 1
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef getelementptr inbounds (i32, ptr @p, i64 1), ptr noundef %34)
  store i64 1, ptr @dp, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %145, %30
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %7, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %60, %40
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %47, label %58

47:                                               ; preds = %43
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [210 x i32], ptr @p, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [210 x i32], ptr @p, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %51, %56
  br label %58

58:                                               ; preds = %47, %43
  %59 = phi i1 [ false, %43 ], [ %57, %47 ]
  br i1 %59, label %60, label %63

60:                                               ; preds = %58
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %7, align 4, !tbaa !5
  br label %43, !llvm.loop !13

63:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sub nsw i32 %64, %65
  store i32 %66, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 1, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 1, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %93, %63
  %68 = load i32, ptr %11, align 4, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = icmp sle i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %96

72:                                               ; preds = %67
  %73 = load i64, ptr %9, align 8, !tbaa !11
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = load i32, ptr %11, align 4, !tbaa !5
  %76 = add nsw i32 %74, %75
  %77 = sub nsw i32 %76, 2
  %78 = sext i32 %77 to i64
  %79 = mul nsw i64 %73, %78
  %80 = srem i64 %79, 1000000007
  store i64 %80, ptr %9, align 8, !tbaa !11
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = icmp sgt i32 %81, 1
  br i1 %82, label %83, label %92

83:                                               ; preds = %72
  %84 = load i64, ptr %10, align 8, !tbaa !11
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = load i32, ptr %11, align 4, !tbaa !5
  %87 = add nsw i32 %85, %86
  %88 = sub nsw i32 %87, 2
  %89 = sext i32 %88 to i64
  %90 = mul nsw i64 %84, %89
  %91 = srem i64 %90, 1000000007
  store i64 %91, ptr %10, align 8, !tbaa !11
  br label %92

92:                                               ; preds = %83, %72
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %11, align 4, !tbaa !5
  br label %67, !llvm.loop !14

96:                                               ; preds = %71
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %140, %96
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %101 = load i32, ptr %2, align 4, !tbaa !5
  %102 = icmp sle i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 13, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %143

104:                                              ; preds = %99
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %107
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [210 x i64], ptr %108, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !11
  %113 = load i64, ptr %9, align 8, !tbaa !11
  %114 = mul nsw i64 %112, %113
  %115 = srem i64 %114, 1000000007
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %118
  %120 = load i32, ptr %12, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [210 x i64], ptr %119, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !11
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = mul nsw i64 %124, %126
  %128 = srem i64 %127, 1000000007
  %129 = load i64, ptr %10, align 8, !tbaa !11
  %130 = mul nsw i64 %128, %129
  %131 = srem i64 %130, 1000000007
  %132 = add nsw i64 %115, %131
  %133 = srem i64 %132, 1000000007
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %135
  %137 = load i32, ptr %12, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [210 x i64], ptr %136, i64 0, i64 %138
  store i64 %133, ptr %139, align 8, !tbaa !11
  br label %140

140:                                              ; preds = %104
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %12, align 4, !tbaa !5
  br label %99, !llvm.loop !15

143:                                              ; preds = %103
  %144 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %144, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %145

145:                                              ; preds = %143
  %146 = load i32, ptr %5, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %5, align 4, !tbaa !5
  br label %35, !llvm.loop !16

148:                                              ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %170, %148
  %150 = load i32, ptr %14, align 4, !tbaa !5
  %151 = load i32, ptr %2, align 4, !tbaa !5
  %152 = icmp sle i32 %150, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %149
  store i32 16, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %173

154:                                              ; preds = %149
  %155 = load i32, ptr %1, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %156
  %158 = load i32, ptr %14, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [210 x i64], ptr %157, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !11
  %162 = load i64, ptr %13, align 8, !tbaa !11
  %163 = add nsw i64 %162, %161
  store i64 %163, ptr %13, align 8, !tbaa !11
  %164 = load i64, ptr %13, align 8, !tbaa !11
  %165 = icmp sge i64 %164, 1000000007
  br i1 %165, label %166, label %169

166:                                              ; preds = %154
  %167 = load i64, ptr %13, align 8, !tbaa !11
  %168 = sub nsw i64 %167, 1000000007
  store i64 %168, ptr %13, align 8, !tbaa !11
  br label %169

169:                                              ; preds = %166, %154
  br label %170

170:                                              ; preds = %169
  %171 = load i32, ptr %14, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %14, align 4, !tbaa !5
  br label %149, !llvm.loop !17

173:                                              ; preds = %153
  %174 = load i64, ptr %13, align 8, !tbaa !11
  %175 = icmp sle i64 0, %174
  %176 = zext i1 %175 to i64
  %177 = icmp slt i64 %176, 1000000007
  br i1 %177, label %178, label %179

178:                                              ; preds = %173
  br label %181

179:                                              ; preds = %173
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 85, ptr noundef @__PRETTY_FUNCTION__._Z5solvev) #7
  unreachable

180:                                              ; No predecessors!
  br label %181

181:                                              ; preds = %180, %178
  %182 = load i64, ptr %13, align 8, !tbaa !11
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %182)
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %183, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef, ptr noundef) #4

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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" }
attributes #5 = { noreturn nounwind "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 }
attributes #7 = { noreturn 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 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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_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" }

@dp = external dso_local local_unnamed_addr global [210 x [210 x i64]], align 16
@p = external dso_local global [210 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 uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(352800) @dp, i8 0, i64 352800, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %3 = 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)
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %.not64 = icmp slt i32 %5, 1
  br i1 %.not64, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre113 = sext i32 %5 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre113, %.._crit_edge_crit_edge ], [ %14, %.lr.ph ]
  %6 = getelementptr inbounds i32, ptr @p, i64 %.pre-phi
  %7 = getelementptr inbounds i8, ptr %6, i64 4
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @p, i64 4), ptr noundef nonnull %7)
  store i64 1, ptr @dp, align 16, !tbaa !9
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %.not5676 = icmp slt i32 %8, 1
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br i1 %.not5676, label %.preheader, label %.preheader62.lr.ph

.preheader62.lr.ph:                               ; preds = %._crit_edge
  %.not6073 = icmp slt i32 %.pre, 1
  br i1 %.not6073, label %._crit_edge83, label %.preheader62.preheader

.preheader62.preheader:                           ; preds = %.preheader62.lr.ph
  %9 = zext nneg i32 %8 to i64
  %10 = add nuw i32 %.pre, 1
  %wide.trip.count98 = zext i32 %10 to i64
  br label %.preheader62

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %11 = getelementptr inbounds [210 x i32], ptr @p, i64 0, i64 %indvars.iv
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %.not.not = icmp slt i64 %indvars.iv, %14
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

..loopexit_crit_edge:                             ; preds = %65
  %.not56.not = icmp slt i32 %.050.in.lcssa, %8
  br i1 %.not56.not, label %.preheader62, label %.preheader, !llvm.loop !13

.preheader62:                                     ; preds = %.preheader62.preheader, %..loopexit_crit_edge
  %.05177 = phi i32 [ %.050.lcssa, %..loopexit_crit_edge ], [ 1, %.preheader62.preheader ]
  %15 = sext i32 %.05177 to i64
  %smax = call i32 @llvm.smax.i32(i32 %.05177, i32 %8)
  %16 = add nuw i32 %smax, 1
  br label %20

.preheader:                                       ; preds = %..loopexit_crit_edge, %._crit_edge
  %.not5779 = icmp slt i32 %.pre, 1
  br i1 %.not5779, label %._crit_edge83, label %.lr.ph82

.lr.ph82:                                         ; preds = %.preheader
  %17 = sext i32 %8 to i64
  %18 = zext nneg i32 %.pre to i64
  %xtraiter130 = and i64 %18, 1
  %19 = icmp eq i32 %.pre, 1
  br i1 %19, label %._crit_edge83.loopexit.unr-lcssa, label %.lr.ph82.new

.lr.ph82.new:                                     ; preds = %.lr.ph82
  %unroll_iter133 = and i64 %18, 2147483646
  br label %80

20:                                               ; preds = %.preheader62, %21
  %indvars.iv88 = phi i64 [ %15, %.preheader62 ], [ %indvars.iv.next89, %21 ]
  %.not58.not = icmp slt i64 %indvars.iv88, %9
  br i1 %.not58.not, label %21, label %.critedge

21:                                               ; preds = %20
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, 1
  %22 = getelementptr inbounds [210 x i32], ptr @p, i64 0, i64 %indvars.iv.next89
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = getelementptr inbounds [210 x i32], ptr @p, i64 0, i64 %indvars.iv88
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = icmp eq i32 %23, %25
  br i1 %26, label %20, label %.critedge.split.loop.exit119, !llvm.loop !14

.critedge.split.loop.exit119:                     ; preds = %21
  %27 = trunc nsw i64 %indvars.iv88 to i32
  %28 = trunc nsw i64 %indvars.iv.next89 to i32
  br label %.critedge

.critedge:                                        ; preds = %20, %.critedge.split.loop.exit119
  %.050.in.lcssa = phi i32 [ %27, %.critedge.split.loop.exit119 ], [ %smax, %20 ]
  %.050.lcssa = phi i32 [ %28, %.critedge.split.loop.exit119 ], [ %16, %20 ]
  %29 = sub nsw i32 %.050.lcssa, %.05177
  %.not5966 = icmp slt i32 %29, 1
  br i1 %.not5966, label %.preheader61, label %30

30:                                               ; preds = %.critedge
  %31 = add i32 %.05177, -2
  %32 = add i32 %.050.lcssa, 1
  %33 = sub i32 %32, %.05177
  %34 = add i32 %.05177, -1
  %35 = srem i32 %34, 1000000007
  %.sext116 = sext i32 %35 to i64
  %exitcond.peel.not = icmp eq i32 %33, 2
  br i1 %exitcond.peel.not, label %.preheader61, label %.peel.next.preheader

.peel.next.preheader:                             ; preds = %30
  %wide.trip.count = zext i32 %33 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %36 = icmp eq i32 %33, 3
  br i1 %36, label %.preheader61.loopexit.unr-lcssa, label %.peel.next.preheader.new

.peel.next.preheader.new:                         ; preds = %.peel.next.preheader
  %37 = and i64 %wide.trip.count, 4294967294
  %38 = add nsw i64 %37, -4
  br label %.peel.next

.preheader61.loopexit.unr-lcssa:                  ; preds = %.peel.next, %.peel.next.preheader
  %.lcssa126.ph = phi i64 [ poison, %.peel.next.preheader ], [ %62, %.peel.next ]
  %.lcssa.ph = phi i64 [ poison, %.peel.next.preheader ], [ %64, %.peel.next ]
  %indvars.iv91.unr = phi i64 [ 2, %.peel.next.preheader ], [ %indvars.iv.next92.1, %.peel.next ]
  %.04668.unr = phi i64 [ 1, %.peel.next.preheader ], [ %64, %.peel.next ]
  %.04867.unr = phi i64 [ %.sext116, %.peel.next.preheader ], [ %62, %.peel.next ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader61, label %.peel.next.epil

.peel.next.epil:                                  ; preds = %.preheader61.loopexit.unr-lcssa
  %39 = trunc nuw nsw i64 %indvars.iv91.unr to i32
  %40 = add i32 %31, %39
  %41 = sext i32 %40 to i64
  %42 = mul nsw i64 %.04867.unr, %41
  %43 = srem i64 %42, 1000000007
  %44 = mul nsw i64 %.04668.unr, %41
  %45 = srem i64 %44, 1000000007
  br label %.preheader61

.preheader61:                                     ; preds = %.peel.next.epil, %.preheader61.loopexit.unr-lcssa, %30, %.critedge
  %.048.lcssa = phi i64 [ 1, %.critedge ], [ %.sext116, %30 ], [ %.lcssa126.ph, %.preheader61.loopexit.unr-lcssa ], [ %43, %.peel.next.epil ]
  %.046.lcssa = phi i64 [ 1, %.critedge ], [ 1, %30 ], [ %.lcssa.ph, %.preheader61.loopexit.unr-lcssa ], [ %45, %.peel.next.epil ]
  %46 = add nsw i32 %.05177, -1
  %47 = sext i32 %46 to i64
  %48 = sext i32 %29 to i64
  %49 = sext i32 %.050.in.lcssa to i64
  br label %65

.peel.next:                                       ; preds = %.peel.next, %.peel.next.preheader.new
  %indvars.iv91 = phi i64 [ 2, %.peel.next.preheader.new ], [ %indvars.iv.next92.1, %.peel.next ]
  %.04668 = phi i64 [ 1, %.peel.next.preheader.new ], [ %64, %.peel.next ]
  %.04867 = phi i64 [ %.sext116, %.peel.next.preheader.new ], [ %62, %.peel.next ]
  %niter = phi i64 [ 0, %.peel.next.preheader.new ], [ %niter.next.1, %.peel.next ]
  %50 = trunc nuw nsw i64 %indvars.iv91 to i32
  %51 = add i32 %31, %50
  %52 = sext i32 %51 to i64
  %53 = mul nsw i64 %.04867, %52
  %54 = srem i64 %53, 1000000007
  %55 = mul nsw i64 %.04668, %52
  %56 = srem i64 %55, 1000000007
  %57 = trunc i64 %indvars.iv91 to i32
  %58 = or disjoint i32 %57, 1
  %59 = add i32 %31, %58
  %60 = sext i32 %59 to i64
  %61 = mul nsw i64 %54, %60
  %62 = srem i64 %61, 1000000007
  %63 = mul nsw i64 %56, %60
  %64 = srem i64 %63, 1000000007
  %indvars.iv.next92.1 = add nuw nsw i64 %indvars.iv91, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter, %38
  br i1 %niter.ncmp.1, label %.preheader61.loopexit.unr-lcssa, label %.peel.next, !llvm.loop !15

65:                                               ; preds = %.preheader61, %65
  %indvars.iv95 = phi i64 [ 1, %.preheader61 ], [ %indvars.iv.next96, %65 ]
  %66 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %47, i64 %indvars.iv95
  %67 = load i64, ptr %66, align 8, !tbaa !9
  %68 = mul nsw i64 %67, %.048.lcssa
  %69 = srem i64 %68, 1000000007
  %70 = add nsw i64 %indvars.iv95, -1
  %71 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %47, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = mul nsw i64 %72, %48
  %74 = srem i64 %73, 1000000007
  %75 = mul nsw i64 %74, %.046.lcssa
  %76 = srem i64 %75, 1000000007
  %77 = add nsw i64 %76, %69
  %.lhs.trunc = trunc nsw i64 %77 to i32
  %78 = srem i32 %.lhs.trunc, 1000000007
  %.sext = sext i32 %78 to i64
  %79 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %49, i64 %indvars.iv95
  store i64 %.sext, ptr %79, align 8, !tbaa !9
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count98
  br i1 %exitcond99.not, label %..loopexit_crit_edge, label %65, !llvm.loop !17

80:                                               ; preds = %80, %.lr.ph82.new
  %indvars.iv107 = phi i64 [ 1, %.lr.ph82.new ], [ %indvars.iv.next108.1, %80 ]
  %.04380 = phi i64 [ 0, %.lr.ph82.new ], [ %spec.select.1, %80 ]
  %niter134 = phi i64 [ 0, %.lr.ph82.new ], [ %niter134.next.1, %80 ]
  %81 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %17, i64 %indvars.iv107
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %83 = add nsw i64 %82, %.04380
  %84 = icmp sgt i64 %83, 1000000006
  %85 = add nsw i64 %83, -1000000007
  %spec.select = select i1 %84, i64 %85, i64 %83
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %86 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %17, i64 %indvars.iv.next108
  %87 = load i64, ptr %86, align 8, !tbaa !9
  %88 = add nsw i64 %87, %spec.select
  %89 = icmp sgt i64 %88, 1000000006
  %90 = add nsw i64 %88, -1000000007
  %spec.select.1 = select i1 %89, i64 %90, i64 %88
  %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 2
  %niter134.next.1 = add i64 %niter134, 2
  %niter134.ncmp.1 = icmp eq i64 %niter134.next.1, %unroll_iter133
  br i1 %niter134.ncmp.1, label %._crit_edge83.loopexit.unr-lcssa, label %80, !llvm.loop !18

._crit_edge83.loopexit.unr-lcssa:                 ; preds = %80, %.lr.ph82
  %spec.select.lcssa.ph = phi i64 [ poison, %.lr.ph82 ], [ %spec.select.1, %80 ]
  %indvars.iv107.unr = phi i64 [ 1, %.lr.ph82 ], [ %indvars.iv.next108.1, %80 ]
  %.04380.unr = phi i64 [ 0, %.lr.ph82 ], [ %spec.select.1, %80 ]
  %lcmp.mod131.not = icmp eq i64 %xtraiter130, 0
  br i1 %lcmp.mod131.not, label %._crit_edge83, label %._crit_edge83.loopexit.epilog-lcssa

._crit_edge83.loopexit.epilog-lcssa:              ; preds = %._crit_edge83.loopexit.unr-lcssa
  %91 = getelementptr inbounds [210 x [210 x i64]], ptr @dp, i64 0, i64 %17, i64 %indvars.iv107.unr
  %92 = load i64, ptr %91, align 8, !tbaa !9
  %93 = add nsw i64 %92, %.04380.unr
  %94 = icmp sgt i64 %93, 1000000006
  %95 = add nsw i64 %93, -1000000007
  %spec.select.epil = select i1 %94, i64 %95, i64 %93
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %._crit_edge83.loopexit.epilog-lcssa, %._crit_edge83.loopexit.unr-lcssa, %.preheader62.lr.ph, %.preheader
  %.043.lcssa = phi i64 [ 0, %.preheader ], [ 0, %.preheader62.lr.ph ], [ %spec.select.lcssa.ph, %._crit_edge83.loopexit.unr-lcssa ], [ %spec.select.epil, %._crit_edge83.loopexit.epilog-lcssa ]
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.043.lcssa)
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"long long", !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.peeled.count", i32 1}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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