; LLVM IR from tangjz/acm-icpc :: codeforces/1530C.ll (Z5solvev)

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

%"struct.std::greater" = type { i8 }

@_ZZ5solvevE3seq = external hidden global [2 x [100001 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 uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::greater", align 1
  %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
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %52, %0
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp slt i32 %19, 2
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %55

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

23:                                               ; preds = %37, %22
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %40

28:                                               ; preds = %23
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %30
  %32 = getelementptr inbounds [100001 x i32], ptr %31, i64 0, i64 0
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i32, ptr %32, i64 %34
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %35)
  br label %37

37:                                               ; preds = %28
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %4, align 4, !tbaa !5
  br label %23, !llvm.loop !9

40:                                               ; preds = %27
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %42
  %44 = getelementptr inbounds [100001 x i32], ptr %43, i64 0, i64 0
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 %46
  %48 = getelementptr inbounds [100001 x i32], ptr %47, i64 0, i64 0
  %49 = load i32, ptr %1, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %48, i64 %50
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef %44, ptr noundef %51)
  br label %52

52:                                               ; preds = %40
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !11

55:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %56 = load i32, ptr %1, align 4, !tbaa !5
  %57 = shl i32 %56, 2
  store i32 %57, ptr %7, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %130, %55
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %62, label %131

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  %66 = ashr i32 %65, 1
  store i32 %66, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %67 = load i32, ptr %1, align 4, !tbaa !5
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = add nsw i32 %67, %68
  %70 = load i32, ptr %1, align 4, !tbaa !5
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = add nsw i32 %70, %71
  %73 = ashr i32 %72, 2
  %74 = sub nsw i32 %69, %73
  store i32 %74, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = sub nsw i32 %75, %76
  store i32 %77, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %79 = load i32, ptr %78, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  store i32 %79, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = sub nsw i32 %80, %81
  %83 = mul nsw i32 %82, 100
  store i32 %83, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %96, %62
  %85 = load i32, ptr %15, align 4, !tbaa !5
  %86 = load i32, ptr %10, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %99

89:                                               ; preds = %84
  %90 = load i32, ptr %15, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3seq, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = load i32, ptr %13, align 4, !tbaa !5
  %95 = add nsw i32 %94, %93
  store i32 %95, ptr %13, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %89
  %97 = load i32, ptr %15, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %15, align 4, !tbaa !5
  br label %84, !llvm.loop !12

99:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %118, %99
  %101 = load i32, ptr %16, align 4, !tbaa !5
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %104, label %108

104:                                              ; preds = %100
  %105 = load i32, ptr %16, align 4, !tbaa !5
  %106 = load i32, ptr %1, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br label %108

108:                                              ; preds = %104, %100
  %109 = phi i1 [ false, %100 ], [ %107, %104 ]
  br i1 %109, label %111, label %110

110:                                              ; preds = %108
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %121

111:                                              ; preds = %108
  %112 = load i32, ptr %16, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100001 x i32], ptr getelementptr inbounds ([2 x [100001 x i32]], ptr @_ZZ5solvevE3seq, i64 0, i64 1), i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = add nsw i32 %116, %115
  store i32 %117, ptr %14, align 4, !tbaa !5
  br label %118

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

121:                                              ; preds = %110
  %122 = load i32, ptr %13, align 4, !tbaa !5
  %123 = load i32, ptr %14, align 4, !tbaa !5
  %124 = icmp sge i32 %122, %123
  br i1 %124, label %125, label %127

125:                                              ; preds = %121
  %126 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %126, ptr %7, align 4, !tbaa !5
  br label %130

127:                                              ; preds = %121
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %6, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %127, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %58, !llvm.loop !14

131:                                              ; preds = %58
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %132)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

; 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

; 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 uwtable
declare dso_local void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef, ptr noundef) #3

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

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

attributes #0 = { 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 #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 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 = { 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 #5 = { 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"

@_ZZ5solvevE3seq = external hidden global [2 x [100001 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 uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
.preheader43:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #6
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %0)
  %4 = load i32, ptr %0, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %.preheader43.._crit_edge_crit_edge

.preheader43.._crit_edge_crit_edge:               ; preds = %.preheader43
  %.pre = sext i32 %4 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader43.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader43.._crit_edge_crit_edge ], [ %21, %.lr.ph ]
  %6 = getelementptr inbounds i32, ptr @_ZZ5solvevE3seq, i64 %.pre-phi
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef nonnull @_ZZ5solvevE3seq, ptr noundef nonnull %6)
  %7 = load i32, ptr %0, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph.1, label %._crit_edge.._crit_edge.1_crit_edge

._crit_edge.._crit_edge.1_crit_edge:              ; preds = %._crit_edge
  %.pre77 = sext i32 %7 to i64
  br label %._crit_edge.1

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

._crit_edge.1:                                    ; preds = %.lr.ph.1, %._crit_edge.._crit_edge.1_crit_edge
  %.pre-phi78 = phi i64 [ %.pre77, %._crit_edge.._crit_edge.1_crit_edge ], [ %12, %.lr.ph.1 ]
  %14 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3seq, i64 400004), i64 %.pre-phi78
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3seq, i64 400004), ptr noundef nonnull %14)
  %15 = load i32, ptr %0, align 4, !tbaa !5
  %16 = shl i32 %15, 2
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph59, label %._crit_edge60

.lr.ph:                                           ; preds = %.preheader43, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader43 ]
  %18 = getelementptr inbounds i32, ptr @_ZZ5solvevE3seq, i64 %indvars.iv
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %0, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph59:                                         ; preds = %._crit_edge.1, %._crit_edge54
  %23 = phi i32 [ %.fr, %._crit_edge54 ], [ %15, %._crit_edge.1 ]
  %.03957 = phi i32 [ %.1, %._crit_edge54 ], [ %16, %._crit_edge.1 ]
  %.04056 = phi i32 [ %.141, %._crit_edge54 ], [ 0, %._crit_edge.1 ]
  %24 = add nuw nsw i32 %.03957, %.04056
  %25 = lshr i32 %24, 1
  %26 = add nsw i32 %23, %25
  %27 = ashr i32 %26, 2
  %28 = sub nsw i32 %26, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %29 = sub nsw i32 %28, %25
  store i32 %29, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %31 = load i32, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %32 = sub nsw i32 %28, %31
  %33 = mul nsw i32 %32, 100
  %34 = icmp sgt i32 %31, 0
  br i1 %34, label %.lr.ph49.preheader, label %.preheader

.lr.ph49.preheader:                               ; preds = %.lr.ph59
  %wide.trip.count = zext nneg i32 %31 to i64
  %min.iters.check89 = icmp ult i32 %31, 8
  br i1 %min.iters.check89, label %.lr.ph49.preheader105, label %vector.ph90

.lr.ph49.preheader105:                            ; preds = %middle.block87, %.lr.ph49.preheader
  %indvars.iv69.ph = phi i64 [ 0, %.lr.ph49.preheader ], [ %n.vec92, %middle.block87 ]
  %.03646.ph = phi i32 [ %33, %.lr.ph49.preheader ], [ %41, %middle.block87 ]
  br label %.lr.ph49

vector.ph90:                                      ; preds = %.lr.ph49.preheader
  %n.vec92 = and i64 %wide.trip.count, 2147483640
  %35 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %33, i64 0
  br label %vector.body94

vector.body94:                                    ; preds = %vector.body94, %vector.ph90
  %index95 = phi i64 [ 0, %vector.ph90 ], [ %index.next100, %vector.body94 ]
  %vec.phi96 = phi <4 x i32> [ %35, %vector.ph90 ], [ %38, %vector.body94 ]
  %vec.phi97 = phi <4 x i32> [ zeroinitializer, %vector.ph90 ], [ %39, %vector.body94 ]
  %36 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3seq, i64 0, i64 %index95
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %wide.load98 = load <4 x i32>, ptr %36, align 16, !tbaa !5
  %wide.load99 = load <4 x i32>, ptr %37, align 16, !tbaa !5
  %38 = add <4 x i32> %wide.load98, %vec.phi96
  %39 = add <4 x i32> %wide.load99, %vec.phi97
  %index.next100 = add nuw i64 %index95, 8
  %40 = icmp eq i64 %index.next100, %n.vec92
  br i1 %40, label %middle.block87, label %vector.body94, !llvm.loop !11

middle.block87:                                   ; preds = %vector.body94
  %bin.rdx101 = add <4 x i32> %39, %38
  %41 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx101)
  %cmp.n102 = icmp eq i64 %n.vec92, %wide.trip.count
  br i1 %cmp.n102, label %.preheader, label %.lr.ph49.preheader105

.preheader:                                       ; preds = %.lr.ph49, %middle.block87, %.lr.ph59
  %.036.lcssa = phi i32 [ %33, %.lr.ph59 ], [ %41, %middle.block87 ], [ %52, %.lr.ph49 ]
  %42 = load i32, ptr %0, align 4
  %.fr = freeze i32 %42
  %invariant.smin = call i32 @llvm.smin.i32(i32 %28, i32 %.fr)
  %43 = icmp sgt i32 %invariant.smin, 0
  br i1 %43, label %.lr.ph53.preheader, label %._crit_edge54

.lr.ph53.preheader:                               ; preds = %.preheader
  %wide.trip.count75 = zext nneg i32 %invariant.smin to i64
  %min.iters.check = icmp ult i32 %invariant.smin, 8
  br i1 %min.iters.check, label %.lr.ph53.preheader104, label %vector.ph

.lr.ph53.preheader104:                            ; preds = %middle.block, %.lr.ph53.preheader
  %indvars.iv72.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %n.vec, %middle.block ]
  %.03551.ph = phi i32 [ 0, %.lr.ph53.preheader ], [ %49, %middle.block ]
  br label %.lr.ph53

vector.ph:                                        ; preds = %.lr.ph53.preheader
  %n.vec = and i64 %wide.trip.count75, 2147483640
  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> [ zeroinitializer, %vector.ph ], [ %46, %vector.body ]
  %vec.phi85 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %47, %vector.body ]
  %44 = getelementptr inbounds [100001 x i32], ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3seq, i64 400004), i64 0, i64 %index
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %wide.load = load <4 x i32>, ptr %44, align 4, !tbaa !5
  %wide.load86 = load <4 x i32>, ptr %45, align 4, !tbaa !5
  %46 = add <4 x i32> %wide.load, %vec.phi
  %47 = add <4 x i32> %wide.load86, %vec.phi85
  %index.next = add nuw i64 %index, 8
  %48 = icmp eq i64 %index.next, %n.vec
  br i1 %48, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %47, %46
  %49 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count75
  br i1 %cmp.n, label %._crit_edge54, label %.lr.ph53.preheader104

.lr.ph49:                                         ; preds = %.lr.ph49.preheader105, %.lr.ph49
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph49 ], [ %indvars.iv69.ph, %.lr.ph49.preheader105 ]
  %.03646 = phi i32 [ %52, %.lr.ph49 ], [ %.03646.ph, %.lr.ph49.preheader105 ]
  %50 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3seq, i64 0, i64 %indvars.iv69
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, %.03646
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph49, !llvm.loop !15

._crit_edge54:                                    ; preds = %.lr.ph53, %middle.block, %.preheader
  %.035.lcssa = phi i32 [ 0, %.preheader ], [ %49, %middle.block ], [ %57, %.lr.ph53 ]
  %.not = icmp slt i32 %.036.lcssa, %.035.lcssa
  %53 = add nuw nsw i32 %25, 1
  %.141 = select i1 %.not, i32 %53, i32 %.04056
  %.1 = select i1 %.not, i32 %.03957, i32 %25
  %54 = icmp slt i32 %.141, %.1
  br i1 %54, label %.lr.ph59, label %._crit_edge60, !llvm.loop !16

.lr.ph53:                                         ; preds = %.lr.ph53.preheader104, %.lr.ph53
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %.lr.ph53 ], [ %indvars.iv72.ph, %.lr.ph53.preheader104 ]
  %.03551 = phi i32 [ %57, %.lr.ph53 ], [ %.03551.ph, %.lr.ph53.preheader104 ]
  %55 = getelementptr inbounds [100001 x i32], ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3seq, i64 400004), i64 0, i64 %indvars.iv72
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %56, %.03551
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75
  br i1 %exitcond76.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !17

._crit_edge60:                                    ; preds = %._crit_edge54, %._crit_edge.1
  %.040.lcssa = phi i32 [ 0, %._crit_edge.1 ], [ %.141, %._crit_edge54 ]
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.040.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #6
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) 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.smin.i32(i32, i32) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

attributes #0 = { 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 #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 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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12, !13}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !13, !12}


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