; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces (cf1637_C)

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

@a = external dso_local global [100010 x i32], align 16
@_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 i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %20 = 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)
  br label %21

21:                                               ; preds = %106, %104, %0
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %2, align 4, !tbaa !8
  %24 = icmp ne i32 %22, 0
  br i1 %24, label %25, label %107

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %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) %3)
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  store i8 1, ptr %4, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %27

27:                                               ; preds = %55, %25
  %28 = load i32, ptr %5, align 4, !tbaa !8
  %29 = load i32, ptr %3, align 4, !tbaa !8
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  %33 = load i32, ptr %5, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %35)
  %37 = load i32, ptr %5, align 4, !tbaa !8
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %43, label %39

39:                                               ; preds = %32
  %40 = load i32, ptr %5, align 4, !tbaa !8
  %41 = load i32, ptr %3, align 4, !tbaa !8
  %42 = icmp eq i32 %40, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %39, %32
  br label %55

44:                                               ; preds = %39
  %45 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %46 = trunc i8 %45 to i1
  br i1 %46, label %47, label %54

47:                                               ; preds = %44
  %48 = load i32, ptr %5, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !8
  %52 = icmp eq i32 %51, 1
  %53 = zext i1 %52 to i8
  store i8 %53, ptr %4, align 1, !tbaa !11
  br label %54

54:                                               ; preds = %47, %44
  br label %55

55:                                               ; preds = %54, %43
  %56 = load i32, ptr %5, align 4, !tbaa !8
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %5, align 4, !tbaa !8
  br label %27, !llvm.loop !15

58:                                               ; preds = %31
  %59 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %60 = trunc i8 %59 to i1
  br i1 %60, label %61, label %64

61:                                               ; preds = %58
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %62, i8 noundef signext 10)
  store i32 2, ptr %6, align 4
  br label %104, !llvm.loop !17

64:                                               ; preds = %58
  %65 = load i32, ptr %3, align 4, !tbaa !8
  %66 = icmp eq i32 %65, 3
  br i1 %66, label %67, label %74

67:                                               ; preds = %64
  %68 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !8
  %69 = srem i32 %68, 2
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %74

71:                                               ; preds = %67
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %72, i8 noundef signext 10)
  store i32 2, ptr %6, align 4
  br label %104, !llvm.loop !17

74:                                               ; preds = %67, %64
  %75 = load i32, ptr %3, align 4, !tbaa !8
  %76 = icmp eq i32 %75, 2
  br i1 %76, label %77, label %80

77:                                               ; preds = %74
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %78, i8 noundef signext 10)
  store i32 2, ptr %6, align 4
  br label %104, !llvm.loop !17

80:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 2, ptr %8, align 4, !tbaa !8
  br label %81

81:                                               ; preds = %97, %80
  %82 = load i32, ptr %8, align 4, !tbaa !8
  %83 = load i32, ptr %3, align 4, !tbaa !8
  %84 = sub nsw i32 %83, 1
  %85 = icmp sle i32 %82, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %81
  store i32 7, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %100

87:                                               ; preds = %81
  %88 = load i32, ptr %8, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !8
  %92 = add nsw i32 %91, 1
  %93 = sdiv i32 %92, 2
  %94 = sext i32 %93 to i64
  %95 = load i64, ptr %7, align 8, !tbaa !18
  %96 = add nsw i64 %95, %94
  store i64 %96, ptr %7, align 8, !tbaa !18
  br label %97

97:                                               ; preds = %87
  %98 = load i32, ptr %8, align 4, !tbaa !8
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %8, align 4, !tbaa !8
  br label %81, !llvm.loop !20

100:                                              ; preds = %86
  %101 = load i64, ptr %7, align 8, !tbaa !18
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %101)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %102, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  store i32 0, ptr %6, align 4
  br label %104

104:                                              ; preds = %100, %77, %71, %61
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  %105 = load i32, ptr %6, align 4
  switch i32 %105, label %109 [
    i32 0, label %106
    i32 2, label %21
  ]

106:                                              ; preds = %104
  br label %21, !llvm.loop !17

107:                                              ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %108 = load i32, ptr %1, align 4
  ret i32 %108

109:                                              ; preds = %104
  unreachable
}

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 noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #5 align 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 = { "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 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!19, !19, i64 0}
!19 = !{!"long long", !10, i64 0}
!20 = distinct !{!20, !16}


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

@a = external dso_local global [100010 x i32], align 16
@_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 i32, align 4
  %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)
  %9 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %14 = 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)
  %15 = load i32, ptr %1, align 4, !tbaa !8
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr %1, align 4, !tbaa !8
  %.not32 = icmp eq i32 %15, 0
  br i1 %.not32, label %._crit_edge35, label %.lr.ph34

.lr.ph34:                                         ; preds = %0, %65
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %17 = 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)
  %18 = load i32, ptr %2, align 4, !tbaa !8
  %.not1822 = icmp slt i32 %18, 1
  br i1 %.not1822, label %._crit_edge.thread, label %19

19:                                               ; preds = %.lr.ph34
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @a, i64 4))
  %21 = load i32, ptr %2, align 4
  %.not18.not.peel = icmp sgt i32 %21, 1
  br i1 %.not18.not.peel, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %34
  %22 = trunc nuw i8 %.1 to i1
  br i1 %22, label %._crit_edge.thread, label %37

.lr.ph:                                           ; preds = %19, %34
  %indvars.iv = phi i64 [ %indvars.iv.next, %34 ], [ 2, %19 ]
  %.01623 = phi i8 [ %.1, %34 ], [ 1, %19 ]
  %23 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %25 = load i32, ptr %2, align 4
  %26 = zext i32 %25 to i64
  %27 = icmp eq i64 %indvars.iv, %26
  br i1 %27, label %34, label %28

28:                                               ; preds = %.lr.ph
  %29 = trunc nuw i8 %.01623 to i1
  br i1 %29, label %30, label %34

30:                                               ; preds = %28
  %31 = load i32, ptr %23, align 4, !tbaa !8
  %32 = icmp eq i32 %31, 1
  %33 = zext i1 %32 to i8
  br label %34

34:                                               ; preds = %28, %30, %.lr.ph
  %.1 = phi i8 [ %.01623, %.lr.ph ], [ %33, %30 ], [ %.01623, %28 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = sext i32 %25 to i64
  %.not18.not = icmp slt i64 %indvars.iv, %35
  br i1 %.not18.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge.thread:                               ; preds = %19, %.lr.ph34, %._crit_edge
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %65, !llvm.loop !14

37:                                               ; preds = %._crit_edge
  switch i32 %25, label %.preheader [
    i32 3, label %51
    i32 2, label %56
  ]

.preheader:                                       ; preds = %37
  %.not20.not26 = icmp sgt i32 %25, 2
  br i1 %.not20.not26, label %.lr.ph29.preheader, label %._crit_edge30

.lr.ph29.preheader:                               ; preds = %51, %.preheader
  %wide.trip.count = zext nneg i32 %25 to i64
  %38 = add nsw i64 %wide.trip.count, -2
  %min.iters.check = icmp ult i64 %38, 4
  br i1 %min.iters.check, label %.lr.ph29.preheader50, label %vector.ph

.lr.ph29.preheader50:                             ; preds = %middle.block, %.lr.ph29.preheader
  %indvars.iv39.ph = phi i64 [ 2, %.lr.ph29.preheader ], [ %ind.end, %middle.block ]
  %.01427.ph = phi i64 [ 0, %.lr.ph29.preheader ], [ %50, %middle.block ]
  br label %.lr.ph29

vector.ph:                                        ; preds = %.lr.ph29.preheader
  %n.vec = and i64 %38, -4
  %ind.end = or disjoint i64 %n.vec, 2
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %47, %vector.body ]
  %vec.phi48 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %48, %vector.body ]
  %offset.idx = or disjoint i64 %index, 2
  %39 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %offset.idx
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  %wide.load = load <2 x i32>, ptr %39, align 8, !tbaa !8
  %wide.load49 = load <2 x i32>, ptr %40, align 16, !tbaa !8
  %41 = add nsw <2 x i32> %wide.load, <i32 1, i32 1>
  %42 = add nsw <2 x i32> %wide.load49, <i32 1, i32 1>
  %43 = sdiv <2 x i32> %41, <i32 2, i32 2>
  %44 = sdiv <2 x i32> %42, <i32 2, i32 2>
  %45 = sext <2 x i32> %43 to <2 x i64>
  %46 = sext <2 x i32> %44 to <2 x i64>
  %47 = add <2 x i64> %vec.phi, %45
  %48 = add <2 x i64> %vec.phi48, %46
  %index.next = add nuw i64 %index, 4
  %49 = icmp eq i64 %index.next, %n.vec
  br i1 %49, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %48, %47
  %50 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %38, %n.vec
  br i1 %cmp.n, label %._crit_edge30, label %.lr.ph29.preheader50

51:                                               ; preds = %37
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !8
  %53 = and i32 %52, 1
  %.not19 = icmp eq i32 %53, 0
  br i1 %.not19, label %.lr.ph29.preheader, label %54

54:                                               ; preds = %51
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %65, !llvm.loop !14

56:                                               ; preds = %37
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  br label %65, !llvm.loop !14

._crit_edge30:                                    ; preds = %.lr.ph29, %middle.block, %.preheader
  %.014.lcssa = phi i64 [ 0, %.preheader ], [ %50, %middle.block ], [ %64, %.lr.ph29 ]
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.014.lcssa)
  br label %65

.lr.ph29:                                         ; preds = %.lr.ph29.preheader50, %.lr.ph29
  %indvars.iv39 = phi i64 [ %indvars.iv.next40, %.lr.ph29 ], [ %indvars.iv39.ph, %.lr.ph29.preheader50 ]
  %.01427 = phi i64 [ %64, %.lr.ph29 ], [ %.01427.ph, %.lr.ph29.preheader50 ]
  %59 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv39
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %61 = add nsw i32 %60, 1
  %62 = sdiv i32 %61, 2
  %63 = sext i32 %62 to i64
  %64 = add nsw i64 %.01427, %63
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next40, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge30, label %.lr.ph29, !llvm.loop !18

65:                                               ; preds = %._crit_edge30, %56, %54, %._crit_edge.thread
  %.sink = phi ptr [ %58, %._crit_edge30 ], [ %57, %56 ], [ %55, %54 ], [ %36, %._crit_edge.thread ]
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %.sink, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %67 = load i32, ptr %1, align 4, !tbaa !8
  %68 = add nsw i32 %67, -1
  store i32 %68, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %67, 0
  br i1 %.not, label %._crit_edge35, label %.lr.ph34

._crit_edge35:                                    ; preds = %65, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  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 noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) 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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #5 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6

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 speculatable willreturn memory(none) }
attributes #7 = { 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}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !12, !17, !16}


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