; LLVM IR from wichue/nethello :: src/net/TcpServer.ll (ZN3chw9TcpServer10GetRcvInfoERmS1_S1_S1_)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.chw::onceToken" = type { %"class.std::function.123" }
%"class.std::function.123" = 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.129 = type { ptr }
%class.anon.130 = type { ptr }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"class.chw::TcpServer" = type { %"class.chw::Server", i8, %"class.std::shared_ptr.6", %"class.std::weak_ptr.9", %"class.std::unordered_map" }
%"class.chw::Server" = type { ptr, %"class.std::enable_shared_from_this", %"class.std::function", %"class.std::shared_ptr", %"class.std::shared_ptr.0", %"class.std::function.3" }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = type { ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.std::function.3" = type { %"class.std::_Function_base", ptr }
%"class.std::shared_ptr.6" = type { %"class.std::__shared_ptr.7" }
%"class.std::__shared_ptr.7" = type { ptr, %"class.std::__shared_count" }
%"class.std::weak_ptr.9" = type { %"class.std::__weak_ptr.10" }
%"class.std::__weak_ptr.10" = type { ptr, %"class.std::__weak_count" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.std::pair.127" = type { ptr, %"class.std::shared_ptr.115" }
%"class.std::shared_ptr.115" = type { %"class.std::__shared_ptr.116" }
%"class.std::__shared_ptr.116" = type { ptr, %"class.std::__shared_count" }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3chw9TcpServer10GetRcvInfoERmS1_S1_S1_(ptr noundef nonnull align 8 dereferenceable(216) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.chw::onceToken", align 8
  %12 = alloca %class.anon.129, align 8
  %13 = alloca %"class.std::function.123", align 8
  %14 = alloca %class.anon.130, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %20 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %21 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %22 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %23 = getelementptr inbounds %class.anon.129, ptr %12, i32 0, i32 0
  store ptr %22, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %24 = getelementptr inbounds %class.anon.130, ptr %14, i32 0, i32 0
  store ptr %22, ptr %24, align 8, !tbaa !11
  call void @"_ZNSt8functionIFvvEEC2IZN3chw9TcpServer10GetRcvInfoERmS5_S5_S5_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  invoke void @"_ZN3chw9onceTokenC2IZNS_9TcpServer10GetRcvInfoERmS3_S3_S3_E3$_1EERKT_St8functionIFvvEE"(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %13)
          to label %25 unwind label %38

25:                                               ; preds = %5
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store i64 0, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %26 = getelementptr inbounds %"class.chw::TcpServer", ptr %22, i32 0, i32 4
  store ptr %26, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %27 = load ptr, ptr %18, align 8, !tbaa !5
  %28 = call ptr @_ZNSt13unordered_mapIPN3chw7SessionESt10shared_ptrIS1_ESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_S4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %27) #4
  %29 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %19, i32 0, i32 0
  %30 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %29, i32 0, i32 0
  store ptr %28, ptr %30, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %31 = load ptr, ptr %18, align 8, !tbaa !5
  %32 = call ptr @_ZNSt13unordered_mapIPN3chw7SessionESt10shared_ptrIS1_ESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_S4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %31) #4
  %33 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %20, i32 0, i32 0
  %34 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %33, i32 0, i32 0
  store ptr %32, ptr %34, align 8
  br label %35

35:                                               ; preds = %87, %25
  %36 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKPN3chw7SessionESt10shared_ptrIS3_EELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #4
  br i1 %36, label %42, label %37

37:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %93

38:                                               ; preds = %5
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %15, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %16, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %102

42:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKPN3chw7SessionESt10shared_ptrIS3_EELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #4
  store ptr %43, ptr %21, align 8, !tbaa !5
  %44 = load ptr, ptr %21, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.std::pair.127", ptr %44, i32 0, i32 1
  %46 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SessionELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %45) #4
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %48 = getelementptr inbounds ptr, ptr %47, i64 5
  %49 = load ptr, ptr %48, align 8
  %50 = invoke noundef i64 %49(ptr noundef nonnull align 8 dereferenceable(112) %46)
          to label %51 unwind label %89

51:                                               ; preds = %42
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = load i64, ptr %52, align 8, !tbaa !13
  %54 = add i64 %53, %50
  store i64 %54, ptr %52, align 8, !tbaa !13
  %55 = load ptr, ptr %21, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.std::pair.127", ptr %55, i32 0, i32 1
  %57 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SessionELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %56) #4
  %58 = load ptr, ptr %57, align 8, !tbaa !15
  %59 = getelementptr inbounds ptr, ptr %58, i64 6
  %60 = load ptr, ptr %59, align 8
  %61 = invoke noundef i64 %60(ptr noundef nonnull align 8 dereferenceable(112) %57)
          to label %62 unwind label %89

62:                                               ; preds = %51
  %63 = load i64, ptr %17, align 8, !tbaa !13
  %64 = add i64 %63, %61
  store i64 %64, ptr %17, align 8, !tbaa !13
  %65 = load ptr, ptr %21, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.std::pair.127", ptr %65, i32 0, i32 1
  %67 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SessionELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %66) #4
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  %69 = getelementptr inbounds ptr, ptr %68, i64 7
  %70 = load ptr, ptr %69, align 8
  %71 = invoke noundef i64 %70(ptr noundef nonnull align 8 dereferenceable(112) %67)
          to label %72 unwind label %89

72:                                               ; preds = %62
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = load i64, ptr %73, align 8, !tbaa !13
  %75 = add i64 %74, %71
  store i64 %75, ptr %73, align 8, !tbaa !13
  %76 = load ptr, ptr %21, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.std::pair.127", ptr %76, i32 0, i32 1
  %78 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SessionELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %77) #4
  %79 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3chw7Session7getSockEv(ptr noundef nonnull align 8 dereferenceable(112) %78)
          to label %80 unwind label %89

80:                                               ; preds = %72
  %81 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %79) #4
  %82 = invoke noundef i64 @_ZN3chw6Socket12getRecvSpeedEv(ptr noundef nonnull align 8 dereferenceable(1072) %81)
          to label %83 unwind label %89

83:                                               ; preds = %80
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = load i64, ptr %84, align 8, !tbaa !13
  %86 = add i64 %85, %82
  store i64 %86, ptr %84, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %87

87:                                               ; preds = %83
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKPN3chw7SessionESt10shared_ptrIS3_EELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #4
  br label %35

89:                                               ; preds = %80, %72, %62, %51, %42
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %15, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @_ZN3chw9onceTokenD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #4
  br label %102

93:                                               ; preds = %37
  %94 = load i64, ptr %17, align 8, !tbaa !13
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = load i64, ptr %95, align 8, !tbaa !13
  %97 = icmp ugt i64 %94, %96
  br i1 %97, label %98, label %101

98:                                               ; preds = %93
  %99 = load i64, ptr %17, align 8, !tbaa !13
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  store i64 %99, ptr %100, align 8, !tbaa !13
  br label %101

101:                                              ; preds = %98, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @_ZN3chw9onceTokenD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #4
  ret void

102:                                              ; preds = %89, %38
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #4
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %15, align 8
  %105 = load i32, ptr %16, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

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

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

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

declare noundef i64 @_ZN3chw6Socket12getRecvSpeedEv(ptr noundef nonnull align 8 dereferenceable(1072)) #3

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

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

!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, !6, i64 0}
!10 = !{!"_ZTSZN3chw9TcpServer10GetRcvInfoERmS1_S1_S1_E3$_1", !6, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSZN3chw9TcpServer10GetRcvInfoERmS1_S1_S1_E3$_0", !6, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}


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

%"class.chw::onceToken" = type { %"class.std::function.123" }
%"class.std::function.123" = 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.129 = type { ptr }
%class.anon.130 = type { ptr }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3chw9TcpServer10GetRcvInfoERmS1_S1_S1_(ptr noundef nonnull align 8 dereferenceable(216) %0, ptr nocapture noundef nonnull align 8 dereferenceable(8) %1, ptr nocapture noundef nonnull align 8 dereferenceable(8) %2, ptr nocapture noundef nonnull align 8 dereferenceable(8) %3, ptr nocapture noundef nonnull align 8 dereferenceable(8) %4) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.chw::onceToken", align 8
  %7 = alloca %class.anon.129, align 8
  %8 = alloca %"class.std::function.123", align 8
  %9 = alloca %class.anon.130, align 8
  %10 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %11 = alloca %"struct.std::__detail::_Node_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  store ptr %0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  store ptr %0, ptr %9, align 8, !tbaa !10
  call void @"_ZNSt8functionIFvvEEC2IZN3chw9TcpServer10GetRcvInfoERmS5_S5_S5_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  invoke void @"_ZN3chw9onceTokenC2IZNS_9TcpServer10GetRcvInfoERmS3_S3_S3_E3$_1EERKT_St8functionIFvvEE"(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %8)
          to label %12 unwind label %19

12:                                               ; preds = %5
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  %13 = getelementptr inbounds i8, ptr %0, i64 160
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %14 = call ptr @_ZNSt13unordered_mapIPN3chw7SessionESt10shared_ptrIS1_ESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_S4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %13) #4
  store ptr %14, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %15 = call ptr @_ZNSt13unordered_mapIPN3chw7SessionESt10shared_ptrIS1_ESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_S4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %13) #4
  store ptr %15, ptr %11, align 8
  %16 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKPN3chw7SessionESt10shared_ptrIS3_EELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  br i1 %16, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %58

._crit_edge:                                      ; preds = %50
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  %17 = load i64, ptr %2, align 8, !tbaa !12
  %18 = icmp ugt i64 %37, %17
  br i1 %18, label %57, label %58

19:                                               ; preds = %5
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %59

.lr.ph:                                           ; preds = %12, %50
  %.01720 = phi i64 [ %37, %50 ], [ 0, %12 ]
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKPN3chw7SessionESt10shared_ptrIS3_EELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SessionELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #4
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %25 = getelementptr inbounds i8, ptr %24, i64 40
  %26 = load ptr, ptr %25, align 8
  %27 = invoke noundef i64 %26(ptr noundef nonnull align 8 dereferenceable(112) %23)
          to label %28 unwind label %55

28:                                               ; preds = %.lr.ph
  %29 = load i64, ptr %1, align 8, !tbaa !12
  %30 = add i64 %29, %27
  store i64 %30, ptr %1, align 8, !tbaa !12
  %31 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SessionELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #4
  %32 = load ptr, ptr %31, align 8, !tbaa !14
  %33 = getelementptr inbounds i8, ptr %32, i64 48
  %34 = load ptr, ptr %33, align 8
  %35 = invoke noundef i64 %34(ptr noundef nonnull align 8 dereferenceable(112) %31)
          to label %36 unwind label %55

36:                                               ; preds = %28
  %37 = add i64 %35, %.01720
  %38 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SessionELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #4
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = getelementptr inbounds i8, ptr %39, i64 56
  %41 = load ptr, ptr %40, align 8
  %42 = invoke noundef i64 %41(ptr noundef nonnull align 8 dereferenceable(112) %38)
          to label %43 unwind label %55

43:                                               ; preds = %36
  %44 = load i64, ptr %3, align 8, !tbaa !12
  %45 = add i64 %44, %42
  store i64 %45, ptr %3, align 8, !tbaa !12
  %46 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw7SessionELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #4
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3chw7Session7getSockEv(ptr noundef nonnull align 8 dereferenceable(112) %46)
  %48 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6SocketELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %47) #4
  %49 = invoke noundef i64 @_ZN3chw6Socket12getRecvSpeedEv(ptr noundef nonnull align 8 dereferenceable(1072) %48)
          to label %50 unwind label %55

50:                                               ; preds = %43
  %51 = load i64, ptr %4, align 8, !tbaa !12
  %52 = add i64 %51, %49
  store i64 %52, ptr %4, align 8, !tbaa !12
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKPN3chw7SessionESt10shared_ptrIS3_EELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %54 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKPN3chw7SessionESt10shared_ptrIS3_EELb0EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  br i1 %54, label %.lr.ph, label %._crit_edge

55:                                               ; preds = %43, %36, %28, %.lr.ph
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @_ZN3chw9onceTokenD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #4
  br label %59

57:                                               ; preds = %._crit_edge
  store i64 %37, ptr %2, align 8, !tbaa !12
  br label %58

58:                                               ; preds = %._crit_edge.thread, %57, %._crit_edge
  call void @_ZN3chw9onceTokenD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  ret void

59:                                               ; preds = %55, %19
  %.pn = phi { ptr, i32 } [ %56, %55 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn
}

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

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

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

declare noundef i64 @_ZN3chw6Socket12getRecvSpeedEv(ptr noundef nonnull align 8 dereferenceable(1072)) local_unnamed_addr #3

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

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

!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, !7, i64 0}
!6 = !{!"_ZTSZN3chw9TcpServer10GetRcvInfoERmS1_S1_S1_E3$_1", !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"_ZTSZN3chw9TcpServer10GetRcvInfoERmS1_S1_S1_E3$_0", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !9, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass