; LLVM IR from tangjz/acm-icpc :: 51nod (1377)

; 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
@m = external dso_local global i32, align 4
@pos = external dso_local global [50010 x i32], align 16
@f = external dso_local global [50010 x i32], align 16
@r = external dso_local global [50010 x i32], align 16
@cnt = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds i32, ptr @r, i64 %17
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %18)
  br label %20

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

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

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

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %37

29:                                               ; preds = %24
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !5
  br label %34

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

37:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %38 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %38, ptr %6, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %119, %37
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %122

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = load i32, ptr @m, align 4, !tbaa !5
  %48 = srem i32 %46, %47
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [50010 x i32], ptr @r, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sub nsw i32 %52, %53
  %55 = add nsw i32 %54, 1
  %56 = srem i32 %51, %55
  %57 = add nsw i32 %45, %56
  store i32 %57, ptr %7, align 4, !tbaa !5
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr @cnt, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  %64 = icmp sgt i32 %61, %63
  br i1 %64, label %65, label %87

65:                                               ; preds = %44
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [50010 x i32], ptr @f, i64 0, i64 %71
  store i32 %66, ptr %72, align 4, !tbaa !5
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %74
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %77
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %75, ptr noundef nonnull align 4 dereferenceable(4) %78) #4
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %80
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %83
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %81, ptr noundef nonnull align 4 dereferenceable(4) %84) #4
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = add nsw i32 %85, -1
  store i32 %86, ptr %6, align 4, !tbaa !5
  br label %118

87:                                               ; preds = %44
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = load i32, ptr @cnt, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [50010 x i32], ptr @f, i64 0, i64 %91
  store i32 %88, ptr %92, align 4, !tbaa !5
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %94
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %97
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %95, ptr noundef nonnull align 4 dereferenceable(4) %98) #4
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %5, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %114, %87
  %102 = load i32, ptr @cnt, align 4, !tbaa !5
  %103 = load i32, ptr @n, align 4, !tbaa !5
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %105, label %112

105:                                              ; preds = %101
  %106 = load i32, ptr @cnt, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [50010 x i32], ptr @f, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = icmp ne i32 %110, 0
  br label %112

112:                                              ; preds = %105, %101
  %113 = phi i1 [ false, %101 ], [ %111, %105 ]
  br i1 %113, label %114, label %117

114:                                              ; preds = %112
  %115 = load i32, ptr @cnt, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr @cnt, align 4, !tbaa !5
  br label %101, !llvm.loop !12

117:                                              ; preds = %112
  br label %118

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

119:                                              ; preds = %118
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %4, align 4, !tbaa !5
  br label %39, !llvm.loop !13

122:                                              ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %134, %122
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = load i32, ptr @n, align 4, !tbaa !5
  %126 = icmp sle i32 %124, %125
  br i1 %126, label %128, label %127

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

128:                                              ; preds = %123
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [50010 x i32], ptr @f, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %132)
  br label %134

134:                                              ; preds = %128
  %135 = load i32, ptr %8, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %8, align 4, !tbaa !5
  br label %123, !llvm.loop !14

137:                                              ; preds = %127
  ret i32 0
}

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

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

; 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 nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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}
!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
@m = external dso_local global i32, align 4
@pos = external dso_local global [50010 x i32], align 16
@f = external dso_local local_unnamed_addr global [50010 x i32], align 16
@r = external dso_local global [50010 x i32], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

.preheader41:                                     ; preds = %.lr.ph, %0
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %.not43 = icmp slt i32 %4, 1
  br i1 %.not43, label %._crit_edge, label %.lr.ph45.preheader

.lr.ph45.preheader:                               ; preds = %.preheader41
  %5 = add nuw i32 %4, 1
  %wide.trip.count = zext i32 %5 to i64
  %6 = zext nneg i32 %4 to i64
  %min.iters.check = icmp ult i32 %4, 8
  br i1 %min.iters.check, label %.lr.ph45.preheader77, label %vector.ph

.lr.ph45.preheader77:                             ; preds = %middle.block, %.lr.ph45.preheader
  %indvars.iv56.ph = phi i64 [ 1, %.lr.ph45.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph45

vector.ph:                                        ; preds = %.lr.ph45.preheader
  %n.vec = and i64 %6, 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.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
  %7 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %offset.idx
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  store <4 x i32> %vec.ind, ptr %7, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %8, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %9 = icmp eq i64 %index.next, %n.vec
  br i1 %9, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %6
  br i1 %cmp.n, label %.lr.ph51.preheader, label %.lr.ph45.preheader77

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

.lr.ph51.preheader:                               ; preds = %.lr.ph45, %middle.block
  %.pre67 = load i32, ptr @cnt, align 4, !tbaa !5
  br label %.lr.ph51

.lr.ph45:                                         ; preds = %.lr.ph45.preheader77, %.lr.ph45
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.lr.ph45 ], [ %indvars.iv56.ph, %.lr.ph45.preheader77 ]
  %15 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %indvars.iv56
  %16 = trunc nuw nsw i64 %indvars.iv56 to i32
  store i32 %16, ptr %15, align 4, !tbaa !5
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count
  br i1 %exitcond.not, label %.lr.ph51.preheader, label %.lr.ph45, !llvm.loop !14

.preheader:                                       ; preds = %.critedge
  %17 = icmp slt i32 %52, 1
  br i1 %17, label %._crit_edge, label %.lr.ph54

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %.critedge
  %18 = phi i32 [ %53, %.critedge ], [ %.pre67, %.lr.ph51.preheader ]
  %.02950 = phi i32 [ %.1, %.critedge ], [ %4, %.lr.ph51.preheader ]
  %.03049 = phi i32 [ %.131, %.critedge ], [ 1, %.lr.ph51.preheader ]
  %.03248 = phi i32 [ %54, %.critedge ], [ 0, %.lr.ph51.preheader ]
  %19 = load i32, ptr @m, align 4, !tbaa !5
  %20 = srem i32 %.03248, %19
  %21 = zext nneg i32 %20 to i64
  %22 = getelementptr inbounds [50010 x i32], ptr @r, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %reass.sub = sub i32 %.02950, %.03049
  %24 = add i32 %reass.sub, 1
  %25 = srem i32 %23, %24
  %26 = add nsw i32 %25, %.03049
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %18, 1
  %31 = icmp sgt i32 %29, %30
  %32 = sext i32 %.03049 to i64
  %33 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %32
  br i1 %31, label %34, label %40

34:                                               ; preds = %.lr.ph51
  %35 = sext i32 %29 to i64
  %36 = getelementptr inbounds [50010 x i32], ptr @f, i64 0, i64 %35
  store i32 %.02950, ptr %36, align 4, !tbaa !5
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %33) #3
  %37 = sext i32 %.02950 to i64
  %38 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %37
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %33, ptr noundef nonnull align 4 dereferenceable(4) %38) #3
  %39 = add nsw i32 %.02950, -1
  %.pre = load i32, ptr @cnt, align 4, !tbaa !5
  %.pre68 = load i32, ptr @n, align 4, !tbaa !5
  br label %.critedge

40:                                               ; preds = %.lr.ph51
  %41 = sext i32 %30 to i64
  %42 = getelementptr inbounds [50010 x i32], ptr @f, i64 0, i64 %41
  store i32 %.03049, ptr %42, align 4, !tbaa !5
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %33) #3
  %43 = add nsw i32 %.03049, 1
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %cnt.promoted = load i32, ptr @cnt, align 4, !tbaa !5
  %45 = icmp slt i32 %cnt.promoted, %44
  br i1 %45, label %.lr.ph46.preheader, label %.critedge

.lr.ph46.preheader:                               ; preds = %40
  %46 = sext i32 %cnt.promoted to i64
  %wide.trip.count62 = sext i32 %44 to i64
  %indvars.iv.next6070 = add nsw i64 %46, 1
  %47 = getelementptr inbounds [50010 x i32], ptr @f, i64 0, i64 %indvars.iv.next6070
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %.not3971 = icmp eq i32 %48, 0
  br i1 %.not3971, label %.critedge, label %.lr.ph73

.lr.ph46:                                         ; preds = %.lr.ph73
  %indvars.iv.next60 = add nsw i64 %indvars.iv.next6072, 1
  %49 = getelementptr inbounds [50010 x i32], ptr @f, i64 0, i64 %indvars.iv.next60
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %.not39 = icmp eq i32 %50, 0
  br i1 %.not39, label %.critedge.loopexit, label %.lr.ph73, !llvm.loop !15

.lr.ph73:                                         ; preds = %.lr.ph46.preheader, %.lr.ph46
  %indvars.iv.next6072 = phi i64 [ %indvars.iv.next60, %.lr.ph46 ], [ %indvars.iv.next6070, %.lr.ph46.preheader ]
  %51 = trunc nsw i64 %indvars.iv.next6072 to i32
  %exitcond63.not = icmp eq i64 %indvars.iv.next6072, %wide.trip.count62
  br i1 %exitcond63.not, label %.critedge.loopexit, label %.lr.ph46, !llvm.loop !15

.critedge.loopexit:                               ; preds = %.lr.ph73, %.lr.ph46
  store i32 %51, ptr @cnt, align 4, !tbaa !5
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph46.preheader, %40, %34
  %52 = phi i32 [ %.pre68, %34 ], [ %44, %40 ], [ %44, %.lr.ph46.preheader ], [ %44, %.critedge.loopexit ]
  %53 = phi i32 [ %.pre, %34 ], [ %cnt.promoted, %40 ], [ %cnt.promoted, %.lr.ph46.preheader ], [ %51, %.critedge.loopexit ]
  %.131 = phi i32 [ %.03049, %34 ], [ %43, %40 ], [ %43, %.lr.ph46.preheader ], [ %43, %.critedge.loopexit ]
  %.1 = phi i32 [ %39, %34 ], [ %.02950, %40 ], [ %.02950, %.lr.ph46.preheader ], [ %.02950, %.critedge.loopexit ]
  %54 = add nuw nsw i32 %.03248, 1
  %55 = icmp slt i32 %54, %52
  br i1 %55, label %.lr.ph51, label %.preheader, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph54, %.preheader41, %.preheader
  ret i32 0

.lr.ph54:                                         ; preds = %.preheader, %.lr.ph54
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph54 ], [ 1, %.preheader ]
  %56 = getelementptr inbounds [50010 x i32], ptr @f, i64 0, i64 %indvars.iv64
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %57)
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %.not38.not = icmp slt i64 %indvars.iv64, %60
  br i1 %.not38.not, label %.lr.ph54, label %._crit_edge, !llvm.loop !17
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

attributes #0 = { mustprogress norecurse 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 = { 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 #2 = { inlinehint 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 #3 = { 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, !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 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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