; 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::segment_value_t" = type { ptr }
%"struct.tbb::internal::concurrent_vector_base_v3::segment_allocated" = type { i8 }
%"struct.tbb::internal::concurrent_vector_base_v3::segment_not_used" = type { i8 }
%"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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef) #0 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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internaleqERKNS0_25concurrent_vector_base_v315segment_value_tENS1_16segment_not_usedE(ptr noundef nonnull align 8 dereferenceable(8)) #0

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(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) #1

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

; 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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalneINS0_25concurrent_vector_base_v317segment_allocatedEEEbRKNS2_15segment_value_tET_(ptr noundef nonnull align 8 dereferenceable(8)) #0

; 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: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEE4loadILNS_16memory_semanticsE1EEES4_v(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

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

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

38:                                               ; preds = %57, %6
  %39 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 2
  %40 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = load i64, ptr %13, align 8, !tbaa !9
  %42 = icmp ugt i64 %40, %41
  br i1 %42, label %43, label %86

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %44 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 2
  %45 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %44)
  %46 = sub i64 %45, 1
  %47 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %46)
  store i64 %47, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %48 = load i64, ptr %14, align 8, !tbaa !9
  %49 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %48)
  store i64 %49, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %50 = load i64, ptr %15, align 8, !tbaa !9
  %51 = load i64, ptr %13, align 8, !tbaa !9
  %52 = icmp uge i64 %50, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %43
  %54 = load i64, ptr %15, align 8, !tbaa !9
  br label %57

55:                                               ; preds = %43
  %56 = load i64, ptr %13, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %55, %53
  %58 = phi i64 [ %54, %53 ], [ %56, %55 ]
  store i64 %58, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %59 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 3
  %60 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %59)
  %61 = load i64, ptr %14, align 8, !tbaa !9
  %62 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %60, i64 %61
  %63 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %62)
  %64 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %17, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  call void @_ZN3tbb8internal25enforce_segment_allocatedERKNS0_25concurrent_vector_base_v315segment_value_tENS0_12exception_idE(ptr noundef nonnull align 8 dereferenceable(8) %17, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %66 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 3
  %67 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %66)
  %68 = load i64, ptr %14, align 8, !tbaa !9
  %69 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %67, i64 %68
  %70 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %69)
  %71 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %18, i32 0, i32 0
  store ptr %70, ptr %71, align 8
  %72 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIcEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %18)
  %73 = load i64, ptr %9, align 8, !tbaa !9
  %74 = load i64, ptr %16, align 8, !tbaa !9
  %75 = load i64, ptr %15, align 8, !tbaa !9
  %76 = sub i64 %74, %75
  %77 = mul i64 %73, %76
  %78 = getelementptr inbounds i8, ptr %72, i64 %77
  %79 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 2
  %80 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %79)
  %81 = load i64, ptr %16, align 8, !tbaa !9
  %82 = sub i64 %80, %81
  call void %65(ptr noundef %78, i64 noundef %82)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %83 = load i64, ptr %16, align 8, !tbaa !9
  %84 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 2
  %85 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %84, i64 noundef %83)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %38, !llvm.loop !11

86:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %87 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 2
  %88 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %87)
  store i64 %88, ptr %19, align 8, !tbaa !9
  %89 = load i64, ptr %13, align 8, !tbaa !9
  %90 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 2
  %91 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %90, i64 noundef %89)
  %92 = load i64, ptr %13, align 8, !tbaa !9
  %93 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %92)
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helper33assign_first_segment_if_necessaryERS1_m(ptr noundef nonnull align 8 dereferenceable(56) %34, i64 noundef %93)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store i64 0, ptr %21, align 8, !tbaa !9
  br label %94

94:                                               ; preds = %227, %86
  %95 = load i64, ptr %21, align 8, !tbaa !9
  %96 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %95)
  store i64 %96, ptr %20, align 8, !tbaa !9
  %97 = load i64, ptr %13, align 8, !tbaa !9
  %98 = icmp ult i64 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %94
  store i32 4, ptr %22, align 4
  br label %230

100:                                              ; preds = %94
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %101, i32 0, i32 3
  %103 = call noundef ptr @_ZNK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEE4loadILNS_16memory_semanticsE1EEES4_v(ptr noundef nonnull align 8 dereferenceable(8) %102)
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %104, i32 0, i32 4
  %106 = getelementptr inbounds [3 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"], ptr %105, i64 0, i64 0
  %107 = icmp eq ptr %103, %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  br i1 %107, label %108, label %111

108:                                              ; preds = %100
  %109 = load i64, ptr %21, align 8, !tbaa !9
  %110 = icmp uge i64 %109, 3
  br i1 %110, label %120, label %111

111:                                              ; preds = %108, %100
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %112, i32 0, i32 3
  %114 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %113)
  %115 = load i64, ptr %21, align 8, !tbaa !9
  %116 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %114, i64 %115
  %117 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %116)
  %118 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %23, i32 0, i32 0
  store ptr %117, ptr %118, align 8
  %119 = call noundef zeroext i1 @_ZN3tbb8internalneINS0_25concurrent_vector_base_v317segment_allocatedEEEbRKNS2_15segment_value_tET_(ptr noundef nonnull align 8 dereferenceable(8) %23)
  br label %120

120:                                              ; preds = %111, %108
  %121 = phi i1 [ true, %108 ], [ %119, %111 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  br i1 %121, label %122, label %126

122:                                              ; preds = %120
  %123 = load i64, ptr %20, align 8, !tbaa !9
  %124 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 2
  %125 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %124, i64 noundef %123)
  store i32 4, ptr %22, align 4
  br label %230

126:                                              ; preds = %120
  %127 = load i64, ptr %21, align 8, !tbaa !9
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helper25extend_table_if_necessaryERS1_mm(ptr noundef nonnull align 8 dereferenceable(56) %34, i64 noundef %127, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %128 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 3
  %129 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %128)
  %130 = load i64, ptr %21, align 8, !tbaa !9
  %131 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %129, i64 %130
  %132 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %131)
  %133 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %25, i32 0, i32 0
  store ptr %132, ptr %133, align 8
  %134 = call noundef zeroext i1 @_ZN3tbb8internaleqERKNS0_25concurrent_vector_base_v315segment_value_tENS1_16segment_not_usedE(ptr noundef nonnull align 8 dereferenceable(8) %25)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br i1 %134, label %135, label %139

135:                                              ; preds = %126
  %136 = load i64, ptr %21, align 8, !tbaa !9
  %137 = load i64, ptr %9, align 8, !tbaa !9
  %138 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper14enable_segmentERS1_mmb(ptr noundef nonnull align 8 dereferenceable(56) %34, i64 noundef %136, i64 noundef %137, i1 noundef zeroext false)
  br label %146

139:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %140 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 3
  %141 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %140)
  %142 = load i64, ptr %21, align 8, !tbaa !9
  %143 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %141, i64 %142
  %144 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %143)
  %145 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %27, i32 0, i32 0
  store ptr %144, ptr %145, align 8
  call void @_ZN3tbb8internal25enforce_segment_allocatedERKNS0_25concurrent_vector_base_v315segment_value_tENS0_12exception_idE(ptr noundef nonnull align 8 dereferenceable(8) %27, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  br label %146

146:                                              ; preds = %139, %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %147 = load i64, ptr %21, align 8, !tbaa !9
  %148 = icmp ne i64 %147, 0
  br i1 %148, label %149, label %152

149:                                              ; preds = %146
  %150 = load i64, ptr %21, align 8, !tbaa !9
  %151 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %150)
  br label %153

152:                                              ; preds = %146
  br label %153

153:                                              ; preds = %152, %149
  %154 = phi i64 [ %151, %149 ], [ 2, %152 ]
  store i64 %154, ptr %28, align 8, !tbaa !9
  %155 = load i64, ptr %28, align 8, !tbaa !9
  %156 = load i64, ptr %13, align 8, !tbaa !9
  %157 = load i64, ptr %20, align 8, !tbaa !9
  %158 = sub i64 %156, %157
  %159 = icmp ugt i64 %155, %158
  br i1 %159, label %160, label %164

160:                                              ; preds = %153
  %161 = load i64, ptr %13, align 8, !tbaa !9
  %162 = load i64, ptr %20, align 8, !tbaa !9
  %163 = sub i64 %161, %162
  store i64 %163, ptr %28, align 8, !tbaa !9
  br label %164

164:                                              ; preds = %160, %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  store i64 0, ptr %29, align 8, !tbaa !9
  %165 = load i64, ptr %19, align 8, !tbaa !9
  %166 = load i64, ptr %20, align 8, !tbaa !9
  %167 = icmp ugt i64 %165, %166
  br i1 %167, label %168, label %201

168:                                              ; preds = %164
  %169 = load i64, ptr %19, align 8, !tbaa !9
  %170 = load i64, ptr %20, align 8, !tbaa !9
  %171 = sub i64 %169, %170
  store i64 %171, ptr %29, align 8, !tbaa !9
  %172 = load i64, ptr %29, align 8, !tbaa !9
  %173 = load i64, ptr %28, align 8, !tbaa !9
  %174 = icmp ugt i64 %172, %173
  br i1 %174, label %175, label %177

175:                                              ; preds = %168
  %176 = load i64, ptr %28, align 8, !tbaa !9
  store i64 %176, ptr %29, align 8, !tbaa !9
  br label %177

177:                                              ; preds = %175, %168
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %179 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 3
  %180 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %179)
  %181 = load i64, ptr %21, align 8, !tbaa !9
  %182 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %180, i64 %181
  %183 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %182)
  %184 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %30, i32 0, i32 0
  store ptr %183, ptr %184, align 8
  %185 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIvEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %30)
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  %186 = load ptr, ptr %8, align 8, !tbaa !5
  %187 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %186, i32 0, i32 3
  %188 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %187)
  %189 = load i64, ptr %21, align 8, !tbaa !9
  %190 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %188, i64 %189
  %191 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %190)
  %192 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %31, i32 0, i32 0
  store ptr %191, ptr %192, align 8
  %193 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIvEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %31)
  %194 = load i64, ptr %29, align 8, !tbaa !9
  call void %178(ptr noundef %185, ptr noundef %193, i64 noundef %194)
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  %195 = load i64, ptr %29, align 8, !tbaa !9
  %196 = load i64, ptr %28, align 8, !tbaa !9
  %197 = sub i64 %196, %195
  store i64 %197, ptr %28, align 8, !tbaa !9
  %198 = load i64, ptr %9, align 8, !tbaa !9
  %199 = load i64, ptr %29, align 8, !tbaa !9
  %200 = mul i64 %199, %198
  store i64 %200, ptr %29, align 8, !tbaa !9
  br label %201

201:                                              ; preds = %177, %164
  %202 = load i64, ptr %28, align 8, !tbaa !9
  %203 = icmp ugt i64 %202, 0
  br i1 %203, label %204, label %226

204:                                              ; preds = %201
  %205 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #4
  %206 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %34, i32 0, i32 3
  %207 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %206)
  %208 = load i64, ptr %21, align 8, !tbaa !9
  %209 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %207, i64 %208
  %210 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %209)
  %211 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %32, i32 0, i32 0
  store ptr %210, ptr %211, align 8
  %212 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIcEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %32)
  %213 = load i64, ptr %29, align 8, !tbaa !9
  %214 = getelementptr inbounds i8, ptr %212, i64 %213
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #4
  %215 = load ptr, ptr %8, align 8, !tbaa !5
  %216 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %215, i32 0, i32 3
  %217 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %216)
  %218 = load i64, ptr %21, align 8, !tbaa !9
  %219 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %217, i64 %218
  %220 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %219)
  %221 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %33, i32 0, i32 0
  store ptr %220, ptr %221, align 8
  %222 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIcEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %33)
  %223 = load i64, ptr %29, align 8, !tbaa !9
  %224 = getelementptr inbounds i8, ptr %222, i64 %223
  %225 = load i64, ptr %28, align 8, !tbaa !9
  call void %205(ptr noundef %214, ptr noundef %224, i64 noundef %225)
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #4
  br label %226

226:                                              ; preds = %204, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  br label %227

227:                                              ; preds = %226
  %228 = load i64, ptr %21, align 8, !tbaa !9
  %229 = add i64 %228, 1
  store i64 %229, ptr %21, align 8, !tbaa !9
  br label %94, !llvm.loop !13

230:                                              ; preds = %122, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %231

231:                                              ; preds = %230
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  ret void
}

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


; 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::segment_value_t" = 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef) local_unnamed_addr #0 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internaleqERKNS0_25concurrent_vector_base_v315segment_value_tENS1_16segment_not_usedE(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(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) #1

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

; 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

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

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalneINS0_25concurrent_vector_base_v317segment_allocatedEEEbRKNS2_15segment_value_tET_(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

; 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: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEE4loadILNS_16memory_semanticsE1EEES4_v(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3tbb8internal25concurrent_vector_base_v315internal_assignERKS1_mPFvPvmEPFvS4_PKvmESA_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, i64 noundef %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readonly %5) local_unnamed_addr #2 align 2 {
  %7 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %8 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %9 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %10 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %11 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %12 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %13 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %14 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %15 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = tail call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = tail call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %18)
  %20 = icmp ugt i64 %19, %17
  br i1 %20, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  br label %22

22:                                               ; preds = %.lr.ph, %22
  %23 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %18)
  %24 = add i64 %23, -1
  %25 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %24)
  %26 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %25)
  %27 = call i64 @llvm.umax.i64(i64 %26, i64 %17)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %28 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %21)
  %29 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %28, i64 %25
  %30 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %29)
  store ptr %30, ptr %7, align 8
  call void @_ZN3tbb8internal25enforce_segment_allocatedERKNS0_25concurrent_vector_base_v315segment_value_tENS0_12exception_idE(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %31 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %21)
  %32 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %31, i64 %25
  %33 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %32)
  store ptr %33, ptr %8, align 8
  %34 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIcEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %35 = sub i64 %27, %26
  %36 = mul i64 %35, %2
  %37 = getelementptr inbounds i8, ptr %34, i64 %36
  %38 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %18)
  %39 = sub i64 %38, %27
  call void %3(ptr noundef %37, i64 noundef %39)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %40 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %18, i64 noundef %27)
  %41 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %18)
  %42 = icmp ugt i64 %41, %17
  br i1 %42, label %22, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %22, %6
  %43 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %18)
  %44 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %18, i64 noundef %17)
  %45 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %17)
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helper33assign_first_segment_if_necessaryERS1_m(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %45)
  %46 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef 0)
  %47 = icmp ult i64 %46, %17
  br i1 %47, label %.lr.ph81, label %.loopexit

.lr.ph81:                                         ; preds = %._crit_edge
  %48 = getelementptr inbounds i8, ptr %1, i64 24
  %49 = getelementptr inbounds i8, ptr %1, i64 32
  %50 = getelementptr inbounds i8, ptr %0, i64 24
  br label %51

51:                                               ; preds = %.lr.ph81, %104
  %52 = phi i64 [ %46, %.lr.ph81 ], [ %106, %104 ]
  %.06579 = phi i64 [ 0, %.lr.ph81 ], [ %105, %104 ]
  %53 = call noundef ptr @_ZNK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEE4loadILNS_16memory_semanticsE1EEES4_v(ptr noundef nonnull align 8 dereferenceable(8) %48)
  %54 = icmp eq ptr %53, %49
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %55 = icmp ugt i64 %.06579, 2
  %or.cond = and i1 %55, %54
  br i1 %or.cond, label %.critedge, label %56

56:                                               ; preds = %51
  %57 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %48)
  %58 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %57, i64 %.06579
  %59 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %58)
  store ptr %59, ptr %9, align 8
  %60 = call noundef zeroext i1 @_ZN3tbb8internalneINS0_25concurrent_vector_base_v317segment_allocatedEEEbRKNS2_15segment_value_tET_(ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br i1 %60, label %.loopexit76, label %62

.critedge:                                        ; preds = %51
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %.loopexit76

.loopexit76:                                      ; preds = %56, %.critedge
  %61 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %18, i64 noundef %52)
  br label %.loopexit

62:                                               ; preds = %56
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helper25extend_table_if_necessaryERS1_mm(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %.06579, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %63 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %50)
  %64 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %63, i64 %.06579
  %65 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %64)
  store ptr %65, ptr %10, align 8
  %66 = call noundef zeroext i1 @_ZN3tbb8internaleqERKNS0_25concurrent_vector_base_v315segment_value_tENS1_16segment_not_usedE(ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br i1 %66, label %67, label %69

67:                                               ; preds = %62
  %68 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper14enable_segmentERS1_mmb(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %.06579, i64 noundef %2, i1 noundef zeroext false)
  br label %73

69:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %70 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %50)
  %71 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %70, i64 %.06579
  %72 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %71)
  store ptr %72, ptr %11, align 8
  call void @_ZN3tbb8internal25enforce_segment_allocatedERKNS0_25concurrent_vector_base_v315segment_value_tENS0_12exception_idE(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %73

73:                                               ; preds = %69, %67
  %.not = icmp eq i64 %.06579, 0
  br i1 %.not, label %76, label %74

74:                                               ; preds = %73
  %75 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %.06579)
  br label %76

76:                                               ; preds = %73, %74
  %77 = phi i64 [ %75, %74 ], [ 2, %73 ]
  %78 = sub i64 %17, %52
  %spec.select = call i64 @llvm.umin.i64(i64 %77, i64 %78)
  %79 = icmp ugt i64 %43, %52
  br i1 %79, label %80, label %92

80:                                               ; preds = %76
  %81 = sub i64 %43, %52
  %spec.select75 = call i64 @llvm.umin.i64(i64 %81, i64 %spec.select)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %82 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %50)
  %83 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %82, i64 %.06579
  %84 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %83)
  store ptr %84, ptr %12, align 8
  %85 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIvEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %86 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %48)
  %87 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %86, i64 %.06579
  %88 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %87)
  store ptr %88, ptr %13, align 8
  %89 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIvEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %13)
  call void %4(ptr noundef %85, ptr noundef %89, i64 noundef %spec.select75)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  %90 = sub i64 %spec.select, %spec.select75
  %91 = mul i64 %spec.select75, %2
  br label %92

92:                                               ; preds = %80, %76
  %.164 = phi i64 [ %90, %80 ], [ %spec.select, %76 ]
  %.1 = phi i64 [ %91, %80 ], [ 0, %76 ]
  %.not73 = icmp eq i64 %.164, 0
  br i1 %.not73, label %104, label %93

93:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %94 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %50)
  %95 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %94, i64 %.06579
  %96 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %95)
  store ptr %96, ptr %14, align 8
  %97 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIcEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %14)
  %98 = getelementptr inbounds i8, ptr %97, i64 %.1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %99 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %48)
  %100 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %99, i64 %.06579
  %101 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %100)
  store ptr %101, ptr %15, align 8
  %102 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIcEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %103 = getelementptr inbounds i8, ptr %102, i64 %.1
  call void %5(ptr noundef %98, ptr noundef %103, i64 noundef %.164)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %104

104:                                              ; preds = %93, %92
  %105 = add i64 %.06579, 1
  %106 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %105)
  %107 = icmp ult i64 %106, %17
  br i1 %107, label %51, label %.loopexit, !llvm.loop !7

.loopexit:                                        ; preds = %104, %._crit_edge, %.loopexit76
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #4

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


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