; LLVM IR from dennisss/tansa :: src/mocap/optitrack/natnet_client.ll (ZN5tansa9optitrack18natnet_data_serverEPv)

; 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"

%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.pollfd = type { i32, i16, i16 }
%"class.tansa::Time" = type { %struct.timespec }
%struct.timespec = type { i64, i64 }
%"class.tansa::optitrack::NatNetClient" = type { %"class.tansa::Channel", i32, i8, i32, i64, i32, i64, i32, i32, %struct.sockaddr_in, %struct.sockaddr_in, %"class.tansa::Time", %"class.tansa::Time", [4 x i8], [4 x i8] }
%"class.tansa::Channel" = type { %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::vector<tansa::Subscription *>>, std::_Select1st<std::pair<const int, std::vector<tansa::Subscription *>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::vector<tansa::Subscription *>>, std::_Select1st<std::pair<const int, std::vector<tansa::Subscription *>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5tansa9optitrack18natnet_data_serverEPv(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [20000 x i8], align 16
  %5 = alloca %struct.sockaddr_in, align 4
  %6 = alloca i32, align 4
  %7 = alloca [1 x %struct.pollfd], align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.tansa::Time", align 8
  %13 = alloca %"class.tansa::Time", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %14, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20000, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 16, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !9
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %15, i32 0, i32 3
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = getelementptr inbounds [1 x %struct.pollfd], ptr %7, i64 0, i64 0
  %19 = getelementptr inbounds %struct.pollfd, ptr %18, i32 0, i32 0
  store i32 %17, ptr %19, align 4, !tbaa !30
  %20 = getelementptr inbounds [1 x %struct.pollfd], ptr %7, i64 0, i64 0
  %21 = getelementptr inbounds %struct.pollfd, ptr %20, i32 0, i32 1
  store i16 1, ptr %21, align 4, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  br label %22

22:                                               ; preds = %96, %64, %1
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %23, i32 0, i32 2
  %25 = load i8, ptr %24, align 4, !tbaa !33, !range !34, !noundef !35
  %26 = trunc i8 %25 to i1
  br i1 %26, label %27, label %97

27:                                               ; preds = %22
  %28 = getelementptr inbounds [1 x %struct.pollfd], ptr %7, i64 0, i64 0
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = call i32 @poll(ptr noundef %28, i64 noundef %30, i32 noundef 50)
  store i32 %31, ptr %9, align 4, !tbaa !9
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %27
  br label %69

35:                                               ; preds = %27
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %35
  br label %68

39:                                               ; preds = %35
  %40 = getelementptr inbounds [1 x %struct.pollfd], ptr %7, i64 0, i64 0
  %41 = getelementptr inbounds %struct.pollfd, ptr %40, i32 0, i32 2
  %42 = load i16, ptr %41, align 2, !tbaa !36
  %43 = sext i16 %42 to i32
  %44 = and i32 %43, 1
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %67

46:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %47, i32 0, i32 3
  %49 = load i32, ptr %48, align 8, !tbaa !11
  %50 = getelementptr inbounds [20000 x i8], ptr %4, i64 0, i64 0
  %51 = call i64 @recvfrom(i32 noundef %49, ptr noundef %50, i64 noundef 20000, i32 noundef 0, ptr noundef %5, ptr noundef %6)
  %52 = trunc i64 %51 to i32
  store i32 %52, ptr %10, align 4, !tbaa !9
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %46
  store i32 2, ptr %11, align 4
  br label %64, !llvm.loop !37

56:                                               ; preds = %46
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = icmp slt i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  store i32 2, ptr %11, align 4
  br label %64, !llvm.loop !37

60:                                               ; preds = %56
  br label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds [20000 x i8], ptr %4, i64 0, i64 0
  call void @_ZN5tansa9optitrack12NatNetClient13handle_packetEPKNS0_12NatNetPacketE(ptr noundef nonnull align 8 dereferenceable(168) %62, ptr noundef %63)
  store i32 0, ptr %11, align 4
  br label %64

64:                                               ; preds = %61, %59, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %65 = load i32, ptr %11, align 4
  switch i32 %65, label %98 [
    i32 0, label %66
    i32 2, label %22
  ]

66:                                               ; preds = %64
  br label %67

67:                                               ; preds = %66, %39
  br label %68

68:                                               ; preds = %67, %38
  br label %69

69:                                               ; preds = %68, %34
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !39
  %73 = icmp eq i32 %72, 2
  br i1 %73, label %74, label %96

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #4
  %75 = call { i64, i64 } @_ZN5tansa4Time3nowEv()
  %76 = getelementptr inbounds %"class.tansa::Time", ptr %12, i32 0, i32 0
  %77 = getelementptr inbounds { i64, i64 }, ptr %76, i32 0, i32 0
  %78 = extractvalue { i64, i64 } %75, 0
  store i64 %78, ptr %77, align 8
  %79 = getelementptr inbounds { i64, i64 }, ptr %76, i32 0, i32 1
  %80 = extractvalue { i64, i64 } %75, 1
  store i64 %80, ptr %79, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %81, i32 0, i32 11
  %83 = call { i64, i64 } @_ZNK5tansa4Time5sinceERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %82)
  %84 = getelementptr inbounds %"class.tansa::Time", ptr %13, i32 0, i32 0
  %85 = getelementptr inbounds { i64, i64 }, ptr %84, i32 0, i32 0
  %86 = extractvalue { i64, i64 } %83, 0
  store i64 %86, ptr %85, align 8
  %87 = getelementptr inbounds { i64, i64 }, ptr %84, i32 0, i32 1
  %88 = extractvalue { i64, i64 } %83, 1
  store i64 %88, ptr %87, align 8
  %89 = call noundef double @_ZNK5tansa4Time7secondsEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %90 = fcmp oge double %89, 1.000000e-01
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  br i1 %90, label %91, label %95

91:                                               ; preds = %74
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN5tansa9optitrack12NatNetClient4pingEv(ptr noundef nonnull align 8 dereferenceable(168) %92)
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %93, i32 0, i32 11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %94, ptr align 8 %12, i64 16, i1 false), !tbaa.struct !40
  br label %95

95:                                               ; preds = %91, %74
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  br label %96

96:                                               ; preds = %95, %69
  br label %22, !llvm.loop !37

97:                                               ; preds = %22
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 20000, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret ptr null

98:                                               ; preds = %64
  unreachable
}

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

declare { i64, i64 } @_ZN5tansa4Time3nowEv() #3

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

declare i32 @poll(ptr noundef, i64 noundef, i32 noundef) #3

declare i64 @recvfrom(i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #3

declare { i64, i64 } @_ZNK5tansa4Time5sinceERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3

declare noundef double @_ZNK5tansa4Time7secondsEv(ptr noundef nonnull align 8 dereferenceable(16)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 56}
!12 = !{!"_ZTSN5tansa9optitrack12NatNetClientE", !13, i64 0, !23, i64 48, !24, i64 52, !10, i64 56, !22, i64 64, !10, i64 72, !22, i64 80, !10, i64 88, !10, i64 92, !25, i64 96, !25, i64 112, !28, i64 128, !28, i64 144, !7, i64 160, !7, i64 164}
!13 = !{!"_ZTSN5tansa7ChannelE", !14, i64 0}
!14 = !{!"_ZTSSt3mapIiSt6vectorIPN5tansa12SubscriptionESaIS3_EESt4lessIiESaISt4pairIKiS5_EEE", !15, i64 0}
!15 = !{!"_ZTSSt8_Rb_treeIiSt4pairIKiSt6vectorIPN5tansa12SubscriptionESaIS5_EEESt10_Select1stIS8_ESt4lessIiESaIS8_EE", !16, i64 0}
!16 = !{!"_ZTSNSt8_Rb_treeIiSt4pairIKiSt6vectorIPN5tansa12SubscriptionESaIS5_EEESt10_Select1stIS8_ESt4lessIiESaIS8_EE13_Rb_tree_implISC_Lb1EEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !18, i64 0}
!18 = !{!"_ZTSSt4lessIiE"}
!19 = !{!"_ZTSSt15_Rb_tree_header", !20, i64 0, !22, i64 32}
!20 = !{!"_ZTSSt18_Rb_tree_node_base", !21, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!21 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSN5tansa9optitrack20NatNetConnectionTypeE", !7, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTS11sockaddr_in", !26, i64 0, !26, i64 2, !27, i64 4, !7, i64 8}
!26 = !{!"short", !7, i64 0}
!27 = !{!"_ZTS7in_addr", !10, i64 0}
!28 = !{!"_ZTSN5tansa4TimeE", !29, i64 0}
!29 = !{!"_ZTS8timespec", !22, i64 0, !22, i64 8}
!30 = !{!31, !10, i64 0}
!31 = !{!"_ZTS6pollfd", !10, i64 0, !26, i64 4, !26, i64 6}
!32 = !{!31, !26, i64 4}
!33 = !{!12, !24, i64 52}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!31, !26, i64 6}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!12, !23, i64 48}
!40 = !{i64 0, i64 8, !41, i64 8, i64 8, !41}
!41 = !{!22, !22, 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"

%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.pollfd = type { i32, i16, i16 }
%"class.tansa::Time" = type { %struct.timespec }
%struct.timespec = type { i64, i64 }

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress uwtable
define dso_local noalias noundef ptr @_ZN5tansa9optitrack18natnet_data_serverEPv(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca [20000 x i8], align 16
  %3 = alloca %struct.sockaddr_in, align 4
  %4 = alloca i32, align 4
  %5 = alloca [1 x %struct.pollfd], align 4
  %6 = alloca %"class.tansa::Time", align 8
  %7 = alloca %"class.tansa::Time", align 8
  call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 16, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  %9 = load i32, ptr %8, align 8, !tbaa !9
  store i32 %9, ptr %5, align 4, !tbaa !29
  %10 = getelementptr inbounds i8, ptr %5, i64 4
  store i16 1, ptr %10, align 4, !tbaa !31
  %11 = getelementptr inbounds i8, ptr %0, i64 52
  %12 = load i8, ptr %11, align 4, !tbaa !32, !range !33, !noundef !34
  %13 = trunc nuw i8 %12 to i1
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %14 = getelementptr inbounds i8, ptr %5, i64 6
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = getelementptr inbounds i8, ptr %6, i64 8
  %17 = getelementptr inbounds i8, ptr %0, i64 128
  %18 = getelementptr inbounds i8, ptr %7, i64 8
  br label %19

19:                                               ; preds = %.lr.ph, %.backedge
  %20 = call i32 @poll(ptr noundef nonnull %5, i64 noundef 1, i32 noundef 50)
  %or.cond = icmp slt i32 %20, 1
  br i1 %or.cond, label %28, label %21

21:                                               ; preds = %19
  %22 = load i16, ptr %14, align 2, !tbaa !35
  %23 = and i16 %22, 1
  %.not = icmp eq i16 %23, 0
  br i1 %.not, label %28, label %24

24:                                               ; preds = %21
  %25 = load i32, ptr %8, align 8, !tbaa !9
  %26 = call i64 @recvfrom(i32 noundef %25, ptr noundef nonnull %2, i64 noundef 20000, i32 noundef 0, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %27 = trunc i64 %26 to i32
  %or.cond16 = icmp slt i32 %27, 1
  br i1 %or.cond16, label %.backedge, label %.thread

.thread:                                          ; preds = %24
  call void @_ZN5tansa9optitrack12NatNetClient13handle_packetEPKNS0_12NatNetPacketE(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull %2)
  br label %28

28:                                               ; preds = %.thread, %21, %19
  %29 = load i32, ptr %15, align 8, !tbaa !36
  %30 = icmp eq i32 %29, 2
  br i1 %30, label %31, label %.backedge

31:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %32 = call { i64, i64 } @_ZN5tansa4Time3nowEv()
  %33 = extractvalue { i64, i64 } %32, 0
  store i64 %33, ptr %6, align 8
  %34 = extractvalue { i64, i64 } %32, 1
  store i64 %34, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %35 = call { i64, i64 } @_ZNK5tansa4Time5sinceERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %17)
  %36 = extractvalue { i64, i64 } %35, 0
  store i64 %36, ptr %7, align 8
  %37 = extractvalue { i64, i64 } %35, 1
  store i64 %37, ptr %18, align 8
  %38 = call noundef double @_ZNK5tansa4Time7secondsEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %39 = fcmp ult double %38, 1.000000e-01
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br i1 %39, label %41, label %40

40:                                               ; preds = %31
  call void @_ZN5tansa9optitrack12NatNetClient4pingEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %6, i64 16, i1 false), !tbaa.struct !37
  br label %41

41:                                               ; preds = %40, %31
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  br label %.backedge

.backedge:                                        ; preds = %28, %41, %24
  %42 = load i8, ptr %11, align 4, !tbaa !32, !range !33, !noundef !34
  %43 = trunc nuw i8 %42 to i1
  br i1 %43, label %19, label %._crit_edge, !llvm.loop !39

._crit_edge:                                      ; preds = %.backedge, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %2) #4
  ret ptr null
}

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

declare { i64, i64 } @_ZN5tansa4Time3nowEv() local_unnamed_addr #3

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

declare i32 @poll(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

declare i64 @recvfrom(i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare { i64, i64 } @_ZNK5tansa4Time5sinceERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

declare noundef double @_ZNK5tansa4Time7secondsEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 56}
!10 = !{!"_ZTSN5tansa9optitrack12NatNetClientE", !11, i64 0, !22, i64 48, !23, i64 52, !6, i64 56, !21, i64 64, !6, i64 72, !21, i64 80, !6, i64 88, !6, i64 92, !24, i64 96, !24, i64 112, !27, i64 128, !27, i64 144, !7, i64 160, !7, i64 164}
!11 = !{!"_ZTSN5tansa7ChannelE", !12, i64 0}
!12 = !{!"_ZTSSt3mapIiSt6vectorIPN5tansa12SubscriptionESaIS3_EESt4lessIiESaISt4pairIKiS5_EEE", !13, i64 0}
!13 = !{!"_ZTSSt8_Rb_treeIiSt4pairIKiSt6vectorIPN5tansa12SubscriptionESaIS5_EEESt10_Select1stIS8_ESt4lessIiESaIS8_EE", !14, i64 0}
!14 = !{!"_ZTSNSt8_Rb_treeIiSt4pairIKiSt6vectorIPN5tansa12SubscriptionESaIS5_EEESt10_Select1stIS8_ESt4lessIiESaIS8_EE13_Rb_tree_implISC_Lb1EEE", !15, i64 0, !17, i64 8}
!15 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !16, i64 0}
!16 = !{!"_ZTSSt4lessIiE"}
!17 = !{!"_ZTSSt15_Rb_tree_header", !18, i64 0, !21, i64 32}
!18 = !{!"_ZTSSt18_Rb_tree_node_base", !19, i64 0, !20, i64 8, !20, i64 16, !20, i64 24}
!19 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!20 = !{!"any pointer", !7, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN5tansa9optitrack20NatNetConnectionTypeE", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTS11sockaddr_in", !25, i64 0, !25, i64 2, !26, i64 4, !7, i64 8}
!25 = !{!"short", !7, i64 0}
!26 = !{!"_ZTS7in_addr", !6, i64 0}
!27 = !{!"_ZTSN5tansa4TimeE", !28, i64 0}
!28 = !{!"_ZTS8timespec", !21, i64 0, !21, i64 8}
!29 = !{!30, !6, i64 0}
!30 = !{!"_ZTS6pollfd", !6, i64 0, !25, i64 4, !25, i64 6}
!31 = !{!30, !25, i64 4}
!32 = !{!10, !23, i64 52}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!30, !25, i64 6}
!36 = !{!10, !22, i64 48}
!37 = !{i64 0, i64 8, !38, i64 8, i64 8, !38}
!38 = !{!21, !21, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass