; LLVM IR from imteekay/algorithms :: competitive-programming/uri (sum_of_consecutive_odd_numbers_II)

; 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 i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  %8 = 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 %9

9:                                                ; preds = %76, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr %2, align 4, !tbaa !5
  %12 = icmp ne i32 %10, 0
  br i1 %12, label %13, label %77

13:                                               ; preds = %9
  %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) %3)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = icmp sgt i32 %16, %17
  br i1 %18, label %19, label %40

19:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr %6, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %36, %19
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %22
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = srem i32 %28, 2
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %35

31:                                               ; preds = %27
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = add nsw i32 %33, %32
  store i32 %34, ptr %5, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %31, %27
  br label %36

36:                                               ; preds = %35
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %6, align 4, !tbaa !5
  br label %22, !llvm.loop !9

39:                                               ; preds = %26
  br label %66

40:                                               ; preds = %13
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = icmp sgt i32 %41, %42
  br i1 %43, label %44, label %65

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %7, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %61, %44
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %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 %7) #5
  br label %64

52:                                               ; preds = %47
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = srem i32 %53, 2
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %60

56:                                               ; preds = %52
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = add nsw i32 %58, %57
  store i32 %59, ptr %5, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %56, %52
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %7, align 4, !tbaa !5
  br label %47, !llvm.loop !11

64:                                               ; preds = %51
  br label %65

65:                                               ; preds = %64, %40
  br label %66

66:                                               ; preds = %65, %39
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %69, label %73

69:                                               ; preds = %66
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %70)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %76

73:                                               ; preds = %66
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %76

76:                                               ; preds = %73, %69
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %9, !llvm.loop !12

77:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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 = { 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 = { 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 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}


; 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 i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %4 = 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)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr %1, align 4, !tbaa !5
  %.not33 = icmp eq i32 %5, 0
  br i1 %.not33, label %._crit_edge, label %.lr.ph34

.lr.ph34:                                         ; preds = %0, %45
  %7 = 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)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %11 = icmp sgt i32 %9, %10
  br i1 %11, label %.preheader, label %27

.preheader:                                       ; preds = %.lr.ph34
  %.01227 = add nsw i32 %10, 1
  %12 = icmp slt i32 %.01227, %9
  br i1 %12, label %.lr.ph31.preheader, label %.thread

.lr.ph31.preheader:                               ; preds = %.preheader
  %13 = xor i32 %10, -1
  %14 = add i32 %9, %13
  %min.iters.check = icmp ult i32 %14, 8
  br i1 %min.iters.check, label %.lr.ph31.preheader84, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph31.preheader
  %n.vec = and i32 %14, -8
  %ind.end = add i32 %.01227, %n.vec
  %ind.end41 = add i32 %10, %n.vec
  %.splatinsert = insertelement <4 x i32> poison, i32 %.01227, i64 0
  %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
  %.splatinsert44 = insertelement <4 x i32> poison, i32 %10, i64 0
  %.splat45 = shufflevector <4 x i32> %.splatinsert44, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction46 = add <4 x i32> %.splat45, <i32 0, i32 1, i32 2, i32 3>
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.ind47 = phi <4 x i32> [ %induction46, %vector.ph ], [ %vec.ind.next50, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
  %vec.phi51 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %15 = and <4 x i32> %vec.ind47, <i32 1, i32 1, i32 1, i32 1>
  %16 = and <4 x i32> %vec.ind47, <i32 1, i32 1, i32 1, i32 1>
  %17 = icmp eq <4 x i32> %15, zeroinitializer
  %18 = icmp eq <4 x i32> %16, zeroinitializer
  %19 = select <4 x i1> %17, <4 x i32> %vec.ind, <4 x i32> zeroinitializer
  %20 = select <4 x i1> %18, <4 x i32> %step.add, <4 x i32> zeroinitializer
  %21 = add <4 x i32> %19, %vec.phi
  %22 = add <4 x i32> %20, %vec.phi51
  %index.next = add nuw i32 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %vec.ind.next50 = add <4 x i32> %vec.ind47, <i32 8, i32 8, i32 8, i32 8>
  %23 = icmp eq i32 %index.next, %n.vec
  br i1 %23, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %22, %21
  %24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i32 %14, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph31.preheader84

.lr.ph31.preheader84:                             ; preds = %middle.block, %.lr.ph31.preheader
  %.01230.ph = phi i32 [ %.01227, %.lr.ph31.preheader ], [ %ind.end, %middle.block ]
  %.012.in29.ph = phi i32 [ %10, %.lr.ph31.preheader ], [ %ind.end41, %middle.block ]
  %.128.ph = phi i32 [ 0, %.lr.ph31.preheader ], [ %24, %middle.block ]
  br label %.lr.ph31

.lr.ph31:                                         ; preds = %.lr.ph31.preheader84, %.lr.ph31
  %.01230 = phi i32 [ %.012, %.lr.ph31 ], [ %.01230.ph, %.lr.ph31.preheader84 ]
  %.012.in29 = phi i32 [ %.01230, %.lr.ph31 ], [ %.012.in29.ph, %.lr.ph31.preheader84 ]
  %.128 = phi i32 [ %spec.select, %.lr.ph31 ], [ %.128.ph, %.lr.ph31.preheader84 ]
  %25 = and i32 %.012.in29, 1
  %.not18.not = icmp eq i32 %25, 0
  %26 = select i1 %.not18.not, i32 %.01230, i32 0
  %spec.select = add nsw i32 %26, %.128
  %.012 = add nsw i32 %.01230, 1
  %exitcond36.not = icmp eq i32 %.012, %9
  br i1 %exitcond36.not, label %.loopexit, label %.lr.ph31, !llvm.loop !13

27:                                               ; preds = %.lr.ph34
  %28 = icmp sgt i32 %10, %9
  %.023 = add nsw i32 %9, 1
  %29 = icmp slt i32 %.023, %10
  %or.cond = select i1 %28, i1 %29, i1 false
  br i1 %or.cond, label %.lr.ph.preheader, label %.thread

.lr.ph.preheader:                                 ; preds = %27
  %30 = xor i32 %9, -1
  %31 = add i32 %10, %30
  %min.iters.check54 = icmp ult i32 %31, 8
  br i1 %min.iters.check54, label %.lr.ph.preheader85, label %vector.ph55

vector.ph55:                                      ; preds = %.lr.ph.preheader
  %n.vec57 = and i32 %31, -8
  %ind.end58 = add i32 %.023, %n.vec57
  %ind.end60 = add i32 %9, %n.vec57
  %.splatinsert64 = insertelement <4 x i32> poison, i32 %.023, i64 0
  %.splat65 = shufflevector <4 x i32> %.splatinsert64, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction66 = add <4 x i32> %.splat65, <i32 0, i32 1, i32 2, i32 3>
  %.splatinsert71 = insertelement <4 x i32> poison, i32 %9, i64 0
  %.splat72 = shufflevector <4 x i32> %.splatinsert71, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction73 = add <4 x i32> %.splat72, <i32 0, i32 1, i32 2, i32 3>
  br label %vector.body62

vector.body62:                                    ; preds = %vector.body62, %vector.ph55
  %index63 = phi i32 [ 0, %vector.ph55 ], [ %index.next80, %vector.body62 ]
  %vec.ind67 = phi <4 x i32> [ %induction66, %vector.ph55 ], [ %vec.ind.next70, %vector.body62 ]
  %vec.ind74 = phi <4 x i32> [ %induction73, %vector.ph55 ], [ %vec.ind.next77, %vector.body62 ]
  %vec.phi78 = phi <4 x i32> [ zeroinitializer, %vector.ph55 ], [ %38, %vector.body62 ]
  %vec.phi79 = phi <4 x i32> [ zeroinitializer, %vector.ph55 ], [ %39, %vector.body62 ]
  %step.add68 = add <4 x i32> %vec.ind67, <i32 4, i32 4, i32 4, i32 4>
  %32 = and <4 x i32> %vec.ind74, <i32 1, i32 1, i32 1, i32 1>
  %33 = and <4 x i32> %vec.ind74, <i32 1, i32 1, i32 1, i32 1>
  %34 = icmp eq <4 x i32> %32, zeroinitializer
  %35 = icmp eq <4 x i32> %33, zeroinitializer
  %36 = select <4 x i1> %34, <4 x i32> %vec.ind67, <4 x i32> zeroinitializer
  %37 = select <4 x i1> %35, <4 x i32> %step.add68, <4 x i32> zeroinitializer
  %38 = add <4 x i32> %36, %vec.phi78
  %39 = add <4 x i32> %37, %vec.phi79
  %index.next80 = add nuw i32 %index63, 8
  %vec.ind.next70 = add <4 x i32> %vec.ind67, <i32 8, i32 8, i32 8, i32 8>
  %vec.ind.next77 = add <4 x i32> %vec.ind74, <i32 8, i32 8, i32 8, i32 8>
  %40 = icmp eq i32 %index.next80, %n.vec57
  br i1 %40, label %middle.block52, label %vector.body62, !llvm.loop !14

middle.block52:                                   ; preds = %vector.body62
  %bin.rdx81 = add <4 x i32> %39, %38
  %41 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx81)
  %cmp.n82 = icmp eq i32 %31, %n.vec57
  br i1 %cmp.n82, label %.loopexit, label %.lr.ph.preheader85

.lr.ph.preheader85:                               ; preds = %middle.block52, %.lr.ph.preheader
  %.026.ph = phi i32 [ %.023, %.lr.ph.preheader ], [ %ind.end58, %middle.block52 ]
  %.0.in25.ph = phi i32 [ %9, %.lr.ph.preheader ], [ %ind.end60, %middle.block52 ]
  %.324.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %41, %middle.block52 ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader85, %.lr.ph
  %.026 = phi i32 [ %.0, %.lr.ph ], [ %.026.ph, %.lr.ph.preheader85 ]
  %.0.in25 = phi i32 [ %.026, %.lr.ph ], [ %.0.in25.ph, %.lr.ph.preheader85 ]
  %.324 = phi i32 [ %spec.select19, %.lr.ph ], [ %.324.ph, %.lr.ph.preheader85 ]
  %42 = and i32 %.0.in25, 1
  %.not17.not = icmp eq i32 %42, 0
  %43 = select i1 %.not17.not, i32 %.026, i32 0
  %spec.select19 = add nsw i32 %43, %.324
  %.0 = add nsw i32 %.026, 1
  %exitcond.not = icmp eq i32 %.0, %10
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph31, %middle.block52, %middle.block
  %.5 = phi i32 [ %24, %middle.block ], [ %41, %middle.block52 ], [ %spec.select, %.lr.ph31 ], [ %spec.select19, %.lr.ph ]
  %44 = icmp sgt i32 %.5, 0
  br i1 %44, label %45, label %.thread

.thread:                                          ; preds = %.preheader, %27, %.loopexit
  br label %45

45:                                               ; preds = %.loopexit, %.thread
  %.sink39 = phi i32 [ 0, %.thread ], [ %.5, %.loopexit ]
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.sink39)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %48, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph34, !llvm.loop !16

._crit_edge:                                      ; preds = %45, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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 #2

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

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

; 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 #3 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 speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

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 = { mustprogress 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 = { 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 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10}


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