; LLVM IR from tangjz/acm-icpc :: uvalive (4771)

; 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
@tot = external dso_local global i32, align 4
@c = external dso_local global [4 x i32], align 16
@val = external dso_local global i32, align 4
@f = external dso_local global [1116 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

; 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
  store i32 0, ptr %1, align 4
  store i32 1, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr @f, align 16, !tbaa !5
  store i32 3, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 2), align 8, !tbaa !5
  store i32 10, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 3), align 4, !tbaa !5
  store i32 35, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 4), align 16, !tbaa !5
  store i32 126, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 5), align 4, !tbaa !5
  store i32 462, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 6), align 8, !tbaa !5
  store i32 1716, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 7), align 4, !tbaa !5
  store i32 6435, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 8), align 16, !tbaa !5
  store i32 24310, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 9), align 4, !tbaa !5
  store i32 7, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 11), align 4, !tbaa !5
  store i32 42, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 12), align 16, !tbaa !5
  store i32 230, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 13), align 4, !tbaa !5
  store i32 1190, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 14), align 8, !tbaa !5
  store i32 5922, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 15), align 4, !tbaa !5
  store i32 28644, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 16), align 16, !tbaa !5
  store i32 135564, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 17), align 4, !tbaa !5
  store i32 630630, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 18), align 8, !tbaa !5
  store i32 393, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 22), align 8, !tbaa !5
  store i32 3030, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 23), align 4, !tbaa !5
  store i32 20790, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 24), align 16, !tbaa !5
  store i32 131796, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 25), align 4, !tbaa !5
  store i32 788634, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 26), align 8, !tbaa !5
  store i32 30670, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 33), align 4, !tbaa !5
  store i32 264740, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 34), align 8, !tbaa !5
  store i32 2050020, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 35), align 4, !tbaa !5
  store i32 115, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 111), align 4, !tbaa !5
  store i32 1158, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 112), align 16, !tbaa !5
  store i32 9350, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 113), align 4, !tbaa !5
  store i32 66290, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 114), align 8, !tbaa !5
  store i32 430794, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 115), align 4, !tbaa !5
  store i32 2628780, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 116), align 16, !tbaa !5
  store i32 16782, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 122), align 8, !tbaa !5
  store i32 180990, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 123), align 4, !tbaa !5
  store i32 1636740, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 124), align 16, !tbaa !5
  store i32 334833, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 222), align 8, !tbaa !5
  store i32 3451, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 1111), align 4, !tbaa !5
  store i32 52422, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 1112), align 16, !tbaa !5
  store i32 583670, ptr getelementptr inbounds ([1116 x i32], ptr @f, i64 0, i64 1113), align 4, !tbaa !5
  br label %4

4:                                                ; preds = %77, %0
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %6 = icmp eq i32 %5, 1
  br i1 %6, label %7, label %83

7:                                                ; preds = %4
  store i32 0, ptr @val, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %43, %7
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = mul nsw i32 %9, %10
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %8
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = srem i32 %16, %17
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %42

20:                                               ; preds = %15
  %21 = load i32, ptr @tot, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %22
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %30, %20
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = srem i32 %25, %26
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %39

29:                                               ; preds = %24
  br label %30

30:                                               ; preds = %29
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = sdiv i32 %32, %31
  store i32 %33, ptr @n, align 4, !tbaa !5
  %34 = load i32, ptr @tot, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !5
  br label %24, !llvm.loop !9

39:                                               ; preds = %24
  %40 = load i32, ptr @tot, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @tot, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %39, %15
  br label %43

43:                                               ; preds = %42
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !11

46:                                               ; preds = %14
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = icmp sgt i32 %47, 1
  br i1 %48, label %49, label %54

49:                                               ; preds = %46
  %50 = load i32, ptr @tot, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr @tot, align 4, !tbaa !5
  %52 = sext i32 %50 to i64
  %53 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %52
  store i32 1, ptr %53, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %49, %46
  %55 = load i32, ptr @tot, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr @c, i64 %56
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @c, ptr noundef %57)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %74, %54
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = load i32, ptr @tot, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %77

63:                                               ; preds = %58
  %64 = load i32, ptr @val, align 4, !tbaa !5
  %65 = shl i32 %64, 3
  %66 = load i32, ptr @val, align 4, !tbaa !5
  %67 = shl i32 %66, 1
  %68 = add nsw i32 %65, %67
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = add nsw i32 %68, %72
  store i32 %73, ptr @val, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %63
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %3, align 4, !tbaa !5
  br label %58, !llvm.loop !12

77:                                               ; preds = %62
  %78 = load i32, ptr @val, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1116 x i32], ptr @f, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %81)
  br label %4, !llvm.loop !13

83:                                               ; preds = %4
  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 uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #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 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}


; 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
@tot = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local global [4 x i32], align 16
@val = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [1116 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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  store <4 x i32> <i32 1, i32 1, i32 3, i32 10>, ptr @f, align 16, !tbaa !5
  store <4 x i32> <i32 35, i32 126, i32 462, i32 1716>, ptr getelementptr inbounds (i8, ptr @f, i64 16), align 16, !tbaa !5
  store i32 6435, ptr getelementptr inbounds (i8, ptr @f, i64 32), align 16, !tbaa !5
  store i32 24310, ptr getelementptr inbounds (i8, ptr @f, i64 36), align 4, !tbaa !5
  store <4 x i32> <i32 7, i32 42, i32 230, i32 1190>, ptr getelementptr inbounds (i8, ptr @f, i64 44), align 4, !tbaa !5
  store <4 x i32> <i32 5922, i32 28644, i32 135564, i32 630630>, ptr getelementptr inbounds (i8, ptr @f, i64 60), align 4, !tbaa !5
  store <4 x i32> <i32 393, i32 3030, i32 20790, i32 131796>, ptr getelementptr inbounds (i8, ptr @f, i64 88), align 8, !tbaa !5
  store i32 788634, ptr getelementptr inbounds (i8, ptr @f, i64 104), align 8, !tbaa !5
  store i32 30670, ptr getelementptr inbounds (i8, ptr @f, i64 132), align 4, !tbaa !5
  store i32 264740, ptr getelementptr inbounds (i8, ptr @f, i64 136), align 8, !tbaa !5
  store i32 2050020, ptr getelementptr inbounds (i8, ptr @f, i64 140), align 4, !tbaa !5
  store <4 x i32> <i32 115, i32 1158, i32 9350, i32 66290>, ptr getelementptr inbounds (i8, ptr @f, i64 444), align 4, !tbaa !5
  store i32 430794, ptr getelementptr inbounds (i8, ptr @f, i64 460), align 4, !tbaa !5
  store i32 2628780, ptr getelementptr inbounds (i8, ptr @f, i64 464), align 16, !tbaa !5
  store i32 16782, ptr getelementptr inbounds (i8, ptr @f, i64 488), align 8, !tbaa !5
  store i32 180990, ptr getelementptr inbounds (i8, ptr @f, i64 492), align 4, !tbaa !5
  store i32 1636740, ptr getelementptr inbounds (i8, ptr @f, i64 496), align 16, !tbaa !5
  store i32 334833, ptr getelementptr inbounds (i8, ptr @f, i64 888), align 8, !tbaa !5
  store i32 3451, ptr getelementptr inbounds (i8, ptr @f, i64 4444), align 4, !tbaa !5
  store i32 52422, ptr getelementptr inbounds (i8, ptr @f, i64 4448), align 16, !tbaa !5
  store i32 583670, ptr getelementptr inbounds (i8, ptr @f, i64 4452), align 4, !tbaa !5
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = icmp eq i32 %1, 1
  br i1 %2, label %.lr.ph30, label %._crit_edge31

.lr.ph30:                                         ; preds = %0, %37
  store i32 0, ptr @val, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  %n.promoted13 = load i32, ptr @n, align 4, !tbaa !5
  %.not17 = icmp slt i32 %n.promoted13, 4
  br i1 %.not17, label %._crit_edge22, label %.lr.ph21

._crit_edge22:                                    ; preds = %17, %.lr.ph30
  %3 = phi i32 [ 0, %.lr.ph30 ], [ %18, %17 ]
  %.lcssa = phi i32 [ %n.promoted13, %.lr.ph30 ], [ %.lcssa1214, %17 ]
  %4 = icmp sgt i32 %.lcssa, 1
  br i1 %4, label %21, label %25

.lr.ph21:                                         ; preds = %.lr.ph30, %17
  %.0919 = phi i32 [ %19, %17 ], [ 2, %.lr.ph30 ]
  %.lcssa121618 = phi i32 [ %.lcssa1214, %17 ], [ %n.promoted13, %.lr.ph30 ]
  %5 = phi i32 [ %18, %17 ], [ 0, %.lr.ph30 ]
  %6 = srem i32 %.lcssa121618, %.0919
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %.lr.ph.preheader, label %17

.lr.ph.preheader:                                 ; preds = %.lr.ph21
  %8 = sext i32 %5 to i64
  %9 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %8
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %storemerge11 = phi i32 [ %12, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %10 = phi i32 [ %11, %.lr.ph ], [ %.lcssa121618, %.lr.ph.preheader ]
  %11 = sdiv i32 %10, %.0919
  %12 = add nuw nsw i32 %storemerge11, 1
  %13 = srem i32 %11, %.0919
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %.lr.ph, label %15, !llvm.loop !9

15:                                               ; preds = %.lr.ph
  store i32 %11, ptr @n, align 4, !tbaa !5
  store i32 %12, ptr %9, align 4, !tbaa !5
  %16 = add nsw i32 %5, 1
  store i32 %16, ptr @tot, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %.lr.ph21, %15
  %18 = phi i32 [ %5, %.lr.ph21 ], [ %16, %15 ]
  %.lcssa1214 = phi i32 [ %.lcssa121618, %.lr.ph21 ], [ %11, %15 ]
  %19 = add nuw nsw i32 %.0919, 1
  %20 = mul nuw nsw i32 %19, %19
  %.not = icmp sgt i32 %20, %.lcssa1214
  br i1 %.not, label %._crit_edge22, label %.lr.ph21, !llvm.loop !11

21:                                               ; preds = %._crit_edge22
  %22 = add nsw i32 %3, 1
  store i32 %22, ptr @tot, align 4, !tbaa !5
  %23 = sext i32 %3 to i64
  %24 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %23
  store i32 1, ptr %24, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %21, %._crit_edge22
  %26 = phi i32 [ %22, %21 ], [ %3, %._crit_edge22 ]
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr @c, i64 %27
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @c, ptr noundef nonnull %28)
  %29 = load i32, ptr @tot, align 4, !tbaa !5
  %val.promoted = load i32, ptr @val, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph26.preheader, label %37

.lr.ph26.preheader:                               ; preds = %25
  %wide.trip.count = zext nneg i32 %29 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %31 = icmp ult i32 %29, 4
  br i1 %31, label %._crit_edge27.unr-lcssa, label %.lr.ph26.preheader.new

.lr.ph26.preheader.new:                           ; preds = %.lr.ph26.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph26

._crit_edge27.unr-lcssa:                          ; preds = %.lr.ph26, %.lr.ph26.preheader
  %.lcssa48.ph = phi i32 [ poison, %.lr.ph26.preheader ], [ %61, %.lr.ph26 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph26.preheader ], [ %indvars.iv.next.3, %.lr.ph26 ]
  %.unr = phi i32 [ %val.promoted, %.lr.ph26.preheader ], [ %61, %.lr.ph26 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge27, label %.lr.ph26.epil

.lr.ph26.epil:                                    ; preds = %._crit_edge27.unr-lcssa, %.lr.ph26.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph26.epil ], [ %indvars.iv.unr, %._crit_edge27.unr-lcssa ]
  %32 = phi i32 [ %36, %.lr.ph26.epil ], [ %.unr, %._crit_edge27.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph26.epil ], [ 0, %._crit_edge27.unr-lcssa ]
  %33 = mul i32 %32, 10
  %34 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %indvars.iv.epil
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %33, %35
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge27, label %.lr.ph26.epil, !llvm.loop !12

._crit_edge27:                                    ; preds = %.lr.ph26.epil, %._crit_edge27.unr-lcssa
  %.lcssa48 = phi i32 [ %.lcssa48.ph, %._crit_edge27.unr-lcssa ], [ %36, %.lr.ph26.epil ]
  store i32 %.lcssa48, ptr @val, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %._crit_edge27, %25
  %38 = phi i32 [ %.lcssa48, %._crit_edge27 ], [ %val.promoted, %25 ]
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1116 x i32], ptr @f, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %41)
  %43 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %.lr.ph30, label %._crit_edge31, !llvm.loop !14

.lr.ph26:                                         ; preds = %.lr.ph26, %.lr.ph26.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph26.preheader.new ], [ %indvars.iv.next.3, %.lr.ph26 ]
  %45 = phi i32 [ %val.promoted, %.lr.ph26.preheader.new ], [ %61, %.lr.ph26 ]
  %niter = phi i64 [ 0, %.lr.ph26.preheader.new ], [ %niter.next.3, %.lr.ph26 ]
  %46 = mul i32 %45, 10
  %47 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %indvars.iv
  %48 = load i32, ptr %47, align 16, !tbaa !5
  %49 = add nsw i32 %46, %48
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %50 = mul i32 %49, 10
  %51 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %indvars.iv.next
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %50, %52
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %54 = mul i32 %53, 10
  %55 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %indvars.iv.next.1
  %56 = load i32, ptr %55, align 8, !tbaa !5
  %57 = add nsw i32 %54, %56
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %58 = mul i32 %57, 10
  %59 = getelementptr inbounds [4 x i32], ptr @c, i64 0, i64 %indvars.iv.next.2
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %58, %60
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge27.unr-lcssa, label %.lr.ph26, !llvm.loop !15

._crit_edge31:                                    ; preds = %37, %0
  ret i32 0
}

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 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" }

!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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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