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

; 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.NET_FRAGMENT = type { i32, ptr }
%struct.IP4_LINK_RX_TOKEN = type { i32, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN }
%struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%struct._IP4_INTERFACE = type { i32, %struct._LIST_ENTRY, i64, i32, i32, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i32, %struct._LIST_ENTRY, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_MANAGED_NETWORK_RECEIVE_DATA = type { %struct.EFI_TIME, ptr, i32, i32, i32, i32, i8, i8, i8, i16, ptr, ptr, ptr, ptr }
%struct.EFI_TIME = type { i16, i8, i8, i8, i8, i8, i8, i32, i16, i8, i8 }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [147 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [109 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare zeroext i8 @DebugAssertEnabled() #1

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @Ip4FreeFrameRxToken(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Ip4RecycleFrame(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @Ip4OnFrameReceivedDpc(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.NET_FRAGMENT, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %10, ptr %5, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %1
  %12 = call zeroext i8 @DebugAssertEnabled()
  %13 = icmp ne i8 %12, 0
  br i1 %13, label %14, label %24

14:                                               ; preds = %11
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %22

17:                                               ; preds = %14
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = icmp eq i32 %20, 1380339785
  br i1 %21, label %23, label %22

22:                                               ; preds = %17, %14
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1133, ptr noundef @.str.3)
  br label %23

23:                                               ; preds = %22, %17
  br label %24

24:                                               ; preds = %23, %11
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %29, i32 0, i32 15
  store ptr null, ptr %30, align 8, !tbaa !15
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %31, i32 0, i32 5
  store ptr %32, ptr %3, align 8, !tbaa !5
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, ptr %33, i32 0, i32 2
  %35 = load ptr, ptr %34, align 8, !tbaa !19
  store ptr %35, ptr %4, align 8, !tbaa !5
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, ptr %36, i32 0, i32 1
  %38 = load i64, ptr %37, align 8, !tbaa !20
  %39 = icmp slt i64 %38, 0
  br i1 %39, label %43, label %40

40:                                               ; preds = %26
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %57

43:                                               ; preds = %40, %26
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %44, i32 0, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %47, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !22
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, ptr %50, i32 0, i32 1
  %52 = load i64, ptr %51, align 8, !tbaa !20
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %53, i32 0, i32 4
  %55 = load ptr, ptr %54, align 8, !tbaa !23
  call void %46(ptr noundef %49, ptr noundef null, i64 noundef %52, i32 noundef 0, ptr noundef %55)
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Ip4FreeFrameRxToken(ptr noundef %56)
  store i32 1, ptr %9, align 4
  br label %125

57:                                               ; preds = %40
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %58, i32 0, i32 5
  %60 = load i32, ptr %59, align 4, !tbaa !24
  %61 = getelementptr inbounds %struct.NET_FRAGMENT, ptr %6, i32 0, i32 0
  store i32 %60, ptr %61, align 8, !tbaa !28
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %62, i32 0, i32 13
  %64 = load ptr, ptr %63, align 8, !tbaa !30
  %65 = getelementptr inbounds %struct.NET_FRAGMENT, ptr %6, i32 0, i32 1
  store ptr %64, ptr %65, align 8, !tbaa !31
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = call ptr @NetbufFromExt(ptr noundef %6, i32 noundef 1, i32 noundef 0, i32 noundef 60, ptr noundef @Ip4RecycleFrame, ptr noundef %66)
  store ptr %67, ptr %7, align 8, !tbaa !5
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = icmp eq ptr %68, null
  br i1 %69, label %70, label %88

70:                                               ; preds = %57
  %71 = load ptr, ptr @gBS, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %71, i32 0, i32 11
  %73 = load ptr, ptr %72, align 8, !tbaa !32
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %74, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !35
  %77 = call i64 %73(ptr noundef %76)
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %78, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !21
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %81, i32 0, i32 2
  %83 = load ptr, ptr %82, align 8, !tbaa !22
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %84, i32 0, i32 4
  %86 = load ptr, ptr %85, align 8, !tbaa !23
  call void %80(ptr noundef %83, ptr noundef null, i64 noundef -9223372036854775799, i32 noundef 0, ptr noundef %86)
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Ip4FreeFrameRxToken(ptr noundef %87)
  store i32 1, ptr %9, align 4
  br label %125

88:                                               ; preds = %57
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %89, i32 0, i32 6
  %91 = load i8, ptr %90, align 8, !tbaa !36
  %92 = zext i8 %91 to i32
  %93 = icmp ne i32 %92, 0
  %94 = zext i1 %93 to i64
  %95 = select i1 %93, i32 1, i32 0
  store i32 %95, ptr %8, align 4, !tbaa !37
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %96, i32 0, i32 7
  %98 = load i8, ptr %97, align 1, !tbaa !38
  %99 = zext i8 %98 to i32
  %100 = icmp ne i32 %99, 0
  %101 = zext i1 %100 to i64
  %102 = select i1 %100, i32 2, i32 0
  %103 = load i32, ptr %8, align 4, !tbaa !37
  %104 = or i32 %103, %102
  store i32 %104, ptr %8, align 4, !tbaa !37
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %105, i32 0, i32 8
  %107 = load i8, ptr %106, align 2, !tbaa !39
  %108 = zext i8 %107 to i32
  %109 = icmp ne i32 %108, 0
  %110 = zext i1 %109 to i64
  %111 = select i1 %109, i32 4, i32 0
  %112 = load i32, ptr %8, align 4, !tbaa !37
  %113 = or i32 %112, %111
  store i32 %113, ptr %8, align 4, !tbaa !37
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %114, i32 0, i32 3
  %116 = load ptr, ptr %115, align 8, !tbaa !21
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %117, i32 0, i32 2
  %119 = load ptr, ptr %118, align 8, !tbaa !22
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = load i32, ptr %8, align 4, !tbaa !37
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.IP4_LINK_RX_TOKEN, ptr %122, i32 0, i32 4
  %124 = load ptr, ptr %123, align 8, !tbaa !23
  call void %116(ptr noundef %119, ptr noundef %120, i64 noundef 0, i32 noundef %121, ptr noundef %124)
  store i32 0, ptr %9, align 4
  br label %125

125:                                              ; preds = %88, %70, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %126 = load i32, ptr %9, align 4
  switch i32 %126, label %128 [
    i32 0, label %127
    i32 1, label %127
  ]

127:                                              ; preds = %125, %125
  ret void

128:                                              ; preds = %125
  unreachable
}

declare ptr @NetbufFromExt(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr 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, !11, i64 0}
!10 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!13 = !{!"long long", !7, i64 0}
!14 = !{!10, !6, i64 8}
!15 = !{!16, !6, i64 128}
!16 = !{!"_IP4_INTERFACE", !11, i64 0, !17, i64 8, !13, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !17, i64 96, !17, i64 112, !6, i64 128, !18, i64 136, !18, i64 168, !11, i64 200, !17, i64 208, !7, i64 224}
!17 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!18 = !{!"", !7, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!12, !13, i64 8}
!21 = !{!10, !6, i64 24}
!22 = !{!10, !6, i64 16}
!23 = !{!10, !6, i64 32}
!24 = !{!25, !11, i64 36}
!25 = !{!"", !26, i64 0, !6, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !7, i64 40, !7, i64 41, !7, i64 42, !27, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!26 = !{!"", !27, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !11, i64 8, !27, i64 12, !7, i64 14, !7, i64 15}
!27 = !{!"short", !7, i64 0}
!28 = !{!29, !11, i64 0}
!29 = !{!"", !11, i64 0, !6, i64 8}
!30 = !{!25, !6, i64 72}
!31 = !{!29, !6, i64 8}
!32 = !{!33, !6, i64 104}
!33 = !{!"", !34, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!34 = !{!"", !13, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!35 = !{!25, !6, i64 16}
!36 = !{!25, !7, i64 40}
!37 = !{!11, !11, i64 0}
!38 = !{!25, !7, i64 41}
!39 = !{!25, !7, i64 42}


; 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.NET_FRAGMENT = type { i32, ptr }

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [147 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [109 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @Ip4FreeFrameRxToken(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Ip4RecycleFrame(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @Ip4OnFrameReceivedDpc(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca %struct.NET_FRAGMENT, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #3
  %3 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %3, 0
  br i1 %.not, label %9, label %4

4:                                                ; preds = %1
  %.not34 = icmp eq ptr %0, null
  br i1 %.not34, label %8, label %5

5:                                                ; preds = %4
  %6 = load i32, ptr %0, align 8, !tbaa !5
  %7 = icmp eq i32 %6, 1380339785
  br i1 %7, label %9, label %8

8:                                                ; preds = %5, %4
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1133, ptr noundef nonnull @.str.3) #3
  br label %9

9:                                                ; preds = %5, %8, %1
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %11, i64 128
  store ptr null, ptr %12, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %0, i64 56
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = load i64, ptr %15, align 8, !tbaa !19
  %17 = icmp slt i64 %16, 0
  %18 = icmp eq ptr %14, null
  %or.cond = select i1 %17, i1 true, i1 %18
  br i1 %or.cond, label %19, label %26

19:                                               ; preds = %9
  %20 = getelementptr inbounds i8, ptr %0, i64 24
  %21 = load ptr, ptr %20, align 8, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  %23 = load ptr, ptr %22, align 8, !tbaa !21
  %24 = getelementptr inbounds i8, ptr %0, i64 32
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  tail call void %21(ptr noundef %23, ptr noundef null, i64 noundef %16, i32 noundef 0, ptr noundef %25) #3
  tail call void @Ip4FreeFrameRxToken(ptr noundef nonnull %0)
  br label %65

26:                                               ; preds = %9
  %27 = getelementptr inbounds i8, ptr %14, i64 36
  %28 = load i32, ptr %27, align 4, !tbaa !23
  store i32 %28, ptr %2, align 8, !tbaa !27
  %29 = getelementptr inbounds i8, ptr %14, i64 72
  %30 = load ptr, ptr %29, align 8, !tbaa !29
  %31 = getelementptr inbounds i8, ptr %2, i64 8
  store ptr %30, ptr %31, align 8, !tbaa !30
  %32 = call ptr @NetbufFromExt(ptr noundef nonnull %2, i32 noundef 1, i32 noundef 0, i32 noundef 60, ptr noundef nonnull @Ip4RecycleFrame, ptr noundef nonnull %0) #3
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %47

34:                                               ; preds = %26
  %35 = load ptr, ptr @gBS, align 8, !tbaa !31
  %36 = getelementptr inbounds i8, ptr %35, i64 104
  %37 = load ptr, ptr %36, align 8, !tbaa !32
  %38 = getelementptr inbounds i8, ptr %14, i64 16
  %39 = load ptr, ptr %38, align 8, !tbaa !35
  %40 = call i64 %37(ptr noundef %39) #3
  %41 = getelementptr inbounds i8, ptr %0, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !20
  %43 = getelementptr inbounds i8, ptr %0, i64 16
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  %45 = getelementptr inbounds i8, ptr %0, i64 32
  %46 = load ptr, ptr %45, align 8, !tbaa !22
  call void %42(ptr noundef %44, ptr noundef null, i64 noundef -9223372036854775799, i32 noundef 0, ptr noundef %46) #3
  call void @Ip4FreeFrameRxToken(ptr noundef nonnull %0)
  br label %65

47:                                               ; preds = %26
  %48 = getelementptr inbounds i8, ptr %14, i64 40
  %49 = load i8, ptr %48, align 8, !tbaa !36
  %.not35 = icmp ne i8 %49, 0
  %50 = zext i1 %.not35 to i32
  %51 = getelementptr inbounds i8, ptr %14, i64 41
  %52 = load i8, ptr %51, align 1, !tbaa !37
  %.not36 = icmp eq i8 %52, 0
  %53 = select i1 %.not36, i32 0, i32 2
  %54 = or disjoint i32 %53, %50
  %55 = getelementptr inbounds i8, ptr %14, i64 42
  %56 = load i8, ptr %55, align 2, !tbaa !38
  %.not37 = icmp eq i8 %56, 0
  %57 = select i1 %.not37, i32 0, i32 4
  %58 = or disjoint i32 %54, %57
  %59 = getelementptr inbounds i8, ptr %0, i64 24
  %60 = load ptr, ptr %59, align 8, !tbaa !20
  %61 = getelementptr inbounds i8, ptr %0, i64 16
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  %63 = getelementptr inbounds i8, ptr %0, i64 32
  %64 = load ptr, ptr %63, align 8, !tbaa !22
  call void %60(ptr noundef %62, ptr noundef nonnull %32, i64 noundef 0, i32 noundef %58, ptr noundef %64) #3
  br label %65

65:                                               ; preds = %47, %34, %19
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #3
  ret void
}

declare ptr @NetbufFromExt(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr 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, !10, i64 16, !10, i64 24, !10, i64 32, !11, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"", !10, i64 0, !12, i64 8, !8, i64 16}
!12 = !{!"long long", !8, i64 0}
!13 = !{!6, !10, i64 8}
!14 = !{!15, !10, i64 128}
!15 = !{!"_IP4_INTERFACE", !7, i64 0, !16, i64 8, !12, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !8, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !16, i64 96, !16, i64 112, !10, i64 128, !17, i64 136, !17, i64 168, !7, i64 200, !16, i64 208, !8, i64 224}
!16 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!17 = !{!"", !8, i64 0}
!18 = !{!8, !8, i64 0}
!19 = !{!11, !12, i64 8}
!20 = !{!6, !10, i64 24}
!21 = !{!6, !10, i64 16}
!22 = !{!6, !10, i64 32}
!23 = !{!24, !7, i64 36}
!24 = !{!"", !25, i64 0, !10, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !8, i64 41, !8, i64 42, !26, i64 44, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72}
!25 = !{!"", !26, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !7, i64 8, !26, i64 12, !8, i64 14, !8, i64 15}
!26 = !{!"short", !8, i64 0}
!27 = !{!28, !7, i64 0}
!28 = !{!"", !7, i64 0, !10, i64 8}
!29 = !{!24, !10, i64 72}
!30 = !{!28, !10, i64 8}
!31 = !{!10, !10, i64 0}
!32 = !{!33, !10, i64 104}
!33 = !{!"", !34, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!34 = !{!"", !12, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!35 = !{!24, !10, i64 16}
!36 = !{!24, !8, i64 40}
!37 = !{!24, !8, i64 41}
!38 = !{!24, !8, i64 42}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass