; 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_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 }
%"class.tbb::internal::concurrent_vector_base_v3::segment_value_t" = type { ptr }
%"class.tbb::internal::concurrent_vector_base_v3::helper" = type { ptr, i64, i64, i64, i64, i64, i64 }
%"struct.tbb::internal::concurrent_vector_base_v3::helper::destroy_body" = type { 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 }
%"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table" = type { i64, [64 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"] }

; 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 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 void @_ZN3tbb8internal25concurrent_vector_base_v39segment_tC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIPN3tbb8internal25concurrent_vector_base_v39segment_tES4_ET0_T_S6_S5_(ptr noundef, ptr noundef, ptr noundef) #3

; 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: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper16allocate_segmentERS1_m(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) #3 align 2

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

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #4

declare ptr @__cxa_begin_catch(ptr)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper16find_segment_endERKS1_(ptr noundef nonnull align 8 dereferenceable(56)) #3 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 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 #0 align 2

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

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

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

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

42:                                               ; preds = %5
  %43 = load i64, ptr %12, align 8, !tbaa !9
  %44 = sub i64 %43, 1
  %45 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %44)
  %46 = add i64 %45, 1
  br label %48

47:                                               ; preds = %5
  br label %48

48:                                               ; preds = %47, %42
  %49 = phi i64 [ %46, %42 ], [ 0, %47 ]
  store i64 %49, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %50 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %36, i32 0, i32 1
  %51 = call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %50)
  store i64 %51, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %52 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %52, ptr %16, align 8, !tbaa !9
  %53 = load i64, ptr %14, align 8, !tbaa !9
  %54 = load i64, ptr %15, align 8, !tbaa !9
  %55 = icmp ult i64 %53, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %48
  %57 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %57, ptr %16, align 8, !tbaa !9
  br label %75

58:                                               ; preds = %48
  br label %59

59:                                               ; preds = %71, %58
  %60 = load i64, ptr %16, align 8, !tbaa !9
  %61 = load i64, ptr %14, align 8, !tbaa !9
  %62 = icmp ult i64 %60, %61
  br i1 %62, label %63, label %69

63:                                               ; preds = %59
  %64 = load i64, ptr %16, align 8, !tbaa !9
  %65 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %64)
  %66 = load i64, ptr %8, align 8, !tbaa !9
  %67 = mul i64 %65, %66
  %68 = call noundef zeroext i1 @_ZN3tbb8internal25concurrent_vector_base_v36helper19incompact_predicateEm(i64 noundef %67)
  br label %69

69:                                               ; preds = %63, %59
  %70 = phi i1 [ false, %59 ], [ %68, %63 ]
  br i1 %70, label %71, label %74

71:                                               ; preds = %69
  %72 = load i64, ptr %16, align 8, !tbaa !9
  %73 = add i64 %72, 1
  store i64 %73, ptr %16, align 8, !tbaa !9
  br label %59, !llvm.loop !11

74:                                               ; preds = %69
  br label %75

75:                                               ; preds = %74, %56
  %76 = load i64, ptr %14, align 8, !tbaa !9
  %77 = load i64, ptr %13, align 8, !tbaa !9
  %78 = icmp eq i64 %76, %77
  br i1 %78, label %79, label %84

79:                                               ; preds = %75
  %80 = load i64, ptr %16, align 8, !tbaa !9
  %81 = load i64, ptr %15, align 8, !tbaa !9
  %82 = icmp eq i64 %80, %81
  br i1 %82, label %83, label %84

83:                                               ; preds = %79
  store ptr null, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %321

84:                                               ; preds = %79, %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %85 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %36, i32 0, i32 3
  %86 = call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %85)
  store ptr %86, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %87, ptr %19, align 8, !tbaa !5
  %88 = load ptr, ptr %19, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %88, i32 0, i32 1
  %90 = getelementptr inbounds [64 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"], ptr %89, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @_ZN3tbb8internal25concurrent_vector_base_v39segment_tC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20)
  %91 = call noundef ptr @_ZSt6fill_nIPN3tbb8internal25concurrent_vector_base_v39segment_tEmS3_ET_S5_T0_RKT1_(ptr noundef %90, i64 noundef 64, ptr noundef nonnull align 8 dereferenceable(8) %20)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  %92 = load ptr, ptr %19, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %92, i32 0, i32 0
  store i64 0, ptr %93, align 8, !tbaa !13
  %94 = load i64, ptr %16, align 8, !tbaa !9
  %95 = load i64, ptr %15, align 8, !tbaa !9
  %96 = icmp ne i64 %94, %95
  br i1 %96, label %97, label %286

97:                                               ; preds = %84
  %98 = load i64, ptr %16, align 8, !tbaa !9
  %99 = icmp ne i64 %98, 0
  br i1 %99, label %100, label %286

100:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %101 = load i64, ptr %16, align 8, !tbaa !9
  %102 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %101)
  %103 = call noundef ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper16allocate_segmentERS1_m(ptr noundef nonnull align 8 dereferenceable(56) %36, i64 noundef %102)
  store ptr %103, ptr %21, align 8, !tbaa !5
  %104 = load ptr, ptr %19, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %104, i32 0, i32 1
  %106 = getelementptr inbounds [64 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"], ptr %105, i64 0, i64 0
  %107 = load ptr, ptr %21, align 8, !tbaa !5
  call void @_ZN3tbb8internal25concurrent_vector_base_v39segment_t5storeILNS_16memory_semanticsE3EEEvPv(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef %107) #6
  %108 = load i64, ptr %16, align 8, !tbaa !9
  %109 = load ptr, ptr %19, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %109, i32 0, i32 0
  store i64 %108, ptr %110, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %111 = load i64, ptr %15, align 8, !tbaa !9
  %112 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %111)
  store i64 %112, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 0, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  store i64 0, ptr %24, align 8, !tbaa !9
  br label %113

113:                                              ; preds = %203, %100
  %114 = load i64, ptr %23, align 8, !tbaa !9
  %115 = load i64, ptr %16, align 8, !tbaa !9
  %116 = icmp ult i64 %114, %115
  br i1 %116, label %117, label %121

117:                                              ; preds = %113
  %118 = load i64, ptr %24, align 8, !tbaa !9
  %119 = load i64, ptr %12, align 8, !tbaa !9
  %120 = icmp ult i64 %118, %119
  br label %121

121:                                              ; preds = %117, %113
  %122 = phi i1 [ false, %113 ], [ %120, %117 ]
  br i1 %122, label %124, label %123

123:                                              ; preds = %121
  store i32 4, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %205

124:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %125 = load ptr, ptr %21, align 8, !tbaa !5
  %126 = load i64, ptr %23, align 8, !tbaa !9
  %127 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %126)
  %128 = load i64, ptr %8, align 8, !tbaa !9
  %129 = mul i64 %127, %128
  %130 = getelementptr inbounds i8, ptr %125, i64 %129
  store ptr %130, ptr %25, align 8, !tbaa !5
  %131 = load i64, ptr %24, align 8, !tbaa !9
  %132 = load i64, ptr %22, align 8, !tbaa !9
  %133 = add i64 %131, %132
  %134 = load i64, ptr %12, align 8, !tbaa !9
  %135 = icmp uge i64 %133, %134
  br i1 %135, label %136, label %140

136:                                              ; preds = %124
  %137 = load i64, ptr %12, align 8, !tbaa !9
  %138 = load i64, ptr %24, align 8, !tbaa !9
  %139 = sub i64 %137, %138
  store i64 %139, ptr %22, align 8, !tbaa !9
  br label %140

140:                                              ; preds = %136, %124
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = load ptr, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %143 = load ptr, ptr %18, align 8, !tbaa !5
  %144 = load i64, ptr %23, align 8, !tbaa !9
  %145 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %143, i64 %144
  %146 = invoke ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %145)
          to label %147 unwind label %153

147:                                              ; preds = %140
  %148 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %26, i32 0, i32 0
  store ptr %146, ptr %148, align 8
  %149 = invoke noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIvEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %150 unwind label %153

150:                                              ; preds = %147
  %151 = load i64, ptr %22, align 8, !tbaa !9
  invoke void %141(ptr noundef %142, ptr noundef %149, i64 noundef %151)
          to label %152 unwind label %153

152:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %191

153:                                              ; preds = %150, %147, %140
  %154 = landingpad { ptr, i32 }
          catch ptr null
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %27, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %157

157:                                              ; preds = %153
  %158 = load ptr, ptr %27, align 8
  %159 = call ptr @__cxa_begin_catch(ptr %158) #6
  call void @llvm.lifetime.start.p0(i64 56, ptr %29) #6
  %160 = load ptr, ptr %19, align 8, !tbaa !5
  %161 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %160, i32 0, i32 1
  %162 = getelementptr inbounds [64 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"], ptr %161, i64 0, i64 0
  %163 = load ptr, ptr %19, align 8, !tbaa !5
  %164 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %163, i32 0, i32 0
  %165 = load i64, ptr %164, align 8, !tbaa !13
  %166 = load i64, ptr %8, align 8, !tbaa !9
  %167 = load i64, ptr %23, align 8, !tbaa !9
  %168 = invoke noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %167)
          to label %169 unwind label %176

169:                                              ; preds = %157
  %170 = load i64, ptr %22, align 8, !tbaa !9
  %171 = add i64 %168, %170
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperC2EPNS1_9segment_tEmmmmm(ptr noundef nonnull align 8 dereferenceable(56) %29, ptr noundef %162, i64 noundef %165, i64 noundef %166, i64 noundef 0, i64 noundef 0, i64 noundef %171) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN3tbb8internal25concurrent_vector_base_v36helper12destroy_bodyC2EPFvPvmE(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef %172)
          to label %173 unwind label %180

173:                                              ; preds = %169
  %174 = invoke noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper5applyINS2_12destroy_bodyEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(56) %29, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %175 unwind label %180

175:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  invoke void @__cxa_rethrow() #7
          to label %331 unwind label %184

176:                                              ; preds = %157
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %27, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %28, align 4
  br label %189

180:                                              ; preds = %173, %169
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %27, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %188

184:                                              ; preds = %175
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %27, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %28, align 4
  br label %188

188:                                              ; preds = %184, %180
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %29) #6
  br label %189

189:                                              ; preds = %188, %176
  call void @llvm.lifetime.end.p0(i64 56, ptr %29) #6
  invoke void @__cxa_end_catch()
          to label %190 unwind label %328

190:                                              ; preds = %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %323

191:                                              ; preds = %152
  %192 = load i64, ptr %23, align 8, !tbaa !9
  %193 = icmp ne i64 %192, 0
  br i1 %193, label %194, label %198

194:                                              ; preds = %191
  %195 = load i64, ptr %23, align 8, !tbaa !9
  %196 = add i64 %195, 1
  store i64 %196, ptr %23, align 8, !tbaa !9
  %197 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %196)
  br label %201

198:                                              ; preds = %191
  %199 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %199, ptr %23, align 8, !tbaa !9
  %200 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %199)
  br label %201

201:                                              ; preds = %198, %194
  %202 = phi i64 [ %197, %194 ], [ %200, %198 ]
  store i64 %202, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %203

203:                                              ; preds = %201
  %204 = load i64, ptr %22, align 8, !tbaa !9
  store i64 %204, ptr %24, align 8, !tbaa !9
  br label %113, !llvm.loop !15

205:                                              ; preds = %123
  %206 = load ptr, ptr %18, align 8, !tbaa !5
  %207 = load ptr, ptr %18, align 8, !tbaa !5
  %208 = load i64, ptr %16, align 8, !tbaa !9
  %209 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %207, i64 %208
  %210 = load ptr, ptr %19, align 8, !tbaa !5
  %211 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %210, i32 0, i32 1
  %212 = getelementptr inbounds [64 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"], ptr %211, i64 0, i64 0
  %213 = call noundef ptr @_ZSt4copyIPN3tbb8internal25concurrent_vector_base_v39segment_tES4_ET0_T_S6_S5_(ptr noundef %206, ptr noundef %209, ptr noundef %212)
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  store i64 0, ptr %31, align 8, !tbaa !9
  br label %214

214:                                              ; preds = %229, %205
  %215 = load i64, ptr %31, align 8, !tbaa !9
  %216 = load i64, ptr %16, align 8, !tbaa !9
  %217 = icmp ult i64 %215, %216
  br i1 %217, label %219, label %218

218:                                              ; preds = %214
  store i32 7, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  br label %232

219:                                              ; preds = %214
  %220 = load ptr, ptr %18, align 8, !tbaa !5
  %221 = load i64, ptr %31, align 8, !tbaa !9
  %222 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %220, i64 %221
  %223 = load ptr, ptr %21, align 8, !tbaa !5
  %224 = load i64, ptr %31, align 8, !tbaa !9
  %225 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %224)
  %226 = load i64, ptr %8, align 8, !tbaa !9
  %227 = mul i64 %225, %226
  %228 = getelementptr inbounds i8, ptr %223, i64 %227
  call void @_ZN3tbb8internal25concurrent_vector_base_v39segment_t5storeILNS_16memory_semanticsE3EEEvPv(ptr noundef nonnull align 8 dereferenceable(8) %222, ptr noundef %228) #6
  br label %229

229:                                              ; preds = %219
  %230 = load i64, ptr %31, align 8, !tbaa !9
  %231 = add i64 %230, 1
  store i64 %231, ptr %31, align 8, !tbaa !9
  br label %214, !llvm.loop !16

232:                                              ; preds = %218
  %233 = load i64, ptr %15, align 8, !tbaa !9
  %234 = load ptr, ptr %19, align 8, !tbaa !5
  %235 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %234, i32 0, i32 0
  store i64 %233, ptr %235, align 8, !tbaa !13
  %236 = load i64, ptr %16, align 8, !tbaa !9
  %237 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %36, i32 0, i32 1
  %238 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %237, i64 noundef %236)
  %239 = load i64, ptr %15, align 8, !tbaa !9
  %240 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %239)
  store i64 %240, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  store i64 0, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  store i64 0, ptr %33, align 8, !tbaa !9
  br label %241

241:                                              ; preds = %283, %232
  %242 = load i64, ptr %32, align 8, !tbaa !9
  %243 = load i64, ptr %16, align 8, !tbaa !9
  %244 = icmp ult i64 %242, %243
  br i1 %244, label %245, label %249

245:                                              ; preds = %241
  %246 = load i64, ptr %33, align 8, !tbaa !9
  %247 = load i64, ptr %12, align 8, !tbaa !9
  %248 = icmp ult i64 %246, %247
  br label %249

249:                                              ; preds = %245, %241
  %250 = phi i1 [ false, %241 ], [ %248, %245 ]
  br i1 %250, label %252, label %251

251:                                              ; preds = %249
  store i32 10, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %285

252:                                              ; preds = %249
  %253 = load i64, ptr %33, align 8, !tbaa !9
  %254 = load i64, ptr %22, align 8, !tbaa !9
  %255 = add i64 %253, %254
  %256 = load i64, ptr %12, align 8, !tbaa !9
  %257 = icmp uge i64 %255, %256
  br i1 %257, label %258, label %262

258:                                              ; preds = %252
  %259 = load i64, ptr %12, align 8, !tbaa !9
  %260 = load i64, ptr %33, align 8, !tbaa !9
  %261 = sub i64 %259, %260
  store i64 %261, ptr %22, align 8, !tbaa !9
  br label %262

262:                                              ; preds = %258, %252
  %263 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %264 = load ptr, ptr %19, align 8, !tbaa !5
  %265 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %264, i32 0, i32 1
  %266 = load i64, ptr %32, align 8, !tbaa !9
  %267 = getelementptr inbounds [64 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"], ptr %265, i64 0, i64 %266
  %268 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %267)
  %269 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", ptr %34, i32 0, i32 0
  store ptr %268, ptr %269, align 8
  %270 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIvEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %34)
  %271 = load i64, ptr %22, align 8, !tbaa !9
  call void %263(ptr noundef %270, i64 noundef %271)
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  %272 = load i64, ptr %32, align 8, !tbaa !9
  %273 = icmp ne i64 %272, 0
  br i1 %273, label %274, label %278

274:                                              ; preds = %262
  %275 = load i64, ptr %32, align 8, !tbaa !9
  %276 = add i64 %275, 1
  store i64 %276, ptr %32, align 8, !tbaa !9
  %277 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %276)
  br label %281

278:                                              ; preds = %262
  %279 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %279, ptr %32, align 8, !tbaa !9
  %280 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %279)
  br label %281

281:                                              ; preds = %278, %274
  %282 = phi i64 [ %277, %274 ], [ %280, %278 ]
  store i64 %282, ptr %22, align 8, !tbaa !9
  br label %283

283:                                              ; preds = %281
  %284 = load i64, ptr %22, align 8, !tbaa !9
  store i64 %284, ptr %33, align 8, !tbaa !9
  br label %241, !llvm.loop !17

285:                                              ; preds = %251
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %286

286:                                              ; preds = %285, %97, %84
  %287 = load i64, ptr %14, align 8, !tbaa !9
  %288 = load i64, ptr %13, align 8, !tbaa !9
  %289 = icmp ult i64 %287, %288
  br i1 %289, label %290, label %319

290:                                              ; preds = %286
  %291 = load i64, ptr %15, align 8, !tbaa !9
  %292 = load ptr, ptr %19, align 8, !tbaa !5
  %293 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %292, i32 0, i32 0
  store i64 %291, ptr %293, align 8, !tbaa !13
  %294 = load ptr, ptr %18, align 8, !tbaa !5
  %295 = load i64, ptr %14, align 8, !tbaa !9
  %296 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %294, i64 %295
  %297 = load ptr, ptr %18, align 8, !tbaa !5
  %298 = load i64, ptr %13, align 8, !tbaa !9
  %299 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %297, i64 %298
  %300 = load ptr, ptr %19, align 8, !tbaa !5
  %301 = getelementptr inbounds %"struct.tbb::internal::concurrent_vector_base_v3::internal_segments_table", ptr %300, i32 0, i32 1
  %302 = getelementptr inbounds [64 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"], ptr %301, i64 0, i64 0
  %303 = load i64, ptr %14, align 8, !tbaa !9
  %304 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %302, i64 %303
  %305 = call noundef ptr @_ZSt4copyIPN3tbb8internal25concurrent_vector_base_v39segment_tES4_ET0_T_S6_S5_(ptr noundef %296, ptr noundef %299, ptr noundef %304)
  %306 = load ptr, ptr %18, align 8, !tbaa !5
  %307 = load i64, ptr %14, align 8, !tbaa !9
  %308 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %306, i64 %307
  %309 = load i64, ptr %13, align 8, !tbaa !9
  %310 = load i64, ptr %14, align 8, !tbaa !9
  %311 = sub i64 %309, %310
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  call void @_ZN3tbb8internal25concurrent_vector_base_v39segment_tC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %35)
  %312 = call noundef ptr @_ZSt6fill_nIPN3tbb8internal25concurrent_vector_base_v39segment_tEmS3_ET_S5_T0_RKT1_(ptr noundef %308, i64 noundef %311, ptr noundef nonnull align 8 dereferenceable(8) %35)
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  %313 = load i64, ptr %16, align 8, !tbaa !9
  %314 = icmp ne i64 %313, 0
  br i1 %314, label %318, label %315

315:                                              ; preds = %290
  %316 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3", ptr %36, i32 0, i32 1
  %317 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %316, i64 noundef 0)
  br label %318

318:                                              ; preds = %315, %290
  br label %319

319:                                              ; preds = %318, %286
  %320 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %320, ptr %6, align 8
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %321

321:                                              ; preds = %319, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %322 = load ptr, ptr %6, align 8
  ret ptr %322

323:                                              ; preds = %190
  %324 = load ptr, ptr %27, align 8
  %325 = load i32, ptr %28, align 4
  %326 = insertvalue { ptr, i32 } poison, ptr %324, 0
  %327 = insertvalue { ptr, i32 } %326, i32 %325, 1
  resume { ptr, i32 } %327

328:                                              ; preds = %189
  %329 = landingpad { ptr, i32 }
          catch ptr null
  %330 = extractvalue { ptr, i32 } %329, 0
  call void @__clang_call_terminate(ptr %330) #8
  unreachable

331:                                              ; preds = %175
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internal25concurrent_vector_base_v36helper19incompact_predicateEm(i64 noundef) #5 align 2

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

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

declare void @__cxa_rethrow()

declare void @__cxa_end_catch()

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 = { noinline noreturn nounwind uwtable "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 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }
attributes #8 = { noreturn 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 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN3tbb8internal25concurrent_vector_base_v323internal_segments_tableE", !10, i64 0, !7, i64 8}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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_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 }
%"class.tbb::internal::concurrent_vector_base_v3::segment_value_t" = type { ptr }
%"class.tbb::internal::concurrent_vector_base_v3::helper" = type { ptr, i64, i64, i64, i64, i64, i64 }
%"struct.tbb::internal::concurrent_vector_base_v3::helper::destroy_body" = 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 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 void @_ZN3tbb8internal25concurrent_vector_base_v39segment_tC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIPN3tbb8internal25concurrent_vector_base_v39segment_tES4_ET0_T_S6_S5_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; 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: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper16allocate_segmentERS1_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 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #4

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper16find_segment_endERKS1_(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 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 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 #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN3tbb8internal25concurrent_vector_base_v316internal_compactEmPvPFvS2_mEPFvS2_PKvmE(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef readonly %4) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_t", align 8
  %7 = alloca %"class.tbb::internal::concurrent_vector_base_v3::segment_value_t", align 8
  %8 = alloca %"class.tbb::internal::concurrent_vector_base_v3::helper", align 8
  %9 = alloca %"struct.tbb::internal::concurrent_vector_base_v3::helper::destroy_body", 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_t", align 8
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = tail call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
  %14 = tail call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper16find_segment_endERKS1_(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %19, label %15

15:                                               ; preds = %5
  %16 = add i64 %13, -1
  %17 = tail call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v316segment_index_ofEm(i64 noundef %16)
  %18 = add i64 %17, 1
  br label %19

19:                                               ; preds = %5, %15
  %20 = phi i64 [ %18, %15 ], [ 0, %5 ]
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = tail call noundef i64 @_ZNVK3tbb8internal11atomic_implImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %21)
  %23 = icmp ult i64 %20, %22
  br i1 %23, label %.critedge, label %.preheader

.preheader:                                       ; preds = %19
  %24 = icmp ult i64 %22, %20
  br i1 %24, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.preheader, %28
  %.0118136 = phi i64 [ %29, %28 ], [ %22, %.preheader ]
  %25 = tail call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %.0118136)
  %26 = mul i64 %25, %1
  %27 = tail call noundef zeroext i1 @_ZN3tbb8internal25concurrent_vector_base_v36helper19incompact_predicateEm(i64 noundef %26)
  br i1 %27, label %28, label %.critedge

28:                                               ; preds = %.lr.ph
  %29 = add i64 %.0118136, 1
  %exitcond.not = icmp eq i64 %29, %20
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !5

.critedge:                                        ; preds = %28, %.lr.ph, %.preheader, %19
  %.1119 = phi i64 [ %20, %19 ], [ %22, %.preheader ], [ %20, %28 ], [ %.0118136, %.lr.ph ]
  %30 = icmp eq i64 %20, %14
  %31 = icmp eq i64 %.1119, %22
  %or.cond133 = and i1 %30, %31
  br i1 %or.cond133, label %104, label %32

32:                                               ; preds = %.critedge
  %33 = getelementptr inbounds i8, ptr %0, i64 24
  %34 = tail call noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_25concurrent_vector_base_v39segment_tEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %33)
  %35 = getelementptr inbounds i8, ptr %2, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN3tbb8internal25concurrent_vector_base_v39segment_tC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %36 = call noundef ptr @_ZSt6fill_nIPN3tbb8internal25concurrent_vector_base_v39segment_tEmS3_ET_S5_T0_RKT1_(ptr noundef nonnull %35, i64 noundef 64, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  store i64 0, ptr %2, align 8, !tbaa !7
  %37 = icmp ne i64 %.1119, %22
  %38 = icmp ne i64 %.1119, 0
  %or.cond = and i1 %37, %38
  br i1 %or.cond, label %39, label %.loopexit

39:                                               ; preds = %32
  %40 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %.1119)
  %41 = call noundef ptr @_ZN3tbb8internal25concurrent_vector_base_v36helper16allocate_segmentERS1_m(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %40)
  call void @_ZN3tbb8internal25concurrent_vector_base_v39segment_t5storeILNS_16memory_semanticsE3EEEvPv(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef %41) #6
  store i64 %.1119, ptr %2, align 8, !tbaa !7
  %42 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %22)
  br i1 %.not, label %._crit_edge, label %.lr.ph142

._crit_edge:                                      ; preds = %54, %39
  %43 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %34, i64 %.1119
  %44 = call noundef ptr @_ZSt4copyIPN3tbb8internal25concurrent_vector_base_v39segment_tES4_ET0_T_S6_S5_(ptr noundef %34, ptr noundef nonnull %43, ptr noundef nonnull %35)
  br label %78

.lr.ph142:                                        ; preds = %39, %54
  %.0113141 = phi i64 [ %56, %54 ], [ 0, %39 ]
  %.0114140 = phi i64 [ %.sink, %54 ], [ 0, %39 ]
  %.0116139 = phi i64 [ %56, %54 ], [ %42, %39 ]
  %45 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %.0114140)
  %46 = add i64 %.0113141, %.0116139
  %.not130 = icmp ult i64 %46, %13
  %47 = sub i64 %13, %.0113141
  %spec.select = select i1 %.not130, i64 %.0116139, i64 %47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %48 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %34, i64 %.0114140
  %49 = invoke ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %48)
          to label %50 unwind label %60

50:                                               ; preds = %.lr.ph142
  %51 = mul i64 %45, %1
  %52 = getelementptr inbounds i8, ptr %41, i64 %51
  store ptr %49, ptr %7, align 8
  %53 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIvEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %7)
  invoke void %4(ptr noundef %52, ptr noundef %53, i64 noundef %spec.select)
          to label %54 unwind label %60

54:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %.not132 = icmp eq i64 %.0114140, 0
  %55 = add nuw i64 %.0114140, 1
  %.sink = select i1 %.not132, i64 %22, i64 %55
  %56 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %.sink)
  %57 = icmp ult i64 %.sink, %.1119
  %58 = icmp ult i64 %56, %13
  %59 = and i1 %57, %58
  br i1 %59, label %.lr.ph142, label %._crit_edge, !llvm.loop !12

60:                                               ; preds = %50, %.lr.ph142
  %61 = landingpad { ptr, i32 }
          catch ptr null
  %62 = extractvalue { ptr, i32 } %61, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %63 = call ptr @__cxa_begin_catch(ptr %62) #6
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #6
  %64 = load i64, ptr %2, align 8, !tbaa !7
  %65 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %.0114140)
  %66 = add i64 %65, %spec.select
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperC2EPNS1_9segment_tEmmmmm(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull %35, i64 noundef %64, i64 noundef %1, i64 noundef 0, i64 noundef 0, i64 noundef %66) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helper12destroy_bodyC2EPFvPvmE(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %3)
  %67 = invoke noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v36helper5applyINS2_12destroy_bodyEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %68 unwind label %69

68:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  invoke void @__cxa_rethrow() #7
          to label %108 unwind label %71

69:                                               ; preds = %60
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %73

71:                                               ; preds = %68
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %73

73:                                               ; preds = %71, %69
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @_ZN3tbb8internal25concurrent_vector_base_v36helperD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #6
  invoke void @__cxa_end_catch()
          to label %74 unwind label %105

74:                                               ; preds = %73
  resume { ptr, i32 } %.pn

75:                                               ; preds = %78
  store i64 %22, ptr %2, align 8, !tbaa !7
  %76 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %21, i64 noundef %.1119)
  %77 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %22)
  br i1 %.not, label %.loopexit, label %.lr.ph148

78:                                               ; preds = %._crit_edge, %78
  %.0109143 = phi i64 [ 0, %._crit_edge ], [ %83, %78 ]
  %79 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %34, i64 %.0109143
  %80 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_baseEm(i64 noundef %.0109143)
  %81 = mul i64 %80, %1
  %82 = getelementptr inbounds i8, ptr %41, i64 %81
  call void @_ZN3tbb8internal25concurrent_vector_base_v39segment_t5storeILNS_16memory_semanticsE3EEEvPv(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef %82) #6
  %83 = add nuw i64 %.0109143, 1
  %exitcond153.not = icmp eq i64 %83, %.1119
  br i1 %exitcond153.not, label %75, label %78, !llvm.loop !13

.lr.ph148:                                        ; preds = %75, %.lr.ph148
  %.0146 = phi i64 [ %90, %.lr.ph148 ], [ 0, %75 ]
  %.0108145 = phi i64 [ %.sink156, %.lr.ph148 ], [ 0, %75 ]
  %.2144 = phi i64 [ %90, %.lr.ph148 ], [ %77, %75 ]
  %84 = add i64 %.0146, %.2144
  %.not128 = icmp ult i64 %84, %13
  %85 = sub i64 %13, %.0146
  %spec.select134 = select i1 %.not128, i64 %.2144, i64 %85
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %86 = getelementptr inbounds [64 x %"class.tbb::internal::concurrent_vector_base_v3::segment_t"], ptr %35, i64 0, i64 %.0108145
  %87 = call ptr @_ZNK3tbb8internal25concurrent_vector_base_v39segment_t4loadILNS_16memory_semanticsE3EEENS1_15segment_value_tEv(ptr noundef nonnull align 8 dereferenceable(8) %86)
  store ptr %87, ptr %10, align 8
  %88 = call noundef ptr @_ZNK3tbb8internal25concurrent_vector_base_v315segment_value_t7pointerIvEEPT_v(ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void %3(ptr noundef %88, i64 noundef %spec.select134)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %.not129 = icmp eq i64 %.0108145, 0
  %89 = add nuw i64 %.0108145, 1
  %.sink156 = select i1 %.not129, i64 %22, i64 %89
  %90 = call noundef i64 @_ZN3tbb8internal25concurrent_vector_base_v312segment_sizeEm(i64 noundef %.sink156)
  %91 = icmp ult i64 %.sink156, %.1119
  %92 = icmp ult i64 %90, %13
  %93 = and i1 %91, %92
  br i1 %93, label %.lr.ph148, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %.lr.ph148, %75, %32
  %94 = icmp ult i64 %20, %14
  br i1 %94, label %95, label %104

95:                                               ; preds = %.loopexit
  store i64 %22, ptr %2, align 8, !tbaa !7
  %96 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %34, i64 %20
  %97 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %34, i64 %14
  %98 = getelementptr inbounds %"class.tbb::internal::concurrent_vector_base_v3::segment_t", ptr %35, i64 %20
  %99 = call noundef ptr @_ZSt4copyIPN3tbb8internal25concurrent_vector_base_v39segment_tES4_ET0_T_S6_S5_(ptr noundef %96, ptr noundef nonnull %97, ptr noundef nonnull %98)
  %100 = sub i64 %14, %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  call void @_ZN3tbb8internal25concurrent_vector_base_v39segment_tC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %101 = call noundef ptr @_ZSt6fill_nIPN3tbb8internal25concurrent_vector_base_v39segment_tEmS3_ET_S5_T0_RKT1_(ptr noundef %96, i64 noundef %100, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br i1 %38, label %104, label %102

102:                                              ; preds = %95
  %103 = call noundef i64 @_ZN3tbb6atomicImEaSEm(ptr noundef nonnull align 8 dereferenceable(8) %21, i64 noundef 0)
  br label %104

104:                                              ; preds = %.loopexit, %102, %95, %.critedge
  %.0112 = phi ptr [ null, %.critedge ], [ %2, %95 ], [ %2, %102 ], [ %2, %.loopexit ]
  ret ptr %.0112

105:                                              ; preds = %73
  %106 = landingpad { ptr, i32 }
          catch ptr null
  %107 = extractvalue { ptr, i32 } %106, 0
  call void @__clang_call_terminate(ptr %107) #8
  unreachable

108:                                              ; preds = %68
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internal25concurrent_vector_base_v36helper19incompact_predicateEm(i64 noundef) local_unnamed_addr #5 align 2

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

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

declare void @__cxa_rethrow() local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

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 = { noinline noreturn nounwind uwtable "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 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }
attributes #8 = { noreturn 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 = !{!8, !9, i64 0}
!8 = !{!"_ZTSN3tbb8internal25concurrent_vector_base_v323internal_segments_tableE", !9, i64 0, !10, i64 8}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}


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