; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/tbb (concurrent_vector)

; 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.tbb::internal::concurrent_vector_base_v3::helper" = type { ptr, i64, i64, i64, i64, i64, i64 }
%"struct.tbb::internal::concurrent_vector_base_v3::helper::init_body" = type { ptr, ptr }
%"class.tbb::internal::concurrent_vector_base_v3" = type { ptr, %"struct.tbb::atomic", %"struct.tbb::atomic", %"struct.tbb::atomic.0", [3 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"] }
%"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 { i64 }
%"struct.tbb::atomic.0" = type { %"struct.tbb::internal::atomic_impl_with_arithmetic.1" }
%"struct.tbb::internal::atomic_impl_with_arithmetic.1" = type { %"struct.tbb::internal::atomic_impl.2" }
%"struct.tbb::internal::atomic_impl.2" = type { %"struct.tbb::internal::aligned_storage.3" }
%"struct.tbb::internal::aligned_storage.3" = type { ptr }
%"class.tbb::internal::concurrent_vector_base_v3::segment_t" = type { %"struct.tbb::atomic.4" }
%"struct.tbb::atomic.4" = type { %"struct.tbb::internal::atomic_impl.5" }
%"struct.tbb::internal::atomic_impl.5" = type { %"struct.tbb::internal::aligned_storage.6" }
%"struct.tbb::internal::aligned_storage.6" = type { ptr }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3tbb8internal25concurrent_vector_base_v36helper33assign_first_segment_if_necessaryERS1_m(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3tbb8internal25concurrent_vector_base_v36helper25extend_table_if_necessaryERS1_mm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper15acquire_segmentERS1_mmb(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef, i1 noundef zeroext) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3tbb8internal25concurrent_vector_base_v313internal_growEmmmPFvPvPKvmES4_(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5) #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"class.tbb::internal::concurrent_vector_base_v3::helper", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.tbb::internal::concurrent_vector_base_v3::helper::init_body", align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store i64 %2, ptr %9, align 8, !tbaa !9
  store i64 %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %19 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %20 = load i64, ptr %8, align 8, !tbaa !9
  %21 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %20)
  store i64 %21, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %22 = load i64, ptr %9, align 8, !tbaa !9
  %23 = sub i64 %22, 1
  %24 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %23)
  store i64 %24, ptr %14, align 8, !tbaa !9
  %25 = load i64, ptr %14, align 8, !tbaa !9
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helper33assign_first_segment_if_necessaryERS1_m(ptr noundef nonnull align 8 dereferenceable(56) %19, i64 noundef %25)
  %26 = load i64, ptr %14, align 8, !tbaa !9
  %27 = load i64, ptr %8, align 8, !tbaa !9
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helper25extend_table_if_necessaryERS1_mm(ptr noundef nonnull align 8 dereferenceable(56) %19, i64 noundef %26, i64 noundef %27)
  call void @llvm.lifetime.start.p0(i64 56, ptr %15) #4
  %28 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %19, i32 0, i32 3
  %29 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %19, i32 0, i32 1
  %31 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %30)
  %32 = load i64, ptr %10, align 8, !tbaa !9
  %33 = load i64, ptr %13, align 8, !tbaa !9
  %34 = load i64, ptr %8, align 8, !tbaa !9
  %35 = load i64, ptr %9, align 8, !tbaa !9
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperC2EPNS1_9segment_tEmmmmm(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef %29, i64 noundef %31, i64 noundef %32, i64 noundef %33, i64 noundef %34, i64 noundef %35) #4
  br label %36

36:                                               ; preds = %52, %6
  %37 = load i64, ptr %14, align 8, !tbaa !9
  %38 = load i64, ptr %13, align 8, !tbaa !9
  %39 = icmp ugt i64 %37, %38
  br i1 %39, label %40, label %45

40:                                               ; preds = %36
  %41 = load i64, ptr %14, align 8, !tbaa !9
  %42 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::helper", ptr %15, i32 0, i32 1
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = icmp uge i64 %41, %43
  br label %45

45:                                               ; preds = %40, %36
  %46 = phi i1 [ false, %36 ], [ %44, %40 ]
  br i1 %46, label %47, label %59

47:                                               ; preds = %45
  %48 = load i64, ptr %14, align 8, !tbaa !9
  %49 = load i64, ptr %10, align 8, !tbaa !9
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper15acquire_segmentERS1_mmb(ptr noundef nonnull align 8 dereferenceable(56) %19, i64 noundef %48, i64 noundef %49, i1 noundef zeroext true)
          to label %51 unwind label %55

51:                                               ; preds = %47
  br label %52

52:                                               ; preds = %51
  %53 = load i64, ptr %14, align 8, !tbaa !9
  %54 = add i64 %53, -1
  store i64 %54, ptr %14, align 8, !tbaa !9
  br label %36, !llvm.loop !13

55:                                               ; preds = %69, %64, %47
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %16, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %17, align 4
  br label %87

59:                                               ; preds = %45
  br label %60

60:                                               ; preds = %74, %59
  %61 = load i64, ptr %13, align 8, !tbaa !9
  %62 = load i64, ptr %14, align 8, !tbaa !9
  %63 = icmp ule i64 %61, %62
  br i1 %63, label %64, label %77

64:                                               ; preds = %60
  %65 = load i64, ptr %13, align 8, !tbaa !9
  %66 = load i64, ptr %10, align 8, !tbaa !9
  %67 = load i64, ptr %13, align 8, !tbaa !9
  %68 = invoke noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %67)
          to label %69 unwind label %55

69:                                               ; preds = %64
  %70 = load i64, ptr %8, align 8, !tbaa !9
  %71 = icmp uge i64 %68, %70
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper15acquire_segmentERS1_mmb(ptr noundef nonnull align 8 dereferenceable(56) %19, i64 noundef %65, i64 noundef %66, i1 noundef zeroext %71)
          to label %73 unwind label %55

73:                                               ; preds = %69
  br label %74

74:                                               ; preds = %73
  %75 = load i64, ptr %13, align 8, !tbaa !9
  %76 = add i64 %75, 1
  store i64 %76, ptr %13, align 8, !tbaa !9
  br label %60, !llvm.loop !15

77:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #4
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN3tbb8internal25concurrent_vector_base_v36helper9init_bodyC2EPFvPvPKvmES6_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef %78, ptr noundef %79)
          to label %80 unwind label %83

80:                                               ; preds = %77
  %81 = invoke noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper5applyINS2_9init_bodyEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %82 unwind label %83

82:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #4
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %15) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  ret void

83:                                               ; preds = %80, %77
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %16, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #4
  br label %87

87:                                               ; preds = %83, %55
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %15) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %16, align 8
  %90 = load i32, ptr %17, align 4
  %91 = insertvalue { ptr, i32 } poison, ptr %89, 0
  %92 = insertvalue { ptr, i32 } %91, i32 %90, 1
  resume { ptr, i32 } %92
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb8internal25concurrent_vector_base_v36helperC2EPNS1_9segment_tEmmmmm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper5applyINS2_9init_bodyEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSN3tbb8internal25concurrent_vector_base_v36helperE", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !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.tbb::internal::concurrent_vector_base_v3::helper" = type { ptr, i64, i64, i64, i64, i64, i64 }
%"struct.tbb::internal::concurrent_vector_base_v3::helper::init_body" = type { ptr, ptr }

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3tbb8internal25concurrent_vector_base_v36helper33assign_first_segment_if_necessaryERS1_m(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3tbb8internal25concurrent_vector_base_v36helper25extend_table_if_necessaryERS1_mm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper15acquire_segmentERS1_mmb(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3tbb8internal25concurrent_vector_base_v313internal_growEmmmPFvPvPKvmES4_(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.tbb::internal::concurrent_vector_base_v3::helper", align 8
  %8 = alloca %"struct.tbb::internal::concurrent_vector_base_v3::helper::init_body", align 8
  %9 = tail call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %1)
  %10 = add i64 %2, -1
  %11 = tail call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %10)
  tail call void @_ZN3tbb8internal25concurrent_vector_base_v36helper33assign_first_segment_if_necessaryERS1_m(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %11)
  tail call void @_ZN3tbb8internal25concurrent_vector_base_v36helper25extend_table_if_necessaryERS1_mm(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %11, i64 noundef %1)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #4
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  %13 = tail call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %12)
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = tail call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperC2EPNS1_9segment_tEmmmmm(ptr noundef nonnull align 8 dereferenceable(56) %7, ptr noundef %13, i64 noundef %15, i64 noundef %3, i64 noundef %9, i64 noundef %1, i64 noundef %2) #4
  %16 = getelementptr inbounds i8, ptr %7, i64 8
  %17 = icmp ugt i64 %11, %9
  %18 = load i64, ptr %16, align 8
  %19 = icmp uge i64 %11, %18
  %20 = select i1 %17, i1 %19, i1 false
  br i1 %20, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %22, %6
  %.027.lcssa = phi i64 [ %11, %6 ], [ %23, %22 ]
  %.not32 = icmp ugt i64 %9, %.027.lcssa
  br i1 %.not32, label %._crit_edge, label %.lr.ph34

.lr.ph:                                           ; preds = %6, %22
  %.02731 = phi i64 [ %23, %22 ], [ %11, %6 ]
  %21 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper15acquire_segmentERS1_mmb(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %.02731, i64 noundef %3, i1 noundef zeroext true)
          to label %22 unwind label %.loopexit.split-lp

22:                                               ; preds = %.lr.ph
  %23 = add i64 %.02731, -1
  %24 = icmp ugt i64 %23, %9
  %25 = load i64, ptr %16, align 8
  %26 = icmp uge i64 %23, %25
  %27 = select i1 %24, i1 %26, i1 false
  br i1 %27, label %.lr.ph, label %.preheader, !llvm.loop !5

.loopexit:                                        ; preds = %.lr.ph34
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %37

.loopexit.split-lp:                               ; preds = %.lr.ph
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %37

.lr.ph34:                                         ; preds = %.preheader, %31
  %.02833 = phi i64 [ %32, %31 ], [ %9, %.preheader ]
  %28 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %.02833)
  %29 = icmp uge i64 %28, %1
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper15acquire_segmentERS1_mmb(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %.02833, i64 noundef %3, i1 noundef zeroext %29)
          to label %31 unwind label %.loopexit

31:                                               ; preds = %.lr.ph34
  %32 = add i64 %.02833, 1
  %.not = icmp ugt i64 %32, %.027.lcssa
  br i1 %.not, label %._crit_edge, label %.lr.ph34, !llvm.loop !7

._crit_edge:                                      ; preds = %31, %.preheader
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #4
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helper9init_bodyC2EPFvPvPKvmES6_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef %4, ptr noundef %5)
  %33 = invoke noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper5applyINS2_9init_bodyEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(56) %7, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %34 unwind label %35

34:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #4
  ret void

35:                                               ; preds = %._crit_edge
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  br label %37

37:                                               ; preds = %.loopexit, %.loopexit.split-lp, %35
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb8internal25concurrent_vector_base_v36helperC2EPNS1_9segment_tEmmmmm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper5applyINS2_9init_bodyEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}


; Effective O3 passes: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass