; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1352G)

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3arr = external hidden global [300001 x i32], align 16
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 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
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %119, %0
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp sle i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %122

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = icmp sle i32 %19, 3
  br i1 %20, label %21, label %23

21:                                               ; preds = %17
  %22 = call i32 @puts(ptr noundef @.str.2)
  store i32 4, ptr %4, align 4
  br label %116

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

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

28:                                               ; preds = %24
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %38

29:                                               ; preds = %24
  %30 = load i32, ptr %8, align 4, !tbaa !5
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %33
  store i32 %30, ptr %34, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %29
  %36 = load i32, ptr %8, align 4, !tbaa !5
  %37 = add nsw i32 %36, 2
  store i32 %37, ptr %8, align 4, !tbaa !5
  br label %24, !llvm.loop !9

38:                                               ; preds = %28
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = icmp eq i32 %43, %44
  br i1 %45, label %46, label %49

46:                                               ; preds = %38
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = sub nsw i32 %47, 1
  br label %51

49:                                               ; preds = %38
  %50 = load i32, ptr %6, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %49, %46
  %52 = phi i32 [ %48, %46 ], [ %50, %49 ]
  store i32 %52, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = and i32 %54, 1
  %56 = sub nsw i32 %53, %55
  store i32 %56, ptr %9, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %67, %51
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %61, label %60

60:                                               ; preds = %57
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %70

61:                                               ; preds = %57
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %6, align 4, !tbaa !5
  %65 = sext i32 %63 to i64
  %66 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %65
  store i32 %62, ptr %66, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %61
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = sub nsw i32 %68, 2
  store i32 %69, ptr %9, align 4, !tbaa !5
  br label %57, !llvm.loop !11

70:                                               ; preds = %60
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = and i32 %71, 1
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %83

74:                                               ; preds = %70
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %77
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = add nsw i32 %79, 2
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %81
  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) %78, ptr noundef nonnull align 4 dereferenceable(4) %82) #4
  br label %92

83:                                               ; preds = %70
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %86
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sub nsw i32 %88, 2
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %90
  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) %87, ptr noundef nonnull align 4 dereferenceable(4) %91) #4
  br label %92

92:                                               ; preds = %83, %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %112, %92
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %115

98:                                               ; preds = %93
  %99 = load i32, ptr %10, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = icmp eq i32 %103, %105
  %107 = zext i1 %106 to i64
  %108 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !12
  %110 = sext i8 %109 to i32
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %102, i32 noundef %110)
  br label %112

112:                                              ; preds = %98
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !5
  br label %93, !llvm.loop !13

115:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  store i32 0, ptr %4, align 4
  br label %116

116:                                              ; preds = %115, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  %117 = load i32, ptr %4, align 4
  switch i32 %117, label %124 [
    i32 0, label %118
    i32 4, label %119
  ]

118:                                              ; preds = %116
  br label %119

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

122:                                              ; preds = %16
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %123 = load i32, ptr %1, align 4
  ret i32 %123

124:                                              ; preds = %116
  unreachable
}

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

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

declare i32 @puts(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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)) #3

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = !{!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"

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3arr = external hidden global [300001 x i32], align 16
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  store i32 1, ptr %1, align 4, !tbaa !5
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %.not36 = icmp slt i32 %4, 1
  br i1 %.not36, label %._crit_edge40, label %.lr.ph39

._crit_edge40:                                    ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret i32 0

.lr.ph39:                                         ; preds = %0, %.loopexit
  %.02737 = phi i32 [ %61, %.loopexit ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = icmp slt i32 %6, 4
  br i1 %7, label %15, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.lr.ph39
  %8 = add nsw i32 %6, -1
  %9 = lshr i32 %8, 1
  %10 = add nuw nsw i32 %9, 1
  %wide.trip.count = zext nneg i32 %10 to i64
  %min.iters.check61 = icmp ult i32 %6, 15
  br i1 %min.iters.check61, label %.preheader.preheader83, label %vector.ph62

.preheader.preheader83:                           ; preds = %middle.block59, %.preheader.preheader
  %indvars.iv44.ph = phi i64 [ 1, %.preheader.preheader ], [ %ind.end65, %middle.block59 ]
  %indvars.iv.ph = phi i64 [ 0, %.preheader.preheader ], [ %n.vec64, %middle.block59 ]
  %.02532.ph = phi i32 [ 1, %.preheader.preheader ], [ %ind.end69, %middle.block59 ]
  br label %.preheader

vector.ph62:                                      ; preds = %.preheader.preheader
  %n.vec64 = and i64 %wide.trip.count, 2147483640
  %ind.end65 = or disjoint i64 %n.vec64, 1
  %.cast68 = trunc nuw nsw i64 %n.vec64 to i32
  %11 = shl nuw i32 %.cast68, 1
  %ind.end69 = or disjoint i32 %11, 1
  br label %vector.body71

vector.body71:                                    ; preds = %vector.body71, %vector.ph62
  %index72 = phi i64 [ 0, %vector.ph62 ], [ %index.next77, %vector.body71 ]
  %vec.ind73 = phi <4 x i32> [ <i32 1, i32 3, i32 5, i32 7>, %vector.ph62 ], [ %vec.ind.next76, %vector.body71 ]
  %step.add74 = add <4 x i32> %vec.ind73, <i32 8, i32 8, i32 8, i32 8>
  %12 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %index72
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  store <4 x i32> %vec.ind73, ptr %12, align 16, !tbaa !5
  store <4 x i32> %step.add74, ptr %13, align 16, !tbaa !5
  %index.next77 = add nuw i64 %index72, 8
  %vec.ind.next76 = add <4 x i32> %vec.ind73, <i32 16, i32 16, i32 16, i32 16>
  %14 = icmp eq i64 %index.next77, %n.vec64
  br i1 %14, label %middle.block59, label %vector.body71, !llvm.loop !9

middle.block59:                                   ; preds = %vector.body71
  %cmp.n78 = icmp eq i64 %n.vec64, %wide.trip.count
  %ind.escape80 = add nsw i64 %n.vec64, -1
  br i1 %cmp.n78, label %.loopexit81, label %.preheader.preheader83

15:                                               ; preds = %.lr.ph39
  %16 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.loopexit

.loopexit81:                                      ; preds = %.preheader, %middle.block59
  %indvars.iv44.lcssa = phi i64 [ %n.vec64, %middle.block59 ], [ %indvars.iv44, %.preheader ]
  %indvars.iv.lcssa = phi i64 [ %ind.escape80, %middle.block59 ], [ %indvars.iv, %.preheader ]
  %17 = trunc nuw nsw i64 %indvars.iv.lcssa to i32
  %18 = and i64 %indvars.iv.lcssa, 4294967295
  %19 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp eq i32 %20, %6
  %22 = select i1 %21, i32 %17, i32 %10
  %23 = and i32 %6, 2147483646
  %.not41 = icmp eq i32 %23, 0
  br i1 %.not41, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.loopexit81
  %24 = add nsw i32 %6, -2
  %25 = lshr i32 %24, 1
  %narrow = add nuw i32 %25, 1
  %26 = zext i32 %narrow to i64
  %min.iters.check = icmp ult i32 %24, 14
  br i1 %min.iters.check, label %.lr.ph.preheader82, label %vector.ph

.lr.ph.preheader82:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv46.ph = phi i64 [ %indvars.iv44.lcssa, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %.02434.ph = phi i32 [ %23, %.lr.ph.preheader ], [ %ind.end56, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %26, 4294967288
  %ind.end = add i64 %indvars.iv44.lcssa, %n.vec
  %.cast = trunc nuw i64 %n.vec to i32
  %27 = shl i32 %.cast, 1
  %ind.end56 = sub i32 %23, %27
  %.splatinsert = insertelement <4 x i32> poison, i32 %23, i64 0
  %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction = add nsw <4 x i32> %.splat, <i32 0, i32 -2, i32 -4, i32 -6>
  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> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 -8, i32 -8, i32 -8, i32 -8>
  %offset.idx = add i64 %indvars.iv44.lcssa, %index
  %28 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %offset.idx
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  store <4 x i32> %vec.ind, ptr %28, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %29, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 -16, i32 -16, i32 -16, i32 -16>
  %30 = icmp eq i64 %index.next, %n.vec
  br i1 %30, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %26
  br i1 %cmp.n, label %._crit_edge.loopexit, label %.lr.ph.preheader82

.preheader:                                       ; preds = %.preheader.preheader83, %.preheader
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %.preheader ], [ %indvars.iv44.ph, %.preheader.preheader83 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader ], [ %indvars.iv.ph, %.preheader.preheader83 ]
  %.02532 = phi i32 [ %32, %.preheader ], [ %.02532.ph, %.preheader.preheader83 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %indvars.iv
  store i32 %.02532, ptr %31, align 4, !tbaa !5
  %32 = add nuw nsw i32 %.02532, 2
  %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  br i1 %exitcond, label %.loopexit81, label %.preheader, !llvm.loop !14

._crit_edge.loopexit:                             ; preds = %.lr.ph, %middle.block
  %indvars.iv.next47.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next47, %.lr.ph ]
  %33 = trunc nuw nsw i64 %indvars.iv.next47.lcssa to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.loopexit81
  %.1.lcssa = phi i32 [ %10, %.loopexit81 ], [ %33, %._crit_edge.loopexit ]
  %34 = and i32 %6, 1
  %.not30 = icmp eq i32 %34, 0
  br i1 %.not30, label %43, label %38

.lr.ph:                                           ; preds = %.lr.ph.preheader82, %.lr.ph
  %indvars.iv46 = phi i64 [ %indvars.iv.next47, %.lr.ph ], [ %indvars.iv46.ph, %.lr.ph.preheader82 ]
  %.02434 = phi i32 [ %36, %.lr.ph ], [ %.02434.ph, %.lr.ph.preheader82 ]
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %35 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %indvars.iv46
  store i32 %.02434, ptr %35, align 4, !tbaa !5
  %36 = add nsw i32 %.02434, -2
  %37 = icmp ugt i32 %.02434, 2
  br i1 %37, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !15

38:                                               ; preds = %._crit_edge
  %39 = add nuw nsw i32 %22, 1
  %40 = zext nneg i32 %39 to i64
  %41 = add nuw nsw i32 %22, 2
  %42 = zext nneg i32 %41 to i64
  br label %48

43:                                               ; preds = %._crit_edge
  %44 = add nsw i32 %22, -1
  %45 = sext i32 %44 to i64
  %46 = add nsw i32 %22, -2
  %47 = sext i32 %46 to i64
  br label %48

48:                                               ; preds = %43, %38
  %.sink55 = phi i64 [ %47, %43 ], [ %42, %38 ]
  %.pn = phi i64 [ %45, %43 ], [ %40, %38 ]
  %.sink = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %.pn
  %49 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %.sink55
  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) %.sink, ptr noundef nonnull align 4 dereferenceable(4) %49) #4
  %50 = add nsw i32 %.1.lcssa, -1
  %51 = zext i32 %50 to i64
  %wide.trip.count52 = zext i32 %.1.lcssa to i64
  br label %52

52:                                               ; preds = %48, %52
  %indvars.iv49 = phi i64 [ 0, %48 ], [ %indvars.iv.next50, %52 ]
  %53 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE3arr, i64 0, i64 %indvars.iv49
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp eq i64 %indvars.iv49, %51
  %56 = zext i1 %55 to i64
  %57 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !16
  %59 = sext i8 %58 to i32
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %54, i32 noundef %59)
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %exitcond53.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count52
  br i1 %exitcond53.not, label %.loopexit, label %52, !llvm.loop !17

.loopexit:                                        ; preds = %52, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %61 = add nuw nsw i32 %.02737, 1
  %62 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.02737, %62
  br i1 %.not.not, label %.lr.ph39, label %._crit_edge40, !llvm.loop !18
}

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

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #3

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !11, !12}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10, !12, !11}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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