; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/old/test_concurrent_vector_v2.ll (Z17TestResizeAndCopyv)

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

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

@FooCount = external dso_local global %"struct.tbb::atomic", align 8
@.str = external hidden unnamed_addr constant [100 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17TestResizeAndCopyv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca %"class.tbb::concurrent_vector", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.tbb::concurrent_vector", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %204, %0
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = icmp sle i32 %15, 128
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %205

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %19 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %19, ptr %3, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %192, %18
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = icmp sle i32 %21, 128
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  store i32 5, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %203

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %25 = call noundef i64 @_ZNVK3tbb8internal11atomic_implIlEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) @FooCount)
  store i64 %25, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  call void @_ZN3tbb17concurrent_vectorI3FooEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %26 = load i64, ptr %4, align 8, !tbaa !9
  %27 = invoke noundef i64 @_ZNVK3tbb8internal11atomic_implIlEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) @FooCount)
          to label %28 unwind label %54

28:                                               ; preds = %24
  %29 = icmp eq i64 %26, %27
  br i1 %29, label %30, label %31

30:                                               ; preds = %28
  br label %33

31:                                               ; preds = %28
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 93, ptr noundef @.str.1, ptr noundef null)
          to label %32 unwind label %54

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32, %30
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = invoke noundef i64 @_ZN3tbb17concurrent_vectorI3FooE7grow_byEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %35)
          to label %37 unwind label %54

37:                                               ; preds = %33
  %38 = load i64, ptr %4, align 8, !tbaa !9
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = add nsw i64 %38, %40
  %42 = invoke noundef i64 @_ZNVK3tbb8internal11atomic_implIlEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) @FooCount)
          to label %43 unwind label %54

43:                                               ; preds = %37
  %44 = icmp eq i64 %41, %42
  br i1 %44, label %45, label %46

45:                                               ; preds = %43
  br label %48

46:                                               ; preds = %43
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 95, ptr noundef @.str.2, ptr noundef null)
          to label %47 unwind label %54

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %68, %48
  %50 = load i32, ptr %8, align 4, !tbaa !5
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %58, label %53

53:                                               ; preds = %49
  store i32 8, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %75

54:                                               ; preds = %147, %140, %87, %78, %75, %46, %37, %33, %31, %24
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %6, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %7, align 4
  br label %202

58:                                               ; preds = %49
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = mul nsw i32 %59, %60
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI3FooEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %63)
          to label %65 unwind label %71

65:                                               ; preds = %58
  %66 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %64)
          to label %67 unwind label %71

67:                                               ; preds = %65
  store i32 %61, ptr %66, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %8, align 4, !tbaa !5
  br label %49, !llvm.loop !11

71:                                               ; preds = %65, %58
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %6, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %202

75:                                               ; preds = %53
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  invoke void @_ZN3tbb17concurrent_vectorI3FooE16grow_to_at_leastEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %77)
          to label %78 unwind label %54

78:                                               ; preds = %75
  %79 = load i64, ptr %4, align 8, !tbaa !9
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = add nsw i64 %79, %81
  %83 = invoke noundef i64 @_ZNVK3tbb8internal11atomic_implIlEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) @FooCount)
          to label %84 unwind label %54

84:                                               ; preds = %78
  %85 = icmp eq i64 %82, %83
  br i1 %85, label %86, label %87

86:                                               ; preds = %84
  br label %89

87:                                               ; preds = %84
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 99, ptr noundef @.str.3, ptr noundef null)
          to label %88 unwind label %54

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88, %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %137, %89
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 11, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %140

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = load i32, ptr %1, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %99, label %103

99:                                               ; preds = %95
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = mul nsw i32 %100, %101
  br label %104

103:                                              ; preds = %95
  br label %104

104:                                              ; preds = %103, %99
  %105 = phi i32 [ %102, %99 ], [ 42, %103 ]
  store i32 %105, ptr %10, align 4, !tbaa !5
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI3FooEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %107)
          to label %109 unwind label %132

109:                                              ; preds = %104
  %110 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %108)
          to label %111 unwind label %132

111:                                              ; preds = %109
  %112 = load i32, ptr %110, align 4, !tbaa !5
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = icmp ne i32 %112, %113
  br i1 %114, label %115, label %136

115:                                              ; preds = %111
  %116 = load i32, ptr %1, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = load i32, ptr %3, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI3FooEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %123)
          to label %125 unwind label %132

125:                                              ; preds = %115
  %126 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %124)
          to label %127 unwind label %132

127:                                              ; preds = %125
  %128 = load i32, ptr %126, align 4, !tbaa !5
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef 103, i64 noundef %117, i64 noundef %119, i64 noundef %121, i32 noundef %128, i32 noundef %129)
          to label %131 unwind label %132

131:                                              ; preds = %127
  br label %136

132:                                              ; preds = %127, %125, %115, %109, %104
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %6, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %202

136:                                              ; preds = %131, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %9, align 4, !tbaa !5
  br label %90, !llvm.loop !13

140:                                              ; preds = %94
  %141 = invoke noundef i64 @_ZNK3tbb17concurrent_vectorI3FooE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %142 unwind label %54

142:                                              ; preds = %140
  %143 = load i32, ptr %3, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = icmp eq i64 %141, %144
  br i1 %145, label %146, label %147

146:                                              ; preds = %142
  br label %149

147:                                              ; preds = %142
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 105, ptr noundef @.str.5, ptr noundef null)
          to label %148 unwind label %54

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148, %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %164, %149
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = load i32, ptr %3, align 4, !tbaa !5
  %153 = icmp slt i32 %151, %152
  br i1 %153, label %155, label %154

154:                                              ; preds = %150
  store i32 14, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %171

155:                                              ; preds = %150
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = xor i32 %156, -1
  %158 = load i32, ptr %11, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI3FooEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %159)
          to label %161 unwind label %167

161:                                              ; preds = %155
  %162 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %160)
          to label %163 unwind label %167

163:                                              ; preds = %161
  store i32 %157, ptr %162, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %11, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %11, align 4, !tbaa !5
  br label %150, !llvm.loop !14

167:                                              ; preds = %161, %155
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %6, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %202

171:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr %5, ptr %12, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  %172 = load ptr, ptr %12, align 8, !tbaa !15
  invoke void @_ZN3tbb17concurrent_vectorI3FooEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %172)
          to label %173 unwind label %193

173:                                              ; preds = %171
  %174 = load ptr, ptr %12, align 8, !tbaa !15
  %175 = load i32, ptr %3, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = load i32, ptr %1, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  invoke void @_ZL11CheckVectorRKN3tbb17concurrent_vectorI3FooEEmm(ptr noundef nonnull align 8 dereferenceable(32) %174, i64 noundef %176, i64 noundef %178)
          to label %179 unwind label %197

179:                                              ; preds = %173
  invoke void @_ZN3tbb17concurrent_vectorI3FooE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %180 unwind label %197

180:                                              ; preds = %179
  %181 = invoke noundef zeroext i1 @_ZNK3tbb17concurrent_vectorI3FooE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %182 unwind label %197

182:                                              ; preds = %180
  br i1 %181, label %183, label %184

183:                                              ; preds = %182
  br label %186

184:                                              ; preds = %182
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 114, ptr noundef @.str.6, ptr noundef null)
          to label %185 unwind label %197

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185, %183
  %187 = load i32, ptr %3, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = load i32, ptr %1, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  invoke void @_ZL11CheckVectorRKN3tbb17concurrent_vectorI3FooEEmm(ptr noundef nonnull align 8 dereferenceable(32) %13, i64 noundef %188, i64 noundef %190)
          to label %191 unwind label %197

191:                                              ; preds = %186
  call void @_ZN3tbb17concurrent_vectorI3FooED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @_ZN3tbb17concurrent_vectorI3FooED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %192

192:                                              ; preds = %191
  call void @_Z8NextSizeRi(ptr noundef nonnull align 4 dereferenceable(4) %3)
  br label %20, !llvm.loop !17

193:                                              ; preds = %171
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %6, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %7, align 4
  br label %201

197:                                              ; preds = %186, %184, %180, %179, %173
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %6, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %7, align 4
  call void @_ZN3tbb17concurrent_vectorI3FooED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  br label %201

201:                                              ; preds = %197, %193
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %202

202:                                              ; preds = %201, %167, %132, %71, %54
  call void @_ZN3tbb17concurrent_vectorI3FooED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %206

203:                                              ; preds = %23
  br label %204

204:                                              ; preds = %203
  call void @_Z8NextSizeRi(ptr noundef nonnull align 4 dereferenceable(4) %1)
  br label %14, !llvm.loop !18

205:                                              ; preds = %17
  ret void

206:                                              ; preds = %202
  %207 = load ptr, ptr %6, align 8
  %208 = load i32, ptr %7, align 4
  %209 = insertvalue { ptr, i32 } poison, ptr %207, 0
  %210 = insertvalue { ptr, i32 } %209, i32 %208, 1
  resume { ptr, i32 } %210
}

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8)) #0 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 @_ZN3tbb17concurrent_vectorI3FooE16grow_to_at_leastEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #0 align 2

declare i32 @printf(ptr noundef, ...) #2

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11CheckVectorRKN3tbb17concurrent_vectorI3FooEEmm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) #0

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

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

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

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

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

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

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

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

@FooCount = external dso_local global %"struct.tbb::atomic", align 8
@.str = external hidden unnamed_addr constant [100 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17TestResizeAndCopyv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.tbb::concurrent_vector", align 8
  %4 = alloca %"class.tbb::concurrent_vector", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %6

5:                                                ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void

6:                                                ; preds = %0, %8
  %7 = phi i32 [ 0, %0 ], [ %.pr, %8 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 %7, ptr %2, align 4, !tbaa !5
  br label %10

8:                                                ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @_Z8NextSizeRi(ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.pr = load i32, ptr %1, align 4, !tbaa !5
  %9 = icmp slt i32 %.pr, 129
  br i1 %9, label %6, label %5, !llvm.loop !9

10:                                               ; preds = %6, %120
  %11 = call noundef i64 @_ZNVK3tbb8internal11atomic_implIlEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) @FooCount)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @_ZN3tbb17concurrent_vectorI3FooEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %12 = invoke noundef i64 @_ZNVK3tbb8internal11atomic_implIlEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) @FooCount)
          to label %13 unwind label %33

13:                                               ; preds = %10
  %14 = icmp eq i64 %11, %12
  br i1 %14, label %16, label %15

15:                                               ; preds = %13
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 93, ptr noundef nonnull @.str.1, ptr noundef null)
          to label %16 unwind label %33

16:                                               ; preds = %15, %13
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = invoke noundef i64 @_ZN3tbb17concurrent_vectorI3FooE7grow_byEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %18)
          to label %20 unwind label %33

20:                                               ; preds = %16
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = invoke noundef i64 @_ZNVK3tbb8internal11atomic_implIlEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) @FooCount)
          to label %23 unwind label %33

23:                                               ; preds = %20
  %24 = sext i32 %21 to i64
  %25 = add nsw i64 %11, %24
  %26 = icmp eq i64 %25, %22
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 95, ptr noundef nonnull @.str.2, ptr noundef null)
          to label %28 unwind label %33

28:                                               ; preds = %27, %23
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %39, %28
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  invoke void @_ZN3tbb17concurrent_vectorI3FooE16grow_to_at_leastEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %32)
          to label %46 unwind label %33

33:                                               ; preds = %90, %._crit_edge39, %53, %46, %._crit_edge, %27, %20, %16, %15, %10
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %127

.lr.ph:                                           ; preds = %28, %39
  %indvars.iv = phi i64 [ %indvars.iv.next, %39 ], [ 0, %28 ]
  %35 = mul nuw nsw i64 %indvars.iv, %indvars.iv
  %36 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI3FooEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %indvars.iv)
          to label %37 unwind label %44

37:                                               ; preds = %.lr.ph
  %38 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %36)
          to label %39 unwind label %44

39:                                               ; preds = %37
  %40 = trunc nuw i64 %35 to i32
  store i32 %40, ptr %38, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = icmp slt i64 %indvars.iv.next, %42
  br i1 %43, label %.lr.ph, label %._crit_edge, !llvm.loop !11

44:                                               ; preds = %37, %.lr.ph
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %127

46:                                               ; preds = %._crit_edge
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = invoke noundef i64 @_ZNVK3tbb8internal11atomic_implIlEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) @FooCount)
          to label %49 unwind label %33

49:                                               ; preds = %46
  %50 = sext i32 %47 to i64
  %51 = add nsw i64 %11, %50
  %52 = icmp eq i64 %51, %48
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 99, ptr noundef nonnull @.str.3, ptr noundef null)
          to label %54 unwind label %33

54:                                               ; preds = %53, %49
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph38, label %._crit_edge39

._crit_edge39:                                    ; preds = %82, %54
  %57 = invoke noundef i64 @_ZNK3tbb17concurrent_vectorI3FooE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %86 unwind label %33

.lr.ph38:                                         ; preds = %54, %82
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %82 ], [ 0, %54 ]
  %58 = load i32, ptr %1, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv45, %59
  %61 = mul nuw nsw i64 %indvars.iv45, %indvars.iv45
  %62 = trunc nuw i64 %61 to i32
  %63 = select i1 %60, i32 %62, i32 42
  %64 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI3FooEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %indvars.iv45)
          to label %65 unwind label %80

65:                                               ; preds = %.lr.ph38
  %66 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %64)
          to label %67 unwind label %80

67:                                               ; preds = %65
  %68 = load i32, ptr %66, align 4, !tbaa !5
  %.not = icmp eq i32 %68, %63
  br i1 %.not, label %82, label %69

69:                                               ; preds = %67
  %70 = load i32, ptr %1, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI3FooEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %indvars.iv45)
          to label %75 unwind label %80

75:                                               ; preds = %69
  %76 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %74)
          to label %77 unwind label %80

77:                                               ; preds = %75
  %78 = load i32, ptr %76, align 4, !tbaa !5
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 103, i64 noundef %71, i64 noundef %73, i64 noundef %indvars.iv45, i32 noundef %78, i32 noundef %63)
  br label %82

80:                                               ; preds = %75, %69, %65, %.lr.ph38
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %127

82:                                               ; preds = %77, %67
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %83 = load i32, ptr %2, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = icmp slt i64 %indvars.iv.next46, %84
  br i1 %85, label %.lr.ph38, label %._crit_edge39, !llvm.loop !12

86:                                               ; preds = %._crit_edge39
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = icmp eq i64 %57, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 105, ptr noundef nonnull @.str.5, ptr noundef null)
          to label %._crit_edge51 unwind label %33

._crit_edge51:                                    ; preds = %90
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %._crit_edge51, %86
  %92 = phi i32 [ %.pre, %._crit_edge51 ], [ %87, %86 ]
  %93 = icmp sgt i32 %92, 0
  br i1 %93, label %.lr.ph42, label %._crit_edge43

._crit_edge43:                                    ; preds = %99, %91
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  invoke void @_ZN3tbb17concurrent_vectorI3FooEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %105 unwind label %122

.lr.ph42:                                         ; preds = %91, %99
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %99 ], [ 0, %91 ]
  %94 = trunc nuw nsw i64 %indvars.iv48 to i32
  %95 = xor i32 %94, -1
  %96 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI3FooEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %indvars.iv48)
          to label %97 unwind label %103

97:                                               ; preds = %.lr.ph42
  %98 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %96)
          to label %99 unwind label %103

99:                                               ; preds = %97
  store i32 %95, ptr %98, align 4, !tbaa !5
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = icmp slt i64 %indvars.iv.next49, %101
  br i1 %102, label %.lr.ph42, label %._crit_edge43, !llvm.loop !13

103:                                              ; preds = %97, %.lr.ph42
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %127

105:                                              ; preds = %._crit_edge43
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = load i32, ptr %1, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  invoke void @_ZL11CheckVectorRKN3tbb17concurrent_vectorI3FooEEmm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %107, i64 noundef %109)
          to label %110 unwind label %124

110:                                              ; preds = %105
  invoke void @_ZN3tbb17concurrent_vectorI3FooE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %111 unwind label %124

111:                                              ; preds = %110
  %112 = invoke noundef zeroext i1 @_ZNK3tbb17concurrent_vectorI3FooE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %113 unwind label %124

113:                                              ; preds = %111
  br i1 %112, label %115, label %114

114:                                              ; preds = %113
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 114, ptr noundef nonnull @.str.6, ptr noundef null)
          to label %115 unwind label %124

115:                                              ; preds = %114, %113
  %116 = load i32, ptr %2, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = load i32, ptr %1, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  invoke void @_ZL11CheckVectorRKN3tbb17concurrent_vectorI3FooEEmm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %117, i64 noundef %119)
          to label %120 unwind label %124

120:                                              ; preds = %115
  call void @_ZN3tbb17concurrent_vectorI3FooED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @_ZN3tbb17concurrent_vectorI3FooED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @_Z8NextSizeRi(ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.pr34 = load i32, ptr %2, align 4, !tbaa !5
  %121 = icmp slt i32 %.pr34, 129
  br i1 %121, label %10, label %8, !llvm.loop !14

122:                                              ; preds = %._crit_edge43
  %123 = landingpad { ptr, i32 }
          cleanup
  br label %126

124:                                              ; preds = %115, %114, %111, %110, %105
  %125 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3tbb17concurrent_vectorI3FooED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  br label %126

126:                                              ; preds = %124, %122
  %.pn = phi { ptr, i32 } [ %125, %124 ], [ %123, %122 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  br label %127

127:                                              ; preds = %126, %103, %80, %44, %33
  %.pn32 = phi { ptr, i32 } [ %45, %44 ], [ %81, %80 ], [ %104, %103 ], [ %.pn, %126 ], [ %34, %33 ]
  call void @_ZN3tbb17concurrent_vectorI3FooED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn32
}

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 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 @_ZN3tbb17concurrent_vectorI3FooE16grow_to_at_leastEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11CheckVectorRKN3tbb17concurrent_vectorI3FooEEmm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3tbb17concurrent_vectorI3FooE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass