; LLVM IR from abeaumont/competitive-programming :: cses (2185)

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

@x = external dso_local global [20 x i64], 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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %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 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !11
  br label %18

18:                                               ; preds = %29, %0
  %19 = load i32, ptr %5, align 4, !tbaa !11
  %20 = sext i32 %19 to i64
  %21 = load i64, ptr %3, align 8, !tbaa !8
  %22 = icmp slt i64 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %32

24:                                               ; preds = %18
  %25 = load i32, ptr %5, align 4, !tbaa !11
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [20 x i64], ptr @x, i64 0, i64 %26
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %27)
  br label %29

29:                                               ; preds = %24
  %30 = load i32, ptr %5, align 4, !tbaa !11
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %5, align 4, !tbaa !11
  br label %18, !llvm.loop !13

32:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !11
  br label %33

33:                                               ; preds = %94, %32
  %34 = load i32, ptr %6, align 4, !tbaa !11
  %35 = load i64, ptr %3, align 8, !tbaa !8
  %36 = trunc i64 %35 to i32
  %37 = shl i32 1, %36
  %38 = icmp slt i32 %34, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 1, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %41

41:                                               ; preds = %71, %40
  %42 = load i32, ptr %9, align 4, !tbaa !11
  %43 = sext i32 %42 to i64
  %44 = load i64, ptr %3, align 8, !tbaa !8
  %45 = icmp slt i64 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  store i32 8, ptr %7, align 4
  br label %74

47:                                               ; preds = %41
  %48 = load i32, ptr %6, align 4, !tbaa !11
  %49 = load i32, ptr %9, align 4, !tbaa !11
  %50 = shl i32 1, %49
  %51 = and i32 %48, %50
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %70

53:                                               ; preds = %47
  %54 = load i64, ptr %2, align 8, !tbaa !8
  %55 = load i64, ptr %8, align 8, !tbaa !8
  %56 = sdiv i64 %54, %55
  %57 = load i32, ptr %9, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [20 x i64], ptr @x, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !8
  %61 = icmp slt i64 %56, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %53
  store i64 0, ptr %8, align 8, !tbaa !8
  store i32 8, ptr %7, align 4
  br label %74

63:                                               ; preds = %53
  %64 = load i32, ptr %9, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [20 x i64], ptr @x, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = load i64, ptr %8, align 8, !tbaa !8
  %69 = mul nsw i64 %68, %67
  store i64 %69, ptr %8, align 8, !tbaa !8
  br label %70

70:                                               ; preds = %63, %47
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %9, align 4, !tbaa !11
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %9, align 4, !tbaa !11
  br label %41, !llvm.loop !15

74:                                               ; preds = %62, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %75

75:                                               ; preds = %74
  %76 = load i64, ptr %8, align 8, !tbaa !8
  %77 = icmp ne i64 %76, 0
  br i1 %77, label %78, label %93

78:                                               ; preds = %75
  %79 = load i64, ptr %2, align 8, !tbaa !8
  %80 = load i64, ptr %8, align 8, !tbaa !8
  %81 = sdiv i64 %79, %80
  store i64 %81, ptr %8, align 8, !tbaa !8
  %82 = load i32, ptr %6, align 4, !tbaa !11
  %83 = call i32 @llvm.ctpop.i32(i32 %82)
  %84 = and i32 %83, 1
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %89, label %86

86:                                               ; preds = %78
  %87 = load i64, ptr %8, align 8, !tbaa !8
  %88 = sub nsw i64 0, %87
  store i64 %88, ptr %8, align 8, !tbaa !8
  br label %89

89:                                               ; preds = %86, %78
  %90 = load i64, ptr %8, align 8, !tbaa !8
  %91 = load i64, ptr %4, align 8, !tbaa !8
  %92 = add nsw i64 %91, %90
  store i64 %92, ptr %4, align 8, !tbaa !8
  br label %93

93:                                               ; preds = %89, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %6, align 4, !tbaa !11
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %6, align 4, !tbaa !11
  br label %33, !llvm.loop !16

97:                                               ; preds = %39
  %98 = load i64, ptr %4, align 8, !tbaa !8
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %98)
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %99, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %101 = load i32, ptr %1, align 4
  ret i32 %101
}

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #5

; 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) #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 #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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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

@x = external dso_local global [20 x i64], 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 i64, align 8
  %2 = alloca i64, align 8
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %11 = load i64, ptr %2, align 8, !tbaa !8
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.lr.ph, label %.preheader33

.preheader33:                                     ; preds = %.lr.ph, %0
  %.lcssa = phi i64 [ %11, %0 ], [ %53, %.lr.ph ]
  %13 = trunc i64 %.lcssa to i32
  %14 = shl nuw i32 1, %13
  %15 = icmp sgt i32 %14, 1
  br i1 %15, label %.preheader.lr.ph, label %._crit_edge42

.preheader.lr.ph:                                 ; preds = %.preheader33
  %16 = icmp sgt i64 %.lcssa, 0
  %17 = load i64, ptr %1, align 8
  br i1 %16, label %.preheader.us, label %.preheader.lr.ph.split

.preheader.us:                                    ; preds = %.preheader.lr.ph, %.thread.us
  %.02241.us = phi i32 [ %35, %.thread.us ], [ 1, %.preheader.lr.ph ]
  %.02440.us = phi i64 [ %.125.us, %.thread.us ], [ 0, %.preheader.lr.ph ]
  br label %24

18:                                               ; preds = %._crit_edge.us
  %19 = sdiv i64 %17, %.1.us
  %20 = call range(i32 0, 32) i32 @llvm.ctpop.i32(i32 %.02241.us)
  %21 = and i32 %20, 1
  %.not30.us = icmp eq i32 %21, 0
  %22 = sub nsw i64 0, %19
  %spec.select.us = select i1 %.not30.us, i64 %22, i64 %19
  %23 = add nsw i64 %spec.select.us, %.02440.us
  br label %.thread.us

24:                                               ; preds = %.preheader.us, %36
  %indvars.iv48 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next49, %36 ]
  %.02136.us = phi i64 [ 1, %.preheader.us ], [ %.1.us, %36 ]
  %25 = trunc nuw nsw i64 %indvars.iv48 to i32
  %26 = shl nuw i32 1, %25
  %27 = and i32 %26, %.02241.us
  %.not.us = icmp eq i32 %27, 0
  br i1 %.not.us, label %36, label %28

28:                                               ; preds = %24
  %29 = sdiv i64 %17, %.02136.us
  %30 = getelementptr inbounds [20 x i64], ptr @x, i64 0, i64 %indvars.iv48
  %31 = load i64, ptr %30, align 8, !tbaa !8
  %32 = icmp slt i64 %29, %31
  br i1 %32, label %.thread.us, label %33

33:                                               ; preds = %28
  %34 = mul nsw i64 %31, %.02136.us
  br label %36

.thread.us:                                       ; preds = %28, %18, %._crit_edge.us
  %.125.us = phi i64 [ %23, %18 ], [ %.02440.us, %._crit_edge.us ], [ %.02440.us, %28 ]
  %35 = add nuw nsw i32 %.02241.us, 1
  %exitcond52.not = icmp eq i32 %35, %14
  br i1 %exitcond52.not, label %._crit_edge42, label %.preheader.us, !llvm.loop !11

36:                                               ; preds = %33, %24
  %.1.us = phi i64 [ %34, %33 ], [ %.02136.us, %24 ]
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond51.not = icmp eq i64 %indvars.iv.next49, %.lcssa
  br i1 %exitcond51.not, label %._crit_edge.us, label %24, !llvm.loop !13

._crit_edge.us:                                   ; preds = %36
  %.not29.us = icmp eq i64 %.1.us, 0
  br i1 %.not29.us, label %.thread.us, label %18

.preheader.lr.ph.split:                           ; preds = %.preheader.lr.ph
  %37 = sub nsw i64 0, %17
  %38 = add nsw i32 %14, -1
  %min.iters.check = icmp ult i32 %13, 3
  br i1 %min.iters.check, label %.preheader.preheader, label %vector.ph

.preheader.preheader:                             ; preds = %middle.block, %.preheader.lr.ph.split
  %.02241.ph = phi i32 [ 1, %.preheader.lr.ph.split ], [ %ind.end, %middle.block ]
  %.02440.ph = phi i64 [ 0, %.preheader.lr.ph.split ], [ %50, %middle.block ]
  br label %.preheader

vector.ph:                                        ; preds = %.preheader.lr.ph.split
  %n.vec = and i32 %38, -4
  %ind.end = or disjoint i32 %n.vec, 1
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %37, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert61 = insertelement <2 x i64> poison, i64 %17, i64 0
  %broadcast.splat62 = shufflevector <2 x i64> %broadcast.splatinsert61, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i32> [ <i32 1, i32 2>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %47, %vector.body ]
  %vec.phi60 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %48, %vector.body ]
  %step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
  %39 = call range(i32 0, 33) <2 x i32> @llvm.ctpop.v2i32(<2 x i32> %vec.ind)
  %40 = call range(i32 0, 33) <2 x i32> @llvm.ctpop.v2i32(<2 x i32> %step.add)
  %41 = and <2 x i32> %39, <i32 1, i32 1>
  %42 = and <2 x i32> %40, <i32 1, i32 1>
  %43 = icmp eq <2 x i32> %41, zeroinitializer
  %44 = icmp eq <2 x i32> %42, zeroinitializer
  %45 = select <2 x i1> %43, <2 x i64> %broadcast.splat, <2 x i64> %broadcast.splat62
  %46 = select <2 x i1> %44, <2 x i64> %broadcast.splat, <2 x i64> %broadcast.splat62
  %47 = add <2 x i64> %45, %vec.phi
  %48 = add <2 x i64> %46, %vec.phi60
  %index.next = add nuw i32 %index, 4
  %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
  %49 = icmp eq i32 %index.next, %n.vec
  br i1 %49, label %middle.block, label %vector.body, !llvm.loop !14

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 i32 %38, %n.vec
  br i1 %cmp.n, label %._crit_edge42, label %.preheader.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %51 = getelementptr inbounds [20 x i64], ptr @x, i64 0, i64 %indvars.iv
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %51)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %53 = load i64, ptr %2, align 8, !tbaa !8
  %54 = icmp sgt i64 %53, %indvars.iv.next
  br i1 %54, label %.lr.ph, label %.preheader33, !llvm.loop !17

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.02241 = phi i32 [ %58, %.preheader ], [ %.02241.ph, %.preheader.preheader ]
  %.02440 = phi i64 [ %57, %.preheader ], [ %.02440.ph, %.preheader.preheader ]
  %55 = call range(i32 0, 32) i32 @llvm.ctpop.i32(i32 %.02241)
  %56 = and i32 %55, 1
  %.not30 = icmp eq i32 %56, 0
  %spec.select = select i1 %.not30, i64 %37, i64 %17
  %57 = add nsw i64 %spec.select, %.02440
  %58 = add nuw nsw i32 %.02241, 1
  %exitcond.not = icmp eq i32 %58, %14
  br i1 %exitcond.not, label %._crit_edge42, label %.preheader, !llvm.loop !18

._crit_edge42:                                    ; preds = %.preheader, %.thread.us, %middle.block, %.preheader33
  %.024.lcssa = phi i64 [ 0, %.preheader33 ], [ %50, %middle.block ], [ %.125.us, %.thread.us ], [ %57, %.preheader ]
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.024.lcssa)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %59, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i32 0
}

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #5

; 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 #6

; 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 #4 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.ctpop.v2i32(<2 x i32>) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #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 = !{!"long long", !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, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !16, !15}


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