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

; 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.MNP_INSTANCE_DATA = type { i32, ptr, ptr, %struct._LIST_ENTRY, %struct._EFI_MANAGED_NETWORK_PROTOCOL, i8, i8, %struct._LIST_ENTRY, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, i8 }
%struct._EFI_MANAGED_NETWORK_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%struct.MNP_SERVICE_DATA = type { i32, %struct._LIST_ENTRY, ptr, ptr, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, %struct._LIST_ENTRY, i64, i32, i16, i8 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.MNP_DEVICE_DATA = type { i32, ptr, ptr, %struct._EFI_VLAN_CONFIG_PROTOCOL, i64, ptr, ptr, %struct._LIST_ENTRY, i64, %struct._LIST_ENTRY, i32, ptr, %struct.NET_BUF_QUEUE, i64, ptr, i8, ptr, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr }
%struct._EFI_VLAN_CONFIG_PROTOCOL = type { ptr, ptr, ptr }
%struct.NET_BUF_QUEUE = type { i32, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i32 }
%struct.MNP_RXDATA_WRAP = type { %struct._LIST_ENTRY, ptr, %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr, i64 }
%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.NET_BUF = type { i32, i64, %struct._LIST_ENTRY, %union.NET_IP_HEAD, ptr, ptr, [64 x i8], ptr, i32, i32, [1 x %struct.NET_BLOCK_OP] }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }
%struct._EFI_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%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 }

@.str = external hidden unnamed_addr constant [147 x i8], align 1
@gBS = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [51 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

declare zeroext i8 @DebugAssertEnabled() #1

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

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @MnpInstanceDeliverPacket(ptr noundef %0) #2 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  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 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %11, i32 0, i32 1
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %13, i32 0, i32 2
  %15 = load ptr, ptr %14, align 8, !tbaa !18
  store ptr %15, ptr %4, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %1
  %17 = call zeroext i8 @DebugAssertEnabled()
  %18 = icmp ne i8 %17, 0
  br i1 %18, label %19, label %29

19:                                               ; preds = %16
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %27

22:                                               ; preds = %19
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !21
  %26 = icmp eq i32 %25, 1148218957
  br i1 %26, label %28, label %27

27:                                               ; preds = %22, %19
  call void @DebugAssert(ptr noundef @.str, i64 noundef 346, ptr noundef @.str.8)
  br label %28

28:                                               ; preds = %27, %22
  br label %29

29:                                               ; preds = %28, %16
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %32, i32 0, i32 8
  %34 = call zeroext i8 @NetMapIsEmpty(ptr noundef %33)
  %35 = zext i8 %34 to i32
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %43, label %37

37:                                               ; preds = %31
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %38, i32 0, i32 10
  %40 = call zeroext i8 @IsListEmpty(ptr noundef %39)
  %41 = zext i8 %40 to i32
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %37, %31
  store i64 0, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %171

44:                                               ; preds = %37
  br label %45

45:                                               ; preds = %44
  %46 = call zeroext i8 @DebugAssertEnabled()
  %47 = icmp ne i8 %46, 0
  br i1 %47, label %48, label %55

48:                                               ; preds = %45
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %49, i32 0, i32 11
  %51 = load i64, ptr %50, align 8, !tbaa !25
  %52 = icmp ne i64 %51, 0
  br i1 %52, label %54, label %53

53:                                               ; preds = %48
  call void @DebugAssert(ptr noundef @.str, i64 noundef 355, ptr noundef @.str.9)
  br label %54

54:                                               ; preds = %53, %48
  br label %55

55:                                               ; preds = %54, %45
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %58, i32 0, i32 10
  %60 = getelementptr inbounds %struct._LIST_ENTRY, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !26
  %62 = ptrtoint ptr %61 to i64
  %63 = sub i64 %62, 0
  %64 = inttoptr i64 %63 to ptr
  store ptr %64, ptr %5, align 8, !tbaa !5
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.MNP_RXDATA_WRAP, ptr %65, i32 0, i32 3
  %67 = load ptr, ptr %66, align 8, !tbaa !27
  %68 = getelementptr inbounds %struct.NET_BUF, ptr %67, i32 0, i32 1
  %69 = load i64, ptr %68, align 8, !tbaa !31
  %70 = icmp sgt i64 %69, 2
  br i1 %70, label %71, label %104

71:                                               ; preds = %57
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = call ptr @MnpAllocNbuf(ptr noundef %72)
  store ptr %73, ptr %6, align 8, !tbaa !5
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %91

76:                                               ; preds = %71
  br label %77

77:                                               ; preds = %76
  %78 = call zeroext i8 @DebugPrintEnabled()
  %79 = icmp ne i8 %78, 0
  br i1 %79, label %80, label %88

80:                                               ; preds = %77
  br label %81

81:                                               ; preds = %80
  %82 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2)
  %83 = icmp ne i8 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %81
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2, ptr noundef @.str.10)
  br label %85

85:                                               ; preds = %84, %81
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87, %77
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %171

91:                                               ; preds = %71
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.MNP_RXDATA_WRAP, ptr %92, i32 0, i32 3
  %94 = load ptr, ptr %93, align 8, !tbaa !27
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = call ptr @NetbufDuplicate(ptr noundef %94, ptr noundef %95, i32 noundef 0)
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.MNP_RXDATA_WRAP, ptr %98, i32 0, i32 3
  %100 = load ptr, ptr %99, align 8, !tbaa !27
  call void @MnpFreeNbuf(ptr noundef %97, ptr noundef %100)
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.MNP_RXDATA_WRAP, ptr %102, i32 0, i32 3
  store ptr %101, ptr %103, align 8, !tbaa !27
  br label %104

104:                                              ; preds = %91, %57
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %105, i32 0, i32 10
  %107 = call ptr @NetListRemoveHead(ptr noundef %106)
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %108, i32 0, i32 11
  %110 = load i64, ptr %109, align 8, !tbaa !25
  %111 = add i64 %110, -1
  store i64 %111, ptr %109, align 8, !tbaa !25
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.MNP_RXDATA_WRAP, ptr %112, i32 0, i32 2
  store ptr %113, ptr %7, align 8, !tbaa !5
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %114, i32 0, i32 6
  %116 = load ptr, ptr %115, align 8, !tbaa !33
  %117 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %116, i32 0, i32 15
  %118 = load ptr, ptr %117, align 8, !tbaa !34
  store ptr %118, ptr %8, align 8, !tbaa !5
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.MNP_RXDATA_WRAP, ptr %119, i32 0, i32 3
  %121 = load ptr, ptr %120, align 8, !tbaa !27
  %122 = call ptr @NetbufGetByte(ptr noundef %121, i32 noundef 0, ptr noundef null)
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %123, i32 0, i32 12
  store ptr %122, ptr %124, align 8, !tbaa !36
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %125, i32 0, i32 12
  %127 = load ptr, ptr %126, align 8, !tbaa !36
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %128, i32 0, i32 10
  store ptr %127, ptr %129, align 8, !tbaa !37
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %130, i32 0, i32 12
  %132 = load ptr, ptr %131, align 8, !tbaa !36
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !38
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds i8, ptr %132, i64 %136
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %138, i32 0, i32 11
  store ptr %137, ptr %139, align 8, !tbaa !41
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %140, i32 0, i32 12
  %142 = load ptr, ptr %141, align 8, !tbaa !36
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %143, i32 0, i32 2
  %145 = load i32, ptr %144, align 4, !tbaa !42
  %146 = zext i32 %145 to i64
  %147 = getelementptr inbounds i8, ptr %142, i64 %146
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_RECEIVE_DATA, ptr %148, i32 0, i32 13
  store ptr %147, ptr %149, align 8, !tbaa !43
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %150, i32 0, i32 9
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.MNP_RXDATA_WRAP, ptr %152, i32 0, i32 0
  %154 = call ptr @InsertTailList(ptr noundef %151, ptr noundef %153)
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %155, i32 0, i32 8
  %157 = call ptr @NetMapRemoveHead(ptr noundef %156, ptr noundef null)
  store ptr %157, ptr %9, align 8, !tbaa !5
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.MNP_RXDATA_WRAP, ptr %158, i32 0, i32 2
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, ptr %160, i32 0, i32 2
  store ptr %159, ptr %161, align 8, !tbaa !44
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, ptr %162, i32 0, i32 1
  store i64 0, ptr %163, align 8, !tbaa !45
  %164 = load ptr, ptr @gBS, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %164, i32 0, i32 11
  %166 = load ptr, ptr %165, align 8, !tbaa !47
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !50
  %170 = call i64 %166(ptr noundef %169)
  store i64 0, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %171

171:                                              ; preds = %104, %90, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, 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
  %172 = load i64, ptr %2, align 8
  ret i64 %172
}

declare zeroext i8 @NetMapIsEmpty(ptr noundef) #1

declare zeroext i8 @IsListEmpty(ptr noundef) #1

declare ptr @MnpAllocNbuf(ptr noundef) #1

declare ptr @NetbufDuplicate(ptr noundef, ptr noundef, i32 noundef) #1

declare void @MnpFreeNbuf(ptr noundef, ptr noundef) #1

declare ptr @NetListRemoveHead(ptr noundef) #1

declare ptr @NetbufGetByte(ptr noundef, i32 noundef, ptr noundef) #1

declare ptr @InsertTailList(ptr noundef, ptr noundef) #1

declare ptr @NetMapRemoveHead(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, !6, i64 8}
!10 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !7, i64 104, !7, i64 105, !12, i64 112, !14, i64 128, !12, i64 168, !12, i64 184, !15, i64 200, !16, i64 208, !7, i64 228}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_MANAGED_NETWORK_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!14 = !{!"", !12, i64 0, !12, i64 16, !15, i64 32}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"", !11, i64 0, !11, i64 4, !17, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !6, i64 24}
!19 = !{!"", !11, i64 0, !12, i64 8, !6, i64 24, !6, i64 32, !20, i64 40, !6, i64 56, !12, i64 64, !15, i64 80, !11, i64 88, !17, i64 92, !7, i64 94}
!20 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!21 = !{!22, !11, i64 0}
!22 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !23, i64 24, !15, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !15, i64 88, !12, i64 96, !11, i64 112, !6, i64 120, !24, i64 128, !15, i64 184, !6, i64 192, !7, i64 200, !6, i64 208, !6, i64 216, !11, i64 224, !11, i64 228, !11, i64 232, !11, i64 236, !11, i64 240, !11, i64 244, !6, i64 248, !6, i64 256}
!23 = !{!"_EFI_VLAN_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"", !11, i64 0, !15, i64 8, !12, i64 16, !12, i64 32, !11, i64 48, !11, i64 52}
!25 = !{!10, !15, i64 200}
!26 = !{!10, !6, i64 184}
!27 = !{!28, !6, i64 104}
!28 = !{!"", !12, i64 0, !6, i64 16, !29, i64 24, !6, i64 104, !15, i64 112}
!29 = !{!"", !30, 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, !17, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!30 = !{!"", !17, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !11, i64 8, !17, i64 12, !7, i64 14, !7, i64 15}
!31 = !{!32, !15, i64 8}
!32 = !{!"", !11, i64 0, !15, i64 8, !12, i64 16, !7, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !11, i64 128, !11, i64 132, !7, i64 136}
!33 = !{!22, !6, i64 64}
!34 = !{!35, !6, i64 120}
!35 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !15, i64 0, !6, i64 8, !6, i64 16, !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}
!36 = !{!29, !6, i64 64}
!37 = !{!29, !6, i64 48}
!38 = !{!39, !11, i64 4}
!39 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !7, i64 40, !40, i64 552, !40, i64 584, !40, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!40 = !{!"", !7, i64 0}
!41 = !{!29, !6, i64 56}
!42 = !{!39, !11, i64 8}
!43 = !{!29, !6, i64 72}
!44 = !{!7, !7, i64 0}
!45 = !{!46, !15, i64 8}
!46 = !{!"", !6, i64 0, !15, i64 8, !7, i64 16}
!47 = !{!48, !6, i64 104}
!48 = !{!"", !49, 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}
!49 = !{!"", !15, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!50 = !{!46, !6, 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"

@.str = external hidden unnamed_addr constant [147 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [51 x i8], align 1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #0

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #0

declare void @DebugPrint(i64 noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775799, 1) i64 @MnpInstanceDeliverPacket(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 24
  %5 = load ptr, ptr %4, align 8, !tbaa !17
  %6 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %6, 0
  br i1 %.not, label %12, label %7

7:                                                ; preds = %1
  %.not39 = icmp eq ptr %5, null
  br i1 %.not39, label %11, label %8

8:                                                ; preds = %7
  %9 = load i32, ptr %5, align 8, !tbaa !20
  %10 = icmp eq i32 %9, 1148218957
  br i1 %10, label %12, label %11

11:                                               ; preds = %8, %7
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 346, ptr noundef nonnull @.str.8) #2
  br label %12

12:                                               ; preds = %8, %11, %1
  %13 = getelementptr inbounds i8, ptr %0, i64 128
  %14 = tail call zeroext i8 @NetMapIsEmpty(ptr noundef nonnull %13) #2
  %.not40 = icmp eq i8 %14, 0
  br i1 %.not40, label %15, label %77

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %0, i64 184
  %17 = tail call zeroext i8 @IsListEmpty(ptr noundef nonnull %16) #2
  %.not41 = icmp eq i8 %17, 0
  br i1 %.not41, label %18, label %77

18:                                               ; preds = %15
  %19 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not42 = icmp eq i8 %19, 0
  br i1 %.not42, label %24, label %20

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %0, i64 200
  %22 = load i64, ptr %21, align 8, !tbaa !24
  %.not43 = icmp eq i64 %22, 0
  br i1 %.not43, label %23, label %24

23:                                               ; preds = %20
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 355, ptr noundef nonnull @.str.9) #2
  br label %24

24:                                               ; preds = %20, %23, %18
  %25 = load ptr, ptr %16, align 8, !tbaa !25
  %26 = getelementptr inbounds i8, ptr %25, i64 104
  %27 = load ptr, ptr %26, align 8, !tbaa !26
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !30
  %30 = icmp sgt i64 %29, 2
  br i1 %30, label %31, label %43

31:                                               ; preds = %24
  %32 = tail call ptr @MnpAllocNbuf(ptr noundef %5) #2
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %39

34:                                               ; preds = %31
  %35 = tail call zeroext i8 @DebugPrintEnabled() #2
  %.not44 = icmp eq i8 %35, 0
  br i1 %.not44, label %77, label %36

36:                                               ; preds = %34
  %37 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2) #2
  %.not45 = icmp eq i8 %37, 0
  br i1 %.not45, label %77, label %38

38:                                               ; preds = %36
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2, ptr noundef nonnull @.str.10) #2
  br label %77

39:                                               ; preds = %31
  %40 = load ptr, ptr %26, align 8, !tbaa !26
  %41 = tail call ptr @NetbufDuplicate(ptr noundef %40, ptr noundef nonnull %32, i32 noundef 0) #2
  %42 = load ptr, ptr %26, align 8, !tbaa !26
  tail call void @MnpFreeNbuf(ptr noundef %5, ptr noundef %42) #2
  store ptr %32, ptr %26, align 8, !tbaa !26
  br label %43

43:                                               ; preds = %39, %24
  %44 = tail call ptr @NetListRemoveHead(ptr noundef nonnull %16) #2
  %45 = getelementptr inbounds i8, ptr %0, i64 200
  %46 = load i64, ptr %45, align 8, !tbaa !24
  %47 = add i64 %46, -1
  store i64 %47, ptr %45, align 8, !tbaa !24
  %48 = getelementptr inbounds i8, ptr %25, i64 24
  %49 = getelementptr inbounds i8, ptr %5, i64 64
  %50 = load ptr, ptr %49, align 8, !tbaa !32
  %51 = getelementptr inbounds i8, ptr %50, i64 120
  %52 = load ptr, ptr %51, align 8, !tbaa !33
  %53 = load ptr, ptr %26, align 8, !tbaa !26
  %54 = tail call ptr @NetbufGetByte(ptr noundef %53, i32 noundef 0, ptr noundef null) #2
  %55 = getelementptr inbounds i8, ptr %25, i64 88
  store ptr %54, ptr %55, align 8, !tbaa !35
  %56 = getelementptr inbounds i8, ptr %25, i64 72
  store ptr %54, ptr %56, align 8, !tbaa !36
  %57 = getelementptr inbounds i8, ptr %52, i64 4
  %58 = load i32, ptr %57, align 4, !tbaa !37
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr %54, i64 %59
  %61 = getelementptr inbounds i8, ptr %25, i64 80
  store ptr %60, ptr %61, align 8, !tbaa !40
  %62 = getelementptr inbounds i8, ptr %52, i64 8
  %63 = load i32, ptr %62, align 4, !tbaa !41
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds i8, ptr %54, i64 %64
  %66 = getelementptr inbounds i8, ptr %25, i64 96
  store ptr %65, ptr %66, align 8, !tbaa !42
  %67 = getelementptr inbounds i8, ptr %0, i64 168
  %68 = tail call ptr @InsertTailList(ptr noundef nonnull %67, ptr noundef nonnull %25) #2
  %69 = tail call ptr @NetMapRemoveHead(ptr noundef nonnull %13, ptr noundef null) #2
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  store ptr %48, ptr %70, align 8, !tbaa !43
  %71 = getelementptr inbounds i8, ptr %69, i64 8
  store i64 0, ptr %71, align 8, !tbaa !44
  %72 = load ptr, ptr @gBS, align 8, !tbaa !46
  %73 = getelementptr inbounds i8, ptr %72, i64 104
  %74 = load ptr, ptr %73, align 8, !tbaa !47
  %75 = load ptr, ptr %69, align 8, !tbaa !50
  %76 = tail call i64 %74(ptr noundef %75) #2
  br label %77

77:                                               ; preds = %34, %38, %36, %12, %15, %43
  %.0 = phi i64 [ 0, %43 ], [ 0, %15 ], [ 0, %12 ], [ -9223372036854775799, %36 ], [ -9223372036854775799, %38 ], [ -9223372036854775799, %34 ]
  ret i64 %.0
}

declare zeroext i8 @NetMapIsEmpty(ptr noundef) local_unnamed_addr #0

declare zeroext i8 @IsListEmpty(ptr noundef) local_unnamed_addr #0

declare ptr @MnpAllocNbuf(ptr noundef) local_unnamed_addr #0

declare ptr @NetbufDuplicate(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @MnpFreeNbuf(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @NetListRemoveHead(ptr noundef) local_unnamed_addr #0

declare ptr @NetbufGetByte(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare ptr @InsertTailList(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @NetMapRemoveHead(ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #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 #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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, !10, i64 8}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 40, !8, i64 104, !8, i64 105, !11, i64 112, !13, i64 128, !11, i64 168, !11, i64 184, !14, i64 200, !15, i64 208, !8, i64 228}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!12 = !{!"_EFI_MANAGED_NETWORK_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!13 = !{!"", !11, i64 0, !11, i64 16, !14, i64 32}
!14 = !{!"long long", !8, i64 0}
!15 = !{!"", !7, i64 0, !7, i64 4, !16, i64 8, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16}
!16 = !{!"short", !8, i64 0}
!17 = !{!18, !10, i64 24}
!18 = !{!"", !7, i64 0, !11, i64 8, !10, i64 24, !10, i64 32, !19, i64 40, !10, i64 56, !11, i64 64, !14, i64 80, !7, i64 88, !16, i64 92, !8, i64 94}
!19 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!20 = !{!21, !7, i64 0}
!21 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !22, i64 24, !14, i64 48, !10, i64 56, !10, i64 64, !11, i64 72, !14, i64 88, !11, i64 96, !7, i64 112, !10, i64 120, !23, i64 128, !14, i64 184, !10, i64 192, !8, i64 200, !10, i64 208, !10, i64 216, !7, i64 224, !7, i64 228, !7, i64 232, !7, i64 236, !7, i64 240, !7, i64 244, !10, i64 248, !10, i64 256}
!22 = !{!"_EFI_VLAN_CONFIG_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16}
!23 = !{!"", !7, i64 0, !14, i64 8, !11, i64 16, !11, i64 32, !7, i64 48, !7, i64 52}
!24 = !{!6, !14, i64 200}
!25 = !{!6, !10, i64 184}
!26 = !{!27, !10, i64 104}
!27 = !{!"", !11, i64 0, !10, i64 16, !28, i64 24, !10, i64 104, !14, i64 112}
!28 = !{!"", !29, 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, !16, i64 44, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72}
!29 = !{!"", !16, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !7, i64 8, !16, i64 12, !8, i64 14, !8, i64 15}
!30 = !{!31, !14, i64 8}
!31 = !{!"", !7, i64 0, !14, i64 8, !11, i64 16, !8, i64 32, !10, i64 40, !10, i64 48, !8, i64 56, !10, i64 120, !7, i64 128, !7, i64 132, !8, i64 136}
!32 = !{!21, !10, i64 64}
!33 = !{!34, !10, i64 120}
!34 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !14, i64 0, !10, i64 8, !10, i64 16, !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}
!35 = !{!28, !10, i64 64}
!36 = !{!28, !10, i64 48}
!37 = !{!38, !7, i64 4}
!38 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !39, i64 552, !39, i64 584, !39, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!39 = !{!"", !8, i64 0}
!40 = !{!28, !10, i64 56}
!41 = !{!38, !7, i64 8}
!42 = !{!28, !10, i64 72}
!43 = !{!8, !8, i64 0}
!44 = !{!45, !14, i64 8}
!45 = !{!"", !10, i64 0, !14, i64 8, !8, i64 16}
!46 = !{!10, !10, i64 0}
!47 = !{!48, !10, i64 104}
!48 = !{!"", !49, 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}
!49 = !{!"", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!50 = !{!45, !10, i64 0}


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