; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100705A1)

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

@tot = external dso_local global i32, align 4
@pr = external dso_local global [154321 x i32], align 16
@d = external dso_local global [1234569 x i32], align 16
@phi = external dso_local global [1234569 x i32], align 16
@n = external dso_local global i32, align 4
@sz = external dso_local global [2 x i32], align 4
@seq = external dso_local global [2 x [1001 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [77 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6factoriRiPi(i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr 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 i32 @_Z5solveiPi(i32 noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5solveiPiiS_(i32 noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 1, ptr getelementptr inbounds ([1234569 x i32], ptr @phi, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %95, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp sle i32 %10, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %98

14:                                               ; preds = %9
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %34, label %20

20:                                               ; preds = %14
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %23
  store i32 %21, ptr %24, align 4, !tbaa !5
  %25 = load i32, ptr @tot, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr @tot, align 4, !tbaa !5
  %27 = sext i32 %25 to i64
  %28 = getelementptr inbounds [154321 x i32], ptr @pr, i64 0, i64 %27
  store i32 %21, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sub nsw i32 %29, 1
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1234569 x i32], ptr @phi, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %20, %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  br label %35

35:                                               ; preds = %90, %34
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [154321 x i32], ptr @pr, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = mul nsw i32 %36, %40
  store i32 %41, ptr %5, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %35
  store i32 5, ptr %3, align 4
  br label %93

45:                                               ; preds = %35
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [154321 x i32], ptr @pr, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %51
  store i32 %49, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [154321 x i32], ptr @pr, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 %56, %60
  br i1 %61, label %62, label %75

62:                                               ; preds = %45
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [1234569 x i32], ptr @phi, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [154321 x i32], ptr @pr, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = mul nsw i32 %66, %70
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1234569 x i32], ptr @phi, i64 0, i64 %73
  store i32 %71, ptr %74, align 4, !tbaa !5
  store i32 5, ptr %3, align 4
  br label %93

75:                                               ; preds = %45
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1234569 x i32], ptr @phi, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [154321 x i32], ptr @pr, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  %85 = mul nsw i32 %79, %84
  %86 = load i32, ptr %5, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1234569 x i32], ptr @phi, i64 0, i64 %87
  store i32 %85, ptr %88, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %75
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %4, align 4, !tbaa !5
  br label %35, !llvm.loop !9

93:                                               ; preds = %62, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !11

98:                                               ; preds = %13
  %99 = load i32, ptr @n, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr @n, align 4, !tbaa !5
  %104 = icmp eq i32 %102, %103
  br i1 %104, label %105, label %111

105:                                              ; preds = %98
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  call void @_Z6factoriRiPi(i32 noundef %107, ptr noundef nonnull align 4 dereferenceable(4) @sz, ptr noundef @seq)
  %108 = load i32, ptr @sz, align 4, !tbaa !5
  %109 = call noundef i32 @_Z5solveiPi(i32 noundef %108, ptr noundef @seq)
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %109)
  br label %140

111:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  store i32 %115, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sdiv i32 %116, %120
  store i32 %121, ptr %7, align 4, !tbaa !5
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = icmp eq i32 %125, %126
  br i1 %127, label %128, label %129

128:                                              ; preds = %111
  br label %131

129:                                              ; preds = %111
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 71, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

130:                                              ; No predecessors!
  br label %131

131:                                              ; preds = %130, %128
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 1
  call void @_Z6factoriRiPi(i32 noundef %133, ptr noundef nonnull align 4 dereferenceable(4) @sz, ptr noundef @seq)
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = sub nsw i32 %134, 1
  call void @_Z6factoriRiPi(i32 noundef %135, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([2 x i32], ptr @sz, i64 0, i64 1), ptr noundef getelementptr inbounds ([2 x [1001 x i32]], ptr @seq, i64 0, i64 1))
  %136 = load i32, ptr @sz, align 4, !tbaa !5
  %137 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @sz, i64 0, i64 1), align 4, !tbaa !5
  %138 = call noundef i32 @_Z5solveiPiiS_(i32 noundef %136, ptr noundef @seq, i32 noundef %137, ptr noundef getelementptr inbounds ([2 x [1001 x i32]], ptr @seq, i64 0, i64 1))
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %138)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %140

140:                                              ; preds = %131, %105
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

declare i32 @printf(ptr noundef, ...) #4

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

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 = { 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 #4 = { "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 = distinct !{!11, !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"

@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [154321 x i32], align 16
@d = external dso_local local_unnamed_addr global [1234569 x i32], align 16
@phi = external dso_local local_unnamed_addr global [1234569 x i32], align 16
@n = external dso_local global i32, align 4
@sz = external dso_local global [2 x i32], align 4
@seq = external dso_local global [2 x [1001 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [77 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6factoriRiPi(i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5solveiPiiS_(i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  store i32 1, ptr getelementptr inbounds (i8, ptr @phi, i64 4), align 4, !tbaa !5
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not36 = icmp slt i32 %2, 2
  br i1 %.not36, label %._crit_edge, label %.lr.ph39.preheader

.lr.ph39.preheader:                               ; preds = %0
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %3 = add nuw i32 %2, 1
  %wide.trip.count = zext i32 %3 to i64
  br label %.lr.ph39

._crit_edge:                                      ; preds = %.loopexit, %0
  %4 = sext i32 %2 to i64
  %5 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %4
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp eq i32 %6, %2
  br i1 %7, label %41, label %45

.lr.ph39:                                         ; preds = %.lr.ph39.preheader, %.loopexit
  %indvars.iv44 = phi i64 [ 2, %.lr.ph39.preheader ], [ %indvars.iv.next45, %.loopexit ]
  %8 = phi i32 [ %tot.promoted, %.lr.ph39.preheader ], [ %19, %.loopexit ]
  %9 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %indvars.iv44
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %.not30 = icmp eq i32 %10, 0
  %11 = trunc nuw nsw i64 %indvars.iv44 to i32
  br i1 %.not30, label %12, label %.lr.ph39._crit_edge

12:                                               ; preds = %.lr.ph39
  store i32 %11, ptr %9, align 4, !tbaa !5
  %13 = add nsw i32 %8, 1
  store i32 %13, ptr @tot, align 4, !tbaa !5
  %14 = sext i32 %8 to i64
  %15 = getelementptr inbounds [154321 x i32], ptr @pr, i64 0, i64 %14
  store i32 %11, ptr %15, align 4, !tbaa !5
  %16 = getelementptr inbounds [1234569 x i32], ptr @phi, i64 0, i64 %indvars.iv44
  %17 = trunc i64 %indvars.iv44 to i32
  %18 = add i32 %17, -1
  store i32 %18, ptr %16, align 4, !tbaa !5
  br label %.lr.ph39._crit_edge

.lr.ph39._crit_edge:                              ; preds = %.lr.ph39, %12
  %19 = phi i32 [ %13, %12 ], [ %8, %.lr.ph39 ]
  %20 = load i32, ptr @pr, align 16, !tbaa !5
  %21 = mul nsw i32 %20, %11
  %.not3134 = icmp sgt i32 %21, %2
  br i1 %.not3134, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph39._crit_edge
  %22 = getelementptr inbounds [1234569 x i32], ptr @phi, i64 0, i64 %indvars.iv44
  br label %23

23:                                               ; preds = %.lr.ph, %34
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %34 ]
  %24 = phi i32 [ %21, %.lr.ph ], [ %40, %34 ]
  %25 = phi i32 [ %20, %.lr.ph ], [ %39, %34 ]
  %26 = sext i32 %24 to i64
  %27 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %26
  store i32 %25, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %9, align 4, !tbaa !5
  %29 = icmp eq i32 %28, %25
  %30 = load i32, ptr %22, align 4, !tbaa !5
  br i1 %29, label %31, label %34

31:                                               ; preds = %23
  %32 = mul nsw i32 %30, %25
  %33 = getelementptr inbounds [1234569 x i32], ptr @phi, i64 0, i64 %26
  store i32 %32, ptr %33, align 4, !tbaa !5
  br label %.loopexit

34:                                               ; preds = %23
  %35 = add nsw i32 %25, -1
  %36 = mul nsw i32 %30, %35
  %37 = getelementptr inbounds [1234569 x i32], ptr @phi, i64 0, i64 %26
  store i32 %36, ptr %37, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %38 = getelementptr inbounds [154321 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = mul nsw i32 %39, %11
  %.not31 = icmp sgt i32 %40, %2
  br i1 %.not31, label %.loopexit, label %23, !llvm.loop !9

.loopexit:                                        ; preds = %34, %.lr.ph39._crit_edge, %31
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph39, !llvm.loop !11

41:                                               ; preds = %._crit_edge
  %42 = add nsw i32 %2, -1
  tail call void @_Z6factoriRiPi(i32 noundef %42, ptr noundef nonnull align 4 dereferenceable(4) @sz, ptr noundef nonnull @seq)
  %43 = load i32, ptr @sz, align 4, !tbaa !5
  %44 = tail call noundef i32 @_Z5solveiPi(i32 noundef %43, ptr noundef nonnull @seq)
  br label %58

45:                                               ; preds = %._crit_edge
  %46 = sdiv i32 %2, %6
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1234569 x i32], ptr @d, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp eq i32 %49, %46
  br i1 %50, label %52, label %51

51:                                               ; preds = %45
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 71, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

52:                                               ; preds = %45
  %53 = add nsw i32 %6, -1
  tail call void @_Z6factoriRiPi(i32 noundef %53, ptr noundef nonnull align 4 dereferenceable(4) @sz, ptr noundef nonnull @seq)
  %54 = add nsw i32 %46, -1
  tail call void @_Z6factoriRiPi(i32 noundef %54, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @sz, i64 4), ptr noundef nonnull getelementptr inbounds (i8, ptr @seq, i64 4004))
  %55 = load i32, ptr @sz, align 4, !tbaa !5
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 4), align 4, !tbaa !5
  %57 = tail call noundef i32 @_Z5solveiPiiS_(i32 noundef %55, ptr noundef nonnull @seq, i32 noundef %56, ptr noundef nonnull getelementptr inbounds (i8, ptr @seq, i64 4004))
  br label %58

58:                                               ; preds = %52, %41
  %.sink = phi i32 [ %57, %52 ], [ %44, %41 ]
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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 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 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 #3 = { nofree 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 #4 = { 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 #5 = { 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 = distinct !{!11, !10}


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