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

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

@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__._ZN3chw6Socket6send_bEPcj = external hidden unnamed_addr constant [7 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [21 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3chw6Socket8shutdownERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072), ptr noundef nonnull align 8 dereferenceable(48)) #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedIN3chw6BufferEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES4_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.29") align 8) #6

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3chw6Buffer11SetCapacityEm(ptr noundef nonnull align 8 dereferenceable(25), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw6Buffer6Reset0Ev(ptr noundef nonnull align 8 dereferenceable(25)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3chw6Socket6send_bEPcj(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef %1, i32 noundef %2) #3 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 %"class.std::lock_guard", align 8
  %9 = alloca %"class.std::shared_ptr.29", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.chw::SockException", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::allocator", align 1
  %15 = alloca i32, align 4
  %16 = alloca %"class.chw::LogContextCapture", align 8
  %17 = alloca i64, align 8
  %18 = alloca %"class.chw::SockException", align 8
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca %"class.std::allocator", align 1
  %21 = alloca %"class.chw::SockException", align 8
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"class.std::allocator", align 1
  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
  %24 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %25 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 15
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEEC2ERS3_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(48) %25)
  %26 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %27 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %26) #7
  br i1 %27, label %62, label %28

28:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  invoke void @_ZSt11make_sharedIN3chw6BufferEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES4_E4typeEEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.29") align 8 %9)
          to label %29 unwind label %40

29:                                               ; preds = %28
  %30 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3chw6BufferEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  call void @_ZNSt12__shared_ptrIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  %32 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %33 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %32) #7
  %34 = invoke noundef i32 @_ZN3chw6Buffer11SetCapacityEm(ptr noundef nonnull align 8 dereferenceable(25) %33, i64 noundef 262144)
          to label %35 unwind label %44

35:                                               ; preds = %29
  %36 = icmp eq i32 %34, 1
  br i1 %36, label %37, label %57

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef @.str.23, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %38 unwind label %48

38:                                               ; preds = %37
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %12, i32 noundef 6, ptr noundef nonnull align 8 dereferenceable(32) %13, i32 noundef 0)
          to label %39 unwind label %52

39:                                               ; preds = %38
  call void @_ZN3chw6Socket8shutdownERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072) %24, ptr noundef nonnull align 8 dereferenceable(48) %12)
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #7
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %210

40:                                               ; preds = %28
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %10, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  br label %212

44:                                               ; preds = %205, %194, %189, %183, %176, %172, %168, %148, %142, %96, %91, %85, %78, %74, %70, %62, %57, %29
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %10, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %11, align 4
  br label %212

48:                                               ; preds = %37
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %10, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %11, align 4
  br label %56

52:                                               ; preds = %38
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %10, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  br label %56

56:                                               ; preds = %52, %48
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #7
  br label %212

57:                                               ; preds = %35
  %58 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %59 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %58) #7
  invoke void @_ZN3chw6Buffer6Reset0Ev(ptr noundef nonnull align 8 dereferenceable(25) %59)
          to label %60 unwind label %44

60:                                               ; preds = %57
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61, %3
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %66 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %65) #7
  %67 = invoke noundef i64 @_ZN3chw6Buffer4IdleEv(ptr noundef nonnull align 8 dereferenceable(25) %66)
          to label %68 unwind label %44

68:                                               ; preds = %62
  %69 = icmp ule i64 %64, %67
  br i1 %69, label %70, label %96

70:                                               ; preds = %68
  %71 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %72 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %71) #7
  %73 = invoke noundef ptr @_ZN3chw6Buffer4dataEv(ptr noundef nonnull align 8 dereferenceable(25) %72)
          to label %74 unwind label %44

74:                                               ; preds = %70
  %75 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %76 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %75) #7
  %77 = invoke noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %76)
          to label %78 unwind label %44

78:                                               ; preds = %74
  %79 = getelementptr inbounds i8, ptr %73, i64 %77
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load i32, ptr %7, align 4, !tbaa !9
  %84 = zext i32 %83 to i64
  invoke void @_ZN3chwL8s_memcpyEPvlPKvl(ptr noundef %79, i64 noundef %81, ptr noundef %82, i64 noundef %84)
          to label %85 unwind label %44

85:                                               ; preds = %78
  %86 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %87 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %86) #7
  %88 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %89 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %88) #7
  %90 = invoke noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %89)
          to label %91 unwind label %44

91:                                               ; preds = %85
  %92 = load i32, ptr %7, align 4, !tbaa !9
  %93 = zext i32 %92 to i64
  %94 = add i64 %90, %93
  invoke void @_ZN3chw6Buffer7SetSizeEm(ptr noundef nonnull align 8 dereferenceable(25) %87, i64 noundef %94)
          to label %95 unwind label %44

95:                                               ; preds = %91
  br label %194

96:                                               ; preds = %68
  %97 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %98 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %97) #7
  %99 = invoke noundef i64 @_ZN3chw6Buffer8CapacityEv(ptr noundef nonnull align 8 dereferenceable(25) %98)
          to label %100 unwind label %44

100:                                              ; preds = %96
  %101 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 26
  %102 = load i32, ptr %101, align 8, !tbaa !11
  %103 = zext i32 %102 to i64
  %104 = icmp ugt i64 %99, %103
  br i1 %104, label %105, label %142

105:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #7
  %106 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %107 unwind label %119

107:                                              ; preds = %105
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(144) %106, i32 noundef 4, ptr noundef @.str.2, ptr noundef @__FUNCTION__._ZN3chw6Socket6send_bEPcj, i32 noundef 1157, ptr noundef @.str.1)
          to label %108 unwind label %119

108:                                              ; preds = %107
  %109 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA21_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 1 dereferenceable(21) @.str.28)
          to label %110 unwind label %123

110:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %111 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %112 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %111) #7
  %113 = invoke noundef i64 @_ZN3chw6Buffer8CapacityEv(ptr noundef nonnull align 8 dereferenceable(25) %112)
          to label %114 unwind label %127

114:                                              ; preds = %110
  store i64 %113, ptr %17, align 8, !tbaa !52
  %115 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsImEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %109, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %116 unwind label %127

116:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef @.str.23, ptr noundef nonnull align 1 dereferenceable(1) %20)
          to label %117 unwind label %133

117:                                              ; preds = %116
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %18, i32 noundef 6, ptr noundef nonnull align 8 dereferenceable(32) %19, i32 noundef 0)
          to label %118 unwind label %137

118:                                              ; preds = %117
  call void @_ZN3chw6Socket8shutdownERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072) %24, ptr noundef nonnull align 8 dereferenceable(48) %18)
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %18) #7
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %210

119:                                              ; preds = %107, %105
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %10, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %11, align 4
  br label %132

123:                                              ; preds = %108
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %10, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %11, align 4
  br label %131

127:                                              ; preds = %114, %110
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %10, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %131

131:                                              ; preds = %127, %123
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  br label %132

132:                                              ; preds = %131, %119
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  br label %212

133:                                              ; preds = %116
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %10, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %11, align 4
  br label %141

137:                                              ; preds = %117
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %10, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  br label %141

141:                                              ; preds = %137, %133
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %18) #7
  br label %212

142:                                              ; preds = %100
  %143 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %144 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %143) #7
  %145 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %146 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %145) #7
  %147 = invoke noundef i64 @_ZN3chw6Buffer8CapacityEv(ptr noundef nonnull align 8 dereferenceable(25) %146)
          to label %148 unwind label %44

148:                                              ; preds = %142
  %149 = load i32, ptr %7, align 4, !tbaa !9
  %150 = zext i32 %149 to i64
  %151 = add i64 %147, %150
  %152 = mul i64 %151, 2
  %153 = invoke noundef i32 @_ZN3chw6Buffer11SetCapacityEm(ptr noundef nonnull align 8 dereferenceable(25) %144, i64 noundef %152)
          to label %154 unwind label %44

154:                                              ; preds = %148
  %155 = icmp eq i32 %153, 1
  br i1 %155, label %156, label %168

156:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 48, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef @.str.23, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %157 unwind label %159

157:                                              ; preds = %156
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %21, i32 noundef 6, ptr noundef nonnull align 8 dereferenceable(32) %22, i32 noundef 0)
          to label %158 unwind label %163

158:                                              ; preds = %157
  call void @_ZN3chw6Socket8shutdownERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072) %24, ptr noundef nonnull align 8 dereferenceable(48) %21)
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #7
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %210

159:                                              ; preds = %156
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %10, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %11, align 4
  br label %167

163:                                              ; preds = %157
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %10, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #7
  br label %167

167:                                              ; preds = %163, %159
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #7
  br label %212

168:                                              ; preds = %154
  %169 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %170 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %169) #7
  %171 = invoke noundef ptr @_ZN3chw6Buffer4dataEv(ptr noundef nonnull align 8 dereferenceable(25) %170)
          to label %172 unwind label %44

172:                                              ; preds = %168
  %173 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %174 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %173) #7
  %175 = invoke noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %174)
          to label %176 unwind label %44

176:                                              ; preds = %172
  %177 = getelementptr inbounds i8, ptr %171, i64 %175
  %178 = load i32, ptr %7, align 4, !tbaa !9
  %179 = zext i32 %178 to i64
  %180 = load ptr, ptr %6, align 8, !tbaa !5
  %181 = load i32, ptr %7, align 4, !tbaa !9
  %182 = zext i32 %181 to i64
  invoke void @_ZN3chwL8s_memcpyEPvlPKvl(ptr noundef %177, i64 noundef %179, ptr noundef %180, i64 noundef %182)
          to label %183 unwind label %44

183:                                              ; preds = %176
  %184 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %185 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %184) #7
  %186 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %187 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %186) #7
  %188 = invoke noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %187)
          to label %189 unwind label %44

189:                                              ; preds = %183
  %190 = load i32, ptr %7, align 4, !tbaa !9
  %191 = zext i32 %190 to i64
  %192 = add i64 %188, %191
  invoke void @_ZN3chw6Buffer7SetSizeEm(ptr noundef nonnull align 8 dereferenceable(25) %185, i64 noundef %192)
          to label %193 unwind label %44

193:                                              ; preds = %189
  br label %194

194:                                              ; preds = %193, %95
  %195 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 25
  %196 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %195) #7
  %197 = invoke noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %196)
          to label %198 unwind label %44

198:                                              ; preds = %194
  %199 = icmp ugt i64 %197, 65536
  br i1 %199, label %200, label %209

200:                                              ; preds = %198
  %201 = getelementptr inbounds %"class.chw::Socket", ptr %24, i32 0, i32 4
  %202 = call noundef zeroext i1 @_ZNKSt6atomicIbEcvbEv(ptr noundef nonnull align 1 dereferenceable(1) %201) #7
  %203 = zext i1 %202 to i32
  %204 = icmp eq i32 %203, 1
  br i1 %204, label %205, label %208

205:                                              ; preds = %200
  %206 = invoke noundef i32 @_ZN3chw6Socket7flush_bEv(ptr noundef nonnull align 8 dereferenceable(1072) %24)
          to label %207 unwind label %44

207:                                              ; preds = %205
  br label %208

208:                                              ; preds = %207, %200
  br label %209

209:                                              ; preds = %208, %198
  store i32 0, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %210

210:                                              ; preds = %209, %158, %118, %39
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %211 = load i32, ptr %4, align 4
  ret i32 %211

212:                                              ; preds = %167, %141, %132, %56, %44, %40
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %213

213:                                              ; preds = %212
  %214 = load ptr, ptr %10, align 8
  %215 = load i32, ptr %11, align 4
  %216 = insertvalue { ptr, i32 } poison, ptr %214, 0
  %217 = insertvalue { ptr, i32 } %216, i32 %215, 1
  resume { ptr, i32 } %217
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN3chwL8s_memcpyEPvlPKvl(ptr noundef, i64 noundef, ptr noundef, i64 noundef) #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw6Buffer7SetSizeEm(ptr noundef nonnull align 8 dereferenceable(25), i64 noundef) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3chw6Socket7flush_bEv(ptr noundef nonnull align 8 dereferenceable(1072)) #3 align 2

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 840}
!12 = !{!"_ZTSN3chw6SocketE", !13, i64 0, !10, i64 16, !10, i64 20, !17, i64 24, !17, i64 25, !19, i64 26, !19, i64 27, !20, i64 32, !23, i64 48, !23, i64 120, !29, i64 192, !31, i64 208, !25, i64 224, !33, i64 272, !35, i64 288, !37, i64 304, !40, i64 352, !42, i64 384, !43, i64 416, !44, i64 448, !37, i64 480, !45, i64 528, !45, i64 656, !47, i64 784, !48, i64 792, !49, i64 824, !10, i64 840, !25, i64 848, !29, i64 896, !10, i64 912, !51, i64 920, !49, i64 928, !45, i64 944}
!13 = !{!"_ZTSSt23enable_shared_from_thisIN3chw6SocketEE", !14, i64 0}
!14 = !{!"_ZTSSt8weak_ptrIN3chw6SocketEE", !15, i64 0}
!15 = !{!"_ZTSSt10__weak_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !16, i64 8}
!16 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!17 = !{!"_ZTSSt6atomicIbE", !18, i64 0}
!18 = !{!"_ZTSSt13__atomic_baseIbE", !19, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSSt10shared_ptrI16sockaddr_storageE", !21, i64 0}
!21 = !{!"_ZTSSt12__shared_ptrI16sockaddr_storageLN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !22, i64 8}
!22 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!23 = !{!"_ZTSN3chw10BytesSpeedE", !24, i64 0, !24, i64 8, !24, i64 16, !25, i64 24}
!24 = !{!"long", !7, i64 0}
!25 = !{!"_ZTSN3chw6TickerE", !24, i64 0, !24, i64 8, !24, i64 16, !26, i64 24}
!26 = !{!"_ZTSN3chw17LogContextCaptureE", !27, i64 0, !6, i64 16}
!27 = !{!"_ZTSSt10shared_ptrIN3chw10LogContextEE", !28, i64 0}
!28 = !{!"_ZTSSt12__shared_ptrIN3chw10LogContextELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !22, i64 8}
!29 = !{!"_ZTSSt10shared_ptrIN3chw5TimerEE", !30, i64 0}
!30 = !{!"_ZTSSt12__shared_ptrIN3chw5TimerELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !22, i64 8}
!31 = !{!"_ZTSSt10shared_ptrIvE", !32, i64 0}
!32 = !{!"_ZTSSt12__shared_ptrIvLN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !22, i64 8}
!33 = !{!"_ZTSSt10shared_ptrIN3chw6SockFDEE", !34, i64 0}
!34 = !{!"_ZTSSt12__shared_ptrIN3chw6SockFDELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !22, i64 8}
!35 = !{!"_ZTSSt10shared_ptrIN3chw9EventLoopEE", !36, i64 0}
!36 = !{!"_ZTSSt12__shared_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !22, i64 8}
!37 = !{!"_ZTSN3chw12MutexWrapperISt15recursive_mutexEE", !19, i64 0, !38, i64 8}
!38 = !{!"_ZTSSt15recursive_mutex", !39, i64 0}
!39 = !{!"_ZTSSt22__recursive_mutex_base", !7, i64 0}
!40 = !{!"_ZTSSt8functionIFvRKN3chw13SockExceptionEEE", !41, i64 0, !6, i64 24}
!41 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!42 = !{!"_ZTSSt8functionIFbvEE", !41, i64 0, !6, i64 24}
!43 = !{!"_ZTSSt8functionIFvRSt10shared_ptrIN3chw6SocketEERS0_IvEEE", !41, i64 0, !6, i64 24}
!44 = !{!"_ZTSSt8functionIFSt10shared_ptrIN3chw6SocketEERKS0_INS1_9EventLoopEEEE", !41, i64 0, !6, i64 24}
!45 = !{!"_ZTS16sockaddr_storage", !46, i64 0, !7, i64 2, !24, i64 120}
!46 = !{!"short", !7, i64 0}
!47 = !{!"_ZTSN3chw6Socket9SEND_TYPEE", !7, i64 0}
!48 = !{!"_ZTSSt8functionIFvRSt10shared_ptrIN3chw6BufferEEP8sockaddriEE", !41, i64 0, !6, i64 24}
!49 = !{!"_ZTSSt10shared_ptrIN3chw6BufferEE", !50, i64 0}
!50 = !{!"_ZTSSt12__shared_ptrIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !22, i64 8}
!51 = !{!"double", !7, i64 0}
!52 = !{!24, !24, i64 0}


; 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.29" = type { %"class.std::__shared_ptr.30" }
%"class.std::__shared_ptr.30" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::lock_guard" = type { ptr }
%"class.chw::SockException" = type { %"class.std::exception", i32, i32, %"class.std::__cxx11::basic_string" }
%"class.std::exception" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"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" }

@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__._ZN3chw6Socket6send_bEPcj = external hidden unnamed_addr constant [7 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [21 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3chw6Socket8shutdownERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedIN3chw6BufferEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES4_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.29") align 8) local_unnamed_addr #6

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3chw6Buffer11SetCapacityEm(ptr noundef nonnull align 8 dereferenceable(25), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw6Buffer6Reset0Ev(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN3chw6Socket6send_bEPcj(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::lock_guard", align 8
  %5 = alloca %"class.std::shared_ptr.29", align 8
  %6 = alloca %"class.chw::SockException", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %"class.chw::LogContextCapture", align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.chw::SockException", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca %"class.chw::SockException", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %17 = getelementptr inbounds i8, ptr %0, i64 304
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEEC2ERS3_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(48) %17)
  %18 = getelementptr inbounds i8, ptr %0, i64 824
  %19 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %18) #7
  br i1 %19, label %41, label %20

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  invoke void @_ZSt11make_sharedIN3chw6BufferEJEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES4_E4typeEEDpOT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.29") align 8 %5)
          to label %21 unwind label %30

21:                                               ; preds = %20
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3chw6BufferEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @_ZNSt12__shared_ptrIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  %23 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %24 = invoke noundef i32 @_ZN3chw6Buffer11SetCapacityEm(ptr noundef nonnull align 8 dereferenceable(25) %23, i64 noundef 262144)
          to label %25 unwind label %32

25:                                               ; preds = %21
  %26 = icmp eq i32 %24, 1
  br i1 %26, label %27, label %39

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

28:                                               ; preds = %27
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %6, i32 noundef 6, ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 0)
          to label %29 unwind label %36

29:                                               ; preds = %28
  call void @_ZN3chw6Socket8shutdownERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull align 8 dereferenceable(48) %6)
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #7
  br label %113

30:                                               ; preds = %20
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br label %114

32:                                               ; preds = %.invoke, %111, %77, %39, %21
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %114

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

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

38:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #7
  br label %114

39:                                               ; preds = %25
  %40 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  invoke void @_ZN3chw6Buffer6Reset0Ev(ptr noundef nonnull align 8 dereferenceable(25) %40)
          to label %41 unwind label %32

41:                                               ; preds = %39, %3
  %42 = zext i32 %2 to i64
  %43 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %44 = call noundef i64 @_ZN3chw6Buffer4IdleEv(ptr noundef nonnull align 8 dereferenceable(25) %43)
  %.not = icmp ult i64 %44, %42
  %45 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  br i1 %.not, label %46, label %.invoke

46:                                               ; preds = %41
  %47 = call noundef i64 @_ZN3chw6Buffer8CapacityEv(ptr noundef nonnull align 8 dereferenceable(25) %45)
  %48 = getelementptr inbounds i8, ptr %0, i64 840
  %49 = load i32, ptr %48, align 8, !tbaa !5
  %50 = zext i32 %49 to i64
  %51 = icmp ugt i64 %47, %50
  br i1 %51, label %52, label %77

52:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  %53 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %54 unwind label %64

54:                                               ; preds = %52
  invoke void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(144) %53, i32 noundef 4, ptr noundef nonnull @.str.2, ptr noundef nonnull @__FUNCTION__._ZN3chw6Socket6send_bEPcj, i32 noundef 1157, ptr noundef nonnull @.str.1)
          to label %55 unwind label %64

55:                                               ; preds = %54
  %56 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA21_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 1 dereferenceable(21) @.str.28)
          to label %57 unwind label %66

57:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %58 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %59 = call noundef i64 @_ZN3chw6Buffer8CapacityEv(ptr noundef nonnull align 8 dereferenceable(25) %58)
  store i64 %59, ptr %10, align 8, !tbaa !50
  %60 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsImEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %61 unwind label %68

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull @.str.23, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %62 unwind label %72

62:                                               ; preds = %61
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %11, i32 noundef 6, ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef 0)
          to label %63 unwind label %74

63:                                               ; preds = %62
  call void @_ZN3chw6Socket8shutdownERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull align 8 dereferenceable(48) %11)
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #7
  br label %113

64:                                               ; preds = %54, %52
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %71

66:                                               ; preds = %55
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %70

68:                                               ; preds = %57
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %70

70:                                               ; preds = %68, %66
  %.pn25 = phi { ptr, i32 } [ %69, %68 ], [ %67, %66 ]
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  br label %71

71:                                               ; preds = %70, %64
  %.pn25.pn = phi { ptr, i32 } [ %.pn25, %70 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  br label %114

72:                                               ; preds = %61
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %76

74:                                               ; preds = %62
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  br label %76

76:                                               ; preds = %74, %72
  %.pn28 = phi { ptr, i32 } [ %75, %74 ], [ %73, %72 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #7
  br label %114

77:                                               ; preds = %46
  %78 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %79 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %80 = call noundef i64 @_ZN3chw6Buffer8CapacityEv(ptr noundef nonnull align 8 dereferenceable(25) %79)
  %81 = add i64 %80, %42
  %82 = shl i64 %81, 1
  %83 = invoke noundef i32 @_ZN3chw6Buffer11SetCapacityEm(ptr noundef nonnull align 8 dereferenceable(25) %78, i64 noundef %82)
          to label %84 unwind label %32

84:                                               ; preds = %77
  %85 = icmp eq i32 %83, 1
  br i1 %85, label %86, label %94

86:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull @.str.23, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %87 unwind label %89

87:                                               ; preds = %86
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %14, i32 noundef 6, ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef 0)
          to label %88 unwind label %91

88:                                               ; preds = %87
  call void @_ZN3chw6Socket8shutdownERKNS_13SockExceptionE(ptr noundef nonnull align 8 dereferenceable(1072) %0, ptr noundef nonnull align 8 dereferenceable(48) %14)
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %14) #7
  br label %113

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

91:                                               ; preds = %87
  %92 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  br label %93

93:                                               ; preds = %91, %89
  %.pn23 = phi { ptr, i32 } [ %92, %91 ], [ %90, %89 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %14) #7
  br label %114

94:                                               ; preds = %84
  %95 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  br label %.invoke

.invoke:                                          ; preds = %41, %94
  %.sink = phi ptr [ %95, %94 ], [ %45, %41 ]
  %96 = call noundef ptr @_ZN3chw6Buffer4dataEv(ptr noundef nonnull align 8 dereferenceable(25) %.sink)
  %97 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %98 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %97)
  %99 = getelementptr inbounds i8, ptr %96, i64 %98
  call void @_ZN3chwL8s_memcpyEPvlPKvl(ptr noundef %99, i64 noundef %42, ptr noundef %1, i64 noundef %42)
  %100 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %101 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %102 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %101)
  %103 = add i64 %102, %42
  invoke void @_ZN3chw6Buffer7SetSizeEm(ptr noundef nonnull align 8 dereferenceable(25) %100, i64 noundef %103)
          to label %104 unwind label %32

104:                                              ; preds = %.invoke
  %105 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  %106 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %105)
  %107 = icmp ugt i64 %106, 65536
  br i1 %107, label %108, label %113

108:                                              ; preds = %104
  %109 = getelementptr inbounds i8, ptr %0, i64 25
  %110 = call noundef zeroext i1 @_ZNKSt6atomicIbEcvbEv(ptr noundef nonnull align 1 dereferenceable(1) %109) #7
  br i1 %110, label %111, label %113

111:                                              ; preds = %108
  %112 = invoke noundef i32 @_ZN3chw6Socket7flush_bEv(ptr noundef nonnull align 8 dereferenceable(1072) %0)
          to label %113 unwind label %32

113:                                              ; preds = %104, %111, %108, %88, %63, %29
  %.019 = phi i32 [ 1, %63 ], [ 1, %88 ], [ 1, %29 ], [ 0, %108 ], [ 0, %111 ], [ 0, %104 ]
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  ret i32 %.019

114:                                              ; preds = %93, %76, %71, %38, %32, %30
  %.pn30 = phi { ptr, i32 } [ %33, %32 ], [ %.pn28, %76 ], [ %.pn25.pn, %71 ], [ %.pn23, %93 ], [ %.pn, %38 ], [ %31, %30 ]
  call void @_ZNSt10lock_guardIN3chw12MutexWrapperISt15recursive_mutexEEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn30
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN3chwL8s_memcpyEPvlPKvl(ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3chw6Buffer7SetSizeEm(ptr noundef nonnull align 8 dereferenceable(25), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3chw6Socket7flush_bEv(ptr noundef nonnull align 8 dereferenceable(1072)) local_unnamed_addr #3 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #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 = { 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, !14, i64 840}
!6 = !{!"_ZTSN3chw6SocketE", !7, i64 0, !14, i64 16, !14, i64 20, !15, i64 24, !15, i64 25, !17, i64 26, !17, i64 27, !18, i64 32, !21, i64 48, !21, i64 120, !27, i64 192, !29, i64 208, !23, i64 224, !31, i64 272, !33, i64 288, !35, i64 304, !38, i64 352, !40, i64 384, !41, i64 416, !42, i64 448, !35, i64 480, !43, i64 528, !43, i64 656, !45, i64 784, !46, i64 792, !47, i64 824, !14, i64 840, !23, i64 848, !27, i64 896, !14, i64 912, !49, i64 920, !47, i64 928, !43, i64 944}
!7 = !{!"_ZTSSt23enable_shared_from_thisIN3chw6SocketEE", !8, i64 0}
!8 = !{!"_ZTSSt8weak_ptrIN3chw6SocketEE", !9, i64 0}
!9 = !{!"_ZTSSt10__weak_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !13, i64 8}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0}
!14 = !{!"int", !11, i64 0}
!15 = !{!"_ZTSSt6atomicIbE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIbE", !17, i64 0}
!17 = !{!"bool", !11, i64 0}
!18 = !{!"_ZTSSt10shared_ptrI16sockaddr_storageE", !19, i64 0}
!19 = !{!"_ZTSSt12__shared_ptrI16sockaddr_storageLN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !20, i64 8}
!20 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0}
!21 = !{!"_ZTSN3chw10BytesSpeedE", !22, i64 0, !22, i64 8, !22, i64 16, !23, i64 24}
!22 = !{!"long", !11, i64 0}
!23 = !{!"_ZTSN3chw6TickerE", !22, i64 0, !22, i64 8, !22, i64 16, !24, i64 24}
!24 = !{!"_ZTSN3chw17LogContextCaptureE", !25, i64 0, !10, i64 16}
!25 = !{!"_ZTSSt10shared_ptrIN3chw10LogContextEE", !26, i64 0}
!26 = !{!"_ZTSSt12__shared_ptrIN3chw10LogContextELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !20, i64 8}
!27 = !{!"_ZTSSt10shared_ptrIN3chw5TimerEE", !28, i64 0}
!28 = !{!"_ZTSSt12__shared_ptrIN3chw5TimerELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !20, i64 8}
!29 = !{!"_ZTSSt10shared_ptrIvE", !30, i64 0}
!30 = !{!"_ZTSSt12__shared_ptrIvLN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !20, i64 8}
!31 = !{!"_ZTSSt10shared_ptrIN3chw6SockFDEE", !32, i64 0}
!32 = !{!"_ZTSSt12__shared_ptrIN3chw6SockFDELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !20, i64 8}
!33 = !{!"_ZTSSt10shared_ptrIN3chw9EventLoopEE", !34, i64 0}
!34 = !{!"_ZTSSt12__shared_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !20, i64 8}
!35 = !{!"_ZTSN3chw12MutexWrapperISt15recursive_mutexEE", !17, i64 0, !36, i64 8}
!36 = !{!"_ZTSSt15recursive_mutex", !37, i64 0}
!37 = !{!"_ZTSSt22__recursive_mutex_base", !11, i64 0}
!38 = !{!"_ZTSSt8functionIFvRKN3chw13SockExceptionEEE", !39, i64 0, !10, i64 24}
!39 = !{!"_ZTSSt14_Function_base", !11, i64 0, !10, i64 16}
!40 = !{!"_ZTSSt8functionIFbvEE", !39, i64 0, !10, i64 24}
!41 = !{!"_ZTSSt8functionIFvRSt10shared_ptrIN3chw6SocketEERS0_IvEEE", !39, i64 0, !10, i64 24}
!42 = !{!"_ZTSSt8functionIFSt10shared_ptrIN3chw6SocketEERKS0_INS1_9EventLoopEEEE", !39, i64 0, !10, i64 24}
!43 = !{!"_ZTS16sockaddr_storage", !44, i64 0, !11, i64 2, !22, i64 120}
!44 = !{!"short", !11, i64 0}
!45 = !{!"_ZTSN3chw6Socket9SEND_TYPEE", !11, i64 0}
!46 = !{!"_ZTSSt8functionIFvRSt10shared_ptrIN3chw6BufferEEP8sockaddriEE", !39, i64 0, !10, i64 24}
!47 = !{!"_ZTSSt10shared_ptrIN3chw6BufferEE", !48, i64 0}
!48 = !{!"_ZTSSt12__shared_ptrIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !20, i64 8}
!49 = !{!"double", !11, i64 0}
!50 = !{!22, !22, i64 0}


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