; LLVM IR from tangjz/acm-icpc :: luogu (2525)

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

@n = external dso_local global i32, align 4
@fact = external dso_local global i32, align 4
@a = external dso_local global [20 x i32], align 16
@f = external dso_local global [2 x [20 x i32]], align 16
@last = external dso_local global i32, align 4
@cur = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5equivPiS_(ptr noundef, 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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
  store i32 0, ptr %1, align 4
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %8

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

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

13:                                               ; preds = %8
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds i32, ptr @a, i64 %15
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %16)
  br label %18

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !9

21:                                               ; preds = %12
  store i32 1, ptr @fact, align 4, !tbaa !5
  store i32 1, ptr @last, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %38, %21
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %22
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = load i32, ptr @cur, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %30
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [20 x i32], ptr %31, i64 0, i64 %33
  store i32 %28, ptr %34, align 4, !tbaa !5
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = load i32, ptr @fact, align 4, !tbaa !5
  %37 = mul nsw i32 %36, %35
  store i32 %37, ptr @fact, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %27
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %3, align 4, !tbaa !5
  br label %22, !llvm.loop !11

41:                                               ; preds = %26
  %42 = load i32, ptr @cur, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %43
  %45 = getelementptr inbounds [20 x i32], ptr %44, i64 0, i64 0
  %46 = call noundef zeroext i1 @_Z5equivPiS_(ptr noundef @a, ptr noundef %45)
  br i1 %46, label %47, label %49

47:                                               ; preds = %41
  %48 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  br label %118

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

50:                                               ; preds = %114, %49
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = load i32, ptr @fact, align 4, !tbaa !5
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 8, ptr %5, align 4
  br label %117

55:                                               ; preds = %50
  %56 = load i32, ptr @last, align 4, !tbaa !5
  %57 = xor i32 %56, 1
  store i32 %57, ptr @last, align 4, !tbaa !5
  %58 = load i32, ptr @cur, align 4, !tbaa !5
  %59 = xor i32 %58, 1
  store i32 %59, ptr @cur, align 4, !tbaa !5
  %60 = load i32, ptr @cur, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %61
  %63 = getelementptr inbounds [20 x i32], ptr %62, i64 0, i64 0
  %64 = load i32, ptr @last, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %65
  %67 = getelementptr inbounds [20 x i32], ptr %66, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %63, ptr align 16 %67, i64 80, i1 false)
  %68 = load i32, ptr @cur, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %69
  %71 = getelementptr inbounds [20 x i32], ptr %70, i64 0, i64 0
  %72 = getelementptr inbounds i32, ptr %71, i64 1
  %73 = load i32, ptr @cur, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %74
  %76 = getelementptr inbounds [20 x i32], ptr %75, i64 0, i64 0
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %76, i64 %78
  %80 = getelementptr inbounds i32, ptr %79, i64 1
  %81 = call noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef %72, ptr noundef %80)
  %82 = load i32, ptr @cur, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %83
  %85 = getelementptr inbounds [20 x i32], ptr %84, i64 0, i64 0
  %86 = call noundef zeroext i1 @_Z5equivPiS_(ptr noundef @a, ptr noundef %85)
  br i1 %86, label %87, label %113

87:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %109, %87
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %112

93:                                               ; preds = %88
  %94 = load i32, ptr @last, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %95
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [20 x i32], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = icmp eq i32 %101, %102
  %104 = zext i1 %103 to i64
  %105 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !12
  %107 = sext i8 %106 to i32
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %100, i32 noundef %107)
  br label %109

109:                                              ; preds = %93
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %6, align 4, !tbaa !5
  br label %88, !llvm.loop !13

112:                                              ; preds = %92
  store i32 8, ptr %5, align 4
  br label %117

113:                                              ; preds = %55
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %4, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %4, align 4, !tbaa !5
  br label %50, !llvm.loop !14

117:                                              ; preds = %112, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %118

118:                                              ; preds = %117, %47
  %119 = load i32, ptr %1, align 4
  ret i32 %119
}

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

declare i32 @puts(ptr noundef) #3

; 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef, ptr noundef) #5

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10}
!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"

@n = external dso_local global i32, align 4
@fact = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [20 x i32], align 16
@f = external dso_local global [2 x [20 x i32]], align 16
@last = external dso_local local_unnamed_addr global i32, align 4
@cur = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5equivPiS_(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not25 = icmp slt i32 %2, 1
  br i1 %.not25, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  store i32 1, ptr @fact, align 4, !tbaa !5
  store i32 1, ptr @last, align 4, !tbaa !5
  %.pre52 = load i32, ptr @cur, align 4, !tbaa !5
  br label %._crit_edge._crit_edge

._crit_edge:                                      ; preds = %.lr.ph
  store i32 1, ptr @fact, align 4, !tbaa !5
  store i32 1, ptr @last, align 4, !tbaa !5
  %.not2027 = icmp slt i32 %14, 1
  %.pre = load i32, ptr @cur, align 4, !tbaa !5
  br i1 %.not2027, label %._crit_edge._crit_edge, label %.lr.ph30

._crit_edge._crit_edge:                           ; preds = %._crit_edge.thread, %._crit_edge
  %.pre53 = phi i32 [ %.pre52, %._crit_edge.thread ], [ %.pre, %._crit_edge ]
  %.pre49 = sext i32 %.pre53 to i64
  br label %16

.lr.ph30:                                         ; preds = %._crit_edge
  %3 = sext i32 %.pre to i64
  %4 = add nuw i32 %14, 1
  %wide.trip.count = zext i32 %4 to i64
  %5 = zext nneg i32 %14 to i64
  %min.iters.check = icmp ult i32 %14, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph30
  %indvars.iv43.ph = phi i64 [ 1, %.lr.ph30 ], [ %ind.end, %middle.block ]
  %.ph = phi i32 [ 1, %.lr.ph30 ], [ %11, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph30
  %n.vec = and i64 %5, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %8, %vector.body ]
  %vec.phi58 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %9, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %offset.idx = or disjoint i64 %index, 1
  %6 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %3, i64 %offset.idx
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  store <4 x i32> %vec.ind, ptr %6, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %7, align 4, !tbaa !5
  %8 = mul <4 x i32> %vec.phi, %vec.ind
  %9 = mul <4 x i32> %vec.phi58, %step.add
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %10 = icmp eq i64 %index.next, %n.vec
  br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = mul <4 x i32> %9, %8
  %11 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %5
  br i1 %cmp.n, label %._crit_edge31, label %scalar.ph.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %12 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %12)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %.not.not = icmp slt i64 %indvars.iv, %15
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge31:                                    ; preds = %scalar.ph, %middle.block
  %.lcssa = phi i32 [ %11, %middle.block ], [ %23, %scalar.ph ]
  store i32 %.lcssa, ptr @fact, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %._crit_edge._crit_edge, %._crit_edge31
  %.pre-phi = phi i64 [ %.pre49, %._crit_edge._crit_edge ], [ %3, %._crit_edge31 ]
  %17 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %.pre-phi
  %18 = tail call noundef zeroext i1 @_Z5equivPiS_(ptr noundef nonnull @a, ptr noundef nonnull %17)
  br i1 %18, label %24, label %.preheader23

.preheader23:                                     ; preds = %16
  %19 = load i32, ptr @fact, align 4, !tbaa !5
  %.not2133 = icmp slt i32 %19, 2
  br i1 %.not2133, label %.loopexit, label %.lr.ph35

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %scalar.ph ], [ %indvars.iv43.ph, %scalar.ph.preheader ]
  %20 = phi i32 [ %23, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %21 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %3, i64 %indvars.iv43
  %22 = trunc nuw nsw i64 %indvars.iv43 to i32
  store i32 %22, ptr %21, align 4, !tbaa !5
  %23 = mul nsw i32 %20, %22
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge31, label %scalar.ph, !llvm.loop !14

24:                                               ; preds = %16
  %25 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.loopexit

26:                                               ; preds = %.lr.ph35
  %27 = add nuw nsw i32 %.01534, 1
  %28 = load i32, ptr @fact, align 4, !tbaa !5
  %.not21.not = icmp slt i32 %.01534, %28
  br i1 %.not21.not, label %.lr.ph35, label %.loopexit, !llvm.loop !15

.lr.ph35:                                         ; preds = %.preheader23, %26
  %.01534 = phi i32 [ %27, %26 ], [ 2, %.preheader23 ]
  %29 = load i32, ptr @last, align 4, !tbaa !5
  %30 = xor i32 %29, 1
  store i32 %30, ptr @last, align 4, !tbaa !5
  %31 = load i32, ptr @cur, align 4, !tbaa !5
  %32 = xor i32 %31, 1
  store i32 %32, ptr @cur, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %33
  %35 = sext i32 %30 to i64
  %36 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %35
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) %34, ptr noundef nonnull align 16 dereferenceable(80) %36, i64 80, i1 false)
  %37 = getelementptr inbounds i8, ptr %34, i64 4
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %34, i64 %39
  %41 = getelementptr inbounds i8, ptr %40, i64 4
  %42 = tail call noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef nonnull %37, ptr noundef nonnull %41)
  %43 = load i32, ptr @cur, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %44
  %46 = tail call noundef zeroext i1 @_Z5equivPiS_(ptr noundef nonnull @a, ptr noundef nonnull %45)
  br i1 %46, label %.preheader, label %26

.preheader:                                       ; preds = %.lr.ph35
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %.not2236 = icmp slt i32 %47, 1
  br i1 %.not2236, label %.loopexit, label %.lr.ph38

.lr.ph38:                                         ; preds = %.preheader, %.lr.ph38
  %indvars.iv46 = phi i64 [ %indvars.iv.next47, %.lr.ph38 ], [ 1, %.preheader ]
  %48 = phi i32 [ %60, %.lr.ph38 ], [ %47, %.preheader ]
  %49 = load i32, ptr @last, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [2 x [20 x i32]], ptr @f, i64 0, i64 %50, i64 %indvars.iv46
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = zext i32 %48 to i64
  %54 = icmp eq i64 %indvars.iv46, %53
  %55 = zext i1 %54 to i64
  %56 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !16
  %58 = sext i8 %57 to i32
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %52, i32 noundef %58)
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %.not22.not = icmp slt i64 %indvars.iv46, %61
  br i1 %.not22.not, label %.lr.ph38, label %.loopexit, !llvm.loop !17

.loopexit:                                        ; preds = %26, %.lr.ph38, %.preheader23, %.preheader, %24
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: mustprogress 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) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #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 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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) }

!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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !10}


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