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

; 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::micro_queue::push_finalizer" = type { i64, ptr }
%"class.tbb::spin_mutex::scoped_lock" = type <{ ptr, i8, [7 x i8] }>
%"class.tbb::internal::concurrent_queue_base" = type { ptr, ptr, i64, i64, i64 }
%"struct.tbb::internal::concurrent_queue_base::page" = type { ptr, i64 }
%"struct.tbb::internal::micro_queue" = type <{ %"struct.tbb::atomic", %"struct.tbb::atomic.0", %"struct.tbb::atomic", %"struct.tbb::atomic.0", %"class.tbb::spin_mutex", [7 x i8] }>
%"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 { ptr }
%"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 }
%"class.tbb::spin_mutex" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3tbb8internal11micro_queue4pushEPKvmRNS0_21concurrent_queue_baseE(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(40) %3) #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.tbb::internal::micro_queue::push_finalizer", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.tbb::spin_mutex::scoped_lock", align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8
  %18 = load i64, ptr %7, align 8, !tbaa !9
  %19 = and i64 %18, -8
  store i64 %19, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %20 = load i64, ptr %7, align 8, !tbaa !9
  %21 = udiv i64 %20, 8
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.tbb::internal::concurrent_queue_base", ptr %22, i32 0, i32 3
  %24 = load i64, ptr %23, align 8, !tbaa !11
  %25 = call noundef i64 @_ZN3tbb8internal19modulo_power_of_twoImmEET_S2_T0_(i64 noundef %21, i64 noundef %24)
  store i64 %25, ptr %10, align 8, !tbaa !9
  %26 = load i64, ptr %10, align 8, !tbaa !9
  %27 = icmp ne i64 %26, 0
  br i1 %27, label %43, label %28

28:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.tbb::internal::concurrent_queue_base", ptr %29, i32 0, i32 3
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.tbb::internal::concurrent_queue_base", ptr %32, i32 0, i32 4
  %34 = load i64, ptr %33, align 8, !tbaa !13
  %35 = mul i64 %31, %34
  %36 = add i64 16, %35
  store i64 %36, ptr %11, align 8, !tbaa !9
  %37 = load i64, ptr %11, align 8, !tbaa !9
  %38 = call noalias noundef nonnull ptr @_Znwm(i64 noundef %37) #6
  store ptr %38, ptr %9, align 8, !tbaa !5
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.tbb::internal::concurrent_queue_base::page", ptr %39, i32 0, i32 1
  store i64 0, ptr %40, align 8, !tbaa !14
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.tbb::internal::concurrent_queue_base::page", ptr %41, i32 0, i32 0
  store ptr null, ptr %42, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %43

43:                                               ; preds = %28, %4
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %44 = load i64, ptr %7, align 8, !tbaa !9
  %45 = add i64 %44, 8
  call void @_ZN3tbb8internal11micro_queue14push_finalizerC2ERS1_m(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(33) %17, i64 noundef %45)
  %46 = getelementptr inbounds %"struct.tbb::internal::micro_queue", ptr %17, i32 0, i32 3
  %47 = load i64, ptr %7, align 8, !tbaa !9
  invoke void @_ZN3tbb8internal18spin_wait_until_eqINS_6atomicImEEmEEvRVKT_T0_(ptr noundef nonnull align 8 dereferenceable(8) %46, i64 noundef %47)
          to label %48 unwind label %63

48:                                               ; preds = %43
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %91

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %52 = getelementptr inbounds %"struct.tbb::internal::micro_queue", ptr %17, i32 0, i32 4
  invoke void @_ZN3tbb10spin_mutex11scoped_lockC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %15, ptr noundef nonnull align 1 dereferenceable(1) %52)
          to label %53 unwind label %67

53:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %54 = getelementptr inbounds %"struct.tbb::internal::micro_queue", ptr %17, i32 0, i32 2
  %55 = invoke noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_21concurrent_queue_base4pageEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %54)
          to label %56 unwind label %71

56:                                               ; preds = %53
  store ptr %55, ptr %16, align 8, !tbaa !5
  %57 = load ptr, ptr %16, align 8, !tbaa !5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %75

59:                                               ; preds = %56
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = load ptr, ptr %16, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.tbb::internal::concurrent_queue_base::page", ptr %61, i32 0, i32 0
  store ptr %60, ptr %62, align 8, !tbaa !16
  br label %80

63:                                               ; preds = %95, %91, %43
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %13, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %14, align 4
  br label %110

67:                                               ; preds = %51
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %13, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %14, align 4
  br label %90

71:                                               ; preds = %75, %53
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %13, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %89

75:                                               ; preds = %56
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.tbb::internal::micro_queue", ptr %17, i32 0, i32 0
  %78 = invoke noundef ptr @_ZN3tbb6atomicIPNS_8internal21concurrent_queue_base4pageEEaSES4_(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef %76)
          to label %79 unwind label %71

79:                                               ; preds = %75
  br label %80

80:                                               ; preds = %79, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.tbb::internal::micro_queue", ptr %17, i32 0, i32 2
  %83 = invoke noundef ptr @_ZN3tbb6atomicIPNS_8internal21concurrent_queue_base4pageEEaSES4_(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef %81)
          to label %84 unwind label %85

84:                                               ; preds = %80
  call void @_ZN3tbb10spin_mutex11scoped_lockD2Ev(ptr noundef nonnull align 8 dereferenceable(9) %15) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %95

85:                                               ; preds = %80
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %13, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %14, align 4
  br label %89

89:                                               ; preds = %85, %71
  call void @_ZN3tbb10spin_mutex11scoped_lockD2Ev(ptr noundef nonnull align 8 dereferenceable(9) %15) #5
  br label %90

90:                                               ; preds = %89, %67
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %110

91:                                               ; preds = %48
  %92 = getelementptr inbounds %"struct.tbb::internal::micro_queue", ptr %17, i32 0, i32 2
  %93 = invoke noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_21concurrent_queue_base4pageEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %92)
          to label %94 unwind label %63

94:                                               ; preds = %91
  store ptr %93, ptr %9, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %94, %84
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = load i64, ptr %10, align 8, !tbaa !9
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = load ptr, ptr %96, align 8, !tbaa !17
  %101 = getelementptr inbounds ptr, ptr %100, i64 0
  %102 = load ptr, ptr %101, align 8
  invoke void %102(ptr noundef nonnull align 8 dereferenceable(40) %96, ptr noundef nonnull align 8 dereferenceable(16) %97, i64 noundef %98, ptr noundef %99)
          to label %103 unwind label %63

103:                                              ; preds = %95
  %104 = load i64, ptr %10, align 8, !tbaa !9
  %105 = shl i64 1, %104
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.tbb::internal::concurrent_queue_base::page", ptr %106, i32 0, i32 1
  %108 = load i64, ptr %107, align 8, !tbaa !14
  %109 = or i64 %108, %105
  store i64 %109, ptr %107, align 8, !tbaa !14
  call void @_ZN3tbb8internal11micro_queue14push_finalizerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret void

110:                                              ; preds = %90, %63
  call void @_ZN3tbb8internal11micro_queue14push_finalizerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %111

111:                                              ; preds = %110
  %112 = load ptr, ptr %13, align 8
  %113 = load i32, ptr %14, align 4
  %114 = insertvalue { ptr, i32 } poison, ptr %112, 0
  %115 = insertvalue { ptr, i32 } %114, i32 %113, 1
  resume { ptr, i32 } %115
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3tbb8internal19modulo_power_of_twoImmEET_S2_T0_(i64 noundef, i64 noundef) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb10spin_mutex11scoped_lockD2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #4 align 2

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

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 = { 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 = { nobuiltin allocsize(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 = { 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 }
attributes #6 = { allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTSN3tbb8internal21concurrent_queue_baseE", !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!13 = !{!12, !10, i64 32}
!14 = !{!15, !10, i64 8}
!15 = !{!"_ZTSN3tbb8internal21concurrent_queue_base4pageE", !6, i64 0, !10, i64 8}
!16 = !{!15, !6, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}


; 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::micro_queue::push_finalizer" = type { i64, ptr }
%"class.tbb::spin_mutex::scoped_lock" = type <{ ptr, i8, [7 x i8] }>

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3tbb8internal11micro_queue4pushEPKvmRNS0_21concurrent_queue_baseE(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(40) %3) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.tbb::internal::micro_queue::push_finalizer", align 8
  %6 = alloca %"class.tbb::spin_mutex::scoped_lock", align 8
  %7 = and i64 %2, -8
  %8 = lshr i64 %2, 3
  %9 = getelementptr inbounds i8, ptr %3, i64 24
  %10 = load i64, ptr %9, align 8, !tbaa !5
  %11 = tail call noundef i64 @_ZN3tbb8internal19modulo_power_of_twoImmEET_S2_T0_(i64 noundef %8, i64 noundef %10)
  %.not = icmp eq i64 %11, 0
  br i1 %.not, label %12, label %19

12:                                               ; preds = %4
  %13 = load i64, ptr %9, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %3, i64 32
  %15 = load i64, ptr %14, align 8, !tbaa !11
  %16 = mul i64 %15, %13
  %17 = add i64 %16, 16
  %18 = tail call noalias noundef nonnull ptr @_Znwm(i64 noundef %17) #6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %18, i8 0, i64 16, i1 false)
  br label %19

19:                                               ; preds = %12, %4
  %.028 = phi ptr [ null, %4 ], [ %18, %12 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %20 = add i64 %7, 8
  call void @_ZN3tbb8internal11micro_queue14push_finalizerC2ERS1_m(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(33) %0, i64 noundef %20)
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  invoke void @_ZN3tbb8internal18spin_wait_until_eqINS_6atomicImEEmEEvRVKT_T0_(ptr noundef nonnull align 8 dereferenceable(8) %21, i64 noundef %7)
          to label %22 unwind label %30

22:                                               ; preds = %19
  %.not31 = icmp eq ptr %.028, null
  br i1 %.not31, label %45, label %23

23:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %24 = getelementptr inbounds i8, ptr %0, i64 32
  invoke void @_ZN3tbb10spin_mutex11scoped_lockC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %6, ptr noundef nonnull align 1 dereferenceable(1) %24)
          to label %25 unwind label %32

25:                                               ; preds = %23
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = invoke noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_21concurrent_queue_base4pageEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %28 unwind label %34

28:                                               ; preds = %25
  %.not32 = icmp eq ptr %27, null
  br i1 %.not32, label %36, label %29

29:                                               ; preds = %28
  store ptr %.028, ptr %27, align 8, !tbaa !12
  br label %38

30:                                               ; preds = %48, %45, %19
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %56

32:                                               ; preds = %23
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %44

34:                                               ; preds = %36, %25
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %43

36:                                               ; preds = %28
  %37 = invoke noundef ptr @_ZN3tbb6atomicIPNS_8internal21concurrent_queue_base4pageEEaSES4_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %.028)
          to label %38 unwind label %34

38:                                               ; preds = %36, %29
  %39 = invoke noundef ptr @_ZN3tbb6atomicIPNS_8internal21concurrent_queue_base4pageEEaSES4_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull %.028)
          to label %40 unwind label %41

40:                                               ; preds = %38
  call void @_ZN3tbb10spin_mutex11scoped_lockD2Ev(ptr noundef nonnull align 8 dereferenceable(9) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  br label %48

41:                                               ; preds = %38
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %43

43:                                               ; preds = %41, %34
  %.pn = phi { ptr, i32 } [ %42, %41 ], [ %35, %34 ]
  call void @_ZN3tbb10spin_mutex11scoped_lockD2Ev(ptr noundef nonnull align 8 dereferenceable(9) %6) #7
  br label %44

44:                                               ; preds = %43, %32
  %.pn.pn = phi { ptr, i32 } [ %.pn, %43 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  br label %56

45:                                               ; preds = %22
  %46 = getelementptr inbounds i8, ptr %0, i64 16
  %47 = invoke noundef ptr @_ZNVK3tbb8internal11atomic_implIPNS0_21concurrent_queue_base4pageEEcvS4_Ev(ptr noundef nonnull align 8 dereferenceable(8) %46)
          to label %48 unwind label %30

48:                                               ; preds = %45, %40
  %.129 = phi ptr [ %.028, %40 ], [ %47, %45 ]
  %49 = load ptr, ptr %3, align 8, !tbaa !14
  %50 = load ptr, ptr %49, align 8
  invoke void %50(ptr noundef nonnull align 8 dereferenceable(40) %3, ptr noundef nonnull align 8 dereferenceable(16) %.129, i64 noundef %11, ptr noundef %1)
          to label %51 unwind label %30

51:                                               ; preds = %48
  %52 = shl nuw i64 1, %11
  %53 = getelementptr inbounds i8, ptr %.129, i64 8
  %54 = load i64, ptr %53, align 8, !tbaa !16
  %55 = or i64 %54, %52
  store i64 %55, ptr %53, align 8, !tbaa !16
  call void @_ZN3tbb8internal11micro_queue14push_finalizerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  ret void

56:                                               ; preds = %44, %30
  %.pn35 = phi { ptr, i32 } [ %31, %30 ], [ %.pn.pn, %44 ]
  call void @_ZN3tbb8internal11micro_queue14push_finalizerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn35
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3tbb8internal19modulo_power_of_twoImmEET_S2_T0_(i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

; 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 nounwind uwtable
declare dso_local void @_ZN3tbb8internal11micro_queue14push_finalizerC2ERS1_m(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(33), i64 noundef) unnamed_addr #4 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb10spin_mutex11scoped_lockD2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #4 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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 = { 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 = { nobuiltin allocsize(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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { allocsize(0) }
attributes #7 = { 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, !10, i64 24}
!6 = !{!"_ZTSN3tbb8internal21concurrent_queue_baseE", !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !10, i64 32}
!12 = !{!13, !7, i64 0}
!13 = !{!"_ZTSN3tbb8internal21concurrent_queue_base4pageE", !7, i64 0, !10, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !9, i64 0}
!16 = !{!13, !10, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass