; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/perf/perf.ll (ZN4Perf8internal13AffinitizeTBBEii)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.tbb::atomic" = type { %"struct.tbb::internal::atomic_impl_with_arithmetic" }
%"struct.tbb::internal::atomic_impl_with_arithmetic" = type { %"struct.tbb::internal::atomic_impl" }
%"struct.tbb::internal::atomic_impl" = type { %"struct.tbb::internal::aligned_storage" }
%"struct.tbb::internal::aligned_storage" = type { i32 }
%"class.tbb::task_list" = type { ptr, ptr }
%"class.tbb::internal::allocate_root_proxy" = type { i8 }

@NumCpus = external dso_local global i32, align 4
@_ZN4Perf8internal18AffinitySetterTask8m_resultE = external dso_local global i8, align 1
@_ZN4Perf8internal18AffinitySetterTask10m_nThreadsE = external dso_local global %"struct.tbb::atomic", align 4

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Perf8internal13AffinitizeTBBEii(i32 noundef %0, i32 noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.tbb::task_list", align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %"class.tbb::internal::allocate_root_proxy", align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.tbb::internal::allocate_root_proxy", align 1
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  store i8 1, ptr @_ZN4Perf8internal18AffinitySetterTask8m_resultE, align 1, !tbaa !9
  %12 = load i32, ptr %3, align 4, !tbaa !5
  %13 = call noundef i32 @_ZN3tbb6atomicIiEaSEi(ptr noundef nonnull align 4 dereferenceable(4) @_ZN4Perf8internal18AffinitySetterTask10m_nThreadsE, i32 noundef %12)
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #5
  call void @_ZN3tbb9task_listC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %43, %2
  %15 = load i32, ptr %6, align 4, !tbaa !5
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  invoke void @_ZN3tbb4task13allocate_rootEv()
          to label %20 unwind label %46

20:                                               ; preds = %19
  %21 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 16, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %22 unwind label %46

22:                                               ; preds = %20
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %31

25:                                               ; preds = %22
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = load i32, ptr @NumCpus, align 4, !tbaa !5
  %28 = mul nsw i32 %26, %27
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sdiv i32 %28, %29
  br label %33

31:                                               ; preds = %22
  %32 = load i32, ptr %6, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %31, %25
  %34 = phi i32 [ %30, %25 ], [ %32, %31 ]
  invoke void @_ZN4Perf8internal18AffinitySetterTaskC2Ei(ptr noundef nonnull align 8 dereferenceable(12) %21, i32 noundef %34)
          to label %35 unwind label %50

35:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  store ptr %21, ptr %7, align 8, !tbaa !11
  %36 = load ptr, ptr %7, align 8, !tbaa !11
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  %39 = trunc i32 %38 to i16
  invoke void @_ZN3tbb4task12set_affinityEt(ptr noundef nonnull align 8 dereferenceable(8) %36, i16 noundef zeroext %39)
          to label %40 unwind label %55

40:                                               ; preds = %35
  %41 = load ptr, ptr %7, align 8, !tbaa !11
  invoke void @_ZN3tbb9task_list9push_backERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %41)
          to label %42 unwind label %55

42:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %43

43:                                               ; preds = %42
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %6, align 4, !tbaa !5
  br label %14, !llvm.loop !13

46:                                               ; preds = %20, %19
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %9, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %10, align 4
  br label %54

50:                                               ; preds = %33
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %9, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %10, align 4
  call void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef %21, ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  br label %54

54:                                               ; preds = %50, %46
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  br label %59

55:                                               ; preds = %40, %35
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  br label %59

59:                                               ; preds = %55, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %68

60:                                               ; preds = %18
  invoke void @_ZN3tbb4task19spawn_root_and_waitERNS_9task_listE(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %61 unwind label %64

61:                                               ; preds = %60
  %62 = load i8, ptr @_ZN4Perf8internal18AffinitySetterTask8m_resultE, align 1, !tbaa !9, !range !15, !noundef !16
  %63 = trunc i8 %62 to i1
  call void @_ZN3tbb9task_listD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  ret i1 %63

64:                                               ; preds = %60
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %9, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %10, align 4
  br label %68

68:                                               ; preds = %64, %59
  call void @_ZN3tbb9task_listD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr %9, align 8
  %71 = load i32, ptr %10, align 4
  %72 = insertvalue { ptr, i32 } poison, ptr %70, 0
  %73 = insertvalue { ptr, i32 } %72, i32 %71, 1
  resume { ptr, i32 } %73
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3tbb6atomicIiEaSEi(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb9task_listC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb4task13allocate_rootEv() #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Perf8internal18AffinitySetterTaskC2Ei(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb4task12set_affinityEt(ptr noundef nonnull align 8 dereferenceable(8), i16 noundef zeroext) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb9task_list9push_backERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3tbb4task19spawn_root_and_waitERNS_9task_listE(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb9task_listD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

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

%"struct.tbb::atomic" = type { %"struct.tbb::internal::atomic_impl_with_arithmetic" }
%"struct.tbb::internal::atomic_impl_with_arithmetic" = type { %"struct.tbb::internal::atomic_impl" }
%"struct.tbb::internal::atomic_impl" = type { %"struct.tbb::internal::aligned_storage" }
%"struct.tbb::internal::aligned_storage" = type { i32 }
%"class.tbb::task_list" = type { ptr, ptr }
%"class.tbb::internal::allocate_root_proxy" = type { i8 }

@NumCpus = external dso_local local_unnamed_addr global i32, align 4
@_ZN4Perf8internal18AffinitySetterTask8m_resultE = external dso_local local_unnamed_addr global i8, align 1
@_ZN4Perf8internal18AffinitySetterTask10m_nThreadsE = external dso_local global %"struct.tbb::atomic", align 4

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Perf8internal13AffinitizeTBBEii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.tbb::task_list", align 8
  %4 = alloca %"class.tbb::internal::allocate_root_proxy", align 1
  store i8 1, ptr @_ZN4Perf8internal18AffinitySetterTask8m_resultE, align 1, !tbaa !5
  %5 = tail call noundef i32 @_ZN3tbb6atomicIiEaSEi(ptr noundef nonnull align 4 dereferenceable(4) @_ZN4Perf8internal18AffinitySetterTask10m_nThreadsE, i32 noundef %0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @_ZN3tbb9task_listC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %6 = icmp sgt i32 %0, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %7 = icmp eq i32 %1, 1
  br i1 %7, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %13
  %.01418.us = phi i32 [ %14, %13 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %8 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 16, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %9 unwind label %.split.us

9:                                                ; preds = %.lr.ph.split.us
  %10 = load i32, ptr @NumCpus, align 4, !tbaa !9
  %11 = mul nsw i32 %10, %.01418.us
  %12 = sdiv i32 %11, %0
  invoke void @_ZN4Perf8internal18AffinitySetterTaskC2Ei(ptr noundef nonnull align 8 dereferenceable(12) %8, i32 noundef %12)
          to label %13 unwind label %.split20.us

13:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  %14 = add nuw nsw i32 %.01418.us, 1
  %15 = trunc i32 %14 to i16
  call void @_ZN3tbb4task12set_affinityEt(ptr noundef nonnull align 8 dereferenceable(8) %8, i16 noundef zeroext %15)
  call void @_ZN3tbb9task_list9push_backERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %exitcond27.not = icmp eq i32 %14, %0
  br i1 %exitcond27.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !11

.split.us:                                        ; preds = %.lr.ph.split.us
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %26

.split20.us:                                      ; preds = %9
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %25

._crit_edge:                                      ; preds = %20, %13, %2
  invoke void @_ZN3tbb4task19spawn_root_and_waitERNS_9task_listE(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %27 unwind label %30

.lr.ph.split:                                     ; preds = %.lr.ph, %20
  %.01418 = phi i32 [ %21, %20 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %18 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 16, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %19 unwind label %.split

19:                                               ; preds = %.lr.ph.split
  invoke void @_ZN4Perf8internal18AffinitySetterTaskC2Ei(ptr noundef nonnull align 8 dereferenceable(12) %18, i32 noundef %.01418)
          to label %20 unwind label %.split20

20:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  %21 = add nuw nsw i32 %.01418, 1
  %22 = trunc i32 %21 to i16
  call void @_ZN3tbb4task12set_affinityEt(ptr noundef nonnull align 8 dereferenceable(8) %18, i16 noundef zeroext %22)
  call void @_ZN3tbb9task_list9push_backERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %exitcond.not = icmp eq i32 %21, %0
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split, !llvm.loop !11

.split:                                           ; preds = %.lr.ph.split
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %26

.split20:                                         ; preds = %19
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %25

25:                                               ; preds = %.split20.us, %.split20
  %.us-phi21 = phi ptr [ %18, %.split20 ], [ %8, %.split20.us ]
  %.us-phi22 = phi { ptr, i32 } [ %24, %.split20 ], [ %17, %.split20.us ]
  call void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef %.us-phi21, ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  br label %26

26:                                               ; preds = %.split, %.split.us, %25
  %.pn = phi { ptr, i32 } [ %.us-phi22, %25 ], [ %23, %.split ], [ %16, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  br label %32

27:                                               ; preds = %._crit_edge
  %28 = load i8, ptr @_ZN4Perf8internal18AffinitySetterTask8m_resultE, align 1, !tbaa !5, !range !13, !noundef !14
  %29 = trunc nuw i8 %28 to i1
  call void @_ZN3tbb9task_listD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  ret i1 %29

30:                                               ; preds = %._crit_edge
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %32

32:                                               ; preds = %30, %26
  %.pn.pn = phi { ptr, i32 } [ %.pn, %26 ], [ %31, %30 ]
  call void @_ZN3tbb9task_listD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3tbb6atomicIiEaSEi(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb9task_listC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb4task13allocate_rootEv() local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Perf8internal18AffinitySetterTaskC2Ei(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb4task12set_affinityEt(ptr noundef nonnull align 8 dereferenceable(8), i16 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb9task_list9push_backERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3tbb4task19spawn_root_and_waitERNS_9task_listE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb9task_listD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

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


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