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

; 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.IP4_HEAD = type { i8, i8, i16, i16, i16, i8, i8, i16, i32, i32 }
%struct._IP4_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, %struct.IP4_ASSEMBLE_TABLE, %struct.IGMP_SERVICE_DATA, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.IP4_ASSEMBLE_TABLE = type { [31 x %struct._LIST_ENTRY] }
%struct.IGMP_SERVICE_DATA = type { i64, %struct._LIST_ENTRY }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%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.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.IP4_CLIP_INFO = type { i64, i64, i64, i64, i64, i32, i64 }

@.str = external hidden unnamed_addr constant [150 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 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 void @NetbufFree(ptr noundef) #1

declare zeroext i8 @DebugAssertEnabled() #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip4IpSecProcessPacket(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip4PreProcessPacket(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

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

20:                                               ; preds = %5
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._IP4_SERVICE, ptr %21, i32 0, i32 2
  %23 = load i64, ptr %22, align 8, !tbaa !13
  %24 = icmp eq i64 %23, 3
  br i1 %24, label %25, label %26

25:                                               ; preds = %20, %5
  br label %144

26:                                               ; preds = %20
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call ptr @NetbufGetByte(ptr noundef %27, i32 noundef 0, ptr noundef null)
  store ptr %28, ptr %12, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %26
  %30 = call zeroext i8 @DebugAssertEnabled()
  %31 = icmp ne i8 %30, 0
  br i1 %31, label %32, label %37

32:                                               ; preds = %29
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  call void @DebugAssert(ptr noundef @.str, i64 noundef 853, ptr noundef @.str.7)
  br label %36

36:                                               ; preds = %35, %32
  br label %37

37:                                               ; preds = %36, %29
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = load i8, ptr %40, align 1
  %42 = and i8 %41, 15
  %43 = zext i8 %42 to i32
  %44 = shl i32 %43, 2
  %45 = sub nsw i32 %44, 20
  store i32 %45, ptr %16, align 4, !tbaa !11
  %46 = load i32, ptr %16, align 4, !tbaa !11
  %47 = icmp ugt i32 %46, 0
  br i1 %47, label %48, label %51

48:                                               ; preds = %39
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.IP4_HEAD, ptr %49, i64 1
  store ptr %50, ptr %15, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %48, %39
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = load i32, ptr %16, align 4, !tbaa !11
  %56 = load i32, ptr %9, align 4, !tbaa !11
  %57 = call i64 @Ip4PreProcessPacket(ptr noundef %52, ptr noundef %7, ptr noundef %53, ptr noundef %54, i32 noundef %55, i32 noundef %56)
  store i64 %57, ptr %13, align 8, !tbaa !9
  %58 = load i64, ptr %13, align 8, !tbaa !9
  %59 = icmp slt i64 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %51
  br label %138

61:                                               ; preds = %51
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = call i64 @Ip4IpSecProcessPacket(ptr noundef %62, ptr noundef %12, ptr noundef %7, ptr noundef %15, ptr noundef %16, i32 noundef 0, ptr noundef null)
  store i64 %63, ptr %13, align 8, !tbaa !9
  %64 = load i64, ptr %13, align 8, !tbaa !9
  %65 = icmp slt i64 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %61
  br label %138

67:                                               ; preds = %61
  %68 = call ptr @ZeroMem(ptr noundef %14, i64 noundef 20)
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = call i64 @CompareMem(ptr noundef %69, ptr noundef %14, i64 noundef 20)
  %71 = icmp eq i64 0, %70
  br i1 %71, label %72, label %96

72:                                               ; preds = %67
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = call ptr @NetbufGetByte(ptr noundef %73, i32 noundef 0, ptr noundef null)
  store ptr %74, ptr %12, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %72
  %76 = call zeroext i8 @DebugAssertEnabled()
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %78, label %83

78:                                               ; preds = %75
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = icmp ne ptr %79, null
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  call void @DebugAssert(ptr noundef @.str, i64 noundef 903, ptr noundef @.str.7)
  br label %82

82:                                               ; preds = %81, %78
  br label %83

83:                                               ; preds = %82, %75
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = load ptr, ptr %15, align 8, !tbaa !5
  %89 = load i32, ptr %16, align 4, !tbaa !11
  %90 = load i32, ptr %9, align 4, !tbaa !11
  %91 = call i64 @Ip4PreProcessPacket(ptr noundef %86, ptr noundef %7, ptr noundef %87, ptr noundef %88, i32 noundef %89, i32 noundef %90)
  store i64 %91, ptr %13, align 8, !tbaa !9
  %92 = load i64, ptr %13, align 8, !tbaa !9
  %93 = icmp slt i64 %92, 0
  br i1 %93, label %94, label %95

94:                                               ; preds = %85
  br label %138

95:                                               ; preds = %85
  br label %96

96:                                               ; preds = %95, %67
  br label %97

97:                                               ; preds = %96
  %98 = call zeroext i8 @DebugAssertEnabled()
  %99 = icmp ne i8 %98, 0
  br i1 %99, label %100, label %105

100:                                              ; preds = %97
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = icmp ne ptr %101, null
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  call void @DebugAssert(ptr noundef @.str, i64 noundef 917, ptr noundef @.str.8)
  br label %104

104:                                              ; preds = %103, %100
  br label %105

105:                                              ; preds = %104, %97
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.NET_BUF, ptr %108, i32 0, i32 3
  %110 = load ptr, ptr %109, align 8, !tbaa !22
  store ptr %110, ptr %12, align 8, !tbaa !5
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.NET_BUF, ptr %111, i32 0, i32 6
  %113 = getelementptr inbounds [64 x i8], ptr %112, i64 0, i64 0
  %114 = getelementptr inbounds %struct.IP4_CLIP_INFO, ptr %113, i32 0, i32 6
  store i64 0, ptr %114, align 8, !tbaa !23
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.IP4_HEAD, ptr %115, i32 0, i32 6
  %117 = load i8, ptr %116, align 1, !tbaa !25
  %118 = zext i8 %117 to i32
  switch i32 %118, label %129 [
    i32 1, label %119
    i32 2, label %124
  ]

119:                                              ; preds = %107
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = call i64 @Ip4IcmpHandle(ptr noundef %120, ptr noundef %121, ptr noundef %122)
  br label %136

124:                                              ; preds = %107
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = call i64 @Ip4IgmpHandle(ptr noundef %125, ptr noundef %126, ptr noundef %127)
  br label %136

129:                                              ; preds = %107
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = load ptr, ptr %15, align 8, !tbaa !5
  %134 = load i32, ptr %16, align 4, !tbaa !11
  %135 = call i64 @Ip4Demultiplex(ptr noundef %130, ptr noundef %131, ptr noundef %132, ptr noundef %133, i32 noundef %134)
  br label %136

136:                                              ; preds = %129, %124, %119
  store ptr null, ptr %7, align 8, !tbaa !5
  %137 = call i64 @DispatchDpc()
  br label %138

138:                                              ; preds = %136, %94, %66, %60
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._IP4_SERVICE, ptr %139, i32 0, i32 6
  %141 = load ptr, ptr %140, align 8, !tbaa !27
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = call i64 @Ip4ReceiveFrame(ptr noundef %141, ptr noundef null, ptr noundef @Ip4AccpetFrame, ptr noundef %142)
  br label %144

144:                                              ; preds = %138, %25
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = icmp ne ptr %145, null
  br i1 %146, label %147, label %149

147:                                              ; preds = %144
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %148)
  br label %149

149:                                              ; preds = %147, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  ret void
}

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip4Demultiplex(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare i64 @DispatchDpc() #1

declare i64 @Ip4ReceiveFrame(ptr noundef, ptr 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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 24}
!14 = !{!"_IP4_SERVICE", !12, i64 0, !15, i64 8, !10, i64 24, !10, i64 32, !16, i64 40, !16, i64 56, !6, i64 72, !6, i64 80, !17, i64 88, !18, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !19, i64 640, !21, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !12, i64 1360, !12, i64 1364}
!15 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!16 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!17 = !{!"", !7, i64 0}
!18 = !{!"", !10, i64 0, !16, i64 8}
!19 = !{!"", !12, i64 0, !12, i64 4, !20, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!20 = !{!"short", !7, i64 0}
!21 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !7, i64 40, !17, i64 552, !17, i64 584, !17, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !10, i64 48}
!24 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !12, i64 40, !10, i64 48}
!25 = !{!26, !7, i64 9}
!26 = !{!"", !7, i64 0, !7, i64 0, !7, i64 1, !20, i64 2, !20, i64 4, !20, i64 6, !7, i64 8, !7, i64 9, !20, i64 10, !12, i64 12, !12, i64 16}
!27 = !{!14, !6, i64 72}


; 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.IP4_HEAD = type { i8, i8, i16, i16, i16, i8, i8, i16, i32, i32 }

@.str = external hidden unnamed_addr constant [150 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 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 void @NetbufFree(ptr noundef) local_unnamed_addr #1

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 i64 @Ip4IpSecProcessPacket(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip4PreProcessPacket(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @Ip4AccpetFrame(ptr nocapture readnone %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.IP4_HEAD, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %1, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #3
  store ptr null, ptr %9, align 8, !tbaa !5
  %11 = icmp slt i64 %2, 0
  br i1 %11, label %83, label %12

12:                                               ; preds = %5
  %13 = getelementptr inbounds i8, ptr %4, i64 24
  %14 = load i64, ptr %13, align 8, !tbaa !9
  %15 = icmp eq i64 %14, 3
  br i1 %15, label %83, label %16

16:                                               ; preds = %12
  %17 = tail call ptr @NetbufGetByte(ptr noundef %1, i32 noundef 0, ptr noundef null) #3
  store ptr %17, ptr %7, align 8, !tbaa !5
  %18 = tail call zeroext i8 @DebugAssertEnabled() #3
  %19 = icmp eq i8 %18, 0
  %20 = icmp ne ptr %17, null
  %or.cond = select i1 %19, i1 true, i1 %20
  br i1 %or.cond, label %22, label %21

21:                                               ; preds = %16
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 853, ptr noundef nonnull @.str.7) #3
  br label %22

22:                                               ; preds = %21, %16
  %23 = load i8, ptr %17, align 1
  %24 = shl i8 %23, 2
  %25 = and i8 %24, 60
  %26 = zext nneg i8 %25 to i32
  %27 = add nsw i32 %26, -20
  store i32 %27, ptr %10, align 4, !tbaa !20
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %30, label %28

28:                                               ; preds = %22
  %29 = getelementptr inbounds i8, ptr %17, i64 20
  store ptr %29, ptr %9, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %28, %22
  %31 = phi ptr [ %29, %28 ], [ null, %22 ]
  %32 = call i64 @Ip4PreProcessPacket(ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull %17, ptr noundef %31, i32 noundef %27, i32 noundef %3)
  %33 = icmp slt i64 %32, 0
  br i1 %33, label %79, label %34

34:                                               ; preds = %30
  %35 = call i64 @Ip4IpSecProcessPacket(ptr noundef nonnull %4, ptr noundef nonnull %7, ptr noundef nonnull %6, ptr noundef nonnull %9, ptr noundef nonnull %10, i32 noundef 0, ptr noundef null)
  %36 = icmp slt i64 %35, 0
  br i1 %36, label %79, label %37

37:                                               ; preds = %34
  %38 = call ptr @ZeroMem(ptr noundef nonnull %8, i64 noundef 20) #3
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call i64 @CompareMem(ptr noundef %39, ptr noundef nonnull %8, i64 noundef 20) #3
  %41 = icmp eq i64 %40, 0
  br i1 %41, label %42, label %56

42:                                               ; preds = %37
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = call ptr @NetbufGetByte(ptr noundef %43, i32 noundef 0, ptr noundef null) #3
  store ptr %44, ptr %7, align 8, !tbaa !5
  %45 = call zeroext i8 @DebugAssertEnabled() #3
  %46 = icmp eq i8 %45, 0
  %47 = load ptr, ptr %7, align 8
  %48 = icmp ne ptr %47, null
  %or.cond3 = select i1 %46, i1 true, i1 %48
  br i1 %or.cond3, label %50, label %49

49:                                               ; preds = %42
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 903, ptr noundef nonnull @.str.7) #3
  %.pre = load ptr, ptr %7, align 8, !tbaa !5
  br label %50

50:                                               ; preds = %49, %42
  %51 = phi ptr [ %.pre, %49 ], [ %47, %42 ]
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = load i32, ptr %10, align 4, !tbaa !20
  %54 = call i64 @Ip4PreProcessPacket(ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef %51, ptr noundef %52, i32 noundef %53, i32 noundef %3)
  %55 = icmp slt i64 %54, 0
  br i1 %55, label %79, label %56

56:                                               ; preds = %37, %50
  %57 = call zeroext i8 @DebugAssertEnabled() #3
  %58 = icmp eq i8 %57, 0
  %59 = load ptr, ptr %6, align 8
  %60 = icmp ne ptr %59, null
  %or.cond5 = select i1 %58, i1 true, i1 %60
  br i1 %or.cond5, label %62, label %61

61:                                               ; preds = %56
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 917, ptr noundef nonnull @.str.8) #3
  %.pre21 = load ptr, ptr %6, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %61, %56
  %63 = phi ptr [ %.pre21, %61 ], [ %59, %56 ]
  %64 = getelementptr inbounds i8, ptr %63, i64 32
  %65 = load ptr, ptr %64, align 8, !tbaa !21
  store ptr %65, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %63, i64 104
  store i64 0, ptr %66, align 8, !tbaa !22
  %67 = getelementptr inbounds i8, ptr %65, i64 9
  %68 = load i8, ptr %67, align 1, !tbaa !24
  switch i8 %68, label %73 [
    i8 1, label %69
    i8 2, label %71
  ]

69:                                               ; preds = %62
  %70 = call i64 @Ip4IcmpHandle(ptr noundef nonnull %4, ptr noundef nonnull %65, ptr noundef nonnull %63) #3
  br label %77

71:                                               ; preds = %62
  %72 = call i64 @Ip4IgmpHandle(ptr noundef nonnull %4, ptr noundef nonnull %65, ptr noundef nonnull %63) #3
  br label %77

73:                                               ; preds = %62
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = load i32, ptr %10, align 4, !tbaa !20
  %76 = call i64 @Ip4Demultiplex(ptr noundef nonnull %4, ptr noundef nonnull %65, ptr noundef nonnull %63, ptr noundef %74, i32 noundef %75)
  br label %77

77:                                               ; preds = %73, %71, %69
  store ptr null, ptr %6, align 8, !tbaa !5
  %78 = call i64 @DispatchDpc() #3
  br label %79

79:                                               ; preds = %50, %34, %30, %77
  %80 = getelementptr inbounds i8, ptr %4, i64 72
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  %82 = call i64 @Ip4ReceiveFrame(ptr noundef %81, ptr noundef null, ptr noundef nonnull @Ip4AccpetFrame, ptr noundef nonnull %4) #3
  %.pre22 = load ptr, ptr %6, align 8, !tbaa !5
  br label %83

83:                                               ; preds = %5, %12, %79
  %84 = phi ptr [ %1, %5 ], [ %1, %12 ], [ %.pre22, %79 ]
  %.not20 = icmp eq ptr %84, null
  br i1 %.not20, label %86, label %85

85:                                               ; preds = %83
  call void @NetbufFree(ptr noundef nonnull %84) #3
  br label %86

86:                                               ; preds = %85, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  ret void
}

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip4Demultiplex(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i64 @DispatchDpc() local_unnamed_addr #1

declare i64 @Ip4ReceiveFrame(ptr noundef, ptr 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !13, i64 24}
!10 = !{!"_IP4_SERVICE", !11, i64 0, !12, i64 8, !13, i64 24, !13, i64 32, !14, i64 40, !14, i64 56, !6, i64 72, !6, i64 80, !15, i64 88, !16, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !17, i64 640, !19, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !11, i64 1360, !11, i64 1364}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"", !7, i64 0}
!16 = !{!"", !13, i64 0, !14, i64 8}
!17 = !{!"", !11, i64 0, !11, i64 4, !18, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !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, !15, i64 552, !15, i64 584, !15, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!20 = !{!11, !11, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !13, i64 48}
!23 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !11, i64 40, !13, i64 48}
!24 = !{!25, !7, i64 9}
!25 = !{!"", !7, i64 0, !7, i64 0, !7, i64 1, !18, i64 2, !18, i64 4, !18, i64 6, !7, i64 8, !7, i64 9, !18, i64 10, !11, i64 12, !11, i64 16}
!26 = !{!10, !6, i64 72}


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