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

; 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" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.101" = type { %"class.std::__shared_ptr.102" }
%"class.std::__shared_ptr.102" = type { ptr, %"class.std::__shared_count" }
%"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] }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }
%"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::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 }
%"class.std::shared_ptr.114" = type { %"class.std::__shared_ptr.115" }
%"class.std::__shared_ptr.115" = type { ptr, %"class.std::__shared_count" }
%"class.std::function.117" = 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.119 = type { %"class.std::weak_ptr.3", %"class.std::shared_ptr.101" }
%"class.std::lock_guard" = type { ptr }
%"class.std::shared_ptr.14" = type { %"class.std::__shared_ptr.15" }
%"class.std::__shared_ptr.15" = type { ptr, %"class.std::__shared_count" }
%class.anon.120 = type { %"class.std::shared_ptr", %"class.std::shared_ptr.101" }
%"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" }
%"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.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.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" }

@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [68 x i8], align 1
@_ZTISt9exception = external constant ptr
@__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [30 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

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 #2

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

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

declare ptr @__cxa_begin_catch(ptr)

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

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

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

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

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

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

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

; 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) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw6Socket7setSockESt10shared_ptrINS_7SockNumEE(ptr noundef nonnull align 8 dereferenceable(1072), ptr noundef) #0 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 #5 align 2

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

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

declare noundef i32 @_ZN3chw12get_uv_errorEb(i1 noundef zeroext) #2

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

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

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

declare void @__cxa_end_catch()

declare noundef i32 @_ZN3chw8SockUtil12setNoSigpipeEi(i32 noundef) #2

declare noundef i32 @_ZN3chw8SockUtil12setNoBlockedEib(i32 noundef, i1 noundef zeroext) #2

declare noundef i32 @_ZN3chw8SockUtil10setCloExecEib(i32 noundef, i1 noundef zeroext) #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %2) #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.sockaddr_storage, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.chw::SockException", align 8
  %14 = alloca %"class.chw::LogContextCapture", align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.std::weak_ptr.3", align 8
  %17 = alloca %"class.std::shared_ptr", align 8
  %18 = alloca %"class.std::shared_ptr.114", align 8
  %19 = alloca %"class.std::function.117", align 8
  %20 = alloca %class.anon.119, align 8
  %21 = alloca %"class.std::shared_ptr", align 8
  %22 = alloca %"class.std::lock_guard", align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca %"class.std::shared_ptr", align 8
  %26 = alloca ptr, align 8
  %27 = alloca %"class.chw::LogContextCapture", align 8
  %28 = alloca ptr, align 8
  %29 = alloca %"class.std::shared_ptr", align 8
  %30 = alloca %"class.std::shared_ptr.101", align 8
  %31 = alloca i32, align 4
  %32 = alloca %"class.std::shared_ptr.101", align 8
  %33 = alloca %"class.std::shared_ptr.14", align 8
  %34 = alloca %class.anon.120, align 8
  %35 = alloca %"class.std::lock_guard", align 8
  %36 = alloca ptr, align 8
  %37 = alloca %"class.chw::LogContextCapture", align 8
  %38 = alloca ptr, align 8
  %39 = alloca %"class.chw::SockException", align 8
  %40 = alloca %"class.chw::LogContextCapture", align 8
  %41 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %42 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #10
  call void @llvm.lifetime.start.p0(i64 128, ptr %9) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  store i32 128, ptr %10, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %228, %206, %3
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = and i32 %45, 1
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %209

48:                                               ; preds = %44
  br label %49

49:                                               ; preds = %63, %48
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %50) #10
  %52 = invoke noundef i32 @_ZNK3chw7SockNum5rawFdEv(ptr noundef nonnull align 4 dereferenceable(8) %51)
          to label %53 unwind label %231

53:                                               ; preds = %49
  %54 = invoke i32 @accept(i32 noundef %52, ptr noundef %9, ptr noundef %10)
          to label %55 unwind label %231

55:                                               ; preds = %53
  store i32 %54, ptr %8, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = icmp eq i32 -1, %57
  br i1 %58, label %59, label %63

59:                                               ; preds = %56
  %60 = invoke noundef i32 @_ZN3chw12get_uv_errorEb(i1 noundef zeroext true)
          to label %61 unwind label %231

61:                                               ; preds = %59
  %62 = icmp eq i32 -4, %60
  br label %63

63:                                               ; preds = %61, %56
  %64 = phi i1 [ false, %56 ], [ %62, %61 ]
  br i1 %64, label %49, label %65, !llvm.loop !11

65:                                               ; preds = %63
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = icmp eq i32 %66, -1
  br i1 %67, label %68, label %94

68:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  %69 = invoke noundef i32 @_ZN3chw12get_uv_errorEb(i1 noundef zeroext true)
          to label %70 unwind label %231

70:                                               ; preds = %68
  store i32 %69, ptr %11, align 4, !tbaa !9
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = icmp eq i32 %71, -11
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  store i32 0, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %93

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #10
  %75 = load i32, ptr %11, align 4, !tbaa !9
  invoke void @_ZN3chwL15toSockExceptionEi(ptr dead_on_unwind writable sret(%"class.chw::SockException") align 8 %13, i32 noundef %75)
          to label %76 unwind label %231

76:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #10
  %77 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %78 unwind label %231

78:                                               ; preds = %76
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(144) %77, i32 noundef 4, ptr noundef @.str.2, ptr noundef @__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi, i32 noundef 577, ptr noundef @.str.1)
          to label %79 unwind label %231

79:                                               ; preds = %78
  %80 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA23_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 1 dereferenceable(23) @.str.14)
          to label %81 unwind label %231

81:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %82 = call noundef ptr @_ZNK3chw13SockException4whatEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #10
  store ptr %82, ptr %15, align 8, !tbaa !5
  %83 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %80, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %84 unwind label %231

84:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #10
  invoke void @_ZNSt23enable_shared_from_thisIN3chw6SocketEE16shared_from_thisEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %17, ptr noundef nonnull align 8 dereferenceable(16) %42)
          to label %85 unwind label %231

85:                                               ; preds = %84
  call void @_ZNSt8weak_ptrIN3chw6SocketEEC2IS1_vEERKSt10shared_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %17) #10
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #10
  %86 = getelementptr inbounds %"class.chw::Socket", ptr %42, i32 0, i32 14
  %87 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %86) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #10
  %88 = getelementptr inbounds %class.anon.119, ptr %20, i32 0, i32 0
  call void @_ZNSt8weak_ptrIN3chw6SocketEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %88, ptr noundef nonnull align 8 dereferenceable(16) %16) #10
  %89 = getelementptr inbounds %class.anon.119, ptr %20, i32 0, i32 1
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %89, ptr noundef nonnull align 8 dereferenceable(16) %90) #10
  invoke void @"_ZNSt8functionIFmvEEC2IZN3chw6Socket8onAcceptERKSt10shared_ptrINS3_7SockNumEEiE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %91 unwind label %231

91:                                               ; preds = %85
  invoke void @_ZN3chw9EventLoop11doDelayTaskEmSt8functionIFmvEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.114") align 8 %18, ptr noundef nonnull align 8 dereferenceable(432) %87, i64 noundef 100, ptr noundef %19)
          to label %92 unwind label %231

92:                                               ; preds = %91
  call void @_ZNSt12__shared_ptrIN3chw17TaskCancelableImpIFmvEJEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #10
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #10
  call void @"_ZZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEiEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(32) %20) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #10
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  call void @_ZNSt10__weak_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #10
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #10
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #10
  br label %93

93:                                               ; preds = %92, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  br label %229

94:                                               ; preds = %65
  %95 = load i32, ptr %8, align 4, !tbaa !9
  %96 = invoke noundef i32 @_ZN3chw8SockUtil12setNoSigpipeEi(i32 noundef %95)
          to label %97 unwind label %231

97:                                               ; preds = %94
  %98 = load i32, ptr %8, align 4, !tbaa !9
  %99 = invoke noundef i32 @_ZN3chw8SockUtil12setNoBlockedEib(i32 noundef %98, i1 noundef zeroext true)
          to label %100 unwind label %231

100:                                              ; preds = %97
  %101 = load i32, ptr %8, align 4, !tbaa !9
  %102 = invoke noundef i32 @_ZN3chw8SockUtil10setNoDelayEib(i32 noundef %101, i1 noundef zeroext true)
          to label %103 unwind label %231

103:                                              ; preds = %100
  %104 = load i32, ptr %8, align 4, !tbaa !9
  %105 = invoke noundef i32 @_ZN3chw8SockUtil10setSendBufEii(i32 noundef %104, i32 noundef 262144)
          to label %106 unwind label %231

106:                                              ; preds = %103
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = invoke noundef i32 @_ZN3chw8SockUtil10setRecvBufEii(i32 noundef %107, i32 noundef 262144)
          to label %109 unwind label %231

109:                                              ; preds = %106
  %110 = load i32, ptr %8, align 4, !tbaa !9
  %111 = invoke noundef i32 @_ZN3chw8SockUtil12setCloseWaitEii(i32 noundef %110, i32 noundef 0)
          to label %112 unwind label %231

112:                                              ; preds = %109
  %113 = load i32, ptr %8, align 4, !tbaa !9
  %114 = invoke noundef i32 @_ZN3chw8SockUtil10setCloExecEib(i32 noundef %113, i1 noundef zeroext true)
          to label %115 unwind label %231

115:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #10
  call void @_ZNSt10shared_ptrIN3chw6SocketEEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %116 = getelementptr inbounds %"class.chw::Socket", ptr %42, i32 0, i32 20
  invoke void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEEC2ERS3_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(48) %116)
          to label %117 unwind label %122

117:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #10
  %118 = getelementptr inbounds %"class.chw::Socket", ptr %42, i32 0, i32 19
  %119 = getelementptr inbounds %"class.chw::Socket", ptr %42, i32 0, i32 14
  invoke void @_ZNKSt8functionIFSt10shared_ptrIN3chw6SocketEERKS0_INS1_9EventLoopEEEEclES7_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %25, ptr noundef nonnull align 8 dereferenceable(32) %118, ptr noundef nonnull align 8 dereferenceable(16) %119)
          to label %120 unwind label %126

120:                                              ; preds = %117
  %121 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3chw6SocketEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %25) #10
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %25) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #10
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %154

122:                                              ; preds = %115
  %123 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %23, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %24, align 4
  br label %130

126:                                              ; preds = %117
  %127 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %23, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #10
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #10
  br label %130

130:                                              ; preds = %126, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %24, align 4
  %133 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #10
  %134 = icmp eq i32 %132, %133
  br i1 %134, label %135, label %234

135:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #10
  %136 = load ptr, ptr %23, align 8
  %137 = call ptr @__cxa_begin_catch(ptr %136) #10
  store ptr %137, ptr %26, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #10
  %138 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %139 unwind label %231

139:                                              ; preds = %135
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(144) %138, i32 noundef 4, ptr noundef @.str.2, ptr noundef @__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi, i32 noundef 615, ptr noundef @.str.1)
          to label %140 unwind label %231

140:                                              ; preds = %139
  %141 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA48_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 1 dereferenceable(48) @.str.15)
          to label %142 unwind label %231

142:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #10
  %143 = load ptr, ptr %26, align 8, !tbaa !5
  %144 = load ptr, ptr %143, align 8, !tbaa !13
  %145 = getelementptr inbounds ptr, ptr %144, i64 2
  %146 = load ptr, ptr %145, align 8
  %147 = call noundef ptr %146(ptr noundef nonnull align 8 dereferenceable(8) %143) #10
  store ptr %147, ptr %28, align 8, !tbaa !5
  %148 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %141, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %149 unwind label %231

149:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #10
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #10
  %150 = load i32, ptr %8, align 4, !tbaa !9
  %151 = invoke i32 @close(i32 noundef %150)
          to label %152 unwind label %231

152:                                              ; preds = %149
  store i32 2, ptr %12, align 4
  invoke void @__cxa_end_catch()
          to label %153 unwind label %231

153:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #10
  br label %206

154:                                              ; preds = %120
  %155 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %21) #10
  br i1 %155, label %160, label %156

156:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #10
  %157 = getelementptr inbounds %"class.chw::Socket", ptr %42, i32 0, i32 14
  invoke void @_ZN3chw6Socket12createSocketERKSt10shared_ptrINS_9EventLoopEEb(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %29, ptr noundef nonnull align 8 dereferenceable(16) %157, i1 noundef zeroext false)
          to label %158 unwind label %231

158:                                              ; preds = %156
  %159 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3chw6SocketEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %29) #10
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %29) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #10
  br label %160

160:                                              ; preds = %158, %154
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #10
  store i32 0, ptr %31, align 4, !tbaa !15
  invoke void @_ZSt11make_sharedIN3chw7SockNumEJRiNS1_8SockTypeEEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.101") align 8 %30, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %161 unwind label %231

161:                                              ; preds = %160
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #10
  %162 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %21) #10
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(16) %30) #10
  invoke void @_ZN3chw6Socket7setSockESt10shared_ptrINS_7SockNumEE(ptr noundef nonnull align 8 dereferenceable(1072) %162, ptr noundef %32)
          to label %163 unwind label %231

163:                                              ; preds = %161
  call void @_ZNSt12__shared_ptrIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %32) #10
  %164 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %21) #10
  %165 = getelementptr inbounds %"class.chw::Socket", ptr %164, i32 0, i32 22
  %166 = load i32, ptr %10, align 4, !tbaa !9
  %167 = zext i32 %166 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %165, ptr align 8 %9, i64 %167, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #10
  %168 = getelementptr inbounds %class.anon.120, ptr %34, i32 0, i32 0
  call void @_ZNSt10shared_ptrIN3chw6SocketEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %168, ptr noundef nonnull align 8 dereferenceable(16) %21) #10
  %169 = getelementptr inbounds %class.anon.120, ptr %34, i32 0, i32 1
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %169, ptr noundef nonnull align 8 dereferenceable(16) %30) #10
  invoke void @"_ZNSt10shared_ptrIvEC2IZN3chw6Socket8onAcceptERKS_INS2_7SockNumEEiE3$_1EEDnT_"(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr null, ptr noundef %34)
          to label %170 unwind label %231

170:                                              ; preds = %163
  call void @"_ZZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEiEN3$_1D2Ev"(ptr noundef nonnull align 8 dereferenceable(32) %34) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #10
  %171 = getelementptr inbounds %"class.chw::Socket", ptr %42, i32 0, i32 20
  invoke void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEEC2ERS3_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(48) %171)
          to label %172 unwind label %175

172:                                              ; preds = %170
  %173 = getelementptr inbounds %"class.chw::Socket", ptr %42, i32 0, i32 18
  invoke void @_ZNKSt8functionIFvRSt10shared_ptrIN3chw6SocketEERS0_IvEEEclES4_S6_(ptr noundef nonnull align 8 dereferenceable(32) %173, ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %33)
          to label %174 unwind label %179

174:                                              ; preds = %172
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %35) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #10
  br label %204

175:                                              ; preds = %170
  %176 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %23, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %24, align 4
  br label %183

179:                                              ; preds = %172
  %180 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %23, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %24, align 4
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %35) #10
  br label %183

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

184:                                              ; preds = %183
  %185 = load i32, ptr %24, align 4
  %186 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #10
  %187 = icmp eq i32 %185, %186
  br i1 %187, label %188, label %234

188:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #10
  %189 = load ptr, ptr %23, align 8
  %190 = call ptr @__cxa_begin_catch(ptr %189) #10
  store ptr %190, ptr %36, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %37) #10
  %191 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %192 unwind label %231

192:                                              ; preds = %188
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(144) %191, i32 noundef 4, ptr noundef @.str.2, ptr noundef @__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi, i32 noundef 649, ptr noundef @.str.1)
          to label %193 unwind label %231

193:                                              ; preds = %192
  %194 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA41_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 1 dereferenceable(41) @.str.16)
          to label %195 unwind label %231

195:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #10
  %196 = load ptr, ptr %36, align 8, !tbaa !5
  %197 = load ptr, ptr %196, align 8, !tbaa !13
  %198 = getelementptr inbounds ptr, ptr %197, i64 2
  %199 = load ptr, ptr %198, align 8
  %200 = call noundef ptr %199(ptr noundef nonnull align 8 dereferenceable(8) %196) #10
  store ptr %200, ptr %38, align 8, !tbaa !5
  %201 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %194, ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %202 unwind label %231

202:                                              ; preds = %195
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #10
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %37) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #10
  store i32 2, ptr %12, align 4
  invoke void @__cxa_end_catch()
          to label %203 unwind label %231

203:                                              ; preds = %202
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #10
  br label %205

204:                                              ; preds = %174
  store i32 0, ptr %12, align 4
  br label %205

205:                                              ; preds = %204, %203
  call void @_ZNSt12__shared_ptrIvLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %33) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #10
  call void @_ZNSt12__shared_ptrIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %30) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #10
  br label %206

206:                                              ; preds = %205, %153
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #10
  %207 = load i32, ptr %12, align 4
  switch i32 %207, label %236 [
    i32 0, label %208
    i32 2, label %43
  ]

208:                                              ; preds = %206
  br label %209

209:                                              ; preds = %208, %44
  %210 = load i32, ptr %7, align 4, !tbaa !9
  %211 = and i32 %210, 4
  %212 = icmp ne i32 %211, 0
  br i1 %212, label %213, label %228

213:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 48, ptr %39) #10
  %214 = load ptr, ptr %6, align 8, !tbaa !5
  %215 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %214) #10
  %216 = invoke noundef i32 @_ZNK3chw7SockNum5rawFdEv(ptr noundef nonnull align 4 dereferenceable(8) %215)
          to label %217 unwind label %231

217:                                              ; preds = %213
  invoke void @_ZN3chwL10getSockErrEib(ptr dead_on_unwind writable sret(%"class.chw::SockException") align 8 %39, i32 noundef %216, i1 noundef zeroext true)
          to label %218 unwind label %231

218:                                              ; preds = %217
  %219 = call noundef zeroext i1 @_ZN3chw6Socket7emitErrERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072) %42, ptr noundef nonnull align 8 dereferenceable(48) %39) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %40) #10
  %220 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %221 unwind label %231

221:                                              ; preds = %218
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(144) %220, i32 noundef 4, ptr noundef @.str.2, ptr noundef @__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi, i32 noundef 657, ptr noundef @.str.1)
          to label %222 unwind label %231

222:                                              ; preds = %221
  %223 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA30_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 1 dereferenceable(30) @.str.17)
          to label %224 unwind label %231

224:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #10
  %225 = call noundef ptr @_ZNK3chw13SockException4whatEv(ptr noundef nonnull align 8 dereferenceable(48) %39) #10
  store ptr %225, ptr %41, align 8, !tbaa !5
  %226 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %223, ptr noundef nonnull align 8 dereferenceable(8) %41)
          to label %227 unwind label %231

227:                                              ; preds = %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #10
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %40) #10
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %39) #10
  call void @llvm.lifetime.end.p0(i64 48, ptr %39) #10
  br label %229

228:                                              ; preds = %209
  br label %43, !llvm.loop !17

229:                                              ; preds = %227, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 128, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  %230 = load i32, ptr %4, align 4
  ret i32 %230

231:                                              ; preds = %224, %222, %221, %218, %217, %213, %202, %195, %193, %192, %188, %163, %161, %160, %156, %152, %149, %142, %140, %139, %135, %112, %109, %106, %103, %100, %97, %94, %91, %85, %84, %81, %79, %78, %76, %74, %68, %59, %53, %49
  %232 = landingpad { ptr, i32 }
          catch ptr null
  %233 = extractvalue { ptr, i32 } %232, 0
  call void @__clang_call_terminate(ptr %233) #11
  unreachable

234:                                              ; preds = %184, %131
  %235 = load ptr, ptr %23, align 8
  call void @__clang_call_terminate(ptr %235) #11
  unreachable

236:                                              ; preds = %206
  unreachable
}

declare i32 @accept(i32 noundef, ptr noundef, ptr noundef) #2

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

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

declare void @_ZN3chw9EventLoop11doDelayTaskEmSt8functionIFmvEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.114") align 8, ptr noundef nonnull align 8 dereferenceable(432), i64 noundef, ptr noundef) #2

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

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

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

declare noundef i32 @_ZN3chw8SockUtil10setNoDelayEib(i32 noundef, i1 noundef zeroext) #2

declare noundef i32 @_ZN3chw8SockUtil10setSendBufEii(i32 noundef, i32 noundef) #2

declare noundef i32 @_ZN3chw8SockUtil10setRecvBufEii(i32 noundef, i32 noundef) #2

declare noundef i32 @_ZN3chw8SockUtil12setCloseWaitEii(i32 noundef, i32 noundef) #2

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

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

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

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

declare i32 @close(i32 noundef) #2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #9

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt10shared_ptrIvEC2IZN3chw6Socket8onAcceptERKS_INS2_7SockNumEEiE3$_1EEDnT_"(ptr noundef nonnull align 8 dereferenceable(16), ptr, ptr noundef) unnamed_addr #0 align 2

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

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

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

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind memory(none) }
attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { nounwind }
attributes #11 = { 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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTSN3chw7SockNum8SockTypeE", !7, i64 0}
!17 = distinct !{!17, !12}


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

%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.101" = type { %"class.std::__shared_ptr.102" }
%"class.std::__shared_ptr.102" = type { ptr, %"class.std::__shared_count" }
%"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] }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }
%"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::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 }
%"class.std::shared_ptr.114" = type { %"class.std::__shared_ptr.115" }
%"class.std::__shared_ptr.115" = type { ptr, %"class.std::__shared_count" }
%"class.std::function.117" = 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.119 = type { %"class.std::weak_ptr.3", %"class.std::shared_ptr.101" }
%"class.std::lock_guard" = type { ptr }
%"class.std::shared_ptr.14" = type { %"class.std::__shared_ptr.15" }
%"class.std::__shared_ptr.15" = type { ptr, %"class.std::__shared_count" }
%class.anon.120 = type { %"class.std::shared_ptr", %"class.std::shared_ptr.101" }

@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [68 x i8], align 1
@_ZTISt9exception = external constant ptr
@__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [30 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

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 #2

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

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

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

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

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

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

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

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

; 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 #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3chw7SockNum5rawFdEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 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 #0 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 #5 align 2

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

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

declare noundef i32 @_ZN3chw12get_uv_errorEb(i1 noundef zeroext) local_unnamed_addr #2

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

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

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

declare void @__cxa_end_catch() local_unnamed_addr

declare noundef i32 @_ZN3chw8SockUtil12setNoSigpipeEi(i32 noundef) local_unnamed_addr #2

declare noundef i32 @_ZN3chw8SockUtil12setNoBlockedEib(i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

declare noundef i32 @_ZN3chw8SockUtil10setCloExecEib(i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 -1, 1) i32 @_ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %2) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca %struct.sockaddr_storage, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.chw::SockException", align 8
  %8 = alloca %"class.chw::LogContextCapture", align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::weak_ptr.3", align 8
  %11 = alloca %"class.std::shared_ptr", align 8
  %12 = alloca %"class.std::shared_ptr.114", align 8
  %13 = alloca %"class.std::function.117", align 8
  %14 = alloca %class.anon.119, align 8
  %15 = alloca %"class.std::shared_ptr", align 8
  %16 = alloca %"class.std::lock_guard", align 8
  %17 = alloca %"class.std::shared_ptr", align 8
  %18 = alloca %"class.chw::LogContextCapture", align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"class.std::shared_ptr", align 8
  %21 = alloca %"class.std::shared_ptr.101", align 8
  %22 = alloca i32, align 4
  %23 = alloca %"class.std::shared_ptr.101", align 8
  %24 = alloca %"class.std::shared_ptr.14", align 8
  %25 = alloca %class.anon.120, align 8
  %26 = alloca %"class.std::lock_guard", align 8
  %27 = alloca %"class.chw::LogContextCapture", align 8
  %28 = alloca ptr, align 8
  %29 = alloca %"class.chw::SockException", align 8
  %30 = alloca %"class.chw::LogContextCapture", align 8
  %31 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #11
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %5) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #11
  store i32 128, ptr %6, align 4, !tbaa !5
  %32 = and i32 %2, 1
  %.not = icmp eq i32 %32, 0
  %33 = getelementptr inbounds i8, ptr %0, i64 480
  %34 = getelementptr inbounds i8, ptr %0, i64 448
  %35 = getelementptr inbounds i8, ptr %0, i64 288
  %36 = getelementptr inbounds i8, ptr %25, i64 16
  %37 = getelementptr inbounds i8, ptr %0, i64 416
  %38 = and i32 %2, 4
  %.not27 = icmp eq i32 %38, 0
  br i1 %.not, label %.split.us, label %.preheader

.split.us:                                        ; preds = %3
  %39 = xor i1 %.not27, true
  tail call void @llvm.assume(i1 %39)
  br label %.split33.us

.preheader:                                       ; preds = %3, %.preheader.backedge
  %40 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #11
  %41 = call noundef i32 @_ZNK3chw7SockNum5rawFdEv(ptr noundef nonnull align 4 dereferenceable(8) %40)
  %42 = invoke i32 @accept(i32 noundef %41, ptr noundef nonnull %5, ptr noundef nonnull %6)
          to label %43 unwind label %.loopexit

43:                                               ; preds = %.preheader
  store i32 %42, ptr %4, align 4, !tbaa !5
  %44 = icmp eq i32 %42, -1
  br i1 %44, label %45, label %.critedge.thread

45:                                               ; preds = %43
  %46 = invoke noundef i32 @_ZN3chw12get_uv_errorEb(i1 noundef zeroext true)
          to label %47 unwind label %.loopexit

47:                                               ; preds = %45
  %48 = icmp eq i32 %46, -4
  br i1 %48, label %.preheader.backedge, label %.critedge

.preheader.backedge:                              ; preds = %47, %.backedge
  br label %.preheader, !llvm.loop !9

.critedge:                                        ; preds = %47
  %.pr = load i32, ptr %4, align 4, !tbaa !5
  %49 = icmp eq i32 %.pr, -1
  br i1 %49, label %50, label %.critedge.thread

50:                                               ; preds = %.critedge
  %51 = invoke noundef i32 @_ZN3chw12get_uv_errorEb(i1 noundef zeroext true)
          to label %52 unwind label %.loopexit.split-lp.loopexit.split-lp

52:                                               ; preds = %50
  %53 = icmp eq i32 %51, -11
  br i1 %53, label %164, label %54

54:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #11
  invoke void @_ZN3chwL15toSockExceptionEi(ptr dead_on_unwind nonnull writable sret(%"class.chw::SockException") align 8 %7, i32 noundef %51)
          to label %55 unwind label %.loopexit.split-lp.loopexit.split-lp

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #11
  %56 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %57 unwind label %.loopexit.split-lp.loopexit.split-lp

57:                                               ; preds = %55
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(144) %56, i32 noundef 4, ptr noundef nonnull @.str.2, ptr noundef nonnull @__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi, i32 noundef 577, ptr noundef nonnull @.str.1)
          to label %58 unwind label %.loopexit.split-lp.loopexit.split-lp

58:                                               ; preds = %57
  %59 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA23_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 1 dereferenceable(23) @.str.14)
          to label %60 unwind label %.loopexit.split-lp.loopexit.split-lp

60:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #11
  %61 = call noundef ptr @_ZNK3chw13SockException4whatEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #11
  store ptr %61, ptr %9, align 8, !tbaa !11
  %62 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %63 unwind label %.loopexit.split-lp.loopexit.split-lp

63:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #11
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #11
  invoke void @_ZNSt23enable_shared_from_thisIN3chw6SocketEE16shared_from_thisEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %64 unwind label %.loopexit.split-lp.loopexit.split-lp

64:                                               ; preds = %63
  call void @_ZNSt8weak_ptrIN3chw6SocketEEC2IS1_vEERKSt10shared_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %11) #11
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #11
  %65 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %35) #11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #11
  call void @_ZNSt8weak_ptrIN3chw6SocketEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %10) #11
  %66 = getelementptr inbounds i8, ptr %14, i64 16
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %66, ptr noundef nonnull align 8 dereferenceable(16) %1) #11
  invoke void @"_ZNSt8functionIFmvEEC2IZN3chw6Socket8onAcceptERKSt10shared_ptrINS3_7SockNumEEiE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %67 unwind label %.loopexit.split-lp.loopexit.split-lp

67:                                               ; preds = %64
  invoke void @_ZN3chw9EventLoop11doDelayTaskEmSt8functionIFmvEE(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.114") align 8 %12, ptr noundef nonnull align 8 dereferenceable(432) %65, i64 noundef 100, ptr noundef nonnull %13)
          to label %68 unwind label %.loopexit.split-lp.loopexit.split-lp

68:                                               ; preds = %67
  call void @_ZNSt12__shared_ptrIN3chw17TaskCancelableImpIFmvEJEEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #11
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #11
  call void @"_ZZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEiEN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(32) %14) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #11
  call void @_ZNSt10__weak_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #11
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #11
  br label %164

.critedge.thread:                                 ; preds = %43, %.critedge
  %69 = phi i32 [ %.pr, %.critedge ], [ %42, %43 ]
  %70 = invoke noundef i32 @_ZN3chw8SockUtil12setNoSigpipeEi(i32 noundef %69)
          to label %71 unwind label %.loopexit.split-lp.loopexit

71:                                               ; preds = %.critedge.thread
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = invoke noundef i32 @_ZN3chw8SockUtil12setNoBlockedEib(i32 noundef %72, i1 noundef zeroext true)
          to label %74 unwind label %.loopexit.split-lp.loopexit

74:                                               ; preds = %71
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = invoke noundef i32 @_ZN3chw8SockUtil10setNoDelayEib(i32 noundef %75, i1 noundef zeroext true)
          to label %77 unwind label %.loopexit.split-lp.loopexit

77:                                               ; preds = %74
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = invoke noundef i32 @_ZN3chw8SockUtil10setSendBufEii(i32 noundef %78, i32 noundef 262144)
          to label %80 unwind label %.loopexit.split-lp.loopexit

80:                                               ; preds = %77
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = invoke noundef i32 @_ZN3chw8SockUtil10setRecvBufEii(i32 noundef %81, i32 noundef 262144)
          to label %83 unwind label %.loopexit.split-lp.loopexit

83:                                               ; preds = %80
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = invoke noundef i32 @_ZN3chw8SockUtil12setCloseWaitEii(i32 noundef %84, i32 noundef 0)
          to label %86 unwind label %.loopexit.split-lp.loopexit

86:                                               ; preds = %83
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = invoke noundef i32 @_ZN3chw8SockUtil10setCloExecEib(i32 noundef %87, i1 noundef zeroext true)
          to label %89 unwind label %.loopexit.split-lp.loopexit

89:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #11
  call void @_ZNSt10shared_ptrIN3chw6SocketEEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #11
  invoke void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEEC2ERS3_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(48) %33)
          to label %90 unwind label %94

90:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #11
  invoke void @_ZNKSt8functionIFSt10shared_ptrIN3chw6SocketEERKS0_INS1_9EventLoopEEEEclES7_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %17, ptr noundef nonnull align 8 dereferenceable(32) %34, ptr noundef nonnull align 8 dereferenceable(16) %35)
          to label %91 unwind label %96

91:                                               ; preds = %90
  %92 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3chw6SocketEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %17) #11
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #11
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #11
  %93 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #11
  br i1 %93, label %120, label %117

94:                                               ; preds = %89
  %95 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  br label %98

96:                                               ; preds = %90
  %97 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #11
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #11
  br label %98

98:                                               ; preds = %96, %94
  %.pn = phi { ptr, i32 } [ %97, %96 ], [ %95, %94 ]
  %.018 = extractvalue { ptr, i32 } %.pn, 1
  %.020 = extractvalue { ptr, i32 } %.pn, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #11
  %99 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #11
  %100 = icmp eq i32 %.018, %99
  br i1 %100, label %101, label %166

101:                                              ; preds = %98
  %102 = call ptr @__cxa_begin_catch(ptr %.020) #11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #11
  %103 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %104 unwind label %.loopexit.split-lp.loopexit

104:                                              ; preds = %101
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(144) %103, i32 noundef 4, ptr noundef nonnull @.str.2, ptr noundef nonnull @__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi, i32 noundef 615, ptr noundef nonnull @.str.1)
          to label %105 unwind label %.loopexit.split-lp.loopexit

105:                                              ; preds = %104
  %106 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA48_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 1 dereferenceable(48) @.str.15)
          to label %107 unwind label %.loopexit.split-lp.loopexit

107:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #11
  %108 = load ptr, ptr %102, align 8, !tbaa !13
  %109 = getelementptr inbounds i8, ptr %108, i64 16
  %110 = load ptr, ptr %109, align 8
  %111 = call noundef ptr %110(ptr noundef nonnull align 8 dereferenceable(8) %102) #11
  store ptr %111, ptr %19, align 8, !tbaa !11
  %112 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %106, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %113 unwind label %.loopexit.split-lp.loopexit

113:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #11
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #11
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = invoke i32 @close(i32 noundef %114)
          to label %116 unwind label %.loopexit.split-lp.loopexit

116:                                              ; preds = %113
  invoke void @__cxa_end_catch()
          to label %.backedge unwind label %.loopexit.split-lp.loopexit

117:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #11
  invoke void @_ZN3chw6Socket12createSocketERKSt10shared_ptrINS_9EventLoopEEb(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %20, ptr noundef nonnull align 8 dereferenceable(16) %35, i1 noundef zeroext false)
          to label %118 unwind label %.loopexit.split-lp.loopexit

118:                                              ; preds = %117
  %119 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3chw6SocketEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %20) #11
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #11
  br label %120

120:                                              ; preds = %118, %91
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %21) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #11
  store i32 0, ptr %22, align 4, !tbaa !15
  invoke void @_ZSt11make_sharedIN3chw7SockNumEJRiNS1_8SockTypeEEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES6_E4typeEEDpOT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.101") align 8 %21, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %121 unwind label %.loopexit.split-lp.loopexit

121:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #11
  %122 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %15) #11
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %21) #11
  invoke void @_ZN3chw6Socket7setSockESt10shared_ptrINS_7SockNumEE(ptr noundef nonnull align 8 dereferenceable(1072) %122, ptr noundef nonnull %23)
          to label %123 unwind label %.loopexit.split-lp.loopexit

123:                                              ; preds = %121
  call void @_ZNSt12__shared_ptrIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #11
  %124 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %15) #11
  %125 = getelementptr inbounds i8, ptr %124, i64 656
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = zext i32 %126 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %125, ptr nonnull align 8 %5, i64 %127, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %24) #11
  call void @_ZNSt10shared_ptrIN3chw6SocketEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(16) %15) #11
  call void @_ZNSt10shared_ptrIN3chw7SockNumEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(16) %21) #11
  invoke void @"_ZNSt10shared_ptrIvEC2IZN3chw6Socket8onAcceptERKS_INS2_7SockNumEEiE3$_1EEDnT_"(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr null, ptr noundef nonnull %25)
          to label %128 unwind label %.loopexit.split-lp.loopexit

128:                                              ; preds = %123
  call void @"_ZZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEiEN3$_1D2Ev"(ptr noundef nonnull align 8 dereferenceable(32) %25) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #11
  invoke void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEEC2ERS3_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(48) %33)
          to label %129 unwind label %131

129:                                              ; preds = %128
  invoke void @_ZNKSt8functionIFvRSt10shared_ptrIN3chw6SocketEERS0_IvEEEclES4_S6_(ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %130 unwind label %133

130:                                              ; preds = %129
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %26) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #11
  br label %151

131:                                              ; preds = %128
  %132 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  br label %135

133:                                              ; preds = %129
  %134 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %26) #11
  br label %135

135:                                              ; preds = %133, %131
  %.pn25 = phi { ptr, i32 } [ %134, %133 ], [ %132, %131 ]
  %.119 = extractvalue { ptr, i32 } %.pn25, 1
  %.121 = extractvalue { ptr, i32 } %.pn25, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #11
  %136 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #11
  %137 = icmp eq i32 %.119, %136
  br i1 %137, label %138, label %166

138:                                              ; preds = %135
  %139 = call ptr @__cxa_begin_catch(ptr %.121) #11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %27) #11
  %140 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %141 unwind label %.loopexit.split-lp.loopexit

141:                                              ; preds = %138
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(144) %140, i32 noundef 4, ptr noundef nonnull @.str.2, ptr noundef nonnull @__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi, i32 noundef 649, ptr noundef nonnull @.str.1)
          to label %142 unwind label %.loopexit.split-lp.loopexit

142:                                              ; preds = %141
  %143 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA41_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 1 dereferenceable(41) @.str.16)
          to label %144 unwind label %.loopexit.split-lp.loopexit

144:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #11
  %145 = load ptr, ptr %139, align 8, !tbaa !13
  %146 = getelementptr inbounds i8, ptr %145, i64 16
  %147 = load ptr, ptr %146, align 8
  %148 = call noundef ptr %147(ptr noundef nonnull align 8 dereferenceable(8) %139) #11
  store ptr %148, ptr %28, align 8, !tbaa !11
  %149 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %143, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %150 unwind label %.loopexit.split-lp.loopexit

150:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #11
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %27) #11
  invoke void @__cxa_end_catch()
          to label %151 unwind label %.loopexit.split-lp.loopexit

151:                                              ; preds = %150, %130
  %.016 = phi i32 [ 0, %130 ], [ 2, %150 ]
  call void @_ZNSt12__shared_ptrIvLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #11
  call void @_ZNSt12__shared_ptrIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #11
  br label %.backedge

.backedge:                                        ; preds = %116, %151
  %.117 = phi i32 [ %.016, %151 ], [ 2, %116 ]
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #11
  %switch = icmp ne i32 %.117, 0
  %or.cond = or i1 %.not27, %switch
  br i1 %or.cond, label %.preheader.backedge, label %.split33.us

.split33.us:                                      ; preds = %.backedge, %.split.us
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %29) #11
  %152 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SockNumELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #11
  %153 = call noundef i32 @_ZNK3chw7SockNum5rawFdEv(ptr noundef nonnull align 4 dereferenceable(8) %152)
  invoke void @_ZN3chwL10getSockErrEib(ptr dead_on_unwind nonnull writable sret(%"class.chw::SockException") align 8 %29, i32 noundef %153, i1 noundef zeroext true)
          to label %154 unwind label %.loopexit.split-lp.loopexit.split-lp

154:                                              ; preds = %.split33.us
  %155 = call noundef zeroext i1 @_ZN3chw6Socket7emitErrERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull align 8 dereferenceable(48) %29) #11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %30) #11
  %156 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %157 unwind label %.loopexit.split-lp.loopexit.split-lp

157:                                              ; preds = %154
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(144) %156, i32 noundef 4, ptr noundef nonnull @.str.2, ptr noundef nonnull @__FUNCTION__._ZN3chw6Socket8onAcceptERKSt10shared_ptrINS_7SockNumEEi, i32 noundef 657, ptr noundef nonnull @.str.1)
          to label %158 unwind label %.loopexit.split-lp.loopexit.split-lp

158:                                              ; preds = %157
  %159 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA30_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 1 dereferenceable(30) @.str.17)
          to label %160 unwind label %.loopexit.split-lp.loopexit.split-lp

160:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %31) #11
  %161 = call noundef ptr @_ZNK3chw13SockException4whatEv(ptr noundef nonnull align 8 dereferenceable(48) %29) #11
  store ptr %161, ptr %31, align 8, !tbaa !11
  %162 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIPKcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %159, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %163 unwind label %.loopexit.split-lp.loopexit.split-lp

163:                                              ; preds = %160
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #11
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %30) #11
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %29) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %29) #11
  br label %164

164:                                              ; preds = %68, %52, %163
  %.1 = phi i32 [ -1, %163 ], [ -1, %68 ], [ 0, %52 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #11
  ret i32 %.1

.loopexit:                                        ; preds = %.preheader, %45
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %150, %144, %142, %141, %138, %123, %121, %120, %117, %116, %113, %107, %105, %104, %101, %86, %83, %80, %77, %74, %71, %.critedge.thread
  %lpad.loopexit28 = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %160, %158, %157, %154, %.split33.us, %67, %64, %63, %60, %58, %57, %55, %54, %50
  %lpad.loopexit.split-lp29 = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit28, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp29, %.loopexit.split-lp.loopexit.split-lp ]
  %165 = extractvalue { ptr, i32 } %lpad.phi, 0
  call void @__clang_call_terminate(ptr %165) #12
  unreachable

166:                                              ; preds = %135, %98
  %.2 = phi ptr [ %.121, %135 ], [ %.020, %98 ]
  call void @__clang_call_terminate(ptr %.2) #12
  unreachable
}

declare i32 @accept(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare void @_ZN3chw9EventLoop11doDelayTaskEmSt8functionIFmvEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.114") align 8, ptr noundef nonnull align 8 dereferenceable(432), i64 noundef, ptr noundef) local_unnamed_addr #2

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

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

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

declare noundef i32 @_ZN3chw8SockUtil10setNoDelayEib(i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

declare noundef i32 @_ZN3chw8SockUtil10setSendBufEii(i32 noundef, i32 noundef) local_unnamed_addr #2

declare noundef i32 @_ZN3chw8SockUtil10setRecvBufEii(i32 noundef, i32 noundef) local_unnamed_addr #2

declare noundef i32 @_ZN3chw8SockUtil12setCloseWaitEii(i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

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

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

declare i32 @close(i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #9

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt10shared_ptrIvEC2IZN3chw6Socket8onAcceptERKS_INS2_7SockNumEEiE3$_1EEDnT_"(ptr noundef nonnull align 8 dereferenceable(16), ptr, ptr noundef) unnamed_addr #0 align 2

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #10

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nosync nounwind memory(none) }
attributes #9 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #11 = { nounwind }
attributes #12 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTSN3chw7SockNum8SockTypeE", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass