; LLVM IR from dennisss/tansa :: src/mocap/optitrack/natnet_client.ll (ZN5tansa9optitrack17natnet_cmd_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.tansa::optitrack::NatNetPacket" = type { i16, i16, [100000 x i8] }
%"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 }
%"struct.tansa::optitrack::NatNetSender" = type { [256 x i8], [4 x i8], [4 x i8] }

@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [8 x i8], align 1

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

; 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

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5tansa9optitrack17natnet_cmd_serverEPv(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %struct.sockaddr_in, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.tansa::optitrack::NatNetPacket", align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.tansa::Time", align 8
  %11 = alloca %"class.tansa::Time", align 8
  %12 = 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
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %13, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, 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 100004, ptr %7) #4
  br label %14

14:                                               ; preds = %117, %41, %30, %1
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %15, i32 0, i32 2
  %17 = load i8, ptr %16, align 4, !tbaa !11, !range !30, !noundef !31
  %18 = trunc i8 %17 to i1
  br i1 %18, label %19, label %118

19:                                               ; preds = %14
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %20, i32 0, i32 5
  %22 = load i32, ptr %21, align 8, !tbaa !32
  %23 = call i64 @recvfrom(i32 noundef %22, ptr noundef %7, i64 noundef 100004, i32 noundef 0, ptr noundef %5, ptr noundef %6)
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %4, align 4, !tbaa !9
  %25 = load i32, ptr %4, align 4, !tbaa !9
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %30, label %27

27:                                               ; preds = %19
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %27, %19
  br label %14, !llvm.loop !33

31:                                               ; preds = %27
  %32 = getelementptr inbounds %struct.sockaddr_in, ptr %5, i32 0, i32 2
  %33 = getelementptr inbounds %struct.in_addr, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 4, !tbaa !35
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %35, i32 0, i32 9
  %37 = getelementptr inbounds %struct.sockaddr_in, ptr %36, i32 0, i32 2
  %38 = getelementptr inbounds %struct.in_addr, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 4, !tbaa !36
  %40 = icmp eq i32 %34, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %31
  br label %14, !llvm.loop !33

42:                                               ; preds = %31
  %43 = getelementptr inbounds %"struct.tansa::optitrack::NatNetPacket", ptr %7, i32 0, i32 0
  %44 = load i16, ptr %43, align 1, !tbaa !37
  %45 = zext i16 %44 to i32
  switch i32 %45, label %112 [
    i32 5, label %46
    i32 7, label %46
    i32 1, label %48
    i32 3, label %104
    i32 100, label %106
    i32 8, label %108
    i32 0, label %117
  ]

46:                                               ; preds = %42, %42
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN5tansa9optitrack12NatNetClient13handle_packetEPKNS0_12NatNetPacketE(ptr noundef nonnull align 8 dereferenceable(168) %47, ptr noundef %7)
  br label %117

48:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %49 = getelementptr inbounds %"struct.tansa::optitrack::NatNetPacket", ptr %7, i32 0, i32 2
  %50 = getelementptr inbounds [100000 x i8], ptr %49, i64 0, i64 0
  store ptr %50, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.sockaddr_in, ptr %5, i32 0, i32 2
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %52, i32 0, i32 10
  %54 = getelementptr inbounds %struct.sockaddr_in, ptr %53, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %54, ptr align 4 %51, i64 4, i1 false), !tbaa.struct !39
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %82, %48
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = icmp slt i32 %56, 4
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %85

59:                                               ; preds = %55
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.tansa::optitrack::NatNetSender", ptr %60, i32 0, i32 2
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [4 x i8], ptr %61, i64 0, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !40
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %66, i32 0, i32 13
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [4 x i8], ptr %67, i64 0, i64 %69
  store i8 %65, ptr %70, align 1, !tbaa !40
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.tansa::optitrack::NatNetSender", ptr %71, i32 0, i32 1
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [4 x i8], ptr %72, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !40
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %77, i32 0, i32 14
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [4 x i8], ptr %78, i64 0, i64 %80
  store i8 %76, ptr %81, align 1, !tbaa !40
  br label %82

82:                                               ; preds = %59
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %9, align 4, !tbaa !9
  br label %55, !llvm.loop !41

85:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #4
  %86 = call { i64, i64 } @_ZN5tansa4Time3nowEv()
  %87 = getelementptr inbounds %"class.tansa::Time", ptr %10, i32 0, i32 0
  %88 = getelementptr inbounds { i64, i64 }, ptr %87, i32 0, i32 0
  %89 = extractvalue { i64, i64 } %86, 0
  store i64 %89, ptr %88, align 8
  %90 = getelementptr inbounds { i64, i64 }, ptr %87, i32 0, i32 1
  %91 = extractvalue { i64, i64 } %86, 1
  store i64 %91, ptr %90, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #4
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %92, i32 0, i32 11
  %94 = call { i64, i64 } @_ZNK5tansa4Time5sinceERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %93)
  %95 = getelementptr inbounds %"class.tansa::Time", ptr %12, i32 0, i32 0
  %96 = getelementptr inbounds { i64, i64 }, ptr %95, i32 0, i32 0
  %97 = extractvalue { i64, i64 } %94, 0
  store i64 %97, ptr %96, align 8
  %98 = getelementptr inbounds { i64, i64 }, ptr %95, i32 0, i32 1
  %99 = extractvalue { i64, i64 } %94, 1
  store i64 %99, ptr %98, align 8
  %100 = call noundef double @_ZNK5tansa4Time7secondsEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
  %101 = fdiv double %100, 2.000000e+00
  call void @_ZN5tansa4TimeC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %11, double noundef %101)
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.tansa::optitrack::NatNetClient", ptr %102, i32 0, i32 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %103, ptr align 8 %11, i64 16, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %117

104:                                              ; preds = %42
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  br label %117

106:                                              ; preds = %42
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  br label %117

108:                                              ; preds = %42
  %109 = getelementptr inbounds %"struct.tansa::optitrack::NatNetPacket", ptr %7, i32 0, i32 2
  %110 = getelementptr inbounds [100000 x i8], ptr %109, i64 0, i64 0
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, ptr noundef %110)
  br label %117

112:                                              ; preds = %42
  %113 = getelementptr inbounds %"struct.tansa::optitrack::NatNetPacket", ptr %7, i32 0, i32 0
  %114 = load i16, ptr %113, align 1, !tbaa !37
  %115 = zext i16 %114 to i32
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %115)
  br label %117

117:                                              ; preds = %112, %108, %106, %104, %85, %46, %42
  br label %14, !llvm.loop !33

118:                                              ; preds = %14
  call void @llvm.lifetime.end.p0(i64 100004, 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 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret ptr null
}

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

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

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

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

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

declare void @_ZN5tansa4TimeC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !24, i64 52}
!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 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!12, !10, i64 72}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!25, !10, i64 4}
!36 = !{!12, !10, i64 100}
!37 = !{!38, !26, i64 0}
!38 = !{!"_ZTSN5tansa9optitrack12NatNetPacketE", !26, i64 0, !26, i64 2, !7, i64 4}
!39 = !{i64 0, i64 4, !9}
!40 = !{!7, !7, i64 0}
!41 = distinct !{!41, !34}
!42 = !{i64 0, i64 8, !43, i64 8, i64 8, !43}
!43 = !{!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.tansa::optitrack::NatNetPacket" = type { i16, i16, [100000 x i8] }
%"class.tansa::Time" = type { %struct.timespec }
%struct.timespec = type { i64, i64 }

@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [8 x i8], align 1

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

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noalias noundef ptr @_ZN5tansa9optitrack17natnet_cmd_serverEPv(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca %struct.sockaddr_in, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.tansa::optitrack::NatNetPacket", align 2
  %5 = alloca %"class.tansa::Time", align 8
  %6 = alloca %"class.tansa::Time", align 8
  %7 = alloca %"class.tansa::Time", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 16, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 100004, ptr nonnull %4) #5
  %8 = getelementptr inbounds i8, ptr %0, i64 52
  %9 = load i8, ptr %8, align 4, !tbaa !9, !range !29, !noundef !30
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 72
  %12 = getelementptr inbounds i8, ptr %2, i64 4
  %13 = getelementptr inbounds i8, ptr %0, i64 100
  %14 = getelementptr inbounds i8, ptr %4, i64 4
  %15 = getelementptr inbounds i8, ptr %0, i64 116
  %16 = getelementptr i8, ptr %0, i64 160
  %17 = getelementptr inbounds i8, ptr %4, i64 260
  %18 = getelementptr inbounds i8, ptr %5, i64 8
  %19 = getelementptr inbounds i8, ptr %0, i64 128
  %20 = getelementptr inbounds i8, ptr %7, i64 8
  %21 = getelementptr inbounds i8, ptr %0, i64 144
  br label %22

22:                                               ; preds = %.lr.ph, %.backedge
  %23 = load i32, ptr %11, align 8, !tbaa !31
  %24 = call i64 @recvfrom(i32 noundef %23, ptr noundef nonnull %4, i64 noundef 100004, i32 noundef 0, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %25 = trunc i64 %24 to i32
  %or.cond = icmp slt i32 %25, 1
  br i1 %or.cond, label %.backedge, label %26

26:                                               ; preds = %22
  %27 = load i32, ptr %12, align 4, !tbaa !5
  %28 = load i32, ptr %13, align 4, !tbaa !32
  %29 = icmp eq i32 %27, %28
  br i1 %29, label %.backedge, label %30

30:                                               ; preds = %26
  %31 = load i16, ptr %4, align 2, !tbaa !33
  switch i16 %31, label %50 [
    i16 5, label %32
    i16 7, label %32
    i16 1, label %33
    i16 3, label %44
    i16 100, label %46
    i16 8, label %48
    i16 0, label %.backedge
  ]

32:                                               ; preds = %30, %30
  call void @_ZN5tansa9optitrack12NatNetClient13handle_packetEPKNS0_12NatNetPacketE(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull %4)
  br label %.backedge

33:                                               ; preds = %30
  store i32 %27, ptr %15, align 4, !tbaa !5
  %34 = load <2 x i32>, ptr %17, align 2, !tbaa !35
  %35 = shufflevector <2 x i32> %34, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i32> %35, ptr %16, align 1, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %36 = call { i64, i64 } @_ZN5tansa4Time3nowEv()
  %37 = extractvalue { i64, i64 } %36, 0
  store i64 %37, ptr %5, align 8
  %38 = extractvalue { i64, i64 } %36, 1
  store i64 %38, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  %39 = call { i64, i64 } @_ZNK5tansa4Time5sinceERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %19)
  %40 = extractvalue { i64, i64 } %39, 0
  store i64 %40, ptr %7, align 8
  %41 = extractvalue { i64, i64 } %39, 1
  store i64 %41, ptr %20, align 8
  %42 = call noundef double @_ZNK5tansa4Time7secondsEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %43 = fmul double %42, 5.000000e-01
  call void @_ZN5tansa4TimeC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %6, double noundef %43)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %6, i64 16, i1 false), !tbaa.struct !36
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %.backedge

44:                                               ; preds = %30
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  br label %.backedge

46:                                               ; preds = %30
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  br label %.backedge

48:                                               ; preds = %30
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef nonnull %14)
  br label %.backedge

50:                                               ; preds = %30
  %51 = zext i16 %31 to i32
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %51)
  br label %.backedge

.backedge:                                        ; preds = %30, %32, %33, %44, %46, %48, %50, %22, %26
  %53 = load i8, ptr %8, align 4, !tbaa !9, !range !29, !noundef !30
  %54 = trunc nuw i8 %53 to i1
  br i1 %54, label %22, label %._crit_edge, !llvm.loop !38

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

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

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

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

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

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

declare void @_ZN5tansa4TimeC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #4

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

!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, !23, i64 52}
!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 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!10, !6, i64 72}
!32 = !{!10, !6, i64 100}
!33 = !{!34, !25, i64 0}
!34 = !{!"_ZTSN5tansa9optitrack12NatNetPacketE", !25, i64 0, !25, i64 2, !7, i64 4}
!35 = !{!7, !7, i64 0}
!36 = !{i64 0, i64 8, !37, i64 8, i64 8, !37}
!37 = !{!21, !21, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass