; LLVM IR from wichue/nethello :: src/net (Socket)

; 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::SockException" = type { %"class.std::exception", i32, i32, %"class.std::__cxx11::basic_string" }
%"class.std::exception" = 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.std::shared_ptr.101" = type { %"class.std::__shared_ptr.102" }
%"class.std::__shared_ptr.102" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::function.104" = 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.107 = type { %"class.std::shared_ptr.101" }
%"class.std::allocator" = type { i8 }
%"class.std::lock_guard" = type { ptr }
%"class.chw::Socket" = type { %"class.std::enable_shared_from_this", i32, i32, %"struct.std::atomic", %"struct.std::atomic", i8, i8, %"class.std::shared_ptr.5", %"class.chw::BytesSpeed", %"class.chw::BytesSpeed", %"class.std::shared_ptr.11", %"class.std::shared_ptr.14", %"class.chw::Ticker", %"class.std::shared_ptr.17", %"class.std::shared_ptr.0", %"class.chw::MutexWrapper", %"class.std::function", %"class.std::function.20", %"class.std::function.22", %"class.std::function.24", %"class.chw::MutexWrapper", %struct.sockaddr_storage, %struct.sockaddr_storage, i32, %"class.std::function.27", %"class.std::shared_ptr.29", i32, %"class.chw::Ticker", %"class.std::shared_ptr.11", i32, double, %"class.std::shared_ptr.29", %struct.sockaddr_storage }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr.3" }
%"class.std::weak_ptr.3" = type { %"class.std::__weak_ptr.4" }
%"class.std::__weak_ptr.4" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = type { ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.std::shared_ptr.5" = type { %"class.std::__shared_ptr.6" }
%"class.std::__shared_ptr.6" = type { ptr, %"class.std::__shared_count" }
%"class.chw::BytesSpeed" = type { i64, i64, i64, %"class.chw::Ticker" }
%"class.std::shared_ptr.14" = type { %"class.std::__shared_ptr.15" }
%"class.std::__shared_ptr.15" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.17" = type { %"class.std::__shared_ptr.18" }
%"class.std::__shared_ptr.18" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::function.20" = type { %"class.std::_Function_base", ptr }
%"class.std::function.22" = type { %"class.std::_Function_base", ptr }
%"class.std::function.24" = type { %"class.std::_Function_base", ptr }
%"class.chw::MutexWrapper" = type { i8, %"class.std::recursive_mutex" }
%"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::function.27" = type { %"class.std::_Function_base", ptr }
%"class.chw::Ticker" = type { i64, i64, i64, %"class.chw::LogContextCapture" }
%"class.chw::LogContextCapture" = type { %"class.std::shared_ptr.8", ptr }
%"class.std::shared_ptr.8" = type { %"class.std::__shared_ptr.9" }
%"class.std::__shared_ptr.9" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.11" = type { %"class.std::__shared_ptr.12" }
%"class.std::__shared_ptr.12" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.29" = type { %"class.std::__shared_ptr.30" }
%"class.std::__shared_ptr.30" = type { ptr, %"class.std::__shared_count" }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }

@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3chw6Socket11onConnectedERKSt10shared_ptrINS_7SockNumEERKSt8functionIFvRKNS_13SockExceptionEEE(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.chw::SockException", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::shared_ptr.101", align 8
  %12 = alloca %"class.std::function.104", align 8
  %13 = alloca %class.anon.107, align 8
  %14 = alloca %"class.chw::SockException", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator", align 1
  %17 = alloca %"class.std::lock_guard", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  %21 = call noundef i32 @_ZNK3chw7SockNum5rawFdEv(ptr noundef nonnull align 4 dereferenceable(8) %20)
  call void @_ZN3chwL10getSockErrEib(ptr dead_on_unwind writable sret(%"class.chw::SockException") align 8 %7, i32 noundef %21, i1 noundef zeroext false)
  %22 = invoke noundef zeroext i1 @_ZNK3chw13SockExceptioncvbEv(ptr noundef nonnull align 8 dereferenceable(48) %7)
          to label %23 unwind label %27

23:                                               ; preds = %3
  br i1 %22, label %24, label %31

24:                                               ; preds = %23
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull align 8 dereferenceable(48) %7)
          to label %26 unwind label %27

26:                                               ; preds = %24
  store i32 1, ptr %10, align 4
  br label %100

27:                                               ; preds = %97, %44, %33, %24, %3
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %8, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %9, align 4
  br label %104

31:                                               ; preds = %23
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %32) #5
  invoke void @_ZN3chw6Socket7setSockESt10shared_ptrINS_7SockNumEE(ptr noundef nonnull align 8 dereferenceable(1072) %18, ptr noundef %11)
          to label %33 unwind label %53

33:                                               ; preds = %31
  call void @_ZNSt12__shared_ptrIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  %34 = getelementptr inbounds %"class.chw::Socket", ptr %18, i32 0, i32 14
  %35 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %34) #5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %36) #5
  %38 = invoke noundef i32 @_ZNK3chw7SockNum5rawFdEv(ptr noundef nonnull align 4 dereferenceable(8) %37)
          to label %39 unwind label %27

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  %40 = getelementptr inbounds %class.anon.107, ptr %13, i32 0, i32 0
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(16) %41) #5
  invoke void @"_ZNSt8functionIFvbEEC2IZN3chw6Socket11onConnectedERKSt10shared_ptrINS3_7SockNumEERKS_IFvRKNS3_13SockExceptionEEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %42 unwind label %57

42:                                               ; preds = %39
  %43 = invoke noundef i32 @_ZN3chw9EventLoop8delEventEiSt8functionIFvbEE(ptr noundef nonnull align 8 dereferenceable(432) %35, i32 noundef %38, ptr noundef %12)
          to label %44 unwind label %61

44:                                               ; preds = %42
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @"_ZZN3chw6Socket11onConnectedERKSt10shared_ptrINS_7SockNumEERKSt8functionIFvRKNS_13SockExceptionEEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = invoke noundef zeroext i1 @_ZN3chw6Socket11attachEventERKSt10shared_ptrINS_7SockNumEE(ptr noundef nonnull align 8 dereferenceable(1072) %18, ptr noundef nonnull align 8 dereferenceable(16) %45)
          to label %47 unwind label %27

47:                                               ; preds = %44
  br i1 %46, label %80, label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef @.str.7, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %50 unwind label %66

50:                                               ; preds = %48
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %14, i32 noundef 255, ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef 0)
          to label %51 unwind label %70

51:                                               ; preds = %50
  invoke void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32) %49, ptr noundef nonnull align 8 dereferenceable(48) %14)
          to label %52 unwind label %74

52:                                               ; preds = %51
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #5
  store i32 1, ptr %10, align 4
  br label %100

53:                                               ; preds = %31
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %8, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %9, align 4
  call void @_ZNSt12__shared_ptrIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  br label %104

57:                                               ; preds = %39
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %8, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %9, align 4
  br label %65

61:                                               ; preds = %42
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %8, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %9, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  br label %65

65:                                               ; preds = %61, %57
  call void @"_ZZN3chw6Socket11onConnectedERKSt10shared_ptrINS_7SockNumEERKSt8functionIFvRKNS_13SockExceptionEEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  br label %104

66:                                               ; preds = %48
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %8, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %9, align 4
  br label %79

70:                                               ; preds = %50
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %8, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %9, align 4
  br label %78

74:                                               ; preds = %51
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %8, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %9, align 4
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #5
  br label %78

78:                                               ; preds = %74, %70
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  br label %79

79:                                               ; preds = %78, %66
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #5
  br label %104

80:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %81 = getelementptr inbounds %"class.chw::Socket", ptr %18, i32 0, i32 15
  invoke void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEEC2ERS3_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(48) %81)
          to label %82 unwind label %89

82:                                               ; preds = %80
  %83 = getelementptr inbounds %"class.chw::Socket", ptr %18, i32 0, i32 13
  %84 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3chw6SockFDELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %83) #5
  br i1 %84, label %85, label %97

85:                                               ; preds = %82
  %86 = getelementptr inbounds %"class.chw::Socket", ptr %18, i32 0, i32 13
  %87 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6SockFDELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %86) #5
  invoke void @_ZN3chw6SockFD12setConnectedEv(ptr noundef nonnull align 8 dereferenceable(32) %87)
          to label %88 unwind label %93

88:                                               ; preds = %85
  br label %97

89:                                               ; preds = %80
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %8, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %9, align 4
  br label %103

93:                                               ; preds = %85
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %8, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %9, align 4
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  br label %103

97:                                               ; preds = %88, %82
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32) %98, ptr noundef nonnull align 8 dereferenceable(48) %7)
          to label %99 unwind label %27

99:                                               ; preds = %97
  store i32 0, ptr %10, align 4
  br label %100

100:                                              ; preds = %99, %52, %26
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #5
  %101 = load i32, ptr %10, align 4
  switch i32 %101, label %110 [
    i32 0, label %102
    i32 1, label %102
  ]

102:                                              ; preds = %100, %100
  ret void

103:                                              ; preds = %93, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %104

104:                                              ; preds = %103, %79, %65, %53, %27
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #5
  br label %105

105:                                              ; preds = %104
  %106 = load ptr, ptr %8, align 8
  %107 = load i32, ptr %9, align 4
  %108 = insertvalue { ptr, i32 } poison, ptr %106, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %107, 1
  resume { ptr, i32 } %109

110:                                              ; preds = %100
  unreachable
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3chwL10getSockErrEib(ptr dead_on_unwind noalias writable sret(%"class.chw::SockException") align 8, i32 noundef, i1 noundef zeroext) #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

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

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

declare noundef i32 @_ZN3chw9EventLoop8delEventEiSt8functionIFvbEE(ptr noundef nonnull align 8 dereferenceable(432), i32 noundef, ptr noundef) #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3chw6Socket11attachEventERKSt10shared_ptrINS_7SockNumEE(ptr noundef nonnull align 8 dereferenceable(1072), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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

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

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


; 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::SockException" = type { %"class.std::exception", i32, i32, %"class.std::__cxx11::basic_string" }
%"class.std::exception" = 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.std::shared_ptr.101" = type { %"class.std::__shared_ptr.102" }
%"class.std::__shared_ptr.102" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::function.104" = 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.107 = type { %"class.std::shared_ptr.101" }
%"class.std::allocator" = type { i8 }
%"class.std::lock_guard" = type { ptr }

@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3chw6Socket11onConnectedERKSt10shared_ptrINS_7SockNumEERKSt8functionIFvRKNS_13SockExceptionEEE(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.chw::SockException", align 8
  %5 = alloca %"class.std::shared_ptr.101", align 8
  %6 = alloca %"class.std::function.104", align 8
  %7 = alloca %class.anon.107, align 8
  %8 = alloca %"class.chw::SockException", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca %"class.std::lock_guard", align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #5
  %12 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %13 = tail call noundef i32 @_ZNK3chw7SockNum5rawFdEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @_ZN3chwL10getSockErrEib(ptr dead_on_unwind nonnull writable sret(%"class.chw::SockException") align 8 %4, i32 noundef %13, i1 noundef zeroext false)
  %14 = call noundef zeroext i1 @_ZNK3chw13SockExceptioncvbEv(ptr noundef nonnull align 8 dereferenceable(48) %4)
  br i1 %14, label %.invoke, label %17

15:                                               ; preds = %.invoke, %25
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %61

17:                                               ; preds = %3
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %1) #5
  invoke void @_ZN3chw6Socket7setSockESt10shared_ptrINS_7SockNumEE(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull %5)
          to label %18 unwind label %32

18:                                               ; preds = %17
  call void @_ZNSt12__shared_ptrIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  %19 = getelementptr inbounds i8, ptr %0, i64 288
  %20 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  %21 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %22 = call noundef i32 @_ZNK3chw7SockNum5rawFdEv(ptr noundef nonnull align 4 dereferenceable(8) %21)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %1) #5
  invoke void @"_ZNSt8functionIFvbEEC2IZN3chw6Socket11onConnectedERKSt10shared_ptrINS3_7SockNumEERKS_IFvRKNS3_13SockExceptionEEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %23 unwind label %34

23:                                               ; preds = %18
  %24 = invoke noundef i32 @_ZN3chw9EventLoop8delEventEiSt8functionIFvbEE(ptr noundef nonnull align 8 dereferenceable(432) %20, i32 noundef %22, ptr noundef nonnull %6)
          to label %25 unwind label %36

25:                                               ; preds = %23
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @"_ZZN3chw6Socket11onConnectedERKSt10shared_ptrINS_7SockNumEERKSt8functionIFvRKNS_13SockExceptionEEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  %26 = invoke noundef zeroext i1 @_ZN3chw6Socket11attachEventERKSt10shared_ptrINS_7SockNumEE(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %27 unwind label %15

27:                                               ; preds = %25
  br i1 %26, label %47, label %28

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str.7, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %29 unwind label %39

29:                                               ; preds = %28
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %8, i32 noundef 255, ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef 0)
          to label %30 unwind label %41

30:                                               ; preds = %29
  invoke void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(48) %8)
          to label %31 unwind label %43

31:                                               ; preds = %30
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #5
  br label %59

32:                                               ; preds = %17
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  br label %61

34:                                               ; preds = %18
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %23
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %38

38:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @"_ZZN3chw6Socket11onConnectedERKSt10shared_ptrINS_7SockNumEERKSt8functionIFvRKNS_13SockExceptionEEEEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %61

39:                                               ; preds = %28
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %46

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

43:                                               ; preds = %30
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  br label %45

45:                                               ; preds = %43, %41
  %.pn16 = phi { ptr, i32 } [ %44, %43 ], [ %42, %41 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  br label %46

46:                                               ; preds = %45, %39
  %.pn16.pn = phi { ptr, i32 } [ %.pn16, %45 ], [ %40, %39 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #5
  br label %61

47:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %48 = getelementptr inbounds i8, ptr %0, i64 304
  invoke void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEEC2ERS3_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(48) %48)
          to label %49 unwind label %54

49:                                               ; preds = %47
  %50 = getelementptr inbounds i8, ptr %0, i64 272
  %51 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3chw6SockFDELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %50) #5
  br i1 %51, label %52, label %58

52:                                               ; preds = %49
  %53 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6SockFDELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %50) #5
  invoke void @_ZN3chw6SockFD12setConnectedEv(ptr noundef nonnull align 8 dereferenceable(32) %53)
          to label %58 unwind label %56

54:                                               ; preds = %47
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %60

56:                                               ; preds = %52
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br label %60

58:                                               ; preds = %52, %49
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %.invoke

.invoke:                                          ; preds = %3, %58
  invoke void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(48) %4)
          to label %59 unwind label %15

59:                                               ; preds = %.invoke, %31
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  ret void

60:                                               ; preds = %56, %54
  %.pn19 = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %61

61:                                               ; preds = %60, %46, %38, %32, %15
  %.pn21 = phi { ptr, i32 } [ %16, %15 ], [ %.pn19, %60 ], [ %.pn16.pn, %46 ], [ %.pn, %38 ], [ %33, %32 ]
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn21
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3chwL10getSockErrEib(ptr dead_on_unwind noalias writable sret(%"class.chw::SockException") align 8, i32 noundef, i1 noundef zeroext) local_unnamed_addr #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

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

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

declare noundef i32 @_ZN3chw9EventLoop8delEventEiSt8functionIFvbEE(ptr noundef nonnull align 8 dereferenceable(432), i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3chw6Socket11attachEventERKSt10shared_ptrINS_7SockNumEE(ptr noundef nonnull align 8 dereferenceable(1072), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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

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

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


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