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

; 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::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.5" = type { %"class.std::__shared_ptr.6" }
%"class.std::__shared_ptr.6" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.8" = type { %"class.std::__shared_ptr.9" }
%"class.std::__shared_ptr.9" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = 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.anon = type { %"class.std::weak_ptr.3", ptr }
%"class.std::function.36" = type { %"class.std::_Function_base", ptr }
%class.anon.53 = type { %"class.std::weak_ptr.3", ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.chw::SockException" = type { %"class.std::exception", i32, i32, %"class.std::__cxx11::basic_string" }
%"class.std::exception" = type { ptr }
%"class.std::allocator" = type { i8 }
%struct.ifreq = type { %union.anon.54, %union.anon.55 }
%union.anon.54 = type { [16 x i8] }
%union.anon.55 = type { %struct.ifmap }
%struct.ifmap = type { i64, i64, i16, i8, i8, i8 }
%"class.chw::Client" = type { ptr, %"class.std::enable_shared_from_this", %"class.std::__cxx11::basic_string", %"class.std::shared_ptr", %"class.std::shared_ptr.0", %"class.std::function" }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.chw::RawSocket" = type <{ %"class.chw::Client", [6 x i8], [2 x i8], %struct.sockaddr_ll, [4 x i8] }>
%struct.sockaddr_ll = type { i16, i16, i32, i16, i8, i8, [8 x i8] }
%struct.sockaddr = type { i16, [14 x i8] }

@.str = external hidden unnamed_addr constant [71 x i8], align 1
@__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_ = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_(ptr noundef nonnull align 8 dereferenceable(148) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i16 noundef zeroext %2, i16 noundef zeroext %3, ptr noundef nonnull align 8 dereferenceable(32) %4) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i16, align 2
  %10 = alloca i16, align 2
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::weak_ptr.3", align 8
  %13 = alloca %"class.std::shared_ptr.5", align 8
  %14 = alloca %"class.std::shared_ptr.8", align 8
  %15 = alloca %"class.std::shared_ptr", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %"class.std::function", align 8
  %20 = alloca %class.anon, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"class.std::function.36", align 8
  %24 = alloca %class.anon.53, align 8
  %25 = alloca %"class.std::__cxx11::basic_string", align 8
  %26 = alloca %"class.chw::SockException", align 8
  %27 = alloca %"class.std::__cxx11::basic_string", align 8
  %28 = alloca %"class.std::allocator", align 1
  %29 = alloca %struct.ifreq, align 8
  %30 = alloca %"class.std::__cxx11::basic_string", align 8
  %31 = alloca %"class.chw::SockException", align 8
  %32 = alloca %"class.std::__cxx11::basic_string", align 8
  %33 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i16 %2, ptr %9, align 2, !tbaa !9
  store i16 %3, ptr %10, align 2, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #8
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  call void @_ZNSt23enable_shared_from_thisIN3chw6ClientEE16shared_from_thisEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.8") align 8 %14, ptr noundef nonnull align 8 dereferenceable(16) %35)
  call void @_ZSt19static_pointer_castIN3chw9RawSocketENS0_6ClientEESt10shared_ptrIT_ERKS3_IT0_E(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.5") align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %14) #8
  call void @_ZNSt8weak_ptrIN3chw9RawSocketEEC2IS1_vEERKSt10shared_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %13) #8
  call void @_ZNSt12__shared_ptrIN3chw9RawSocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #8
  call void @_ZNSt12__shared_ptrIN3chw6ClientELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #8
  %36 = getelementptr inbounds %"class.chw::Client", ptr %34, i32 0, i32 4
  invoke void @_ZN3chw6Socket12createSocketERKSt10shared_ptrINS_9EventLoopEEb(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %15, ptr noundef nonnull align 8 dereferenceable(16) %36, i1 noundef zeroext true)
          to label %37 unwind label %60

37:                                               ; preds = %5
  %38 = getelementptr inbounds %"class.chw::Client", ptr %34, i32 0, i32 3
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3chw6SocketEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %15) #8
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %40 = getelementptr inbounds %"class.chw::Client", ptr %34, i32 0, i32 3
  %41 = call noundef ptr @_ZNKSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %40) #8
  store ptr %41, ptr %18, align 8, !tbaa !5
  %42 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #8
  %43 = getelementptr inbounds %class.anon, ptr %20, i32 0, i32 0
  call void @_ZNSt8weak_ptrIN3chw9RawSocketEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 8 dereferenceable(16) %12) #8
  %44 = getelementptr inbounds %class.anon, ptr %20, i32 0, i32 1
  %45 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %45, ptr %44, align 8, !tbaa !11
  invoke void @"_ZNSt8functionIFvRKN3chw13SockExceptionEEEC2IZNS0_9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttSF_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %46 unwind label %64

46:                                               ; preds = %37
  invoke void @_ZN3chw6Socket8setOnErrESt8functionIFvRKNS_13SockExceptionEEE(ptr noundef nonnull align 8 dereferenceable(1072) %42, ptr noundef %19)
          to label %47 unwind label %68

47:                                               ; preds = %46
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #8
  call void @"_ZZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_EN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(24) %20) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %48 = invoke noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 3)
          to label %49 unwind label %73

49:                                               ; preds = %47
  %50 = zext i16 %48 to i32
  %51 = call i32 @socket(i32 noundef 17, i32 noundef 3, i32 noundef %50) #8
  store i32 %51, ptr %21, align 4, !tbaa !16
  %52 = load i32, ptr %21, align 4, !tbaa !16
  %53 = icmp slt i32 %52, 0
  br i1 %53, label %54, label %77

54:                                               ; preds = %49
  %55 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %56 unwind label %73

56:                                               ; preds = %54
  %57 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %58 unwind label %73

58:                                               ; preds = %56
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %55, i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 54, ptr noundef @.str.1, ptr noundef %57)
          to label %59 unwind label %73

59:                                               ; preds = %58
  store i32 1, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %284

60:                                               ; preds = %5
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %16, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  br label %288

64:                                               ; preds = %37
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %16, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %17, align 4
  br label %72

68:                                               ; preds = %46
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %16, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %17, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #8
  br label %72

72:                                               ; preds = %68, %64
  call void @"_ZZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_EN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(24) %20) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #8
  br label %287

73:                                               ; preds = %95, %86, %58, %56, %54, %47
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %16, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %17, align 4
  br label %286

77:                                               ; preds = %49
  %78 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #8
  %79 = getelementptr inbounds %class.anon.53, ptr %24, i32 0, i32 0
  call void @_ZNSt8weak_ptrIN3chw9RawSocketEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %79, ptr noundef nonnull align 8 dereferenceable(16) %12) #8
  %80 = getelementptr inbounds %class.anon.53, ptr %24, i32 0, i32 1
  %81 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %81, ptr %80, align 8, !tbaa !18
  invoke void @"_ZNSt8functionIFvRSt10shared_ptrIN3chw6BufferEEP8sockaddriEEC2IZNS1_9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttSI_E3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %82 unwind label %104

82:                                               ; preds = %77
  invoke void @_ZN3chw6Socket9setOnReadESt8functionIFvRSt10shared_ptrINS_6BufferEEP8sockaddriEE(ptr noundef nonnull align 8 dereferenceable(1072) %78, ptr noundef %23)
          to label %83 unwind label %108

83:                                               ; preds = %82
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #8
  call void @"_ZZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_EN3$_1D2Ev"(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %84) #8
  br i1 %85, label %86, label %136

86:                                               ; preds = %83
  %87 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %88 unwind label %73

88:                                               ; preds = %86
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %89) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #8
  %91 = getelementptr inbounds %"class.chw::RawSocket", ptr %34, i32 0, i32 1
  %92 = getelementptr inbounds [6 x i8], ptr %91, i64 0, i64 0
  invoke void @_ZN3chw11MacBuftoStrB5cxx11EPKh(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %25, ptr noundef %92)
          to label %93 unwind label %113

93:                                               ; preds = %88
  %94 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %25) #8
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %87, i32 noundef 1, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 79, ptr noundef @.str.2, ptr noundef %90, ptr noundef %94)
          to label %95 unwind label %117

95:                                               ; preds = %93
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #8
  %96 = load ptr, ptr %18, align 8, !tbaa !5
  %97 = load i32, ptr %21, align 4, !tbaa !16
  %98 = invoke noundef zeroext i1 @_ZN3chw6Socket8fromSockEiNS_7SockNum8SockTypeE(ptr noundef nonnull align 8 dereferenceable(1072) %96, i32 noundef %97, i32 noundef 1)
          to label %99 unwind label %73

99:                                               ; preds = %95
  %100 = getelementptr inbounds %"class.chw::Client", ptr %34, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 48, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %28)
          to label %101 unwind label %122

101:                                              ; preds = %99
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %26, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef 0)
          to label %102 unwind label %126

102:                                              ; preds = %101
  invoke void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32) %100, ptr noundef nonnull align 8 dereferenceable(48) %26)
          to label %103 unwind label %130

103:                                              ; preds = %102
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %26) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %26) #8
  store i32 0, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %284

104:                                              ; preds = %77
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %16, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %17, align 4
  br label %112

108:                                              ; preds = %82
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %16, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %17, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #8
  br label %112

112:                                              ; preds = %108, %104
  call void @"_ZZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_EN3$_1D2Ev"(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  br label %286

113:                                              ; preds = %88
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %16, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %17, align 4
  br label %121

117:                                              ; preds = %93
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %16, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %17, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #8
  br label %121

121:                                              ; preds = %117, %113
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #8
  br label %286

122:                                              ; preds = %99
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %16, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %17, align 4
  br label %135

126:                                              ; preds = %101
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %16, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %17, align 4
  br label %134

130:                                              ; preds = %102
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %16, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %17, align 4
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %26) #8
  br label %134

134:                                              ; preds = %130, %126
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #8
  br label %135

135:                                              ; preds = %134, %122
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %26) #8
  br label %286

136:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 40, ptr %29) #8
  %137 = getelementptr inbounds %struct.ifreq, ptr %29, i32 0, i32 0
  %138 = getelementptr inbounds [16 x i8], ptr %137, i64 0, i64 0
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %139) #8
  %141 = call ptr @strcpy(ptr noundef %138, ptr noundef %140) #8
  %142 = load i32, ptr %21, align 4, !tbaa !16
  %143 = call i32 (i32, i64, ...) @ioctl(i32 noundef %142, i64 noundef 35091, ptr noundef %29) #8
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %160

145:                                              ; preds = %136
  %146 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %147 unwind label %156

147:                                              ; preds = %145
  %148 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %149 unwind label %156

149:                                              ; preds = %147
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %150) #8
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %146, i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 89, ptr noundef @.str.4, ptr noundef %148, ptr noundef %151)
          to label %152 unwind label %156

152:                                              ; preds = %149
  %153 = load i32, ptr %21, align 4, !tbaa !16
  %154 = invoke i32 @close(i32 noundef %153)
          to label %155 unwind label %156

155:                                              ; preds = %152
  store i32 1, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %282

156:                                              ; preds = %250, %241, %238, %235, %231, %230, %227, %225, %211, %210, %208, %206, %191, %187, %186, %184, %182, %174, %173, %171, %169, %152, %149, %147, %145
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %16, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %17, align 4
  br label %283

160:                                              ; preds = %136
  %161 = getelementptr inbounds %struct.ifreq, ptr %29, i32 0, i32 1
  %162 = load i16, ptr %161, align 8, !tbaa !20
  %163 = sext i16 %162 to i32
  %164 = or i32 %163, 256
  %165 = trunc i32 %164 to i16
  store i16 %165, ptr %161, align 8, !tbaa !20
  %166 = load i32, ptr %21, align 4, !tbaa !16
  %167 = call i32 (i32, i64, ...) @ioctl(i32 noundef %166, i64 noundef 35092, ptr noundef %29) #8
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %169, label %178

169:                                              ; preds = %160
  %170 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %171 unwind label %156

171:                                              ; preds = %169
  %172 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %173 unwind label %156

173:                                              ; preds = %171
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %170, i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 97, ptr noundef @.str.5, ptr noundef %172)
          to label %174 unwind label %156

174:                                              ; preds = %173
  %175 = load i32, ptr %21, align 4, !tbaa !16
  %176 = invoke i32 @close(i32 noundef %175)
          to label %177 unwind label %156

177:                                              ; preds = %174
  store i32 1, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %282

178:                                              ; preds = %160
  %179 = load i32, ptr %21, align 4, !tbaa !16
  %180 = call i32 (i32, i64, ...) @ioctl(i32 noundef %179, i64 noundef 35123, ptr noundef %29) #8
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %191

182:                                              ; preds = %178
  %183 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %184 unwind label %156

184:                                              ; preds = %182
  %185 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %186 unwind label %156

186:                                              ; preds = %184
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %183, i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 104, ptr noundef @.str.6, ptr noundef %185)
          to label %187 unwind label %156

187:                                              ; preds = %186
  %188 = load i32, ptr %21, align 4, !tbaa !16
  %189 = invoke i32 @close(i32 noundef %188)
          to label %190 unwind label %156

190:                                              ; preds = %187
  store i32 1, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %282

191:                                              ; preds = %178
  %192 = getelementptr inbounds %"class.chw::RawSocket", ptr %34, i32 0, i32 3
  call void @llvm.memset.p0.i64(ptr align 8 %192, i8 0, i64 20, i1 false)
  %193 = getelementptr inbounds %"class.chw::RawSocket", ptr %34, i32 0, i32 3
  %194 = getelementptr inbounds %struct.sockaddr_ll, ptr %193, i32 0, i32 0
  store i16 17, ptr %194, align 8, !tbaa !21
  %195 = getelementptr inbounds %struct.ifreq, ptr %29, i32 0, i32 1
  %196 = load i32, ptr %195, align 8, !tbaa !20
  %197 = getelementptr inbounds %"class.chw::RawSocket", ptr %34, i32 0, i32 3
  %198 = getelementptr inbounds %struct.sockaddr_ll, ptr %197, i32 0, i32 2
  store i32 %196, ptr %198, align 4, !tbaa !38
  %199 = invoke noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 3)
          to label %200 unwind label %156

200:                                              ; preds = %191
  %201 = getelementptr inbounds %"class.chw::RawSocket", ptr %34, i32 0, i32 3
  %202 = getelementptr inbounds %struct.sockaddr_ll, ptr %201, i32 0, i32 1
  store i16 %199, ptr %202, align 2, !tbaa !39
  %203 = load i32, ptr %21, align 4, !tbaa !16
  %204 = call i32 (i32, i64, ...) @ioctl(i32 noundef %203, i64 noundef 35111, ptr noundef %29) #8
  %205 = icmp ne i32 %204, 0
  br i1 %205, label %206, label %215

206:                                              ; preds = %200
  %207 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %208 unwind label %156

208:                                              ; preds = %206
  %209 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %210 unwind label %156

210:                                              ; preds = %208
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %207, i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 117, ptr noundef @.str.7, ptr noundef %209)
          to label %211 unwind label %156

211:                                              ; preds = %210
  %212 = load i32, ptr %21, align 4, !tbaa !16
  %213 = invoke i32 @close(i32 noundef %212)
          to label %214 unwind label %156

214:                                              ; preds = %211
  store i32 1, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %282

215:                                              ; preds = %200
  %216 = getelementptr inbounds %"class.chw::RawSocket", ptr %34, i32 0, i32 1
  %217 = getelementptr inbounds [6 x i8], ptr %216, i64 0, i64 0
  %218 = getelementptr inbounds %struct.ifreq, ptr %29, i32 0, i32 1
  %219 = getelementptr inbounds %struct.sockaddr, ptr %218, i32 0, i32 1
  %220 = getelementptr inbounds [14 x i8], ptr %219, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %217, ptr align 2 %220, i64 6, i1 false)
  %221 = load i32, ptr %21, align 4, !tbaa !16
  %222 = getelementptr inbounds %"class.chw::RawSocket", ptr %34, i32 0, i32 3
  %223 = call i32 @bind(i32 noundef %221, ptr noundef %222, i32 noundef 20) #8
  %224 = icmp ne i32 %223, 0
  br i1 %224, label %225, label %235

225:                                              ; preds = %215
  %226 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %227 unwind label %156

227:                                              ; preds = %225
  %228 = load i32, ptr %21, align 4, !tbaa !16
  %229 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %230 unwind label %156

230:                                              ; preds = %227
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %226, i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 125, ptr noundef @.str.8, i32 noundef %228, ptr noundef %229)
          to label %231 unwind label %156

231:                                              ; preds = %230
  %232 = load i32, ptr %21, align 4, !tbaa !16
  %233 = invoke i32 @close(i32 noundef %232)
          to label %234 unwind label %156

234:                                              ; preds = %231
  store i32 1, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %282

235:                                              ; preds = %215
  %236 = load i32, ptr %21, align 4, !tbaa !16
  %237 = invoke noundef i32 @_ZN3chw8SockUtil10setSendBufEii(i32 noundef %236, i32 noundef 209715200)
          to label %238 unwind label %156

238:                                              ; preds = %235
  %239 = load i32, ptr %21, align 4, !tbaa !16
  %240 = invoke noundef i32 @_ZN3chw8SockUtil10setRecvBufEii(i32 noundef %239, i32 noundef 209715200)
          to label %241 unwind label %156

241:                                              ; preds = %238
  %242 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %243 unwind label %156

243:                                              ; preds = %241
  %244 = load ptr, ptr %8, align 8, !tbaa !5
  %245 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %244) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %30) #8
  %246 = getelementptr inbounds %"class.chw::RawSocket", ptr %34, i32 0, i32 1
  %247 = getelementptr inbounds [6 x i8], ptr %246, i64 0, i64 0
  invoke void @_ZN3chw11MacBuftoStrB5cxx11EPKh(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %30, ptr noundef %247)
          to label %248 unwind label %259

248:                                              ; preds = %243
  %249 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %30) #8
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %242, i32 noundef 1, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 134, ptr noundef @.str.2, ptr noundef %245, ptr noundef %249)
          to label %250 unwind label %263

250:                                              ; preds = %248
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %30) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %30) #8
  %251 = load ptr, ptr %18, align 8, !tbaa !5
  %252 = load i32, ptr %21, align 4, !tbaa !16
  %253 = invoke noundef zeroext i1 @_ZN3chw6Socket8fromSockEiNS_7SockNum8SockTypeE(ptr noundef nonnull align 8 dereferenceable(1072) %251, i32 noundef %252, i32 noundef 1)
          to label %254 unwind label %156

254:                                              ; preds = %250
  %255 = getelementptr inbounds %"class.chw::Client", ptr %34, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 48, ptr %31) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %32) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %33) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %33)
          to label %256 unwind label %268

256:                                              ; preds = %254
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %31, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(32) %32, i32 noundef 0)
          to label %257 unwind label %272

257:                                              ; preds = %256
  invoke void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32) %255, ptr noundef nonnull align 8 dereferenceable(48) %31)
          to label %258 unwind label %276

258:                                              ; preds = %257
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %31) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %32) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %31) #8
  store i32 0, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %282

259:                                              ; preds = %243
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %16, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %17, align 4
  br label %267

263:                                              ; preds = %248
  %264 = landingpad { ptr, i32 }
          cleanup
  %265 = extractvalue { ptr, i32 } %264, 0
  store ptr %265, ptr %16, align 8
  %266 = extractvalue { ptr, i32 } %264, 1
  store i32 %266, ptr %17, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %30) #8
  br label %267

267:                                              ; preds = %263, %259
  call void @llvm.lifetime.end.p0(i64 32, ptr %30) #8
  br label %283

268:                                              ; preds = %254
  %269 = landingpad { ptr, i32 }
          cleanup
  %270 = extractvalue { ptr, i32 } %269, 0
  store ptr %270, ptr %16, align 8
  %271 = extractvalue { ptr, i32 } %269, 1
  store i32 %271, ptr %17, align 4
  br label %281

272:                                              ; preds = %256
  %273 = landingpad { ptr, i32 }
          cleanup
  %274 = extractvalue { ptr, i32 } %273, 0
  store ptr %274, ptr %16, align 8
  %275 = extractvalue { ptr, i32 } %273, 1
  store i32 %275, ptr %17, align 4
  br label %280

276:                                              ; preds = %257
  %277 = landingpad { ptr, i32 }
          cleanup
  %278 = extractvalue { ptr, i32 } %277, 0
  store ptr %278, ptr %16, align 8
  %279 = extractvalue { ptr, i32 } %277, 1
  store i32 %279, ptr %17, align 4
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %31) #8
  br label %280

280:                                              ; preds = %276, %272
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %32) #8
  br label %281

281:                                              ; preds = %280, %268
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %31) #8
  br label %283

282:                                              ; preds = %258, %234, %214, %190, %177, %155
  call void @llvm.lifetime.end.p0(i64 40, ptr %29) #8
  br label %284

283:                                              ; preds = %281, %267, %156
  call void @llvm.lifetime.end.p0(i64 40, ptr %29) #8
  br label %286

284:                                              ; preds = %282, %103, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @_ZNSt10__weak_ptrIN3chw9RawSocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  %285 = load i32, ptr %6, align 4
  ret i32 %285

286:                                              ; preds = %283, %135, %121, %112, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %287

287:                                              ; preds = %286, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %288

288:                                              ; preds = %287, %60
  call void @_ZNSt10__weak_ptrIN3chw9RawSocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  br label %289

289:                                              ; preds = %288
  %290 = load ptr, ptr %16, align 8
  %291 = load i32, ptr %17, align 4
  %292 = insertvalue { ptr, i32 } poison, ptr %290, 0
  %293 = insertvalue { ptr, i32 } %292, i32 %291, 1
  resume { ptr, i32 } %293
}

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

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

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

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

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

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

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

declare void @_ZN3chw6Socket12createSocketERKSt10shared_ptrINS_9EventLoopEEb(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #4

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

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

declare void @_ZN3chw6Socket8setOnErrESt8functionIFvRKNS_13SockExceptionEEE(ptr noundef nonnull align 8 dereferenceable(1072), ptr noundef) #4

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

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

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

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext) #2

declare void @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144), i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) #4

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

declare noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext) #4

declare void @_ZN3chw6Socket9setOnReadESt8functionIFvRSt10shared_ptrINS_6BufferEEP8sockaddriEE(ptr noundef nonnull align 8 dereferenceable(1072), ptr noundef) #4

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

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

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

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

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

declare void @_ZN3chw11MacBuftoStrB5cxx11EPKh(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef) #4

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

declare noundef zeroext i1 @_ZN3chw6Socket8fromSockEiNS_7SockNum8SockTypeE(ptr noundef nonnull align 8 dereferenceable(1072), i32 noundef, i32 noundef) #4

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

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

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

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind
declare i32 @ioctl(i32 noundef, i64 noundef, ...) #5

declare i32 @close(i32 noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

; Function Attrs: nounwind
declare i32 @bind(i32 noundef, ptr noundef, i32 noundef) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10__weak_ptrIN3chw9RawSocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) 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 #3 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 #3 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 = { 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 #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"_ZTSZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_E3$_0", !13, i64 0, !6, i64 16}
!13 = !{!"_ZTSSt8weak_ptrIN3chw9RawSocketEE", !14, i64 0}
!14 = !{!"_ZTSSt10__weak_ptrIN3chw9RawSocketELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !15, i64 8}
!15 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!19, !6, i64 16}
!19 = !{!"_ZTSZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_E3$_1", !13, i64 0, !6, i64 16}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !10, i64 128}
!22 = !{!"_ZTSN3chw9RawSocketE", !23, i64 0, !7, i64 120, !37, i64 128}
!23 = !{!"_ZTSN3chw6ClientE", !24, i64 8, !27, i64 24, !30, i64 56, !33, i64 72, !35, i64 88}
!24 = !{!"_ZTSSt23enable_shared_from_thisIN3chw6ClientEE", !25, i64 0}
!25 = !{!"_ZTSSt8weak_ptrIN3chw6ClientEE", !26, i64 0}
!26 = !{!"_ZTSSt10__weak_ptrIN3chw6ClientELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !15, i64 8}
!27 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !28, i64 0, !29, i64 8, !7, i64 16}
!28 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!29 = !{!"long", !7, i64 0}
!30 = !{!"_ZTSSt10shared_ptrIN3chw6SocketEE", !31, i64 0}
!31 = !{!"_ZTSSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !32, i64 8}
!32 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!33 = !{!"_ZTSSt10shared_ptrIN3chw9EventLoopEE", !34, i64 0}
!34 = !{!"_ZTSSt12__shared_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !32, i64 8}
!35 = !{!"_ZTSSt8functionIFvRKN3chw13SockExceptionEEE", !36, i64 0, !6, i64 24}
!36 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!37 = !{!"_ZTS11sockaddr_ll", !10, i64 0, !10, i64 2, !17, i64 4, !10, i64 8, !7, i64 10, !7, i64 11, !7, i64 12}
!38 = !{!22, !17, i64 132}
!39 = !{!22, !10, i64 130}


; 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::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.5" = type { %"class.std::__shared_ptr.6" }
%"class.std::__shared_ptr.6" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.8" = type { %"class.std::__shared_ptr.9" }
%"class.std::__shared_ptr.9" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = 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.anon = type { %"class.std::weak_ptr.3", ptr }
%"class.std::function.36" = type { %"class.std::_Function_base", ptr }
%class.anon.53 = type { %"class.std::weak_ptr.3", ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.chw::SockException" = type { %"class.std::exception", i32, i32, %"class.std::__cxx11::basic_string" }
%"class.std::exception" = type { ptr }
%"class.std::allocator" = type { i8 }
%struct.ifreq = type { %union.anon.54, %union.anon.55 }
%union.anon.54 = type { [16 x i8] }
%union.anon.55 = type { %struct.ifmap }
%struct.ifmap = type { i64, i64, i16, i8, i8, i8 }

@.str = external hidden unnamed_addr constant [71 x i8], align 1
@__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_ = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_(ptr noundef nonnull align 8 dereferenceable(148) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i16 noundef zeroext %2, i16 noundef zeroext %3, ptr nocapture noundef nonnull readnone align 8 dereferenceable(32) %4) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::weak_ptr.3", align 8
  %7 = alloca %"class.std::shared_ptr.5", align 8
  %8 = alloca %"class.std::shared_ptr.8", align 8
  %9 = alloca %"class.std::shared_ptr", align 8
  %10 = alloca %"class.std::function", align 8
  %11 = alloca %class.anon, align 8
  %12 = alloca %"class.std::function.36", align 8
  %13 = alloca %class.anon.53, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.chw::SockException", align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca %struct.ifreq, align 8
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca %"class.chw::SockException", align 8
  %21 = alloca %"class.std::__cxx11::basic_string", align 8
  %22 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #9
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  call void @_ZNSt23enable_shared_from_thisIN3chw6ClientEE16shared_from_thisEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.8") align 8 %8, ptr noundef nonnull align 8 dereferenceable(16) %23)
  call void @_ZSt19static_pointer_castIN3chw9RawSocketENS0_6ClientEESt10shared_ptrIT_ERKS3_IT0_E(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.5") align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %8) #9
  call void @_ZNSt8weak_ptrIN3chw9RawSocketEEC2IS1_vEERKSt10shared_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %7) #9
  call void @_ZNSt12__shared_ptrIN3chw9RawSocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #9
  call void @_ZNSt12__shared_ptrIN3chw6ClientELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #9
  %24 = getelementptr inbounds i8, ptr %0, i64 72
  invoke void @_ZN3chw6Socket12createSocketERKSt10shared_ptrINS_9EventLoopEEb(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %24, i1 noundef zeroext true)
          to label %25 unwind label %41

25:                                               ; preds = %5
  %26 = getelementptr inbounds i8, ptr %0, i64 56
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3chw6SocketEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(16) %9) #9
  call void @_ZNSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #9
  %28 = call noundef ptr @_ZNKSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %26) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #9
  call void @_ZNSt8weak_ptrIN3chw9RawSocketEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %6) #9
  %29 = getelementptr inbounds i8, ptr %11, i64 16
  store ptr %28, ptr %29, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFvRKN3chw13SockExceptionEEEC2IZNS0_9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttSF_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %30 unwind label %43

30:                                               ; preds = %25
  invoke void @_ZN3chw6Socket8setOnErrESt8functionIFvRKNS_13SockExceptionEEE(ptr noundef nonnull align 8 dereferenceable(1072) %28, ptr noundef nonnull %10)
          to label %31 unwind label %45

31:                                               ; preds = %30
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #9
  call void @"_ZZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_EN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(24) %11) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #9
  %32 = call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 3)
  %33 = zext i16 %32 to i32
  %34 = call i32 @socket(i32 noundef 17, i32 noundef 3, i32 noundef %33) #9
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %36, label %50

36:                                               ; preds = %31
  %37 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %38 unwind label %48

38:                                               ; preds = %36
  %39 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %40 unwind label %48

40:                                               ; preds = %38
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %37, i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 54, ptr noundef nonnull @.str.1, ptr noundef %39)
          to label %171 unwind label %48

41:                                               ; preds = %5
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #9
  br label %172

43:                                               ; preds = %25
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %47

45:                                               ; preds = %30
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #9
  br label %47

47:                                               ; preds = %45, %43
  %.pn = phi { ptr, i32 } [ %46, %45 ], [ %44, %43 ]
  call void @"_ZZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_EN3$_0D2Ev"(ptr noundef nonnull align 8 dereferenceable(24) %11) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #9
  br label %172

48:                                               ; preds = %62, %55, %40, %38, %36
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %172

50:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #9
  call void @_ZNSt8weak_ptrIN3chw9RawSocketEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %6) #9
  %51 = getelementptr inbounds i8, ptr %13, i64 16
  store ptr %28, ptr %51, align 8, !tbaa !13
  invoke void @"_ZNSt8functionIFvRSt10shared_ptrIN3chw6BufferEEP8sockaddriEEC2IZNS1_9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttSI_E3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %52 unwind label %69

52:                                               ; preds = %50
  invoke void @_ZN3chw6Socket9setOnReadESt8functionIFvRSt10shared_ptrINS_6BufferEEP8sockaddriEE(ptr noundef nonnull align 8 dereferenceable(1072) %28, ptr noundef nonnull %12)
          to label %53 unwind label %71

53:                                               ; preds = %52
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  call void @"_ZZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_EN3$_1D2Ev"(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #9
  %54 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  br i1 %54, label %55, label %87

55:                                               ; preds = %53
  %56 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %57 unwind label %48

57:                                               ; preds = %55
  %58 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #9
  %59 = getelementptr inbounds i8, ptr %0, i64 120
  invoke void @_ZN3chw11MacBuftoStrB5cxx11EPKh(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef nonnull %59)
          to label %60 unwind label %74

60:                                               ; preds = %57
  %61 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %14) #9
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %56, i32 noundef 1, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 79, ptr noundef nonnull @.str.2, ptr noundef %58, ptr noundef %61)
          to label %62 unwind label %76

62:                                               ; preds = %60
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #9
  %63 = invoke noundef zeroext i1 @_ZN3chw6Socket8fromSockEiNS_7SockNum8SockTypeE(ptr noundef nonnull align 8 dereferenceable(1072) %28, i32 noundef %34, i32 noundef 1)
          to label %64 unwind label %48

64:                                               ; preds = %62
  %65 = getelementptr inbounds i8, ptr %0, i64 88
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %15) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %16) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %66 unwind label %79

66:                                               ; preds = %64
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %15, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef 0)
          to label %67 unwind label %81

67:                                               ; preds = %66
  invoke void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32) %65, ptr noundef nonnull align 8 dereferenceable(48) %15)
          to label %68 unwind label %83

68:                                               ; preds = %67
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %15) #9
  br label %171

69:                                               ; preds = %50
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %73

71:                                               ; preds = %52
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  br label %73

73:                                               ; preds = %71, %69
  %.pn46 = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @"_ZZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_EN3$_1D2Ev"(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #9
  br label %172

74:                                               ; preds = %57
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %78

76:                                               ; preds = %60
  %77 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #9
  br label %78

78:                                               ; preds = %76, %74
  %.pn59 = phi { ptr, i32 } [ %77, %76 ], [ %75, %74 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #9
  br label %172

79:                                               ; preds = %64
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %86

81:                                               ; preds = %66
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %85

83:                                               ; preds = %67
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #9
  br label %85

85:                                               ; preds = %83, %81
  %.pn61 = phi { ptr, i32 } [ %84, %83 ], [ %82, %81 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #9
  br label %86

86:                                               ; preds = %85, %79
  %.pn61.pn = phi { ptr, i32 } [ %.pn61, %85 ], [ %80, %79 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %15) #9
  br label %172

87:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %18) #9
  %88 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  %89 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %18, ptr noundef nonnull dereferenceable(1) %88) #9
  %90 = call i32 (i32, i64, ...) @ioctl(i32 noundef %34, i64 noundef 35091, ptr noundef nonnull %18) #9
  %.not = icmp eq i32 %90, 0
  br i1 %.not, label %99, label %91

91:                                               ; preds = %87
  %92 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %93 unwind label %97

93:                                               ; preds = %91
  %94 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %95 unwind label %97

95:                                               ; preds = %93
  %96 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %92, i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 89, ptr noundef nonnull @.str.4, ptr noundef %94, ptr noundef %96)
          to label %.invoke unwind label %97

97:                                               ; preds = %.invoke68, %.invoke, %149, %143, %141, %139, %137, %135, %133, %123, %121, %112, %110, %106, %104, %95, %93, %91
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %170

99:                                               ; preds = %87
  %100 = getelementptr inbounds i8, ptr %18, i64 16
  %101 = load i16, ptr %100, align 8, !tbaa !15
  %102 = or i16 %101, 256
  store i16 %102, ptr %100, align 8, !tbaa !15
  %103 = call i32 (i32, i64, ...) @ioctl(i32 noundef %34, i64 noundef 35092, ptr noundef nonnull %18) #9
  %.not48 = icmp eq i32 %103, 0
  br i1 %.not48, label %108, label %104

104:                                              ; preds = %99
  %105 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %106 unwind label %97

106:                                              ; preds = %104
  %107 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %.invoke68 unwind label %97

108:                                              ; preds = %99
  %109 = call i32 (i32, i64, ...) @ioctl(i32 noundef %34, i64 noundef 35123, ptr noundef nonnull %18) #9
  %.not49 = icmp eq i32 %109, 0
  br i1 %.not49, label %114, label %110

110:                                              ; preds = %108
  %111 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %112 unwind label %97

112:                                              ; preds = %110
  %113 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %.invoke68 unwind label %97

114:                                              ; preds = %108
  %115 = getelementptr inbounds i8, ptr %0, i64 128
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %115, i8 0, i64 20, i1 false)
  store i16 17, ptr %115, align 8, !tbaa !16
  %116 = load i32, ptr %100, align 8, !tbaa !15
  %117 = getelementptr inbounds i8, ptr %0, i64 132
  store i32 %116, ptr %117, align 4, !tbaa !35
  %118 = call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 3)
  %119 = getelementptr inbounds i8, ptr %0, i64 130
  store i16 %118, ptr %119, align 2, !tbaa !36
  %120 = call i32 (i32, i64, ...) @ioctl(i32 noundef %34, i64 noundef 35111, ptr noundef nonnull %18) #9
  %.not50 = icmp eq i32 %120, 0
  br i1 %.not50, label %129, label %121

121:                                              ; preds = %114
  %122 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %123 unwind label %97

123:                                              ; preds = %121
  %124 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %.invoke68 unwind label %97

.invoke68:                                        ; preds = %123, %112, %106
  %125 = phi ptr [ %105, %106 ], [ %111, %112 ], [ %122, %123 ]
  %126 = phi i32 [ 97, %106 ], [ 104, %112 ], [ 117, %123 ]
  %127 = phi ptr [ @.str.5, %106 ], [ @.str.6, %112 ], [ @.str.7, %123 ]
  %128 = phi ptr [ %107, %106 ], [ %113, %112 ], [ %124, %123 ]
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %125, i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef %126, ptr noundef nonnull %127, ptr noundef %128)
          to label %.invoke unwind label %97

129:                                              ; preds = %114
  %130 = getelementptr inbounds i8, ptr %0, i64 120
  %131 = getelementptr inbounds i8, ptr %18, i64 18
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(6) %130, ptr noundef nonnull align 2 dereferenceable(6) %131, i64 6, i1 false)
  %132 = call i32 @bind(i32 noundef %34, ptr noundef nonnull %115, i32 noundef 20) #9
  %.not51 = icmp eq i32 %132, 0
  br i1 %.not51, label %139, label %133

133:                                              ; preds = %129
  %134 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %135 unwind label %97

135:                                              ; preds = %133
  %136 = invoke noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext true)
          to label %137 unwind label %97

137:                                              ; preds = %135
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %134, i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 125, ptr noundef nonnull @.str.8, i32 noundef %34, ptr noundef %136)
          to label %.invoke unwind label %97

.invoke:                                          ; preds = %.invoke68, %95, %137
  %138 = invoke i32 @close(i32 noundef %34)
          to label %169 unwind label %97

139:                                              ; preds = %129
  %140 = invoke noundef i32 @_ZN3chw8SockUtil10setSendBufEii(i32 noundef %34, i32 noundef 209715200)
          to label %141 unwind label %97

141:                                              ; preds = %139
  %142 = invoke noundef i32 @_ZN3chw8SockUtil10setRecvBufEii(i32 noundef %34, i32 noundef 209715200)
          to label %143 unwind label %97

143:                                              ; preds = %141
  %144 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
          to label %145 unwind label %97

145:                                              ; preds = %143
  %146 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %19) #9
  invoke void @_ZN3chw11MacBuftoStrB5cxx11EPKh(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %19, ptr noundef nonnull %130)
          to label %147 unwind label %156

147:                                              ; preds = %145
  %148 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #9
  invoke void (ptr, i32, ptr, ptr, i32, ptr, ...) @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144) %144, i32 noundef 1, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_, i32 noundef 134, ptr noundef nonnull @.str.2, ptr noundef %146, ptr noundef %148)
          to label %149 unwind label %158

149:                                              ; preds = %147
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %19) #9
  %150 = invoke noundef zeroext i1 @_ZN3chw6Socket8fromSockEiNS_7SockNum8SockTypeE(ptr noundef nonnull align 8 dereferenceable(1072) %28, i32 noundef %34, i32 noundef 1)
          to label %151 unwind label %97

151:                                              ; preds = %149
  %152 = getelementptr inbounds i8, ptr %0, i64 88
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %20) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %21) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %22) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %22)
          to label %153 unwind label %161

153:                                              ; preds = %151
  invoke void @_ZN3chw13SockExceptionC2ENS_7ErrCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(48) %20, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(32) %21, i32 noundef 0)
          to label %154 unwind label %163

154:                                              ; preds = %153
  invoke void @_ZNKSt8functionIFvRKN3chw13SockExceptionEEEclES3_(ptr noundef nonnull align 8 dereferenceable(32) %152, ptr noundef nonnull align 8 dereferenceable(48) %20)
          to label %155 unwind label %165

155:                                              ; preds = %154
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %20) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %22) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %21) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %20) #9
  br label %169

156:                                              ; preds = %145
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %160

158:                                              ; preds = %147
  %159 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #9
  br label %160

160:                                              ; preds = %158, %156
  %.pn52 = phi { ptr, i32 } [ %159, %158 ], [ %157, %156 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %19) #9
  br label %170

161:                                              ; preds = %151
  %162 = landingpad { ptr, i32 }
          cleanup
  br label %168

163:                                              ; preds = %153
  %164 = landingpad { ptr, i32 }
          cleanup
  br label %167

165:                                              ; preds = %154
  %166 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3chw13SockExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %20) #9
  br label %167

167:                                              ; preds = %165, %163
  %.pn54 = phi { ptr, i32 } [ %166, %165 ], [ %164, %163 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #9
  br label %168

168:                                              ; preds = %167, %161
  %.pn54.pn = phi { ptr, i32 } [ %.pn54, %167 ], [ %162, %161 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %22) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %21) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %20) #9
  br label %170

169:                                              ; preds = %.invoke, %155
  %.0 = phi i32 [ 0, %155 ], [ 1, %.invoke ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %18) #9
  br label %171

170:                                              ; preds = %168, %160, %97
  %.pn57 = phi { ptr, i32 } [ %98, %97 ], [ %.pn54.pn, %168 ], [ %.pn52, %160 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %18) #9
  br label %172

171:                                              ; preds = %40, %169, %68
  %.1 = phi i32 [ 0, %68 ], [ %.0, %169 ], [ 1, %40 ]
  call void @_ZNSt10__weak_ptrIN3chw9RawSocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #9
  ret i32 %.1

172:                                              ; preds = %47, %170, %86, %78, %73, %48, %41
  %.pn64.pn.pn = phi { ptr, i32 } [ %42, %41 ], [ %.pn, %47 ], [ %49, %48 ], [ %.pn61.pn, %86 ], [ %.pn59, %78 ], [ %.pn57, %170 ], [ %.pn46, %73 ]
  call void @_ZNSt10__weak_ptrIN3chw9RawSocketELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #9
  resume { ptr, i32 } %.pn64.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23enable_shared_from_thisIN3chw6ClientEE16shared_from_thisEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.8") 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_ptrIN3chw9RawSocketEEC2IS1_vEERKSt10shared_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

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

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

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

declare void @_ZN3chw6Socket12createSocketERKSt10shared_ptrINS_9EventLoopEEb(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #4

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

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

declare void @_ZN3chw6Socket8setOnErrESt8functionIFvRKNS_13SockExceptionEEE(ptr noundef nonnull align 8 dereferenceable(1072), ptr noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext) local_unnamed_addr #2

declare void @_ZN3chw13LoggerWrapper8printLogERNS_6LoggerEiPKcS4_iS4_z(ptr noundef nonnull align 8 dereferenceable(144), i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #4

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

declare noundef ptr @_ZN3chw13get_uv_errmsgEb(i1 noundef zeroext) local_unnamed_addr #4

declare void @_ZN3chw6Socket9setOnReadESt8functionIFvRSt10shared_ptrINS_6BufferEEP8sockaddriEE(ptr noundef nonnull align 8 dereferenceable(1072), ptr noundef) local_unnamed_addr #4

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

declare void @_ZN3chw11MacBuftoStrB5cxx11EPKh(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef) local_unnamed_addr #4

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

declare noundef zeroext i1 @_ZN3chw6Socket8fromSockEiNS_7SockNum8SockTypeE(ptr noundef nonnull align 8 dereferenceable(1072), i32 noundef, i32 noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @ioctl(i32 noundef, i64 noundef, ...) local_unnamed_addr #5

declare i32 @close(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

; Function Attrs: nounwind
declare i32 @bind(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { 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, !9, i64 16}
!6 = !{!"_ZTSZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_E3$_0", !7, i64 0, !9, i64 16}
!7 = !{!"_ZTSSt8weak_ptrIN3chw9RawSocketEE", !8, i64 0}
!8 = !{!"_ZTSSt10__weak_ptrIN3chw9RawSocketELN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0, !12, i64 8}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0}
!13 = !{!14, !9, i64 16}
!14 = !{!"_ZTSZN3chw9RawSocket13create_clientERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEttS8_E3$_1", !7, i64 0, !9, i64 16}
!15 = !{!10, !10, i64 0}
!16 = !{!17, !33, i64 128}
!17 = !{!"_ZTSN3chw9RawSocketE", !18, i64 0, !10, i64 120, !32, i64 128}
!18 = !{!"_ZTSN3chw6ClientE", !19, i64 8, !22, i64 24, !25, i64 56, !28, i64 72, !30, i64 88}
!19 = !{!"_ZTSSt23enable_shared_from_thisIN3chw6ClientEE", !20, i64 0}
!20 = !{!"_ZTSSt8weak_ptrIN3chw6ClientEE", !21, i64 0}
!21 = !{!"_ZTSSt10__weak_ptrIN3chw6ClientELN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0, !12, i64 8}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !23, i64 0, !24, i64 8, !10, i64 16}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !9, i64 0}
!24 = !{!"long", !10, i64 0}
!25 = !{!"_ZTSSt10shared_ptrIN3chw6SocketEE", !26, i64 0}
!26 = !{!"_ZTSSt12__shared_ptrIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0, !27, i64 8}
!27 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0}
!28 = !{!"_ZTSSt10shared_ptrIN3chw9EventLoopEE", !29, i64 0}
!29 = !{!"_ZTSSt12__shared_ptrIN3chw9EventLoopELN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0, !27, i64 8}
!30 = !{!"_ZTSSt8functionIFvRKN3chw13SockExceptionEEE", !31, i64 0, !9, i64 24}
!31 = !{!"_ZTSSt14_Function_base", !10, i64 0, !9, i64 16}
!32 = !{!"_ZTS11sockaddr_ll", !33, i64 0, !33, i64 2, !34, i64 4, !33, i64 8, !10, i64 10, !10, i64 11, !10, i64 12}
!33 = !{!"short", !10, i64 0}
!34 = !{!"int", !10, i64 0}
!35 = !{!17, !34, i64 132}
!36 = !{!17, !33, i64 130}


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