; LLVM IR from wichue/nethello :: src/event/EventLoop.ll (ZN3chw9EventLoop8addEventEiiSt8functionIFviEE)

; 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.chw::LogContextCapture" = type { %"class.std::shared_ptr.31", ptr }
%"class.std::shared_ptr.31" = type { %"class.std::__shared_ptr.32" }
%"class.std::__shared_ptr.32" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%struct.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }
%"class.std::shared_ptr.51" = type { %"class.std::__shared_ptr.52" }
%"class.std::__shared_ptr.52" = type { ptr, %"class.std::__shared_count" }
%"struct.std::pair" = type <{ %"struct.std::__detail::_Node_iterator", i8, [7 x i8] }>
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"class.std::shared_ptr.45" = type { %"class.std::__shared_ptr.46" }
%"class.std::__shared_ptr.46" = type { ptr, %"class.std::__shared_count" }
%"class.std::function.48" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.54 = type { ptr, i32, i32, %"class.std::function" }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.chw::EventLoop" = type { %"class.std::enable_shared_from_this", i8, %"class.std::__cxx11::basic_string", ptr, %"class.chw::Semaphore", %"class.chw::PipeWrap", %"class.std::mutex", %"class.chw::List", %"class.std::shared_ptr.3", i32, %"class.std::unordered_map", %"class.std::unordered_set", %"class.std::multimap" }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.chw::Semaphore" = type { i64, %"class.std::recursive_mutex", %"class.std::_V2::condition_variable_any" }
%"class.std::recursive_mutex" = type { %"class.std::__recursive_mutex_base" }
%"class.std::__recursive_mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::_V2::condition_variable_any" = type { %"class.std::condition_variable", %"class.std::shared_ptr" }
%"class.std::condition_variable" = type { %"class.std::__condvar" }
%"class.std::__condvar" = type { %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.chw::PipeWrap" = type { [2 x i32] }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%"class.chw::List" = type { %"class.std::__cxx11::list" }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<std::shared_ptr<chw::TaskCancelableImp<void ()>>, std::allocator<std::shared_ptr<chw::TaskCancelableImp<void ()>>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<std::shared_ptr<chw::TaskCancelableImp<void ()>>, std::allocator<std::shared_ptr<chw::TaskCancelableImp<void ()>>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::shared_ptr.3" = type { %"class.std::__shared_ptr.4" }
%"class.std::__shared_ptr.4" = type { ptr, %"class.std::__shared_count" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::unordered_set" = type { %"class.std::_Hashtable.11" }
%"class.std::_Hashtable.11" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::multimap" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, std::shared_ptr<chw::TaskCancelableImp<unsigned long ()>>>, std::_Select1st<std::pair<const unsigned long, std::shared_ptr<chw::TaskCancelableImp<unsigned long ()>>>>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, std::shared_ptr<chw::TaskCancelableImp<unsigned long ()>>>, std::_Select1st<std::pair<const unsigned long, std::shared_ptr<chw::TaskCancelableImp<unsigned long ()>>>>, std::less<unsigned long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@__FUNCTION__._ZN3chw9EventLoop8addEventEiiSt8functionIFviEE = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3chw9EventLoop8addEventEiiSt8functionIFviEE(ptr noundef nonnull align 8 dereferenceable(432) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.chw::LogContextCapture", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %struct.epoll_event, align 1
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::shared_ptr.51", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca %"class.std::shared_ptr.45", align 8
  %18 = alloca %"class.std::function.48", align 8
  %19 = alloca %class.anon.54, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8
  %21 = call noundef zeroext i1 @_ZNKSt8functionIFviEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  br i1 %21, label %30, label %22

22:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #8
  %23 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
  call void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(144) %23, i32 noundef 3, ptr noundef @.str.2, ptr noundef @__FUNCTION__._ZN3chw9EventLoop8addEventEiiSt8functionIFviEE, i32 noundef 106, ptr noundef @.str.3)
  %24 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA21_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 1 dereferenceable(21) @.str.4)
          to label %25 unwind label %26

25:                                               ; preds = %22
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #8
  store i32 -1, ptr %5, align 4
  br label %97

26:                                               ; preds = %22
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %11, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %12, align 4
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #8
  br label %99

30:                                               ; preds = %4
  %31 = call noundef zeroext i1 @_ZN3chw9EventLoop15isCurrentThreadEv(ptr noundef nonnull align 8 dereferenceable(432) %20)
  br i1 %31, label %32, label %79

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #8
  call void @llvm.memset.p0.i64(ptr align 1 %13, i8 0, i64 12, i1 false)
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = and i32 %33, 1
  %35 = icmp ne i32 %34, 0
  %36 = zext i1 %35 to i64
  %37 = select i1 %35, i32 1, i32 0
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = and i32 %38, 2
  %40 = icmp ne i32 %39, 0
  %41 = zext i1 %40 to i64
  %42 = select i1 %40, i32 4, i32 0
  %43 = or i32 %37, %42
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = and i32 %44, 4
  %46 = icmp ne i32 %45, 0
  %47 = zext i1 %46 to i64
  %48 = select i1 %46, i32 24, i32 0
  %49 = or i32 %43, %48
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = and i32 %50, 8
  %52 = icmp ne i32 %51, 0
  %53 = zext i1 %52 to i64
  %54 = select i1 %52, i32 0, i32 -2147483648
  %55 = or i32 %49, %54
  %56 = getelementptr inbounds %struct.epoll_event, ptr %13, i32 0, i32 0
  store i32 %55, ptr %56, align 1, !tbaa !11
  %57 = load i32, ptr %7, align 4, !tbaa !9
  %58 = getelementptr inbounds %struct.epoll_event, ptr %13, i32 0, i32 1
  store i32 %57, ptr %58, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %59 = getelementptr inbounds %"class.chw::EventLoop", ptr %20, i32 0, i32 9
  %60 = load i32, ptr %59, align 8, !tbaa !14
  %61 = load i32, ptr %7, align 4, !tbaa !9
  %62 = call i32 @epoll_ctl(i32 noundef %60, i32 noundef 1, i32 noundef %61, ptr noundef %13) #8
  store i32 %62, ptr %14, align 4, !tbaa !9
  %63 = load i32, ptr %14, align 4, !tbaa !9
  %64 = icmp ne i32 %63, -1
  br i1 %64, label %65, label %77

65:                                               ; preds = %32
  %66 = getelementptr inbounds %"class.chw::EventLoop", ptr %20, i32 0, i32 10
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #8
  call void @_ZSt11make_sharedISt8functionIFviEEJS2_EESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.51") align 8 %15, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %67 = invoke { ptr, i8 } @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE7emplaceIJRiS4_EEES9_INSt8__detail14_Node_iteratorISB_Lb0ELb0EEEbEDpOT_(ptr noundef nonnull align 8 dereferenceable(56) %66, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %68 unwind label %73

68:                                               ; preds = %65
  %69 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 0
  %70 = extractvalue { ptr, i8 } %67, 0
  store ptr %70, ptr %69, align 8
  %71 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 1
  %72 = extractvalue { ptr, i8 } %67, 1
  store i8 %72, ptr %71, align 8
  call void @_ZNSt12__shared_ptrISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  br label %77

73:                                               ; preds = %65
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %11, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %12, align 4
  call void @_ZNSt12__shared_ptrISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #8
  br label %99

77:                                               ; preds = %68, %32
  %78 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %78, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #8
  br label %97

79:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 48, ptr %19) #8
  %80 = getelementptr inbounds %class.anon.54, ptr %19, i32 0, i32 0
  store ptr %20, ptr %80, align 8, !tbaa !59
  %81 = getelementptr inbounds %class.anon.54, ptr %19, i32 0, i32 1
  %82 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %82, ptr %81, align 8, !tbaa !63
  %83 = getelementptr inbounds %class.anon.54, ptr %19, i32 0, i32 2
  %84 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %84, ptr %83, align 4, !tbaa !64
  %85 = getelementptr inbounds %class.anon.54, ptr %19, i32 0, i32 3
  call void @_ZNSt8functionIFviEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %85, ptr noundef nonnull align 8 dereferenceable(32) %3)
  invoke void @"_ZNSt8functionIFvvEEC2IZN3chw9EventLoop8addEventEiiS_IFviEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(48) %19)
          to label %86 unwind label %88

86:                                               ; preds = %79
  invoke void @_ZN3chw9EventLoop5asyncESt8functionIFvvEEb(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.45") align 8 %17, ptr noundef nonnull align 8 dereferenceable(432) %20, ptr noundef %18, i1 noundef zeroext true)
          to label %87 unwind label %92

87:                                               ; preds = %86
  call void @_ZNSt12__shared_ptrIN3chw17TaskCancelableImpIFvvEJEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #8
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  call void @"_ZZN3chw9EventLoop8addEventEiiSt8functionIFviEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(48) %19) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #8
  store i32 0, ptr %5, align 4
  br label %97

88:                                               ; preds = %79
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %11, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %12, align 4
  br label %96

92:                                               ; preds = %86
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %11, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %12, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  br label %96

96:                                               ; preds = %92, %88
  call void @"_ZZN3chw9EventLoop8addEventEiiSt8functionIFviEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(48) %19) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #8
  br label %99

97:                                               ; preds = %87, %77, %25
  %98 = load i32, ptr %5, align 4
  ret i32 %98

99:                                               ; preds = %96, %73, %26
  %100 = load ptr, ptr %11, align 8
  %101 = load i32, ptr %12, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

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

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

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

declare noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv() #3

declare void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(144), i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3chw9EventLoop15isCurrentThreadEv(ptr noundef nonnull align 8 dereferenceable(432)) #2 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

; Function Attrs: nounwind
declare i32 @epoll_ctl(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE7emplaceIJRiS4_EEES9_INSt8__detail14_Node_iteratorISB_Lb0ELb0EEEbEDpOT_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedISt8functionIFviEEJS2_EESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.51") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw9EventLoop5asyncESt8functionIFvvEEb(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.45") align 8, ptr noundef nonnull align 8 dereferenceable(432), ptr noundef, i1 noundef zeroext) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN3chw9EventLoop8addEventEiiS_IFviEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZN3chw9EventLoop8addEventEiiSt8functionIFviEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 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 = { 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 = { "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 "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 = { 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 #7 = { 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 #8 = { 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 = !{!12, !10, i64 0}
!12 = !{!"_ZTS11epoll_event", !10, i64 0, !7, i64 4}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 264}
!15 = !{!"_ZTSN3chw9EventLoopE", !16, i64 0, !20, i64 16, !21, i64 24, !6, i64 56, !24, i64 64, !33, i64 176, !34, i64 184, !36, i64 224, !42, i64 248, !10, i64 264, !44, i64 272, !49, i64 328, !51, i64 384}
!16 = !{!"_ZTSSt23enable_shared_from_thisIN3chw9EventLoopEE", !17, i64 0}
!17 = !{!"_ZTSSt8weak_ptrIN3chw9EventLoopEE", !18, i64 0}
!18 = !{!"_ZTSSt10__weak_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !19, i64 8}
!19 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !22, i64 0, !23, i64 8, !7, i64 16}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTSN3chw9SemaphoreE", !23, i64 0, !25, i64 8, !27, i64 48}
!25 = !{!"_ZTSSt15recursive_mutex", !26, i64 0}
!26 = !{!"_ZTSSt22__recursive_mutex_base", !7, i64 0}
!27 = !{!"_ZTSNSt3_V222condition_variable_anyE", !28, i64 0, !30, i64 48}
!28 = !{!"_ZTSSt18condition_variable", !29, i64 0}
!29 = !{!"_ZTSSt9__condvar", !7, i64 0}
!30 = !{!"_ZTSSt10shared_ptrISt5mutexE", !31, i64 0}
!31 = !{!"_ZTSSt12__shared_ptrISt5mutexLN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !32, i64 8}
!32 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!33 = !{!"_ZTSN3chw8PipeWrapE", !7, i64 0}
!34 = !{!"_ZTSSt5mutex", !35, i64 0}
!35 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!36 = !{!"_ZTSN3chw4ListISt10shared_ptrINS_17TaskCancelableImpIFvvEJEEEEEE", !37, i64 0}
!37 = !{!"_ZTSNSt7__cxx114listISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EEE", !38, i64 0}
!38 = !{!"_ZTSNSt7__cxx1110_List_baseISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EEE", !39, i64 0}
!39 = !{!"_ZTSNSt7__cxx1110_List_baseISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EE10_List_implE", !40, i64 0}
!40 = !{!"_ZTSNSt8__detail17_List_node_headerE", !41, i64 0, !23, i64 16}
!41 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!42 = !{!"_ZTSSt10shared_ptrIN3chw6LoggerEE", !43, i64 0}
!43 = !{!"_ZTSSt12__shared_ptrIN3chw6LoggerELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !32, i64 8}
!44 = !{!"_ZTSSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE", !45, i64 0}
!45 = !{!"_ZTSSt10_HashtableIiSt4pairIKiSt10shared_ptrISt8functionIFviEEEESaIS7_ENSt8__detail10_Select1stESt8equal_toIiESt4hashIiENS9_18_Mod_range_hashingENS9_20_Default_ranged_hashENS9_20_Prime_rehash_policyENS9_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !23, i64 8, !46, i64 16, !23, i64 24, !47, i64 32, !6, i64 48}
!46 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!47 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !48, i64 0, !23, i64 8}
!48 = !{!"float", !7, i64 0}
!49 = !{!"_ZTSSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE", !50, i64 0}
!50 = !{!"_ZTSSt10_HashtableIiiSaIiENSt8__detail9_IdentityESt8equal_toIiESt4hashIiENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb0ELb1ELb1EEEE", !6, i64 0, !23, i64 8, !46, i64 16, !23, i64 24, !47, i64 32, !6, i64 48}
!51 = !{!"_ZTSSt8multimapImSt10shared_ptrIN3chw17TaskCancelableImpIFmvEJEEEESt4lessImESaISt4pairIKmS5_EEE", !52, i64 0}
!52 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmSt10shared_ptrIN3chw17TaskCancelableImpIFmvEJEEEEESt10_Select1stIS8_ESt4lessImESaIS8_EE", !53, i64 0}
!53 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmSt10shared_ptrIN3chw17TaskCancelableImpIFmvEJEEEEESt10_Select1stIS8_ESt4lessImESaIS8_EE13_Rb_tree_implISC_Lb1EEE", !54, i64 0, !56, i64 8}
!54 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !55, i64 0}
!55 = !{!"_ZTSSt4lessImE"}
!56 = !{!"_ZTSSt15_Rb_tree_header", !57, i64 0, !23, i64 32}
!57 = !{!"_ZTSSt18_Rb_tree_node_base", !58, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!58 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!59 = !{!60, !6, i64 0}
!60 = !{!"_ZTSZN3chw9EventLoop8addEventEiiSt8functionIFviEEE3$_0", !6, i64 0, !10, i64 8, !10, i64 12, !61, i64 16}
!61 = !{!"_ZTSSt8functionIFviEE", !62, i64 0, !6, i64 24}
!62 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!63 = !{!60, !10, i64 8}
!64 = !{!60, !10, i64 12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.chw::LogContextCapture" = type { %"class.std::shared_ptr.31", ptr }
%"class.std::shared_ptr.31" = type { %"class.std::__shared_ptr.32" }
%"class.std::__shared_ptr.32" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%struct.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }
%"class.std::shared_ptr.51" = type { %"class.std::__shared_ptr.52" }
%"class.std::__shared_ptr.52" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.45" = type { %"class.std::__shared_ptr.46" }
%"class.std::__shared_ptr.46" = type { ptr, %"class.std::__shared_count" }
%"class.std::function.48" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.54 = type { ptr, i32, i32, %"class.std::function" }
%"class.std::function" = type { %"class.std::_Function_base", ptr }

@.str.2 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@__FUNCTION__._ZN3chw9EventLoop8addEventEiiSt8functionIFviEE = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3chw9EventLoop8addEventEiiSt8functionIFviEE(ptr noundef nonnull align 8 dereferenceable(432) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull %3) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca %"class.chw::LogContextCapture", align 8
  %7 = alloca %struct.epoll_event, align 4
  %8 = alloca %"class.std::shared_ptr.51", align 8
  %9 = alloca %"class.std::shared_ptr.45", align 8
  %10 = alloca %"class.std::function.48", align 8
  %11 = alloca %class.anon.54, align 8
  store i32 %1, ptr %5, align 4, !tbaa !5
  %12 = tail call noundef zeroext i1 @_ZNKSt8functionIFviEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  br i1 %12, label %19, label %13

13:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  %14 = tail call noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
  call void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(144) %14, i32 noundef 3, ptr noundef nonnull @.str.2, ptr noundef nonnull @__FUNCTION__._ZN3chw9EventLoop8addEventEiiSt8functionIFviEE, i32 noundef 106, ptr noundef nonnull @.str.3)
  %15 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA21_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 1 dereferenceable(21) @.str.4)
          to label %16 unwind label %17

16:                                               ; preds = %13
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %56

17:                                               ; preds = %13
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %57

19:                                               ; preds = %4
  %20 = tail call noundef zeroext i1 @_ZN3chw9EventLoop15isCurrentThreadEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  br i1 %20, label %21, label %45

21:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  %22 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 0, ptr %22, align 4
  %23 = and i32 %2, 1
  %24 = shl i32 %2, 1
  %25 = and i32 %24, 4
  %26 = or disjoint i32 %25, %23
  %27 = and i32 %2, 4
  %.not = icmp eq i32 %27, 0
  %28 = select i1 %.not, i32 0, i32 24
  %29 = shl i32 %2, 28
  %30 = and i32 %29, -2147483648
  %31 = or disjoint i32 %26, %30
  %32 = or disjoint i32 %31, %28
  %33 = xor i32 %32, -2147483648
  store i32 %33, ptr %7, align 4, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %7, i64 4
  store i32 %1, ptr %34, align 4, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %0, i64 264
  %36 = load i32, ptr %35, align 8, !tbaa !12
  %37 = call i32 @epoll_ctl(i32 noundef %36, i32 noundef 1, i32 noundef %1, ptr noundef nonnull %7) #7
  %.not15 = icmp eq i32 %37, -1
  br i1 %.not15, label %44, label %38

38:                                               ; preds = %21
  %39 = getelementptr inbounds i8, ptr %0, i64 272
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @_ZSt11make_sharedISt8functionIFviEEJS2_EESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.51") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %40 = invoke { ptr, i8 } @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE7emplaceIJRiS4_EEES9_INSt8__detail14_Node_iteratorISB_Lb0ELb0EEEbEDpOT_(ptr noundef nonnull align 8 dereferenceable(56) %39, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %41 unwind label %42

41:                                               ; preds = %38
  call void @_ZNSt12__shared_ptrISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  br label %44

42:                                               ; preds = %38
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  br label %57

44:                                               ; preds = %41, %21
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  br label %56

45:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #7
  store ptr %0, ptr %11, align 8, !tbaa !58
  %46 = getelementptr inbounds i8, ptr %11, i64 8
  store i32 %1, ptr %46, align 8, !tbaa !62
  %47 = getelementptr inbounds i8, ptr %11, i64 12
  store i32 %2, ptr %47, align 4, !tbaa !63
  %48 = getelementptr inbounds i8, ptr %11, i64 16
  call void @_ZNSt8functionIFviEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %48, ptr noundef nonnull align 8 dereferenceable(32) %3)
  invoke void @"_ZNSt8functionIFvvEEC2IZN3chw9EventLoop8addEventEiiS_IFviEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(48) %11)
          to label %49 unwind label %51

49:                                               ; preds = %45
  invoke void @_ZN3chw9EventLoop5asyncESt8functionIFvvEEb(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.45") align 8 %9, ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef nonnull %10, i1 noundef zeroext true)
          to label %50 unwind label %53

50:                                               ; preds = %49
  call void @_ZNSt12__shared_ptrIN3chw17TaskCancelableImpIFvvEJEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @"_ZZN3chw9EventLoop8addEventEiiSt8functionIFviEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(48) %11) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #7
  br label %56

51:                                               ; preds = %45
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %55

53:                                               ; preds = %49
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  br label %55

55:                                               ; preds = %53, %51
  %.pn = phi { ptr, i32 } [ %54, %53 ], [ %52, %51 ]
  call void @"_ZZN3chw9EventLoop8addEventEiiSt8functionIFviEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(48) %11) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #7
  br label %57

56:                                               ; preds = %50, %44, %16
  %.0 = phi i32 [ %37, %44 ], [ 0, %50 ], [ -1, %16 ]
  ret i32 %.0

57:                                               ; preds = %55, %42, %17
  %.pn16 = phi { ptr, i32 } [ %43, %42 ], [ %.pn, %55 ], [ %18, %17 ]
  resume { ptr, i32 } %.pn16
}

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

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

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

declare noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv() local_unnamed_addr #3

declare void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(144), i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt8functionIFviEEcvbEv(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(24) ptr @_ZN3chw17LogContextCapturelsIRA21_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(21)) local_unnamed_addr #0 align 2

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

; Function Attrs: nounwind
declare i32 @epoll_ctl(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE7emplaceIJRiS4_EEES9_INSt8__detail14_Node_iteratorISB_Lb0ELb0EEEbEDpOT_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedISt8functionIFviEEJS2_EESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.51") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw9EventLoop5asyncESt8functionIFvvEEb(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.45") align 8, ptr noundef nonnull align 8 dereferenceable(432), ptr noundef, i1 noundef zeroext) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN3chw9EventLoop8addEventEiiS_IFviEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZN3chw9EventLoop8addEventEiiSt8functionIFviEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 "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 = { 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 #6 = { 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 #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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS11epoll_event", !6, i64 0, !7, i64 4}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 264}
!13 = !{!"_ZTSN3chw9EventLoopE", !14, i64 0, !19, i64 16, !20, i64 24, !17, i64 56, !23, i64 64, !32, i64 176, !33, i64 184, !35, i64 224, !41, i64 248, !6, i64 264, !43, i64 272, !48, i64 328, !50, i64 384}
!14 = !{!"_ZTSSt23enable_shared_from_thisIN3chw9EventLoopEE", !15, i64 0}
!15 = !{!"_ZTSSt8weak_ptrIN3chw9EventLoopEE", !16, i64 0}
!16 = !{!"_ZTSSt10__weak_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !18, i64 8}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !22, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !17, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSN3chw9SemaphoreE", !22, i64 0, !24, i64 8, !26, i64 48}
!24 = !{!"_ZTSSt15recursive_mutex", !25, i64 0}
!25 = !{!"_ZTSSt22__recursive_mutex_base", !7, i64 0}
!26 = !{!"_ZTSNSt3_V222condition_variable_anyE", !27, i64 0, !29, i64 48}
!27 = !{!"_ZTSSt18condition_variable", !28, i64 0}
!28 = !{!"_ZTSSt9__condvar", !7, i64 0}
!29 = !{!"_ZTSSt10shared_ptrISt5mutexE", !30, i64 0}
!30 = !{!"_ZTSSt12__shared_ptrISt5mutexLN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !31, i64 8}
!31 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0}
!32 = !{!"_ZTSN3chw8PipeWrapE", !7, i64 0}
!33 = !{!"_ZTSSt5mutex", !34, i64 0}
!34 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!35 = !{!"_ZTSN3chw4ListISt10shared_ptrINS_17TaskCancelableImpIFvvEJEEEEEE", !36, i64 0}
!36 = !{!"_ZTSNSt7__cxx114listISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EEE", !37, i64 0}
!37 = !{!"_ZTSNSt7__cxx1110_List_baseISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EEE", !38, i64 0}
!38 = !{!"_ZTSNSt7__cxx1110_List_baseISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EE10_List_implE", !39, i64 0}
!39 = !{!"_ZTSNSt8__detail17_List_node_headerE", !40, i64 0, !22, i64 16}
!40 = !{!"_ZTSNSt8__detail15_List_node_baseE", !17, i64 0, !17, i64 8}
!41 = !{!"_ZTSSt10shared_ptrIN3chw6LoggerEE", !42, i64 0}
!42 = !{!"_ZTSSt12__shared_ptrIN3chw6LoggerELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !31, i64 8}
!43 = !{!"_ZTSSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE", !44, i64 0}
!44 = !{!"_ZTSSt10_HashtableIiSt4pairIKiSt10shared_ptrISt8functionIFviEEEESaIS7_ENSt8__detail10_Select1stESt8equal_toIiESt4hashIiENS9_18_Mod_range_hashingENS9_20_Default_ranged_hashENS9_20_Prime_rehash_policyENS9_17_Hashtable_traitsILb0ELb0ELb1EEEE", !17, i64 0, !22, i64 8, !45, i64 16, !22, i64 24, !46, i64 32, !17, i64 48}
!45 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !17, i64 0}
!46 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !47, i64 0, !22, i64 8}
!47 = !{!"float", !7, i64 0}
!48 = !{!"_ZTSSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE", !49, i64 0}
!49 = !{!"_ZTSSt10_HashtableIiiSaIiENSt8__detail9_IdentityESt8equal_toIiESt4hashIiENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb0ELb1ELb1EEEE", !17, i64 0, !22, i64 8, !45, i64 16, !22, i64 24, !46, i64 32, !17, i64 48}
!50 = !{!"_ZTSSt8multimapImSt10shared_ptrIN3chw17TaskCancelableImpIFmvEJEEEESt4lessImESaISt4pairIKmS5_EEE", !51, i64 0}
!51 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmSt10shared_ptrIN3chw17TaskCancelableImpIFmvEJEEEEESt10_Select1stIS8_ESt4lessImESaIS8_EE", !52, i64 0}
!52 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmSt10shared_ptrIN3chw17TaskCancelableImpIFmvEJEEEEESt10_Select1stIS8_ESt4lessImESaIS8_EE13_Rb_tree_implISC_Lb1EEE", !53, i64 0, !55, i64 8}
!53 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !54, i64 0}
!54 = !{!"_ZTSSt4lessImE"}
!55 = !{!"_ZTSSt15_Rb_tree_header", !56, i64 0, !22, i64 32}
!56 = !{!"_ZTSSt18_Rb_tree_node_base", !57, i64 0, !17, i64 8, !17, i64 16, !17, i64 24}
!57 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!58 = !{!59, !17, i64 0}
!59 = !{!"_ZTSZN3chw9EventLoop8addEventEiiSt8functionIFviEEE3$_0", !17, i64 0, !6, i64 8, !6, i64 12, !60, i64 16}
!60 = !{!"_ZTSSt8functionIFviEE", !61, i64 0, !17, i64 24}
!61 = !{!"_ZTSSt14_Function_base", !7, i64 0, !17, i64 16}
!62 = !{!59, !6, i64 8}
!63 = !{!59, !6, i64 12}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass