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

; 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::shared_ptr.69" = type { %"class.std::__shared_ptr.70" }
%"class.std::__shared_ptr.70" = 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 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = 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.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.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 }
%"struct.std::pair.72" = type { i32, %"class.std::shared_ptr.51" }

@.str.2 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@_ZTISt9exception = external constant ptr
@__FUNCTION__._ZN3chw9EventLoop7runLoopEbb = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 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

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_end_catch()

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #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: nounwind
declare i32 @epoll_ctl(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #4

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

; Function Attrs: uwtable
declare hidden noundef ptr @_ZTWN3chwL16s_current_pollerE() #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3chw9EventLoop7runLoopEbb(ptr noundef nonnull align 8 dereferenceable(432) %0, i1 noundef zeroext %1, i1 noundef zeroext %2) #7 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca %"class.std::shared_ptr.69", align 8
  %8 = alloca i64, align 8
  %9 = alloca [1024 x %struct.epoll_event], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %16 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %17 = alloca %"class.std::shared_ptr.51", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca %"class.chw::LogContextCapture", align 8
  %22 = alloca ptr, align 8
  %23 = alloca { i64, i64 }, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i8, align 1
  %26 = alloca i1, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  %27 = zext i1 %1 to i8
  store i8 %27, ptr %5, align 1, !tbaa !9
  %28 = zext i1 %2 to i8
  store i8 %28, ptr %6, align 1, !tbaa !9
  %29 = load ptr, ptr %4, align 8
  %30 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %31 = trunc i8 %30 to i1
  br i1 %31, label %32, label %190

32:                                               ; preds = %3
  %33 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %34 = trunc i8 %33 to i1
  br i1 %34, label %35, label %38

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #10
  call void @_ZNSt23enable_shared_from_thisIN3chw9EventLoopEE16shared_from_thisEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.69") align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %29)
  %36 = call ptr @_ZTWN3chwL16s_current_pollerE()
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8weak_ptrIN3chw9EventLoopEEaSIS1_EENSt9enable_ifIXsr13is_assignableIRSt10__weak_ptrIS1_LN9__gnu_cxx12_Lock_policyE2EERKSt10shared_ptrIT_EEE5valueERS2_E4typeESE_(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(16) %7) #10
  call void @_ZNSt12__shared_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #10
  br label %38

38:                                               ; preds = %35, %32
  %39 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 4
  call void @_ZN3chw9Semaphore4postEm(ptr noundef nonnull align 8 dereferenceable(112) %39, i64 noundef 1)
  %40 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 1
  store i8 0, ptr %40, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  call void @llvm.lifetime.start.p0(i64 12288, ptr %9) #10
  br label %41

41:                                               ; preds = %188, %186, %38
  %42 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 1
  %43 = load i8, ptr %42, align 8, !tbaa !13, !range !11, !noundef !12
  %44 = trunc i8 %43 to i1
  %45 = xor i1 %44, true
  br i1 %45, label %46, label %189

46:                                               ; preds = %41
  %47 = call noundef i64 @_ZN3chw9EventLoop11getMinDelayEv(ptr noundef nonnull align 8 dereferenceable(432) %29)
  store i64 %47, ptr %8, align 8, !tbaa !58
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  %48 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 9
  %49 = load i32, ptr %48, align 8, !tbaa !59
  %50 = getelementptr inbounds [1024 x %struct.epoll_event], ptr %9, i64 0, i64 0
  %51 = load i64, ptr %8, align 8, !tbaa !58
  %52 = icmp ne i64 %51, 0
  br i1 %52, label %53, label %55

53:                                               ; preds = %46
  %54 = load i64, ptr %8, align 8, !tbaa !58
  br label %56

55:                                               ; preds = %46
  br label %56

56:                                               ; preds = %55, %53
  %57 = phi i64 [ %54, %53 ], [ -1, %55 ]
  %58 = trunc i64 %57 to i32
  %59 = call i32 @epoll_wait(i32 noundef %49, ptr noundef %50, i32 noundef 1024, i32 noundef %58)
  store i32 %59, ptr %10, align 4, !tbaa !60
  %60 = load i32, ptr %10, align 4, !tbaa !60
  %61 = icmp sle i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %56
  store i32 2, ptr %11, align 4
  br label %186, !llvm.loop !61

63:                                               ; preds = %56
  %64 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 11
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56) %64) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #10
  store i32 0, ptr %12, align 4, !tbaa !60
  br label %65

65:                                               ; preds = %161, %63
  %66 = load i32, ptr %12, align 4, !tbaa !60
  %67 = load i32, ptr %10, align 4, !tbaa !60
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 4, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #10
  br label %185

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  %71 = load i32, ptr %12, align 4, !tbaa !60
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1024 x %struct.epoll_event], ptr %9, i64 0, i64 %72
  store ptr %73, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.epoll_event, ptr %74, i32 0, i32 1
  %76 = load i32, ptr %75, align 1, !tbaa !63
  store i32 %76, ptr %14, align 4, !tbaa !60
  %77 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 11
  %78 = call noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(56) %77, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %79 = icmp ne i64 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %70
  store i32 6, ptr %11, align 4
  br label %158

81:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %82 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 10
  %83 = call ptr @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(56) %82, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %84 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %15, i32 0, i32 0
  %85 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %84, i32 0, i32 0
  store ptr %83, ptr %85, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #10
  %86 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 10
  %87 = call ptr @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %86) #10
  %88 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %16, i32 0, i32 0
  %89 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %88, i32 0, i32 0
  store ptr %87, ptr %89, align 8
  %90 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKiSt10shared_ptrISt8functionIFviEEEELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  br i1 %90, label %91, label %96

91:                                               ; preds = %81
  %92 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 9
  %93 = load i32, ptr %92, align 8, !tbaa !59
  %94 = load i32, ptr %14, align 4, !tbaa !60
  %95 = call i32 @epoll_ctl(i32 noundef %93, i32 noundef 2, i32 noundef %94, ptr noundef null) #10
  store i32 6, ptr %11, align 4
  br label %157

96:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #10
  %97 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiSt10shared_ptrISt8functionIFviEEEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #10
  %98 = getelementptr inbounds %"struct.std::pair.72", ptr %97, i32 0, i32 1
  call void @_ZNSt10shared_ptrISt8functionIFviEEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %98) #10
  %99 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt19__shared_ptr_accessISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEdeEv(ptr noundef nonnull align 1 dereferenceable(1) %17) #10
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.epoll_event, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 1, !tbaa !64
  %103 = and i32 %102, 81
  %104 = icmp ne i32 %103, 0
  %105 = zext i1 %104 to i64
  %106 = select i1 %104, i32 1, i32 0
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.epoll_event, ptr %107, i32 0, i32 0
  %109 = load i32, ptr %108, align 1, !tbaa !64
  %110 = and i32 %109, 260
  %111 = icmp ne i32 %110, 0
  %112 = zext i1 %111 to i64
  %113 = select i1 %111, i32 2, i32 0
  %114 = or i32 %106, %113
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.epoll_event, ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 1, !tbaa !64
  %118 = and i32 %117, 16
  %119 = icmp ne i32 %118, 0
  %120 = zext i1 %119 to i64
  %121 = select i1 %119, i32 4, i32 0
  %122 = or i32 %114, %121
  %123 = load ptr, ptr %13, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.epoll_event, ptr %123, i32 0, i32 0
  %125 = load i32, ptr %124, align 1, !tbaa !64
  %126 = and i32 %125, 8
  %127 = icmp ne i32 %126, 0
  %128 = zext i1 %127 to i64
  %129 = select i1 %127, i32 4, i32 0
  %130 = or i32 %122, %129
  invoke void @_ZNKSt8functionIFviEEclEi(ptr noundef nonnull align 8 dereferenceable(32) %99, i32 noundef %130)
          to label %131 unwind label %132

131:                                              ; preds = %96
  br label %156

132:                                              ; preds = %96
  %133 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %18, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %19, align 4
  br label %136

136:                                              ; preds = %132
  %137 = load i32, ptr %19, align 4
  %138 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #10
  %139 = icmp eq i32 %137, %138
  br i1 %139, label %140, label %184

140:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #10
  %141 = load ptr, ptr %18, align 8
  %142 = call ptr @__cxa_begin_catch(ptr %141) #10
  store ptr %142, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #10
  %143 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %144 unwind label %164

144:                                              ; preds = %140
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(144) %143, i32 noundef 4, ptr noundef @.str.2, ptr noundef @__FUNCTION__._ZN3chw9EventLoop7runLoopEbb, i32 noundef 378, ptr noundef @.str.3)
          to label %145 unwind label %164

145:                                              ; preds = %144
  %146 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA40_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 1 dereferenceable(40) @.str.5)
          to label %147 unwind label %168

147:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %148 = load ptr, ptr %20, align 8, !tbaa !5
  %149 = load ptr, ptr %148, align 8, !tbaa !66
  %150 = getelementptr inbounds ptr, ptr %149, i64 2
  %151 = load ptr, ptr %150, align 8
  %152 = call noundef ptr %151(ptr noundef nonnull align 8 dereferenceable(8) %148) #10
  store ptr %152, ptr %22, align 8, !tbaa !5
  %153 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %146, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %154 unwind label %172

154:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #10
  invoke void @__cxa_end_catch()
          to label %155 unwind label %178

155:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #10
  br label %156

156:                                              ; preds = %155, %131
  call void @_ZNSt12__shared_ptrISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #10
  store i32 0, ptr %11, align 4
  br label %157

157:                                              ; preds = %156, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  br label %158

158:                                              ; preds = %157, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  %159 = load i32, ptr %11, align 4
  switch i32 %159, label %211 [
    i32 0, label %160
    i32 6, label %161
  ]

160:                                              ; preds = %158
  br label %161

161:                                              ; preds = %160, %158
  %162 = load i32, ptr %12, align 4, !tbaa !60
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %12, align 4, !tbaa !60
  br label %65, !llvm.loop !68

164:                                              ; preds = %144, %140
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %18, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %19, align 4
  br label %177

168:                                              ; preds = %145
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %18, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %19, align 4
  br label %176

172:                                              ; preds = %147
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %18, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %176

176:                                              ; preds = %172, %168
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #10
  br label %177

177:                                              ; preds = %176, %164
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #10
  invoke void @__cxa_end_catch()
          to label %182 unwind label %208

178:                                              ; preds = %154
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %18, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %19, align 4
  br label %183

182:                                              ; preds = %177
  br label %183

183:                                              ; preds = %182, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #10
  br label %184

184:                                              ; preds = %183, %136
  call void @_ZNSt12__shared_ptrISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 12288, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  br label %203

185:                                              ; preds = %69
  store i32 0, ptr %11, align 4
  br label %186

186:                                              ; preds = %185, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  %187 = load i32, ptr %11, align 4
  switch i32 %187, label %211 [
    i32 0, label %188
    i32 2, label %41
  ]

188:                                              ; preds = %186
  br label %41, !llvm.loop !61

189:                                              ; preds = %41
  call void @llvm.lifetime.end.p0(i64 12288, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  br label %202

190:                                              ; preds = %3
  %191 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #11
  store i1 true, ptr %26, align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #10
  store { i64, i64 } { i64 ptrtoint (ptr @_ZN3chw9EventLoop7runLoopEbb to i64), i64 0 }, ptr %23, align 8, !tbaa !63
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #10
  store ptr %29, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #10
  store i8 1, ptr %25, align 1, !tbaa !9
  invoke void @_ZNSt6threadC2IMN3chw9EventLoopEFvbbEJPS2_bRbEvEEOT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8) %191, ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 1 dereferenceable(1) %25, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %192 unwind label %195

192:                                              ; preds = %190
  store i1 false, ptr %26, align 1
  %193 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 3
  store ptr %191, ptr %193, align 8, !tbaa !69
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #10
  %194 = getelementptr inbounds %"class.chw::EventLoop", ptr %29, i32 0, i32 4
  call void @_ZN3chw9Semaphore4waitEv(ptr noundef nonnull align 8 dereferenceable(112) %194)
  br label %202

195:                                              ; preds = %190
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %18, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #10
  %199 = load i1, ptr %26, align 1
  br i1 %199, label %200, label %201

200:                                              ; preds = %195
  call void @_ZdlPvm(ptr noundef %191, i64 noundef 8) #12
  br label %201

201:                                              ; preds = %200, %195
  br label %203

202:                                              ; preds = %192, %189
  ret void

203:                                              ; preds = %201, %184
  %204 = load ptr, ptr %18, align 8
  %205 = load i32, ptr %19, align 4
  %206 = insertvalue { ptr, i32 } poison, ptr %204, 0
  %207 = insertvalue { ptr, i32 } %206, i32 %205, 1
  resume { ptr, i32 } %207

208:                                              ; preds = %177
  %209 = landingpad { ptr, i32 }
          catch ptr null
  %210 = extractvalue { ptr, i32 } %209, 0
  call void @__clang_call_terminate(ptr %210) #13
  unreachable

211:                                              ; preds = %186, %158
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23enable_shared_from_thisIN3chw9EventLoopEE16shared_from_thisEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.69") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #7 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw9Semaphore4postEm(ptr noundef nonnull align 8 dereferenceable(112), i64 noundef) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN3chw9EventLoop11getMinDelayEv(ptr noundef nonnull align 8 dereferenceable(432)) #7 align 2

declare i32 @epoll_wait(i32 noundef, ptr noundef, i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKiSt10shared_ptrISt8functionIFviEEEELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFviEEclEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #7 align 2

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #8

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA40_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(40)) #7 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6threadC2IMN3chw9EventLoopEFvbbEJPS2_bRbEvEEOT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw9Semaphore4waitEv(ptr noundef nonnull align 8 dereferenceable(112)) #7 align 2

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 = { nobuiltin 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 #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 = { 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 #6 = { 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 #7 = { 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 #8 = { nounwind memory(none) }
attributes #9 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { builtin nounwind }
attributes #13 = { 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, !10, i64 16}
!14 = !{!"_ZTSN3chw9EventLoopE", !15, i64 0, !10, i64 16, !19, i64 24, !6, i64 56, !22, i64 64, !31, i64 176, !32, i64 184, !34, i64 224, !40, i64 248, !42, i64 264, !43, i64 272, !48, i64 328, !50, i64 384}
!15 = !{!"_ZTSSt23enable_shared_from_thisIN3chw9EventLoopEE", !16, i64 0}
!16 = !{!"_ZTSSt8weak_ptrIN3chw9EventLoopEE", !17, i64 0}
!17 = !{!"_ZTSSt10__weak_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !18, i64 8}
!18 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !21, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN3chw9SemaphoreE", !21, i64 0, !23, i64 8, !25, i64 48}
!23 = !{!"_ZTSSt15recursive_mutex", !24, i64 0}
!24 = !{!"_ZTSSt22__recursive_mutex_base", !7, i64 0}
!25 = !{!"_ZTSNSt3_V222condition_variable_anyE", !26, i64 0, !28, i64 48}
!26 = !{!"_ZTSSt18condition_variable", !27, i64 0}
!27 = !{!"_ZTSSt9__condvar", !7, i64 0}
!28 = !{!"_ZTSSt10shared_ptrISt5mutexE", !29, i64 0}
!29 = !{!"_ZTSSt12__shared_ptrISt5mutexLN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !30, i64 8}
!30 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!31 = !{!"_ZTSN3chw8PipeWrapE", !7, i64 0}
!32 = !{!"_ZTSSt5mutex", !33, i64 0}
!33 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!34 = !{!"_ZTSN3chw4ListISt10shared_ptrINS_17TaskCancelableImpIFvvEJEEEEEE", !35, i64 0}
!35 = !{!"_ZTSNSt7__cxx114listISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EEE", !36, i64 0}
!36 = !{!"_ZTSNSt7__cxx1110_List_baseISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EEE", !37, i64 0}
!37 = !{!"_ZTSNSt7__cxx1110_List_baseISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EE10_List_implE", !38, i64 0}
!38 = !{!"_ZTSNSt8__detail17_List_node_headerE", !39, i64 0, !21, i64 16}
!39 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!40 = !{!"_ZTSSt10shared_ptrIN3chw6LoggerEE", !41, i64 0}
!41 = !{!"_ZTSSt12__shared_ptrIN3chw6LoggerELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !30, i64 8}
!42 = !{!"int", !7, i64 0}
!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", !6, i64 0, !21, i64 8, !45, i64 16, !21, i64 24, !46, i64 32, !6, i64 48}
!45 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!46 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !47, i64 0, !21, 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", !6, i64 0, !21, i64 8, !45, i64 16, !21, i64 24, !46, i64 32, !6, 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, !21, i64 32}
!56 = !{!"_ZTSSt18_Rb_tree_node_base", !57, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!57 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!58 = !{!21, !21, i64 0}
!59 = !{!14, !42, i64 264}
!60 = !{!42, !42, i64 0}
!61 = distinct !{!61, !62}
!62 = !{!"llvm.loop.mustprogress"}
!63 = !{!7, !7, i64 0}
!64 = !{!65, !42, i64 0}
!65 = !{!"_ZTS11epoll_event", !42, i64 0, !7, i64 4}
!66 = !{!67, !67, i64 0}
!67 = !{!"vtable pointer", !8, i64 0}
!68 = distinct !{!68, !62}
!69 = !{!14, !6, i64 56}


; 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::shared_ptr.69" = type { %"class.std::__shared_ptr.70" }
%"class.std::__shared_ptr.70" = 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 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = 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.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" }

@.str.2 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@_ZTISt9exception = external constant ptr
@__FUNCTION__._ZN3chw9EventLoop7runLoopEbb = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #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: nounwind
declare i32 @epoll_ctl(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: uwtable
declare hidden noundef ptr @_ZTWN3chwL16s_current_pollerE() local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3chw9EventLoop7runLoopEbb(ptr noundef nonnull align 8 dereferenceable(432) %0, i1 noundef zeroext %1, i1 noundef zeroext %2) #7 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i8, align 1
  %5 = alloca %"class.std::shared_ptr.69", align 8
  %6 = alloca [1024 x %struct.epoll_event], align 16
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %9 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %10 = alloca %"class.std::shared_ptr.51", align 8
  %11 = alloca %"class.chw::LogContextCapture", align 8
  %12 = alloca ptr, align 8
  %13 = alloca { i64, i64 }, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = zext i1 %2 to i8
  store i8 %16, ptr %4, align 1, !tbaa !5
  br i1 %1, label %17, label %97

17:                                               ; preds = %3
  br i1 %2, label %18, label %.lr.ph

18:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #10
  call void @_ZNSt23enable_shared_from_thisIN3chw9EventLoopEE16shared_from_thisEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.69") align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) %0)
  %19 = call ptr @_ZTWN3chwL16s_current_pollerE()
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8weak_ptrIN3chw9EventLoopEEaSIS1_EENSt9enable_ifIXsr13is_assignableIRSt10__weak_ptrIS1_LN9__gnu_cxx12_Lock_policyE2EERKSt10shared_ptrIT_EEE5valueERS2_E4typeESE_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %5) #10
  call void @_ZNSt12__shared_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #10
  br label %.lr.ph

.lr.ph:                                           ; preds = %17, %18
  %21 = getelementptr inbounds i8, ptr %0, i64 64
  call void @_ZN3chw9Semaphore4postEm(ptr noundef nonnull align 8 dereferenceable(112) %21, i64 noundef 1)
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  store i8 0, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12288, ptr nonnull %6) #10
  %23 = getelementptr inbounds i8, ptr %0, i64 264
  %24 = getelementptr inbounds i8, ptr %0, i64 328
  %25 = getelementptr inbounds i8, ptr %0, i64 272
  br label %26

26:                                               ; preds = %.lr.ph, %.loopexit
  %27 = call noundef i64 @_ZN3chw9EventLoop11getMinDelayEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %28 = load i32, ptr %23, align 8, !tbaa !55
  %.not = icmp eq i64 %27, 0
  %29 = trunc i64 %27 to i32
  %30 = select i1 %.not, i32 -1, i32 %29
  %31 = call i32 @epoll_wait(i32 noundef %28, ptr noundef nonnull %6, i32 noundef 1024, i32 noundef %30)
  %32 = icmp slt i32 %31, 1
  br i1 %32, label %.loopexit, label %33, !llvm.loop !56

33:                                               ; preds = %26
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56) %24) #10
  %wide.trip.count = zext nneg i32 %31 to i64
  br label %34

34:                                               ; preds = %33, %83
  %indvars.iv = phi i64 [ 0, %33 ], [ %indvars.iv.next, %83 ]
  %35 = getelementptr inbounds [1024 x %struct.epoll_event], ptr %6, i64 0, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #10
  %36 = getelementptr inbounds i8, ptr %35, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !58
  store i32 %37, ptr %7, align 4, !tbaa !59
  %38 = call noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(56) %24, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %.not27 = icmp eq i64 %38, 0
  br i1 %.not27, label %39, label %83

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #10
  %40 = call ptr @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(56) %25, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store ptr %40, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #10
  %41 = call ptr @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %25) #10
  store ptr %41, ptr %9, align 8
  %42 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKiSt10shared_ptrISt8functionIFviEEEELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #10
  br i1 %42, label %43, label %47

43:                                               ; preds = %39
  %44 = load i32, ptr %23, align 8, !tbaa !55
  %45 = load i32, ptr %7, align 4, !tbaa !59
  %46 = call i32 @epoll_ctl(i32 noundef %44, i32 noundef 2, i32 noundef %45, ptr noundef null) #10
  br label %82

47:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #10
  %48 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKiSt10shared_ptrISt8functionIFviEEEELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #10
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  call void @_ZNSt10shared_ptrISt8functionIFviEEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %49) #10
  %50 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt19__shared_ptr_accessISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEdeEv(ptr noundef nonnull align 1 dereferenceable(1) %10) #10
  %51 = load i32, ptr %35, align 4, !tbaa !60
  %52 = and i32 %51, 81
  %.not28 = icmp ne i32 %52, 0
  %53 = zext i1 %.not28 to i32
  %54 = and i32 %51, 260
  %.not29 = icmp eq i32 %54, 0
  %55 = select i1 %.not29, i32 0, i32 2
  %56 = or disjoint i32 %55, %53
  %57 = lshr i32 %51, 2
  %58 = lshr i32 %51, 1
  %59 = or i32 %57, %58
  %60 = and i32 %59, 4
  %61 = or disjoint i32 %56, %60
  invoke void @_ZNKSt8functionIFviEEclEi(ptr noundef nonnull align 8 dereferenceable(32) %50, i32 noundef %61)
          to label %81 unwind label %62

62:                                               ; preds = %47
  %63 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %64 = extractvalue { ptr, i32 } %63, 0
  %65 = extractvalue { ptr, i32 } %63, 1
  %66 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #10
  %67 = icmp eq i32 %65, %66
  br i1 %67, label %68, label %.loopexit36

68:                                               ; preds = %62
  %69 = call ptr @__cxa_begin_catch(ptr %64) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #10
  %70 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %71 unwind label %84

71:                                               ; preds = %68
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(144) %70, i32 noundef 4, ptr noundef nonnull @.str.2, ptr noundef nonnull @__FUNCTION__._ZN3chw9EventLoop7runLoopEbb, i32 noundef 378, ptr noundef nonnull @.str.3)
          to label %72 unwind label %84

72:                                               ; preds = %71
  %73 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA40_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 1 dereferenceable(40) @.str.5)
          to label %74 unwind label %86

74:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #10
  %75 = load ptr, ptr %69, align 8, !tbaa !62
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  %77 = load ptr, ptr %76, align 8
  %78 = call noundef ptr %77(ptr noundef nonnull align 8 dereferenceable(8) %69) #10
  store ptr %78, ptr %12, align 8, !tbaa !64
  %79 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %73, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %80 unwind label %88

80:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #10
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #10
  invoke void @__cxa_end_catch()
          to label %81 unwind label %92

81:                                               ; preds = %80, %47
  call void @_ZNSt12__shared_ptrISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #10
  br label %82

82:                                               ; preds = %81, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  br label %83

83:                                               ; preds = %34, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %34, !llvm.loop !65

84:                                               ; preds = %71, %68
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %91

86:                                               ; preds = %72
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %90

88:                                               ; preds = %74
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #10
  br label %90

90:                                               ; preds = %88, %86
  %.pn = phi { ptr, i32 } [ %89, %88 ], [ %87, %86 ]
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #10
  br label %91

91:                                               ; preds = %90, %84
  %.pn.pn = phi { ptr, i32 } [ %.pn, %90 ], [ %85, %84 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #10
  invoke void @__cxa_end_catch()
          to label %94 unwind label %110

92:                                               ; preds = %80
  %93 = landingpad { ptr, i32 }
          cleanup
  br label %94

94:                                               ; preds = %91, %92
  %.pn34 = phi { ptr, i32 } [ %93, %92 ], [ %.pn.pn, %91 ]
  %.2 = extractvalue { ptr, i32 } %.pn34, 1
  %.221 = extractvalue { ptr, i32 } %.pn34, 0
  br label %.loopexit36

.loopexit36:                                      ; preds = %62, %94
  %.322 = phi ptr [ %.221, %94 ], [ %64, %62 ]
  %.3 = phi i32 [ %.2, %94 ], [ %65, %62 ]
  call void @_ZNSt12__shared_ptrISt8functionIFviEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 12288, ptr nonnull %6) #10
  br label %107

.loopexit:                                        ; preds = %83, %26
  %95 = load i8, ptr %22, align 8, !tbaa !9, !range !66, !noundef !67
  %96 = trunc nuw i8 %95 to i1
  br i1 %96, label %._crit_edge, label %26

._crit_edge:                                      ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 12288, ptr nonnull %6) #10
  br label %106

97:                                               ; preds = %3
  %98 = tail call noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #10
  store i64 ptrtoint (ptr @_ZN3chw9EventLoop7runLoopEbb to i64), ptr %13, align 8, !tbaa !58
  %.fca.1.gep = getelementptr inbounds i8, ptr %13, i64 8
  store i64 0, ptr %.fca.1.gep, align 8, !tbaa !58
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #10
  store ptr %0, ptr %14, align 8, !tbaa !64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %15) #10
  store i8 1, ptr %15, align 1, !tbaa !5
  invoke void @_ZNSt6threadC2IMN3chw9EventLoopEFvbbEJPS2_bRbEvEEOT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 1 dereferenceable(1) %15, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %99 unwind label %102

99:                                               ; preds = %97
  %100 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %98, ptr %100, align 8, !tbaa !68
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #10
  %101 = getelementptr inbounds i8, ptr %0, i64 64
  call void @_ZN3chw9Semaphore4waitEv(ptr noundef nonnull align 8 dereferenceable(112) %101)
  br label %106

102:                                              ; preds = %97
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #10
  %104 = extractvalue { ptr, i32 } %103, 1
  %105 = extractvalue { ptr, i32 } %103, 0
  call void @_ZdlPvm(ptr noundef nonnull %98, i64 noundef 8) #12
  br label %107

106:                                              ; preds = %99, %._crit_edge
  ret void

107:                                              ; preds = %102, %.loopexit36
  %.423 = phi ptr [ %.322, %.loopexit36 ], [ %105, %102 ]
  %.4 = phi i32 [ %.3, %.loopexit36 ], [ %104, %102 ]
  %108 = insertvalue { ptr, i32 } poison, ptr %.423, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %.4, 1
  resume { ptr, i32 } %109

110:                                              ; preds = %91
  %111 = landingpad { ptr, i32 }
          catch ptr null
  %112 = extractvalue { ptr, i32 } %111, 0
  call void @__clang_call_terminate(ptr %112) #13
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23enable_shared_from_thisIN3chw9EventLoopEE16shared_from_thisEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.69") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #7 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw9Semaphore4postEm(ptr noundef nonnull align 8 dereferenceable(112), i64 noundef) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN3chw9EventLoop11getMinDelayEv(ptr noundef nonnull align 8 dereferenceable(432)) local_unnamed_addr #7 align 2

declare i32 @epoll_wait(i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKiSt10shared_ptrISt8functionIFviEEEELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFviEEclEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #7 align 2

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #8

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA40_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(40)) local_unnamed_addr #7 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6threadC2IMN3chw9EventLoopEFvbbEJPS2_bRbEvEEOT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw9Semaphore4waitEv(ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #7 align 2

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 = { nobuiltin 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 #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 = { 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 #6 = { 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 #7 = { 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 #8 = { nofree nosync nounwind memory(none) }
attributes #9 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { builtin nounwind }
attributes #13 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTSN3chw9EventLoopE", !11, i64 0, !6, i64 16, !16, i64 24, !14, i64 56, !19, i64 64, !28, i64 176, !29, i64 184, !31, i64 224, !37, i64 248, !39, i64 264, !40, i64 272, !45, i64 328, !47, i64 384}
!11 = !{!"_ZTSSt23enable_shared_from_thisIN3chw9EventLoopEE", !12, i64 0}
!12 = !{!"_ZTSSt8weak_ptrIN3chw9EventLoopEE", !13, i64 0}
!13 = !{!"_ZTSSt10__weak_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EE", !14, i64 0, !15, i64 8}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !14, i64 0}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !18, i64 8, !7, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !14, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSN3chw9SemaphoreE", !18, i64 0, !20, i64 8, !22, i64 48}
!20 = !{!"_ZTSSt15recursive_mutex", !21, i64 0}
!21 = !{!"_ZTSSt22__recursive_mutex_base", !7, i64 0}
!22 = !{!"_ZTSNSt3_V222condition_variable_anyE", !23, i64 0, !25, i64 48}
!23 = !{!"_ZTSSt18condition_variable", !24, i64 0}
!24 = !{!"_ZTSSt9__condvar", !7, i64 0}
!25 = !{!"_ZTSSt10shared_ptrISt5mutexE", !26, i64 0}
!26 = !{!"_ZTSSt12__shared_ptrISt5mutexLN9__gnu_cxx12_Lock_policyE2EE", !14, i64 0, !27, i64 8}
!27 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !14, i64 0}
!28 = !{!"_ZTSN3chw8PipeWrapE", !7, i64 0}
!29 = !{!"_ZTSSt5mutex", !30, i64 0}
!30 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!31 = !{!"_ZTSN3chw4ListISt10shared_ptrINS_17TaskCancelableImpIFvvEJEEEEEE", !32, i64 0}
!32 = !{!"_ZTSNSt7__cxx114listISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EEE", !33, i64 0}
!33 = !{!"_ZTSNSt7__cxx1110_List_baseISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseISt10shared_ptrIN3chw17TaskCancelableImpIFvvEJEEEESaIS6_EE10_List_implE", !35, i64 0}
!35 = !{!"_ZTSNSt8__detail17_List_node_headerE", !36, i64 0, !18, i64 16}
!36 = !{!"_ZTSNSt8__detail15_List_node_baseE", !14, i64 0, !14, i64 8}
!37 = !{!"_ZTSSt10shared_ptrIN3chw6LoggerEE", !38, i64 0}
!38 = !{!"_ZTSSt12__shared_ptrIN3chw6LoggerELN9__gnu_cxx12_Lock_policyE2EE", !14, i64 0, !27, i64 8}
!39 = !{!"int", !7, i64 0}
!40 = !{!"_ZTSSt13unordered_mapIiSt10shared_ptrISt8functionIFviEEESt4hashIiESt8equal_toIiESaISt4pairIKiS4_EEE", !41, i64 0}
!41 = !{!"_ZTSSt10_HashtableIiSt4pairIKiSt10shared_ptrISt8functionIFviEEEESaIS7_ENSt8__detail10_Select1stESt8equal_toIiESt4hashIiENS9_18_Mod_range_hashingENS9_20_Default_ranged_hashENS9_20_Prime_rehash_policyENS9_17_Hashtable_traitsILb0ELb0ELb1EEEE", !14, i64 0, !18, i64 8, !42, i64 16, !18, i64 24, !43, i64 32, !14, i64 48}
!42 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !14, i64 0}
!43 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !44, i64 0, !18, i64 8}
!44 = !{!"float", !7, i64 0}
!45 = !{!"_ZTSSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE", !46, i64 0}
!46 = !{!"_ZTSSt10_HashtableIiiSaIiENSt8__detail9_IdentityESt8equal_toIiESt4hashIiENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb0ELb1ELb1EEEE", !14, i64 0, !18, i64 8, !42, i64 16, !18, i64 24, !43, i64 32, !14, i64 48}
!47 = !{!"_ZTSSt8multimapImSt10shared_ptrIN3chw17TaskCancelableImpIFmvEJEEEESt4lessImESaISt4pairIKmS5_EEE", !48, i64 0}
!48 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmSt10shared_ptrIN3chw17TaskCancelableImpIFmvEJEEEEESt10_Select1stIS8_ESt4lessImESaIS8_EE", !49, i64 0}
!49 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmSt10shared_ptrIN3chw17TaskCancelableImpIFmvEJEEEEESt10_Select1stIS8_ESt4lessImESaIS8_EE13_Rb_tree_implISC_Lb1EEE", !50, i64 0, !52, i64 8}
!50 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !51, i64 0}
!51 = !{!"_ZTSSt4lessImE"}
!52 = !{!"_ZTSSt15_Rb_tree_header", !53, i64 0, !18, i64 32}
!53 = !{!"_ZTSSt18_Rb_tree_node_base", !54, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!54 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!55 = !{!10, !39, i64 264}
!56 = distinct !{!56, !57}
!57 = !{!"llvm.loop.mustprogress"}
!58 = !{!7, !7, i64 0}
!59 = !{!39, !39, i64 0}
!60 = !{!61, !39, i64 0}
!61 = !{!"_ZTS11epoll_event", !39, i64 0, !7, i64 4}
!62 = !{!63, !63, i64 0}
!63 = !{!"vtable pointer", !8, i64 0}
!64 = !{!14, !14, i64 0}
!65 = distinct !{!65, !57}
!66 = !{i8 0, i8 2}
!67 = !{}
!68 = !{!10, !14, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass