; LLVM IR from viveakrt/Competitive-programing :: Codeforces/1043 A. Elections (main)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [101 x i32], align 16
  %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
  store i32 0, ptr %1, align 4
  %10 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 404, ptr %3) #6
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %17

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

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

22:                                               ; preds = %17
  %23 = load i32, ptr %6, align 4, !tbaa !8
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [101 x i32], ptr %3, i64 0, i64 %24
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %27 = load i32, ptr %6, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [101 x i32], ptr %3, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !8
  %31 = load i32, ptr %4, align 4, !tbaa !8
  %32 = add nsw i32 %31, %30
  store i32 %32, ptr %4, align 4, !tbaa !8
  br label %33

33:                                               ; preds = %22
  %34 = load i32, ptr %6, align 4, !tbaa !8
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %6, align 4, !tbaa !8
  br label %17, !llvm.loop !11

36:                                               ; preds = %21
  %37 = getelementptr inbounds [101 x i32], ptr %3, i64 0, i64 0
  %38 = getelementptr inbounds [101 x i32], ptr %3, i64 0, i64 0
  %39 = load i32, ptr %2, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr %38, i64 %40
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %37, ptr noundef %41)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %42 = load i32, ptr %2, align 4, !tbaa !8
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [101 x i32], ptr %3, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !8
  store i32 %46, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !8
  br label %47

47:                                               ; preds = %61, %36
  %48 = load i32, ptr %8, align 4, !tbaa !8
  %49 = load i32, ptr %2, align 4, !tbaa !8
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

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

52:                                               ; preds = %47
  %53 = load i32, ptr %7, align 4, !tbaa !8
  %54 = load i32, ptr %8, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [101 x i32], ptr %3, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !8
  %58 = sub nsw i32 %53, %57
  %59 = load i32, ptr %5, align 4, !tbaa !8
  %60 = add nsw i32 %59, %58
  store i32 %60, ptr %5, align 4, !tbaa !8
  br label %61

61:                                               ; preds = %52
  %62 = load i32, ptr %8, align 4, !tbaa !8
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %8, align 4, !tbaa !8
  br label %47, !llvm.loop !13

64:                                               ; preds = %51
  %65 = load i32, ptr %5, align 4, !tbaa !8
  %66 = load i32, ptr %4, align 4, !tbaa !8
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %68, label %104

68:                                               ; preds = %64
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %69

69:                                               ; preds = %102, %68
  %70 = load i32, ptr %5, align 4, !tbaa !8
  %71 = load i32, ptr %4, align 4, !tbaa !8
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %73, label %103

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %74

74:                                               ; preds = %88, %73
  %75 = load i32, ptr %9, align 4, !tbaa !8
  %76 = load i32, ptr %2, align 4, !tbaa !8
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %91

79:                                               ; preds = %74
  %80 = load i32, ptr %7, align 4, !tbaa !8
  %81 = load i32, ptr %9, align 4, !tbaa !8
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [101 x i32], ptr %3, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !8
  %85 = sub nsw i32 %80, %84
  %86 = load i32, ptr %5, align 4, !tbaa !8
  %87 = add nsw i32 %86, %85
  store i32 %87, ptr %5, align 4, !tbaa !8
  br label %88

88:                                               ; preds = %79
  %89 = load i32, ptr %9, align 4, !tbaa !8
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %9, align 4, !tbaa !8
  br label %74, !llvm.loop !14

91:                                               ; preds = %78
  %92 = load i32, ptr %5, align 4, !tbaa !8
  %93 = load i32, ptr %4, align 4, !tbaa !8
  %94 = icmp sgt i32 %92, %93
  br i1 %94, label %95, label %99

95:                                               ; preds = %91
  %96 = load i32, ptr %7, align 4, !tbaa !8
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %96)
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %103

99:                                               ; preds = %91
  store i32 0, ptr %5, align 4, !tbaa !8
  %100 = load i32, ptr %7, align 4, !tbaa !8
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %7, align 4, !tbaa !8
  br label %102

102:                                              ; preds = %99
  br label %69, !llvm.loop !15

103:                                              ; preds = %95, %69
  br label %108

104:                                              ; preds = %64
  %105 = load i32, ptr %7, align 4, !tbaa !8
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %105)
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %108

108:                                              ; preds = %104, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 404, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca [101 x i32], align 16
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %2) #8
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %10 = load i32, ptr %1, align 4, !tbaa !8
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %10 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %32, %.lr.ph ]
  %.028.lcssa = phi i32 [ 0, %.._crit_edge_crit_edge ], [ %30, %.lr.ph ]
  %12 = getelementptr inbounds i32, ptr %2, i64 %.pre-phi
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %2, ptr noundef nonnull %12)
  %13 = load i32, ptr %1, align 4, !tbaa !8
  %14 = add nsw i32 %13, -1
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [101 x i32], ptr %2, i64 0, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !8
  %18 = icmp sgt i32 %13, 0
  br i1 %18, label %.lr.ph39.preheader, label %._crit_edge40

.lr.ph39.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %13 to i64
  %min.iters.check = icmp ult i32 %13, 8
  br i1 %min.iters.check, label %.lr.ph39.preheader102, label %vector.ph

.lr.ph39.preheader102:                            ; preds = %middle.block, %.lr.ph39.preheader
  %indvars.iv59.ph = phi i64 [ 0, %.lr.ph39.preheader ], [ %n.vec, %middle.block ]
  %.02736.ph = phi i32 [ 0, %.lr.ph39.preheader ], [ %26, %middle.block ]
  br label %.lr.ph39

vector.ph:                                        ; preds = %.lr.ph39.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %17, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  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 ], [ %23, %vector.body ]
  %vec.phi78 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
  %19 = getelementptr inbounds [101 x i32], ptr %2, i64 0, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %wide.load = load <4 x i32>, ptr %19, align 16, !tbaa !8
  %wide.load79 = load <4 x i32>, ptr %20, align 16, !tbaa !8
  %21 = add <4 x i32> %vec.phi, %broadcast.splat
  %22 = add <4 x i32> %vec.phi78, %broadcast.splat
  %23 = sub <4 x i32> %21, %wide.load
  %24 = sub <4 x i32> %22, %wide.load79
  %index.next = add nuw i64 %index, 8
  %25 = icmp eq i64 %index.next, %n.vec
  br i1 %25, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %24, %23
  %26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge40, label %.lr.ph39.preheader102

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %.02833 = phi i32 [ %30, %.lr.ph ], [ 0, %0 ]
  %27 = getelementptr inbounds [101 x i32], ptr %2, i64 0, i64 %indvars.iv
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %29 = load i32, ptr %27, align 4, !tbaa !8
  %30 = add nsw i32 %29, %.02833
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr %1, align 4, !tbaa !8
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next, %32
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge40:                                    ; preds = %.lr.ph39, %middle.block, %._crit_edge
  %.027.lcssa = phi i32 [ 0, %._crit_edge ], [ %26, %middle.block ], [ %52, %.lr.ph39 ]
  %.not = icmp sgt i32 %.027.lcssa, %.028.lcssa
  br i1 %.not, label %.loopexit.sink.split, label %.preheader31

.preheader31:                                     ; preds = %._crit_edge40
  %34 = icmp sgt i32 %.028.lcssa, 0
  br i1 %34, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %.preheader31
  call void @llvm.assume(i1 %18)
  %wide.trip.count70 = zext nneg i32 %13 to i64
  %min.iters.check82 = icmp ult i32 %13, 8
  %n.vec85 = and i64 %wide.trip.count70, 2147483640
  %cmp.n97 = icmp eq i64 %n.vec85, %wide.trip.count70
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %.preheader.lr.ph, %._crit_edge45.us.us
  %.02547.us.us = phi i32 [ %48, %._crit_edge45.us.us ], [ %17, %.preheader.lr.ph ]
  br i1 %min.iters.check82, label %scalar.ph81.preheader, label %vector.ph83

vector.ph83:                                      ; preds = %.preheader.us.us
  %broadcast.splatinsert93 = insertelement <4 x i32> poison, i32 %.02547.us.us, i64 0
  %broadcast.splat94 = shufflevector <4 x i32> %broadcast.splatinsert93, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body87

vector.body87:                                    ; preds = %vector.body87, %vector.ph83
  %index88 = phi i64 [ 0, %vector.ph83 ], [ %index.next95, %vector.body87 ]
  %vec.phi89 = phi <4 x i32> [ zeroinitializer, %vector.ph83 ], [ %39, %vector.body87 ]
  %vec.phi90 = phi <4 x i32> [ zeroinitializer, %vector.ph83 ], [ %40, %vector.body87 ]
  %35 = getelementptr inbounds [101 x i32], ptr %2, i64 0, i64 %index88
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %wide.load91 = load <4 x i32>, ptr %35, align 16, !tbaa !8
  %wide.load92 = load <4 x i32>, ptr %36, align 16, !tbaa !8
  %37 = add <4 x i32> %vec.phi89, %broadcast.splat94
  %38 = add <4 x i32> %vec.phi90, %broadcast.splat94
  %39 = sub <4 x i32> %37, %wide.load91
  %40 = sub <4 x i32> %38, %wide.load92
  %index.next95 = add nuw i64 %index88, 8
  %41 = icmp eq i64 %index.next95, %n.vec85
  br i1 %41, label %middle.block80, label %vector.body87, !llvm.loop !16

middle.block80:                                   ; preds = %vector.body87
  %bin.rdx96 = add <4 x i32> %40, %39
  %42 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx96)
  br i1 %cmp.n97, label %._crit_edge45.us.us, label %scalar.ph81.preheader

scalar.ph81.preheader:                            ; preds = %middle.block80, %.preheader.us.us
  %indvars.iv67.ph = phi i64 [ 0, %.preheader.us.us ], [ %n.vec85, %middle.block80 ]
  %.242.us.us.ph = phi i32 [ 0, %.preheader.us.us ], [ %42, %middle.block80 ]
  br label %scalar.ph81

scalar.ph81:                                      ; preds = %scalar.ph81.preheader, %scalar.ph81
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %scalar.ph81 ], [ %indvars.iv67.ph, %scalar.ph81.preheader ]
  %.242.us.us = phi i32 [ %46, %scalar.ph81 ], [ %.242.us.us.ph, %scalar.ph81.preheader ]
  %43 = getelementptr inbounds [101 x i32], ptr %2, i64 0, i64 %indvars.iv67
  %44 = load i32, ptr %43, align 4, !tbaa !8
  %45 = add i32 %.242.us.us, %.02547.us.us
  %46 = sub i32 %45, %44
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70
  br i1 %exitcond71.not, label %._crit_edge45.us.us, label %scalar.ph81, !llvm.loop !17

._crit_edge45.us.us:                              ; preds = %scalar.ph81, %middle.block80
  %.lcssa = phi i32 [ %42, %middle.block80 ], [ %46, %scalar.ph81 ]
  %47 = icmp sgt i32 %.lcssa, %.028.lcssa
  %48 = add nsw i32 %.02547.us.us, 1
  br i1 %47, label %.loopexit.sink.split, label %.preheader.us.us

.lr.ph39:                                         ; preds = %.lr.ph39.preheader102, %.lr.ph39
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph39 ], [ %indvars.iv59.ph, %.lr.ph39.preheader102 ]
  %.02736 = phi i32 [ %52, %.lr.ph39 ], [ %.02736.ph, %.lr.ph39.preheader102 ]
  %49 = getelementptr inbounds [101 x i32], ptr %2, i64 0, i64 %indvars.iv59
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = add i32 %.02736, %17
  %52 = sub i32 %51, %50
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge40, label %.lr.ph39, !llvm.loop !18

.loopexit.sink.split:                             ; preds = %._crit_edge45.us.us, %._crit_edge40
  %.02547.us.us.lcssa.sink = phi i32 [ %17, %._crit_edge40 ], [ %.02547.us.us, %._crit_edge45.us.us ]
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.02547.us.us.lcssa.sink)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.sink.split, %.preheader31
  call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #6

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

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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !13, !14}
!17 = distinct !{!17, !12, !14, !13}
!18 = distinct !{!18, !12, !14, !13}


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