; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal (Udp4ValidateTxToken)

; 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.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_UDP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%struct.EFI_UDP4_TRANSMIT_DATA = type { ptr, ptr, i32, i32, [1 x %struct.EFI_UDP4_FRAGMENT_DATA] }
%struct.EFI_UDP4_FRAGMENT_DATA = type { i32, ptr }
%struct._UDP4_INSTANCE_DATA_ = type { i32, %struct._LIST_ENTRY, ptr, %struct._EFI_UDP4_PROTOCOL, %struct.EFI_UDP4_CONFIG_DATA, ptr, i8, i8, %struct.NET_MAP, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i16, i64, ptr, i8 }
%struct._EFI_UDP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_UDP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_UDP4_SESSION_DATA = type { %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }

@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #1

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

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Udp4ValidateTxToken(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.EFI_UDP4_COMPLETION_TOKEN, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %2
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

19:                                               ; preds = %2
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.EFI_UDP4_COMPLETION_TOKEN, ptr %20, i32 0, i32 2
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  store ptr %22, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %30, label %25

25:                                               ; preds = %19
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %26, i32 0, i32 3
  %28 = load i32, ptr %27, align 4, !tbaa !13
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %25, %19
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

31:                                               ; preds = %25
  store i32 0, ptr %8, align 4, !tbaa !16
  store i32 0, ptr %7, align 4, !tbaa !16
  br label %32

32:                                               ; preds = %67, %31
  %33 = load i32, ptr %7, align 4, !tbaa !16
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %34, i32 0, i32 3
  %36 = load i32, ptr %35, align 4, !tbaa !13
  %37 = icmp ult i32 %33, %36
  br i1 %37, label %38, label %70

38:                                               ; preds = %32
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %39, i32 0, i32 4
  %41 = load i32, ptr %7, align 4, !tbaa !16
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds [1 x %struct.EFI_UDP4_FRAGMENT_DATA], ptr %40, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.EFI_UDP4_FRAGMENT_DATA, ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !17
  %46 = icmp eq ptr %45, null
  br i1 %46, label %56, label %47

47:                                               ; preds = %38
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %48, i32 0, i32 4
  %50 = load i32, ptr %7, align 4, !tbaa !16
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds [1 x %struct.EFI_UDP4_FRAGMENT_DATA], ptr %49, i64 0, i64 %51
  %53 = getelementptr inbounds %struct.EFI_UDP4_FRAGMENT_DATA, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 8, !tbaa !19
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %47, %38
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

57:                                               ; preds = %47
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %58, i32 0, i32 4
  %60 = load i32, ptr %7, align 4, !tbaa !16
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds [1 x %struct.EFI_UDP4_FRAGMENT_DATA], ptr %59, i64 0, i64 %61
  %63 = getelementptr inbounds %struct.EFI_UDP4_FRAGMENT_DATA, ptr %62, i32 0, i32 0
  %64 = load i32, ptr %63, align 8, !tbaa !19
  %65 = load i32, ptr %8, align 4, !tbaa !16
  %66 = add i32 %65, %64
  store i32 %66, ptr %8, align 4, !tbaa !16
  br label %67

67:                                               ; preds = %57
  %68 = load i32, ptr %7, align 4, !tbaa !16
  %69 = add i32 %68, 1
  store i32 %69, ptr %7, align 4, !tbaa !16
  br label %32, !llvm.loop !20

70:                                               ; preds = %32
  %71 = load i32, ptr %8, align 4, !tbaa !16
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %72, i32 0, i32 2
  %74 = load i32, ptr %73, align 8, !tbaa !22
  %75 = icmp ne i32 %71, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %70
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

77:                                               ; preds = %70
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %78, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8, !tbaa !23
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %93

82:                                               ; preds = %77
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !23
  %86 = call ptr @CopyMem(ptr noundef %12, ptr noundef %85, i64 noundef 4)
  %87 = load i32, ptr %12, align 4, !tbaa !16
  %88 = call i32 @SwapBytes32(i32 noundef %87)
  %89 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %88, i32 noundef 0)
  %90 = icmp ne i8 %89, 0
  br i1 %90, label %92, label %91

91:                                               ; preds = %82
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

92:                                               ; preds = %82
  br label %93

93:                                               ; preds = %92, %77
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %94, i32 0, i32 4
  store ptr %95, ptr %9, align 8, !tbaa !5
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !24
  store ptr %98, ptr %10, align 8, !tbaa !5
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %133

101:                                              ; preds = %93
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %102, i32 0, i32 0
  %104 = call ptr @CopyMem(ptr noundef %11, ptr noundef %103, i64 noundef 4)
  %105 = load i32, ptr %11, align 4, !tbaa !16
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %113

107:                                              ; preds = %101
  %108 = load i32, ptr %11, align 4, !tbaa !16
  %109 = call i32 @SwapBytes32(i32 noundef %108)
  %110 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %109, i32 noundef 0)
  %111 = icmp ne i8 %110, 0
  br i1 %111, label %113, label %112

112:                                              ; preds = %107
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

113:                                              ; preds = %107, %101
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %114, i32 0, i32 3
  %116 = load i16, ptr %115, align 2, !tbaa !25
  %117 = zext i16 %116 to i32
  %118 = icmp eq i32 %117, 0
  br i1 %118, label %119, label %126

119:                                              ; preds = %113
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %120, i32 0, i32 14
  %122 = load i16, ptr %121, align 4, !tbaa !29
  %123 = zext i16 %122 to i32
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %126

125:                                              ; preds = %119
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

126:                                              ; preds = %119, %113
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.EFI_UDP4_SESSION_DATA, ptr %127, i32 0, i32 2
  %129 = call i64 @CompareMem(ptr noundef %128, ptr noundef @mZeroIp4Addr, i64 noundef 4)
  %130 = icmp eq i64 %129, 0
  br i1 %130, label %131, label %132

131:                                              ; preds = %126
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

132:                                              ; preds = %126
  br label %140

133:                                              ; preds = %93
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.EFI_UDP4_CONFIG_DATA, ptr %134, i32 0, i32 13
  %136 = call i64 @CompareMem(ptr noundef %135, ptr noundef @mZeroIp4Addr, i64 noundef 4)
  %137 = icmp eq i64 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %133
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

139:                                              ; preds = %133
  br label %140

140:                                              ; preds = %139, %132
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.EFI_UDP4_TRANSMIT_DATA, ptr %141, i32 0, i32 2
  %143 = load i32, ptr %142, align 8, !tbaa !22
  %144 = icmp ugt i32 %143, 65507
  br i1 %144, label %145, label %146

145:                                              ; preds = %140
  store i64 -9223372036854775804, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

146:                                              ; preds = %140
  store i64 0, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %147

147:                                              ; preds = %146, %145, %138, %131, %125, %112, %91, %76, %56, %30, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %148 = load i64, ptr %3, align 8
  ret i64 %148
}

declare zeroext i8 @NetIp4IsUnicast(i32 noundef, i32 noundef) #1

declare i32 @SwapBytes32(i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind 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 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !11, i64 8, !7, i64 16}
!11 = !{!"long long", !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !15, i64 20}
!14 = !{!"", !6, i64 0, !6, i64 8, !15, i64 16, !15, i64 20, !7, i64 24}
!15 = !{!"int", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"", !15, i64 0, !6, i64 8}
!19 = !{!18, !15, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!14, !15, i64 16}
!23 = !{!14, !6, i64 8}
!24 = !{!14, !6, i64 0}
!25 = !{!26, !28, i64 10}
!26 = !{!"", !27, i64 0, !28, i64 4, !27, i64 6, !28, i64 10}
!27 = !{!"", !7, i64 0}
!28 = !{!"short", !7, i64 0}
!29 = !{!30, !28, i64 32}
!30 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !15, i64 8, !15, i64 12, !7, i64 16, !27, i64 17, !27, i64 21, !28, i64 26, !27, i64 28, !28, i64 32}


; 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.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_UDP4_FRAGMENT_DATA = type { i32, ptr }

@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @Udp4ValidateTxToken(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %.loopexit, label %7

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !11
  %10 = icmp eq ptr %9, null
  br i1 %10, label %.loopexit, label %11

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %9, i64 20
  %13 = load i32, ptr %12, align 4, !tbaa !12
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %11
  %15 = getelementptr inbounds i8, ptr %9, i64 24
  %wide.trip.count = zext i32 %13 to i64
  br label %16

16:                                               ; preds = %.preheader, %24
  %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %24 ]
  %.02840 = phi i32 [ 0, %.preheader ], [ %25, %24 ]
  %17 = getelementptr inbounds [1 x %struct.EFI_UDP4_FRAGMENT_DATA], ptr %15, i64 0, i64 %indvars.iv
  %18 = getelementptr inbounds i8, ptr %17, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = icmp eq ptr %19, null
  br i1 %20, label %.loopexit, label %21

21:                                               ; preds = %16
  %22 = load i32, ptr %17, align 8, !tbaa !17
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %.loopexit, label %24

24:                                               ; preds = %21
  %25 = add i32 %22, %.02840
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %26, label %16, !llvm.loop !18

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %9, i64 16
  %28 = load i32, ptr %27, align 8, !tbaa !20
  %.not = icmp eq i32 %25, %28
  br i1 %.not, label %29, label %.loopexit

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %9, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  %.not34 = icmp eq ptr %31, null
  br i1 %.not34, label %37, label %32

32:                                               ; preds = %29
  %33 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %31, i64 noundef 4) #3
  %34 = load i32, ptr %4, align 4, !tbaa !22
  %35 = call i32 @SwapBytes32(i32 noundef %34) #3
  %36 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %35, i32 noundef 0) #3
  %.not35 = icmp eq i8 %36, 0
  br i1 %.not35, label %.loopexit, label %37

37:                                               ; preds = %32, %29
  %38 = load ptr, ptr %9, align 8, !tbaa !23
  %.not36 = icmp eq ptr %38, null
  br i1 %.not36, label %57, label %39

39:                                               ; preds = %37
  %40 = call ptr @CopyMem(ptr noundef nonnull %3, ptr noundef nonnull %38, i64 noundef 4) #3
  %41 = load i32, ptr %3, align 4, !tbaa !22
  %.not37 = icmp eq i32 %41, 0
  br i1 %.not37, label %45, label %42

42:                                               ; preds = %39
  %43 = call i32 @SwapBytes32(i32 noundef %41) #3
  %44 = call zeroext i8 @NetIp4IsUnicast(i32 noundef %43, i32 noundef 0) #3
  %.not38 = icmp eq i8 %44, 0
  br i1 %.not38, label %.loopexit, label %45

45:                                               ; preds = %42, %39
  %46 = getelementptr inbounds i8, ptr %38, i64 10
  %47 = load i16, ptr %46, align 2, !tbaa !24
  %48 = icmp eq i16 %47, 0
  br i1 %48, label %49, label %53

49:                                               ; preds = %45
  %50 = getelementptr inbounds i8, ptr %0, i64 128
  %51 = load i16, ptr %50, align 4, !tbaa !28
  %52 = icmp eq i16 %51, 0
  br i1 %52, label %.loopexit, label %53

53:                                               ; preds = %49, %45
  %54 = getelementptr inbounds i8, ptr %38, i64 6
  %55 = call i64 @CompareMem(ptr noundef nonnull %54, ptr noundef nonnull @mZeroIp4Addr, i64 noundef 4) #3
  %56 = icmp eq i64 %55, 0
  br i1 %56, label %.loopexit, label %61

57:                                               ; preds = %37
  %58 = getelementptr inbounds i8, ptr %0, i64 124
  %59 = call i64 @CompareMem(ptr noundef nonnull %58, ptr noundef nonnull @mZeroIp4Addr, i64 noundef 4) #3
  %60 = icmp eq i64 %59, 0
  br i1 %60, label %.loopexit, label %61

61:                                               ; preds = %57, %53
  %62 = load i32, ptr %27, align 8, !tbaa !20
  %63 = icmp ugt i32 %62, 65507
  %. = select i1 %63, i64 -9223372036854775804, i64 0
  br label %.loopexit

.loopexit:                                        ; preds = %16, %21, %61, %57, %53, %49, %42, %32, %26, %7, %11, %2
  %.0 = phi i64 [ -9223372036854775806, %2 ], [ -9223372036854775806, %11 ], [ -9223372036854775806, %7 ], [ -9223372036854775806, %26 ], [ -9223372036854775806, %32 ], [ -9223372036854775806, %42 ], [ -9223372036854775806, %49 ], [ -9223372036854775806, %53 ], [ -9223372036854775806, %57 ], [ %., %61 ], [ -9223372036854775806, %21 ], [ -9223372036854775806, %16 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  ret i64 %.0
}

declare zeroext i8 @NetIp4IsUnicast(i32 noundef, i32 noundef) local_unnamed_addr #1

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind 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 = { 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 = !{!"", !7, i64 0, !10, i64 8, !8, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !14, i64 20}
!13 = !{!"", !7, i64 0, !7, i64 8, !14, i64 16, !14, i64 20, !8, i64 24}
!14 = !{!"int", !8, i64 0}
!15 = !{!16, !7, i64 8}
!16 = !{!"", !14, i64 0, !7, i64 8}
!17 = !{!16, !14, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!13, !14, i64 16}
!21 = !{!13, !7, i64 8}
!22 = !{!14, !14, i64 0}
!23 = !{!13, !7, i64 0}
!24 = !{!25, !27, i64 10}
!25 = !{!"", !26, i64 0, !27, i64 4, !26, i64 6, !27, i64 10}
!26 = !{!"", !8, i64 0}
!27 = !{!"short", !8, i64 0}
!28 = !{!29, !27, i64 32}
!29 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !14, i64 8, !14, i64 12, !8, i64 16, !26, i64 17, !26, i64 21, !27, i64 26, !26, i64 28, !27, i64 32}


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