; LLVM IR from ardiloot/NonlinearTMM :: NonlinearTMM/src/eigen-3.4.0/unsupported/test (cxx11_tensor_thread_pool)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Eigen::ThreadPoolTempl" = type { %"class.Eigen::ThreadPoolInterface", [4 x i8], i32, i8, %"class.Eigen::MaxSizeVector", %"class.Eigen::MaxSizeVector.14", %"class.Eigen::MaxSizeVector.15", i32, %"struct.std::atomic", %"struct.std::atomic.16", %"struct.std::atomic.16", %"struct.std::atomic.16", %"class.Eigen::EventCount" }
%"class.Eigen::ThreadPoolInterface" = type { ptr }
%"class.Eigen::MaxSizeVector" = type { i64, i64, ptr }
%"class.Eigen::MaxSizeVector.14" = type { i64, i64, ptr }
%"class.Eigen::MaxSizeVector.15" = type { i64, i64, ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"struct.std::atomic.16" = type { %"struct.std::__atomic_base.17" }
%"struct.std::__atomic_base.17" = type { i8 }
%"class.Eigen::EventCount" = type { %"struct.std::atomic.18", ptr }
%"struct.std::atomic.18" = type { %"struct.std::__atomic_base.19" }
%"struct.std::__atomic_base.19" = type { i64 }
%"struct.Eigen::StlThreadEnvironment" = type { i8 }
%"struct.Eigen::ThreadPoolDevice" = type { ptr, i32, ptr }

@_ZN5EigenL12g_test_stackB5cxx11E = external hidden global %"class.std::vector", align 8
@.str.28 = external hidden unnamed_addr constant [130 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [60 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z11verify_implbPKcS0_iS0_(i1 noundef zeroext, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN5Eigen8internal6randomIiEENS0_13random_retvalINS0_36global_math_functions_filtering_baseIT_vE4typeEE4typeERKS4_SA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Eigen15ThreadPoolTemplINS_20StlThreadEnvironmentEEC2EiS1_(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z24test_threadpool_allocateP13TestAllocator(ptr noundef %0) #3 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.Eigen::ThreadPoolTempl", align 8
  %10 = alloca %"struct.Eigen::StlThreadEnvironment", align 1
  %11 = alloca %"struct.Eigen::ThreadPoolDevice", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 2, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 11, ptr %5, align 4, !tbaa !9
  %18 = call noundef i32 @_ZN5Eigen8internal6randomIiEENS0_13random_retvalINS0_36global_math_functions_filtering_baseIT_vE4typeEE4typeERKS4_SA_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  store i32 %18, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 11, ptr %8, align 4, !tbaa !9
  %19 = call noundef i32 @_ZN5Eigen8internal6randomIiEENS0_13random_retvalINS0_36global_math_functions_filtering_baseIT_vE4typeEE4typeERKS4_SA_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  store i32 %19, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 128, ptr %9) #4
  %20 = load i32, ptr %3, align 4, !tbaa !9
  call void @_ZN5Eigen15ThreadPoolTemplINS_20StlThreadEnvironmentEEC2EiS1_(ptr noundef nonnull align 8 dereferenceable(128) %9, i32 noundef %20)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  %21 = load i32, ptr %3, align 4, !tbaa !9
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  invoke void @_ZN5Eigen16ThreadPoolDeviceC2EPNS_19ThreadPoolInterfaceEiPNS_9AllocatorE(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef %9, i32 noundef %21, ptr noundef %22)
          to label %23 unwind label %29

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

24:                                               ; preds = %38, %23
  %25 = load i32, ptr %14, align 4, !tbaa !9
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %33, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %45

29:                                               ; preds = %45, %1
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %12, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %13, align 4
  br label %75

33:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %34 = invoke noundef ptr @_ZNK5Eigen16ThreadPoolDevice8allocateEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 512)
          to label %35 unwind label %41

35:                                               ; preds = %33
  store ptr %34, ptr %15, align 8, !tbaa !5
  %36 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZNK5Eigen16ThreadPoolDevice10deallocateEPv(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef %36)
          to label %37 unwind label %41

37:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %38

38:                                               ; preds = %37
  %39 = load i32, ptr %14, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %14, align 4, !tbaa !9
  br label %24, !llvm.loop !11

41:                                               ; preds = %35, %33
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %12, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %75

45:                                               ; preds = %28
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  %48 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5EigenL12g_test_stackB5cxx11E) #4
  %49 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %48) #4
  invoke void @_Z11verify_implbPKcS0_iS0_(i1 noundef zeroext %47, ptr noundef %49, ptr noundef @.str.28, i32 noundef 668, ptr noundef @.str.32)
          to label %50 unwind label %29

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = invoke noundef i32 @_ZNK13TestAllocator11alloc_countEv(ptr noundef nonnull align 8 dereferenceable(16) %51)
          to label %53 unwind label %67

53:                                               ; preds = %50
  store i32 %52, ptr %16, align 4, !tbaa !9
  %54 = invoke noundef zeroext i1 @_ZN5Eigen13test_is_equalIiiEEbRKT_RKT0_b(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %6, i1 noundef zeroext true)
          to label %55 unwind label %67

55:                                               ; preds = %53
  %56 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5EigenL12g_test_stackB5cxx11E) #4
  %57 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %56) #4
  invoke void @_Z11verify_implbPKcS0_iS0_(i1 noundef zeroext %54, ptr noundef %57, ptr noundef @.str.28, i32 noundef 669, ptr noundef @.str.33)
          to label %58 unwind label %67

58:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = invoke noundef i32 @_ZNK13TestAllocator13dealloc_countEv(ptr noundef nonnull align 8 dereferenceable(16) %59)
          to label %61 unwind label %71

61:                                               ; preds = %58
  store i32 %60, ptr %17, align 4, !tbaa !9
  %62 = invoke noundef zeroext i1 @_ZN5Eigen13test_is_equalIiiEEbRKT_RKT0_b(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %6, i1 noundef zeroext true)
          to label %63 unwind label %71

63:                                               ; preds = %61
  %64 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5EigenL12g_test_stackB5cxx11E) #4
  %65 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %64) #4
  invoke void @_Z11verify_implbPKcS0_iS0_(i1 noundef zeroext %62, ptr noundef %65, ptr noundef @.str.28, i32 noundef 670, ptr noundef @.str.34)
          to label %66 unwind label %71

66:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @_ZN5Eigen15ThreadPoolTemplINS_20StlThreadEnvironmentEED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %9) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void

67:                                               ; preds = %55, %53, %50
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %12, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %75

71:                                               ; preds = %63, %61, %58
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %12, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %75

75:                                               ; preds = %71, %67, %41, %29
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @_ZN5Eigen15ThreadPoolTemplINS_20StlThreadEnvironmentEED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %9) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr %12, align 8
  %78 = load i32, ptr %13, align 4
  %79 = insertvalue { ptr, i32 } poison, ptr %77, 0
  %80 = insertvalue { ptr, i32 } %79, i32 %78, 1
  resume { ptr, i32 } %80
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK5Eigen16ThreadPoolDevice8allocateEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Eigen16ThreadPoolDevice10deallocateEPv(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5Eigen13test_is_equalIiiEEbRKT_RKT0_b(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i1 noundef zeroext) #3

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

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

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

!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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Eigen::ThreadPoolTempl" = type { %"class.Eigen::ThreadPoolInterface", [4 x i8], i32, i8, %"class.Eigen::MaxSizeVector", %"class.Eigen::MaxSizeVector.14", %"class.Eigen::MaxSizeVector.15", i32, %"struct.std::atomic", %"struct.std::atomic.16", %"struct.std::atomic.16", %"struct.std::atomic.16", %"class.Eigen::EventCount" }
%"class.Eigen::ThreadPoolInterface" = type { ptr }
%"class.Eigen::MaxSizeVector" = type { i64, i64, ptr }
%"class.Eigen::MaxSizeVector.14" = type { i64, i64, ptr }
%"class.Eigen::MaxSizeVector.15" = type { i64, i64, ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"struct.std::atomic.16" = type { %"struct.std::__atomic_base.17" }
%"struct.std::__atomic_base.17" = type { i8 }
%"class.Eigen::EventCount" = type { %"struct.std::atomic.18", ptr }
%"struct.std::atomic.18" = type { %"struct.std::__atomic_base.19" }
%"struct.std::__atomic_base.19" = type { i64 }
%"struct.Eigen::ThreadPoolDevice" = type { ptr, i32, ptr }

@_ZN5EigenL12g_test_stackB5cxx11E = external hidden global %"class.std::vector", align 8
@.str.28 = external hidden unnamed_addr constant [130 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [60 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z11verify_implbPKcS0_iS0_(i1 noundef zeroext, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN5Eigen8internal6randomIiEENS0_13random_retvalINS0_36global_math_functions_filtering_baseIT_vE4typeEE4typeERKS4_SA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Eigen15ThreadPoolTemplINS_20StlThreadEnvironmentEEC2EiS1_(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z24test_threadpool_allocateP13TestAllocator(ptr noundef %0) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.Eigen::ThreadPoolTempl", align 8
  %8 = alloca %"struct.Eigen::ThreadPoolDevice", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 2, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 11, ptr %3, align 4, !tbaa !5
  %11 = call noundef i32 @_ZN5Eigen8internal6randomIiEENS0_13random_retvalINS0_36global_math_functions_filtering_baseIT_vE4typeEE4typeERKS4_SA_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 2, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 11, ptr %6, align 4, !tbaa !5
  %12 = call noundef i32 @_ZN5Eigen8internal6randomIiEENS0_13random_retvalINS0_36global_math_functions_filtering_baseIT_vE4typeEE4typeERKS4_SA_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  store i32 %12, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %7) #4
  call void @_ZN5Eigen15ThreadPoolTemplINS_20StlThreadEnvironmentEEC2EiS1_(ptr noundef nonnull align 8 dereferenceable(128) %7, i32 noundef %11)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  call void @_ZN5Eigen16ThreadPoolDeviceC2EPNS_19ThreadPoolInterfaceEiPNS_9AllocatorE(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull %7, i32 noundef %11, ptr noundef %0)
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %21, %1
  %14 = icmp ne ptr %0, null
  %15 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5EigenL12g_test_stackB5cxx11E) #4
  %16 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  invoke void @_Z11verify_implbPKcS0_iS0_(i1 noundef zeroext %14, ptr noundef %16, ptr noundef nonnull @.str.28, i32 noundef 668, ptr noundef nonnull @.str.32)
          to label %26 unwind label %17

17:                                               ; preds = %._crit_edge
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %43

.lr.ph:                                           ; preds = %1, %21
  %.01013 = phi i32 [ %22, %21 ], [ 0, %1 ]
  %19 = invoke noundef ptr @_ZNK5Eigen16ThreadPoolDevice8allocateEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 512)
          to label %20 unwind label %24

20:                                               ; preds = %.lr.ph
  invoke void @_ZNK5Eigen16ThreadPoolDevice10deallocateEPv(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef %19)
          to label %21 unwind label %24

21:                                               ; preds = %20
  %22 = add nuw nsw i32 %.01013, 1
  %23 = icmp slt i32 %22, %12
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !9

24:                                               ; preds = %20, %.lr.ph
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %43

26:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %27 = call noundef i32 @_ZNK13TestAllocator11alloc_countEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  store i32 %27, ptr %9, align 4, !tbaa !5
  %28 = invoke noundef zeroext i1 @_ZN5Eigen13test_is_equalIiiEEbRKT_RKT0_b(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %4, i1 noundef zeroext true)
          to label %29 unwind label %39

29:                                               ; preds = %26
  %30 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5EigenL12g_test_stackB5cxx11E) #4
  %31 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %30) #4
  invoke void @_Z11verify_implbPKcS0_iS0_(i1 noundef zeroext %28, ptr noundef %31, ptr noundef nonnull @.str.28, i32 noundef 669, ptr noundef nonnull @.str.33)
          to label %32 unwind label %39

32:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %33 = call noundef i32 @_ZNK13TestAllocator13dealloc_countEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  store i32 %33, ptr %10, align 4, !tbaa !5
  %34 = invoke noundef zeroext i1 @_ZN5Eigen13test_is_equalIiiEEbRKT_RKT0_b(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %4, i1 noundef zeroext true)
          to label %35 unwind label %41

35:                                               ; preds = %32
  %36 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5EigenL12g_test_stackB5cxx11E) #4
  %37 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %36) #4
  invoke void @_Z11verify_implbPKcS0_iS0_(i1 noundef zeroext %34, ptr noundef %37, ptr noundef nonnull @.str.28, i32 noundef 670, ptr noundef nonnull @.str.34)
          to label %38 unwind label %41

38:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  call void @_ZN5Eigen15ThreadPoolTemplINS_20StlThreadEnvironmentEED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %7) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  ret void

39:                                               ; preds = %29, %26
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  br label %43

41:                                               ; preds = %35, %32
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  br label %43

43:                                               ; preds = %41, %39, %24, %17
  %.pn = phi { ptr, i32 } [ %25, %24 ], [ %42, %41 ], [ %40, %39 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  call void @_ZN5Eigen15ThreadPoolTemplINS_20StlThreadEnvironmentEED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %7) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK5Eigen16ThreadPoolDevice8allocateEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Eigen16ThreadPoolDevice10deallocateEPv(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5Eigen13test_is_equalIiiEEbRKT_RKT0_b(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i1 noundef zeroext) local_unnamed_addr #3

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

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

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

!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"}


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