; LLVM IR from Tunghohin/Competitive_Coding :: Nowcoder/22529_C.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" }

@fact = external dso_local global [60000001 x i32], align 16
@inv = external dso_local global [60000001 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 nounwind uwtable
declare dso_local noundef i32 @_Z4qpowii(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z1Cii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  %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) %1)
  store i32 1, ptr @fact, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %30, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %33

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sub nsw i32 %16, 1
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [60000001 x i32], ptr @fact, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = mul nsw i64 %21, %23
  %25 = srem i64 %24, 1000000007
  %26 = trunc i64 %25 to i32
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [60000001 x i32], ptr @fact, i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %15
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !9

33:                                               ; preds = %14
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [60000001 x i32], ptr @fact, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = call noundef i32 @_Z4qpowii(i32 noundef %37, i32 noundef 1000000005)
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [60000001 x i32], ptr @inv, i64 0, i64 %40
  store i32 %38, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %42 = load i32, ptr %1, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  store i32 %43, ptr %3, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %64, %33
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp sge i32 %45, 0
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %67

48:                                               ; preds = %44
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [60000001 x i32], ptr @inv, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = mul nsw i64 %54, %57
  %59 = srem i64 %58, 1000000007
  %60 = trunc i64 %59 to i32
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [60000001 x i32], ptr @inv, i64 0, i64 %62
  store i32 %60, ptr %63, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %48
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %3, align 4, !tbaa !5
  br label %44, !llvm.loop !11

67:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = call noundef i32 @_Z4qpowii(i32 noundef 2, i32 noundef %68)
  %70 = sext i32 %69 to i64
  store i64 %70, ptr %5, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %71 = load i32, ptr %1, align 4, !tbaa !5
  %72 = sub nsw i32 %71, 2
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [60000001 x i32], ptr @fact, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  store i64 %76, ptr %6, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %77 = load i32, ptr %1, align 4, !tbaa !5
  %78 = srem i32 %77, 2
  %79 = icmp eq i32 %78, 1
  %80 = zext i1 %79 to i64
  %81 = select i1 %79, i32 -1, i32 1
  %82 = sext i32 %81 to i64
  store i64 %82, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %83 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %83, ptr %8, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %120, %67
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = icmp sge i32 %85, 0
  br i1 %86, label %88, label %87

87:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %123

88:                                               ; preds = %84
  %89 = load i64, ptr %6, align 8, !tbaa !12
  %90 = load i32, ptr %1, align 4, !tbaa !5
  %91 = mul nsw i32 2, %90
  %92 = sub nsw i32 %91, 1
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = sub nsw i32 %92, %93
  %95 = sext i32 %94 to i64
  %96 = mul nsw i64 %89, %95
  %97 = srem i64 %96, 1000000007
  store i64 %97, ptr %6, align 8, !tbaa !12
  %98 = load i64, ptr %4, align 8, !tbaa !12
  %99 = load i64, ptr %7, align 8, !tbaa !12
  %100 = load i32, ptr %1, align 4, !tbaa !5
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = call noundef i64 @_Z1Cii(i32 noundef %100, i32 noundef %101)
  %103 = mul nsw i64 %99, %102
  %104 = load i64, ptr %6, align 8, !tbaa !12
  %105 = mul nsw i64 %103, %104
  %106 = srem i64 %105, 1000000007
  %107 = load i64, ptr %5, align 8, !tbaa !12
  %108 = mul nsw i64 %106, %107
  %109 = srem i64 %108, 1000000007
  %110 = add nsw i64 %98, %109
  %111 = add nsw i64 %110, 1000000007
  %112 = srem i64 %111, 1000000007
  store i64 %112, ptr %4, align 8, !tbaa !12
  %113 = load i64, ptr %5, align 8, !tbaa !12
  %114 = load i32, ptr getelementptr inbounds ([60000001 x i32], ptr @inv, i64 0, i64 2), align 8, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = mul nsw i64 %113, %115
  %117 = srem i64 %116, 1000000007
  store i64 %117, ptr %5, align 8, !tbaa !12
  %118 = load i64, ptr %7, align 8, !tbaa !12
  %119 = sub nsw i64 0, %118
  store i64 %119, ptr %7, align 8, !tbaa !12
  br label %120

120:                                              ; preds = %88
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = add nsw i32 %121, -1
  store i32 %122, ptr %8, align 4, !tbaa !5
  br label %84, !llvm.loop !14

123:                                              ; preds = %87
  %124 = load i64, ptr %4, align 8, !tbaa !12
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %124)
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %125, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !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" }

@fact = external dso_local local_unnamed_addr global [60000001 x i32], align 16
@inv = external dso_local local_unnamed_addr global [60000001 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 nounwind uwtable
declare dso_local noundef i32 @_Z4qpowii(i32 noundef, i32 noundef) 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) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z1Cii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = 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)
  store i32 1, ptr @fact, align 16, !tbaa !5
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not29 = icmp slt i32 %3, 1
  br i1 %.not29, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %4 = zext nneg i32 %3 to i64
  %xtraiter = and i64 %4, 1
  %5 = icmp eq i32 %3, 1
  br i1 %5, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %4, 2147483646
  br label %.lr.ph

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %31, %.lr.ph ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %6 = mul nsw i64 %.unr, %indvars.iv.unr
  %7 = srem i64 %6, 1000000007
  %8 = trunc nsw i64 %7 to i32
  %9 = getelementptr inbounds [60000001 x i32], ptr @fact, i64 0, i64 %indvars.iv.unr
  store i32 %8, ptr %9, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %0
  %10 = sext i32 %3 to i64
  %11 = getelementptr inbounds [60000001 x i32], ptr @fact, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = call noundef i32 @_Z4qpowii(i32 noundef %12, i32 noundef 1000000005)
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [60000001 x i32], ptr @inv, i64 0, i64 %15
  store i32 %13, ptr %16, align 4, !tbaa !5
  %17 = icmp sgt i32 %14, 0
  br i1 %17, label %.lr.ph33.preheader, label %._crit_edge34

.lr.ph33.preheader:                               ; preds = %._crit_edge
  %18 = zext nneg i32 %14 to i64
  %.phi.trans.insert = getelementptr inbounds [60000001 x i32], ptr @inv, i64 0, i64 %18
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  %xtraiter49 = and i64 %18, 1
  %lcmp.mod50.not = icmp eq i64 %xtraiter49, 0
  br i1 %lcmp.mod50.not, label %.lr.ph33.prol.loopexit, label %.lr.ph33.prol

.lr.ph33.prol:                                    ; preds = %.lr.ph33.preheader
  %indvars.iv.next46.prol = add nsw i64 %18, -1
  %19 = sext i32 %.pre to i64
  %20 = mul nsw i64 %18, %19
  %21 = srem i64 %20, 1000000007
  %22 = trunc nsw i64 %21 to i32
  %23 = getelementptr inbounds [60000001 x i32], ptr @inv, i64 0, i64 %indvars.iv.next46.prol
  store i32 %22, ptr %23, align 4, !tbaa !5
  br label %.lr.ph33.prol.loopexit

.lr.ph33.prol.loopexit:                           ; preds = %.lr.ph33.prol, %.lr.ph33.preheader
  %.unr51 = phi i32 [ %.pre, %.lr.ph33.preheader ], [ %22, %.lr.ph33.prol ]
  %indvars.iv45.unr = phi i64 [ %18, %.lr.ph33.preheader ], [ %indvars.iv.next46.prol, %.lr.ph33.prol ]
  %24 = icmp eq i32 %14, 1
  br i1 %24, label %._crit_edge34, label %.lr.ph33

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %25 = phi i64 [ 1, %.lr.ph.preheader.new ], [ %31, %.lr.ph ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %26 = mul nsw i64 %25, %indvars.iv
  %27 = srem i64 %26, 1000000007
  %28 = trunc nsw i64 %27 to i32
  %29 = getelementptr inbounds [60000001 x i32], ptr @fact, i64 0, i64 %indvars.iv
  store i32 %28, ptr %29, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = mul nsw i64 %27, %indvars.iv.next
  %31 = srem i64 %30, 1000000007
  %32 = trunc nsw i64 %31 to i32
  %33 = getelementptr inbounds [60000001 x i32], ptr @fact, i64 0, i64 %indvars.iv.next
  store i32 %32, ptr %33, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !9

._crit_edge34:                                    ; preds = %.lr.ph33.prol.loopexit, %.lr.ph33, %._crit_edge
  %34 = call noundef i32 @_Z4qpowii(i32 noundef 2, i32 noundef %14)
  %35 = load i32, ptr %1, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, -1
  br i1 %36, label %.lr.ph41.preheader, label %._crit_edge42

.lr.ph41.preheader:                               ; preds = %._crit_edge34
  %37 = and i32 %35, 1
  %.not = icmp eq i32 %37, 0
  %38 = select i1 %.not, i64 1, i64 -1
  %39 = add nsw i32 %35, -2
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [60000001 x i32], ptr @fact, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = sext i32 %34 to i64
  br label %.lr.ph41

.lr.ph33:                                         ; preds = %.lr.ph33.prol.loopexit, %.lr.ph33
  %45 = phi i32 [ %53, %.lr.ph33 ], [ %.unr51, %.lr.ph33.prol.loopexit ]
  %indvars.iv45 = phi i64 [ %indvars.iv.next46.1, %.lr.ph33 ], [ %indvars.iv45.unr, %.lr.ph33.prol.loopexit ]
  %indvars.iv.next46 = add nsw i64 %indvars.iv45, -1
  %46 = sext i32 %45 to i64
  %47 = mul nsw i64 %indvars.iv45, %46
  %48 = srem i64 %47, 1000000007
  %49 = trunc nsw i64 %48 to i32
  %50 = getelementptr inbounds [60000001 x i32], ptr @inv, i64 0, i64 %indvars.iv.next46
  store i32 %49, ptr %50, align 4, !tbaa !5
  %indvars.iv.next46.1 = add nsw i64 %indvars.iv45, -2
  %51 = mul nsw i64 %indvars.iv.next46, %48
  %52 = srem i64 %51, 1000000007
  %53 = trunc nsw i64 %52 to i32
  %54 = getelementptr inbounds [60000001 x i32], ptr @inv, i64 0, i64 %indvars.iv.next46.1
  store i32 %53, ptr %54, align 4, !tbaa !5
  %55 = icmp ugt i64 %indvars.iv.next46, 1
  br i1 %55, label %.lr.ph33, label %._crit_edge34, !llvm.loop !11

._crit_edge42:                                    ; preds = %.lr.ph41, %._crit_edge34
  %.025.lcssa = phi i64 [ 0, %._crit_edge34 ], [ %73, %.lr.ph41 ]
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.025.lcssa)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %56, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %.lr.ph41
  %.039 = phi i32 [ %79, %.lr.ph41 ], [ %35, %.lr.ph41.preheader ]
  %.02238 = phi i64 [ %78, %.lr.ph41 ], [ %38, %.lr.ph41.preheader ]
  %.02337 = phi i64 [ %64, %.lr.ph41 ], [ %43, %.lr.ph41.preheader ]
  %.02436 = phi i64 [ %77, %.lr.ph41 ], [ %44, %.lr.ph41.preheader ]
  %.02535 = phi i64 [ %73, %.lr.ph41 ], [ 0, %.lr.ph41.preheader ]
  %58 = load i32, ptr %1, align 4, !tbaa !5
  %59 = shl nsw i32 %58, 1
  %60 = xor i32 %.039, -1
  %61 = add i32 %59, %60
  %62 = sext i32 %61 to i64
  %63 = mul nsw i64 %.02337, %62
  %64 = srem i64 %63, 1000000007
  %65 = call noundef i64 @_Z1Cii(i32 noundef %58, i32 noundef %.039)
  %66 = mul nsw i64 %65, %.02238
  %67 = mul nsw i64 %66, %64
  %68 = srem i64 %67, 1000000007
  %69 = mul nsw i64 %68, %.02436
  %70 = srem i64 %69, 1000000007
  %71 = add nuw nsw i64 %.02535, 1000000007
  %72 = add nsw i64 %71, %70
  %73 = urem i64 %72, 1000000007
  %74 = load i32, ptr getelementptr inbounds (i8, ptr @inv, i64 8), align 8, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = mul nsw i64 %.02436, %75
  %77 = srem i64 %76, 1000000007
  %78 = sub nsw i64 0, %.02238
  %79 = add nsw i32 %.039, -1
  %.not48 = icmp eq i32 %.039, 0
  br i1 %.not48, label %._crit_edge42, label %.lr.ph41, !llvm.loop !12
}

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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) 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 #2 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = distinct !{!12, !10}


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