; LLVM IR from vczh/herodb :: Kernel/Source/Vlpp.ll (ZN2vl18threading_internal14ThreadPoolProcEPNS_6ThreadEPv)

; 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.vl::SpinLock" = type { %"class.vl::Object", i64 }
%"class.vl::Object" = type { ptr }
%"class.vl::Ptr.1125" = type { ptr, ptr, ptr, ptr }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"struct.vl::threading_internal::ThreadPoolData" = type { %"class.vl::Semaphore", %"class.vl::EventObject", %"class.vl::Ptr.1125", ptr, i8, %"class.vl::collections::List.1126" }
%"class.vl::Semaphore" = type { %"class.vl::WaitableObject", ptr }
%"class.vl::WaitableObject" = type { %"class.vl::Object" }
%"class.vl::EventObject" = type { %"class.vl::WaitableObject", ptr }
%"class.vl::collections::List.1126" = type { %"class.vl::collections::ListBase.base.1132", %"class.vl::collections::IEnumerable.1130" }
%"class.vl::collections::ListBase.base.1132" = type <{ %"class.vl::collections::ArrayBase.base.1131", i64, i8 }>
%"class.vl::collections::ArrayBase.base.1131" = type { %"class.vl::collections::ListStore.1129", ptr, i64 }
%"class.vl::collections::ListStore.1129" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.1130" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"struct.vl::threading_internal::ThreadPoolTask" = type { %"class.vl::Func", %"class.vl::Ptr.1125" }
%"class.vl::Func" = type { %"class.vl::Object", %"class.vl::Ptr.1124" }
%"class.vl::Ptr.1124" = type { ptr, ptr, ptr, ptr }

@_ZN2vl18threading_internal14threadPoolLockE = external dso_local global %"class.vl::SpinLock", align 8
@_ZN2vl18threading_internal14threadPoolDataE = external dso_local global ptr, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_end_catch()

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl18ThreadLocalStorage11FixStoragesEv() #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl18ThreadLocalStorage13ClearStoragesEv() #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl11EventObject6SignalEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl9Semaphore4WaitEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl18threading_internal14ThreadPoolProcEPNS_6ThreadEPv(ptr noundef %0, ptr noundef %1) #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.vl::Ptr.1125", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca %"class.vl::SpinLock::Scope", align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  br label %12

12:                                               ; preds = %106, %2
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #4
  call void @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %13 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %14 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolData", ptr %13, i32 0, i32 0
  %15 = invoke noundef zeroext i1 @_ZN2vl9Semaphore4WaitEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %16 unwind label %25

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  store i8 1, ptr %8, align 1, !tbaa !9
  %17 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %18 = trunc i8 %17 to i1
  br i1 %18, label %19, label %72

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #4
  invoke void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) @_ZN2vl18threading_internal14threadPoolLockE)
          to label %20 unwind label %29

20:                                               ; preds = %19
  store ptr %10, ptr %9, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %69, %20
  %22 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %23 = trunc i8 %22 to i1
  br i1 %23, label %33, label %24

24:                                               ; preds = %21
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %71

25:                                               ; preds = %88, %72, %12
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %6, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %7, align 4
  br label %107

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

33:                                               ; preds = %21
  %34 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolData", ptr %34, i32 0, i32 2
  %36 = invoke noundef zeroext i1 @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %35)
          to label %37 unwind label %50

37:                                               ; preds = %33
  br i1 %36, label %38, label %54

38:                                               ; preds = %37
  %39 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolData", ptr %39, i32 0, i32 2
  %41 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %40)
          to label %42 unwind label %50

42:                                               ; preds = %38
  %43 = invoke noundef ptr @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %44 unwind label %50

44:                                               ; preds = %42
  %45 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolTask", ptr %43, i32 0, i32 1
  %46 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolData", ptr %46, i32 0, i32 2
  %48 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(32) %47, ptr noundef nonnull align 8 dereferenceable(32) %45)
          to label %49 unwind label %50

49:                                               ; preds = %44
  br label %54

50:                                               ; preds = %59, %54, %44, %42, %38, %33
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %6, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %7, align 4
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #4
  br label %70

54:                                               ; preds = %49, %37
  %55 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolData", ptr %55, i32 0, i32 2
  %57 = invoke noundef zeroext i1 @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %56)
          to label %58 unwind label %50

58:                                               ; preds = %54
  br i1 %57, label %68, label %59

59:                                               ; preds = %58
  %60 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolData", ptr %60, i32 0, i32 2
  %62 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolData", ptr %62, i32 0, i32 3
  store ptr %61, ptr %63, align 8, !tbaa !13
  %64 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolData", ptr %64, i32 0, i32 1
  %66 = invoke noundef zeroext i1 @_ZN2vl11EventObject6SignalEv(ptr noundef nonnull align 8 dereferenceable(16) %65)
          to label %67 unwind label %50

67:                                               ; preds = %59
  br label %68

68:                                               ; preds = %67, %58
  br label %69

69:                                               ; preds = %68
  store i8 0, ptr %8, align 1, !tbaa !9
  br label %21, !llvm.loop !25

70:                                               ; preds = %50, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  br label %107

71:                                               ; preds = %24
  br label %72

72:                                               ; preds = %71, %16
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  %73 = invoke noundef zeroext i1 @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %74 unwind label %25

74:                                               ; preds = %72
  br i1 %73, label %75, label %96

75:                                               ; preds = %74
  call void @_ZN2vl18ThreadLocalStorage11FixStoragesEv()
  %76 = invoke noundef ptr @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %77 unwind label %81

77:                                               ; preds = %75
  %78 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolTask", ptr %76, i32 0, i32 0
  invoke void @_ZNK2vl4FuncIFvvEEclEv(ptr noundef nonnull align 8 dereferenceable(40) %78)
          to label %79 unwind label %81

79:                                               ; preds = %77
  invoke void @_ZN2vl18ThreadLocalStorage13ClearStoragesEv()
          to label %80 unwind label %81

80:                                               ; preds = %79
  br label %90

81:                                               ; preds = %79, %77, %75
  %82 = landingpad { ptr, i32 }
          catch ptr null
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %6, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %7, align 4
  br label %85

85:                                               ; preds = %81
  %86 = load ptr, ptr %6, align 8
  %87 = call ptr @__cxa_begin_catch(ptr %86) #4
  invoke void @_ZN2vl18ThreadLocalStorage13ClearStoragesEv()
          to label %88 unwind label %91

88:                                               ; preds = %85
  invoke void @__cxa_end_catch()
          to label %89 unwind label %25

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89, %80
  br label %103

91:                                               ; preds = %85
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %6, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %7, align 4
  invoke void @__cxa_end_catch()
          to label %95 unwind label %114

95:                                               ; preds = %91
  br label %107

96:                                               ; preds = %74
  %97 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.vl::threading_internal::ThreadPoolData", ptr %97, i32 0, i32 4
  %99 = load volatile i8, ptr %98, align 8, !tbaa !27, !range !11, !noundef !12
  %100 = trunc i8 %99 to i1
  br i1 %100, label %101, label %102

101:                                              ; preds = %96
  store i32 1, ptr %11, align 4
  br label %104

102:                                              ; preds = %96
  br label %103

103:                                              ; preds = %102, %90
  store i32 0, ptr %11, align 4
  br label %104

104:                                              ; preds = %103, %101
  call void @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  %105 = load i32, ptr %11, align 4
  switch i32 %105, label %117 [
    i32 0, label %106
    i32 1, label %108
  ]

106:                                              ; preds = %104
  br label %12, !llvm.loop !28

107:                                              ; preds = %95, %70, %25
  call void @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  br label %109

108:                                              ; preds = %104
  ret void

109:                                              ; preds = %107
  %110 = load ptr, ptr %6, align 8
  %111 = load i32, ptr %7, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113

114:                                              ; preds = %91
  %115 = landingpad { ptr, i32 }
          catch ptr null
  %116 = extractvalue { ptr, i32 } %115, 0
  call void @__clang_call_terminate(ptr %116) #5
  unreachable

117:                                              ; preds = %104
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2vl4FuncIFvvEEclEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

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

declare void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr, ptr)

declare void @_ZN2vl8SpinLock5ScopeD1Ev(ptr)

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !6, i64 64}
!14 = !{!"_ZTSN2vl18threading_internal14ThreadPoolDataE", !15, i64 0, !18, i64 16, !19, i64 32, !6, i64 64, !10, i64 72, !20, i64 80}
!15 = !{!"_ZTSN2vl9SemaphoreE", !16, i64 0, !6, i64 8}
!16 = !{!"_ZTSN2vl14WaitableObjectE", !17, i64 0}
!17 = !{!"_ZTSN2vl6ObjectE"}
!18 = !{!"_ZTSN2vl11EventObjectE", !16, i64 0, !6, i64 8}
!19 = !{!"_ZTSN2vl3PtrINS_18threading_internal14ThreadPoolTaskEEE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"_ZTSN2vl11collections4ListIPNS_6ThreadES3_EE", !21, i64 0}
!21 = !{!"_ZTSN2vl11collections8ListBaseIPNS_6ThreadES3_EE", !22, i64 0, !24, i64 24, !10, i64 32}
!22 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS_6ThreadEEE", !23, i64 0, !6, i64 8, !24, i64 16}
!23 = !{!"_ZTSN2vl11collections9ListStoreIPNS_6ThreadELb1EEE", !17, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!14, !10, i64 72}
!28 = distinct !{!28, !26}


; 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.vl::SpinLock" = type { %"class.vl::Object", i64 }
%"class.vl::Object" = type { ptr }
%"class.vl::Ptr.1125" = type { ptr, ptr, ptr, ptr }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }

@_ZN2vl18threading_internal14threadPoolLockE = external dso_local global %"class.vl::SpinLock", align 8
@_ZN2vl18threading_internal14threadPoolDataE = external dso_local local_unnamed_addr global ptr, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl18ThreadLocalStorage11FixStoragesEv() local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl18ThreadLocalStorage13ClearStoragesEv() local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl11EventObject6SignalEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl9Semaphore4WaitEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl18threading_internal14ThreadPoolProcEPNS_6ThreadEPv(ptr nocapture noundef readnone %0, ptr nocapture noundef readnone %1) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.vl::Ptr.1125", align 8
  %4 = alloca %"class.vl::SpinLock::Scope", align 8
  br label %5

5:                                                ; preds = %55, %2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  call void @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %6 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %7 = invoke noundef zeroext i1 @_ZN2vl9Semaphore4WaitEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %8 unwind label %9

8:                                                ; preds = %5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  invoke void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) @_ZN2vl18threading_internal14threadPoolLockE)
          to label %13 unwind label %11

9:                                                ; preds = %47, %5
  %10 = landingpad { ptr, i32 }
          cleanup
  br label %56

11:                                               ; preds = %8
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %56

13:                                               ; preds = %8
  %14 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 32
  %16 = call noundef zeroext i1 @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %15)
  br i1 %16, label %17, label %29

17:                                               ; preds = %13
  %18 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 32
  %20 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %21 unwind label %27

21:                                               ; preds = %17
  %22 = call noundef ptr @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %23 = getelementptr inbounds i8, ptr %22, i64 40
  %24 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 32
  %26 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull align 8 dereferenceable(32) %23)
          to label %29 unwind label %27

27:                                               ; preds = %33, %21, %17
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br label %56

29:                                               ; preds = %21, %13
  %30 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 32
  %32 = call noundef zeroext i1 @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %31)
  br i1 %32, label %.critedge, label %33

33:                                               ; preds = %29
  %34 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 32
  %36 = getelementptr inbounds i8, ptr %34, i64 64
  store ptr %35, ptr %36, align 8, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %34, i64 16
  %38 = invoke noundef zeroext i1 @_ZN2vl11EventObject6SignalEv(ptr noundef nonnull align 8 dereferenceable(16) %37)
          to label %.critedge unwind label %27

.critedge:                                        ; preds = %29, %33
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  %39 = call noundef zeroext i1 @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  br i1 %39, label %40, label %50

40:                                               ; preds = %.critedge
  call void @_ZN2vl18ThreadLocalStorage11FixStoragesEv()
  %41 = call noundef ptr @_ZNK2vl3PtrINS_18threading_internal14ThreadPoolTaskEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  invoke void @_ZNK2vl4FuncIFvvEEclEv(ptr noundef nonnull align 8 dereferenceable(40) %41)
          to label %42 unwind label %43

42:                                               ; preds = %40
  invoke void @_ZN2vl18ThreadLocalStorage13ClearStoragesEv()
          to label %55 unwind label %43

43:                                               ; preds = %42, %40
  %44 = landingpad { ptr, i32 }
          catch ptr null
  %45 = extractvalue { ptr, i32 } %44, 0
  %46 = call ptr @__cxa_begin_catch(ptr %45) #4
  invoke void @_ZN2vl18ThreadLocalStorage13ClearStoragesEv()
          to label %47 unwind label %48

47:                                               ; preds = %43
  invoke void @__cxa_end_catch()
          to label %55 unwind label %9

48:                                               ; preds = %43
  %49 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %56 unwind label %58

50:                                               ; preds = %.critedge
  %51 = load ptr, ptr @_ZN2vl18threading_internal14threadPoolDataE, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %51, i64 72
  %53 = load volatile i8, ptr %52, align 8, !tbaa !22, !range !23, !noundef !24
  %54 = trunc nuw i8 %53 to i1
  br i1 %54, label %57, label %55

55:                                               ; preds = %47, %42, %50
  call void @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  br label %5

56:                                               ; preds = %11, %27, %48, %9
  %.pn.pn = phi { ptr, i32 } [ %10, %9 ], [ %49, %48 ], [ %28, %27 ], [ %12, %11 ]
  call void @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn.pn

57:                                               ; preds = %50
  call void @_ZN2vl3PtrINS_18threading_internal14ThreadPoolTaskEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  ret void

58:                                               ; preds = %48
  %59 = landingpad { ptr, i32 }
          catch ptr null
  %60 = extractvalue { ptr, i32 } %59, 0
  call void @__clang_call_terminate(ptr %60) #5
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2vl4FuncIFvvEEclEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3 align 2

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

declare void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr, ptr) local_unnamed_addr

declare void @_ZN2vl8SpinLock5ScopeD1Ev(ptr) local_unnamed_addr

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 64}
!10 = !{!"_ZTSN2vl18threading_internal14ThreadPoolDataE", !11, i64 0, !14, i64 16, !15, i64 32, !6, i64 64, !16, i64 72, !17, i64 80}
!11 = !{!"_ZTSN2vl9SemaphoreE", !12, i64 0, !6, i64 8}
!12 = !{!"_ZTSN2vl14WaitableObjectE", !13, i64 0}
!13 = !{!"_ZTSN2vl6ObjectE"}
!14 = !{!"_ZTSN2vl11EventObjectE", !12, i64 0, !6, i64 8}
!15 = !{!"_ZTSN2vl3PtrINS_18threading_internal14ThreadPoolTaskEEE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSN2vl11collections4ListIPNS_6ThreadES3_EE", !18, i64 0}
!18 = !{!"_ZTSN2vl11collections8ListBaseIPNS_6ThreadES3_EE", !19, i64 0, !21, i64 24, !16, i64 32}
!19 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS_6ThreadEEE", !20, i64 0, !6, i64 8, !21, i64 16}
!20 = !{!"_ZTSN2vl11collections9ListStoreIPNS_6ThreadELb1EEE", !13, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!10, !16, i64 72}
!23 = !{i8 0, i8 2}
!24 = !{}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass