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

; 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::concurrent_vector.14" = 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 }

@.str = external hidden unnamed_addr constant [100 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [18 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

11:                                               ; preds = %138, %0
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp sle i32 %12, 128
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 2, ptr %3, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %133, %15
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = icmp sle i32 %17, 128
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #4
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  invoke void @_ZN3tbb17concurrent_vectorI13FooWithAssignE16grow_to_at_leastEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %22)
          to label %23 unwind label %29

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %43, %23
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %33, label %28

28:                                               ; preds = %24
  store i32 8, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %50

29:                                               ; preds = %20
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %5, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %6, align 4
  br label %136

33:                                               ; preds = %24
  %34 = load i32, ptr %7, align 4, !tbaa !5
  %35 = load i32, ptr %7, align 4, !tbaa !5
  %36 = mul nsw i32 %34, %35
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI13FooWithAssignEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %38)
          to label %40 unwind label %46

40:                                               ; preds = %33
  %41 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %39)
          to label %42 unwind label %46

42:                                               ; preds = %40
  store i32 %36, ptr %41, align 4, !tbaa !5
  br label %43

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

46:                                               ; preds = %40, %33
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %136

50:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #4
  invoke void @_ZN3tbb17concurrent_vectorI13FooWithAssignEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %51 unwind label %60

51:                                               ; preds = %50
  %52 = load i32, ptr %1, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  invoke void @_ZN3tbb17concurrent_vectorI13FooWithAssignE16grow_to_at_leastEm(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 noundef %53)
          to label %54 unwind label %64

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

55:                                               ; preds = %77, %54
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = load i32, ptr %1, align 4, !tbaa !5
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %68, label %59

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

60:                                               ; preds = %50
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %5, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %6, align 4
  br label %135

64:                                               ; preds = %101, %94, %92, %87, %86, %84, %51
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %5, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %6, align 4
  br label %134

68:                                               ; preds = %55
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = sub nsw i32 0, %69
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI13FooWithAssignEixEm(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 noundef %72)
          to label %74 unwind label %80

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

76:                                               ; preds = %74
  store i32 %70, ptr %75, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %9, align 4, !tbaa !5
  br label %55, !llvm.loop !11

80:                                               ; preds = %74, %68
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %5, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %134

84:                                               ; preds = %59
  %85 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3tbb17concurrent_vectorI13FooWithAssignEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %86 unwind label %64

86:                                               ; preds = %84
  invoke void @_ZN3tbb17concurrent_vectorI13FooWithAssignE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %87 unwind label %64

87:                                               ; preds = %86
  %88 = invoke noundef i64 @_ZNK3tbb17concurrent_vectorI13FooWithAssignE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %89 unwind label %64

89:                                               ; preds = %87
  %90 = icmp eq i64 %88, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %89
  br label %94

92:                                               ; preds = %89
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 444, ptr noundef @.str.38, ptr noundef null)
          to label %93 unwind label %64

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93, %91
  %95 = invoke noundef i64 @_ZNK3tbb17concurrent_vectorI13FooWithAssignE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %96 unwind label %64

96:                                               ; preds = %94
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = icmp eq i64 %95, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %96
  br label %103

101:                                              ; preds = %96
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 445, ptr noundef @.str.39, ptr noundef null)
          to label %102 unwind label %64

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102, %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %125, %103
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  store i32 14, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %132

109:                                              ; preds = %104
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI13FooWithAssignEixEm(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 noundef %111)
          to label %113 unwind label %128

113:                                              ; preds = %109
  %114 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %112)
          to label %115 unwind label %128

115:                                              ; preds = %113
  %116 = load i32, ptr %114, align 4, !tbaa !5
  %117 = load i32, ptr %10, align 4, !tbaa !5
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = mul nsw i32 %117, %118
  %120 = icmp eq i32 %116, %119
  br i1 %120, label %121, label %122

121:                                              ; preds = %115
  br label %124

122:                                              ; preds = %115
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 447, ptr noundef @.str.40, ptr noundef null)
          to label %123 unwind label %128

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123, %121
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %10, align 4, !tbaa !5
  br label %104, !llvm.loop !12

128:                                              ; preds = %122, %113, %109
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %5, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %134

132:                                              ; preds = %108
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  br label %133

133:                                              ; preds = %132
  call void @_Z8NextSizeRi(ptr noundef nonnull align 4 dereferenceable(4) %3)
  br label %16, !llvm.loop !13

134:                                              ; preds = %128, %80, %64
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  br label %135

135:                                              ; preds = %134, %60
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  br label %136

136:                                              ; preds = %135, %46, %29
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %140

137:                                              ; preds = %19
  br label %138

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

139:                                              ; preds = %14
  ret void

140:                                              ; preds = %136
  %141 = load ptr, ptr %5, align 8
  %142 = load i32, ptr %6, align 4
  %143 = insertvalue { ptr, i32 } poison, ptr %141, 0
  %144 = insertvalue { ptr, i32 } %143, i32 %142, 1
  resume { ptr, i32 } %144
}

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

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

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

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

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

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

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

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


; 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::concurrent_vector.14" = 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 }

@.str = external hidden unnamed_addr constant [100 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [18 x i8], align 1

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

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 #1

; 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 #1 align 2

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

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

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

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

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

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

9:                                                ; preds = %6, %._crit_edge34
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  invoke void @_ZN3tbb17concurrent_vectorI13FooWithAssignE16grow_to_at_leastEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %11)
          to label %.preheader26 unwind label %14

.preheader26:                                     ; preds = %9
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %20, %.preheader26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  invoke void @_ZN3tbb17concurrent_vectorI13FooWithAssignEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %27 unwind label %33

14:                                               ; preds = %9
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %82

.lr.ph:                                           ; preds = %.preheader26, %20
  %indvars.iv = phi i64 [ %indvars.iv.next, %20 ], [ 0, %.preheader26 ]
  %16 = mul nuw nsw i64 %indvars.iv, %indvars.iv
  %17 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI13FooWithAssignEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %indvars.iv)
          to label %18 unwind label %25

18:                                               ; preds = %.lr.ph
  %19 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3Foo3barEv(ptr noundef nonnull align 4 dereferenceable(8) %17)
          to label %20 unwind label %25

20:                                               ; preds = %18
  %21 = trunc nuw i64 %16 to i32
  store i32 %21, ptr %19, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !11

25:                                               ; preds = %18, %.lr.ph
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %82

27:                                               ; preds = %._crit_edge
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  invoke void @_ZN3tbb17concurrent_vectorI13FooWithAssignE16grow_to_at_leastEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %29)
          to label %.preheader unwind label %35

.preheader:                                       ; preds = %27
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph29, label %._crit_edge30

._crit_edge30:                                    ; preds = %40, %.preheader
  %32 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3tbb17concurrent_vectorI13FooWithAssignEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %48 unwind label %35

33:                                               ; preds = %._crit_edge
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %81

35:                                               ; preds = %60, %54, %53, %49, %48, %._crit_edge30, %27
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %80

.lr.ph29:                                         ; preds = %.preheader, %40
  %indvars.iv36 = phi i64 [ %indvars.iv.next37, %40 ], [ 0, %.preheader ]
  %37 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI13FooWithAssignEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv36)
          to label %38 unwind label %46

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

40:                                               ; preds = %38
  %41 = trunc i64 %indvars.iv36 to i32
  %42 = sub i32 0, %41
  store i32 %42, ptr %39, align 4, !tbaa !5
  %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
  %43 = load i32, ptr %1, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = icmp slt i64 %indvars.iv.next37, %44
  br i1 %45, label %.lr.ph29, label %._crit_edge30, !llvm.loop !12

46:                                               ; preds = %38, %.lr.ph29
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %80

48:                                               ; preds = %._crit_edge30
  invoke void @_ZN3tbb17concurrent_vectorI13FooWithAssignE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %49 unwind label %35

49:                                               ; preds = %48
  %50 = invoke noundef i64 @_ZNK3tbb17concurrent_vectorI13FooWithAssignE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %51 unwind label %35

51:                                               ; preds = %49
  %52 = icmp eq i64 %50, 0
  br i1 %52, label %54, label %53

53:                                               ; preds = %51
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 444, ptr noundef nonnull @.str.38, ptr noundef null)
          to label %54 unwind label %35

54:                                               ; preds = %53, %51
  %55 = invoke noundef i64 @_ZNK3tbb17concurrent_vectorI13FooWithAssignE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %56 unwind label %35

56:                                               ; preds = %54
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = icmp eq i64 %55, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 445, ptr noundef nonnull @.str.39, ptr noundef null)
          to label %._crit_edge42 unwind label %35

._crit_edge42:                                    ; preds = %60
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %._crit_edge42, %56
  %62 = phi i32 [ %.pre, %._crit_edge42 ], [ %57, %56 ]
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph33, label %._crit_edge34

._crit_edge34:                                    ; preds = %74, %61
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  call void @_Z8NextSizeRi(ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.pr25 = load i32, ptr %2, align 4, !tbaa !5
  %64 = icmp slt i32 %.pr25, 129
  br i1 %64, label %9, label %7, !llvm.loop !13

.lr.ph33:                                         ; preds = %61, %74
  %indvars.iv39 = phi i64 [ %indvars.iv.next40, %74 ], [ 0, %61 ]
  %65 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3tbb17concurrent_vectorI13FooWithAssignEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv39)
          to label %66 unwind label %78

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

68:                                               ; preds = %66
  %69 = load i32, ptr %67, align 4, !tbaa !5
  %70 = mul nuw nsw i64 %indvars.iv39, %indvars.iv39
  %71 = zext i32 %69 to i64
  %72 = icmp eq i64 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %68
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 447, ptr noundef nonnull @.str.40, ptr noundef null)
          to label %74 unwind label %78

74:                                               ; preds = %68, %73
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next40, %76
  br i1 %77, label %.lr.ph33, label %._crit_edge34, !llvm.loop !14

78:                                               ; preds = %73, %66, %.lr.ph33
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %80

80:                                               ; preds = %78, %46, %35
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %79, %78 ], [ %36, %35 ]
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  br label %81

81:                                               ; preds = %80, %33
  %.pn.pn = phi { ptr, i32 } [ %.pn, %80 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %82

82:                                               ; preds = %81, %25, %14
  %.pn23 = phi { ptr, i32 } [ %26, %25 ], [ %.pn.pn, %81 ], [ %15, %14 ]
  call void @_ZN3tbb17concurrent_vectorI13FooWithAssignED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  resume { ptr, i32 } %.pn23
}

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

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

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { 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: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass