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

; 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_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] }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }
%struct.IP4_RXDATA_WRAP = type { %struct._LIST_ENTRY, ptr, ptr, %struct.EFI_IP4_RECEIVE_DATA }
%struct.EFI_IP4_RECEIVE_DATA = type { %struct.EFI_TIME, ptr, i32, ptr, i32, ptr, i32, i32, [1 x %struct.EFI_IP4_FRAGMENT_DATA] }
%struct.EFI_TIME = type { i16, i8, i8, i8, i8, i8, i8, i32, i16, i8, i8 }
%struct.EFI_IP4_FRAGMENT_DATA = type { i32, 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 }
%struct._IP4_PROTOCOL = type { i32, %struct._EFI_IP4_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, ptr, i32, ptr, i32, %struct.EFI_IP4_CONFIG_DATA }
%struct._EFI_IP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_IP4_HEADER = type { i8, i8, i16, i16, i16, i8, i8, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }

@.str = external hidden unnamed_addr constant [150 x i8], align 1
@gBS = external global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 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 ptr @AllocatePool(i64 noundef) #1

declare ptr @InitializeListHead(ptr noundef) #1

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

declare void @FreePool(ptr noundef) #1

declare zeroext i8 @DebugAssertEnabled() #1

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

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

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

declare ptr @Ip4NtohHead(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local ptr @Ip4WrapRxData(ptr noundef %0, ptr noundef %1) #2 {
  %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 i64, align 8
  %9 = alloca i8, align 1
  %10 = 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 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.NET_BUF, ptr %11, i32 0, i32 8
  %13 = load i32, ptr %12, align 8, !tbaa !9
  %14 = sub i32 %13, 1
  %15 = zext i32 %14 to i64
  %16 = mul i64 16, %15
  %17 = add i64 112, %16
  %18 = call ptr @AllocatePool(i64 noundef %17)
  store ptr %18, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %2
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %133

22:                                               ; preds = %2
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.IP4_RXDATA_WRAP, ptr %23, i32 0, i32 0
  %25 = call ptr @InitializeListHead(ptr noundef %24)
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.IP4_RXDATA_WRAP, ptr %27, i32 0, i32 1
  store ptr %26, ptr %28, align 8, !tbaa !14
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.IP4_RXDATA_WRAP, ptr %30, i32 0, i32 2
  store ptr %29, ptr %31, align 8, !tbaa !19
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.IP4_RXDATA_WRAP, ptr %32, i32 0, i32 3
  store ptr %33, ptr %7, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call ptr @ZeroMem(ptr noundef %34, i64 noundef 80)
  %36 = load ptr, ptr @gBS, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %36, i32 0, i32 8
  %38 = load ptr, ptr %37, align 8, !tbaa !20
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %40, i32 0, i32 1
  %42 = call i64 %38(i32 noundef 512, i64 noundef 16, ptr noundef @Ip4OnRecyclePacket, ptr noundef %39, ptr noundef %41)
  store i64 %42, ptr %8, align 8, !tbaa !23
  %43 = load i64, ptr %8, align 8, !tbaa !23
  %44 = icmp slt i64 %43, 0
  br i1 %44, label %45, label %47

45:                                               ; preds = %22
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  call void @FreePool(ptr noundef %46)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %133

47:                                               ; preds = %22
  br label %48

48:                                               ; preds = %47
  %49 = call zeroext i8 @DebugAssertEnabled()
  %50 = icmp ne i8 %49, 0
  br i1 %50, label %51, label %58

51:                                               ; preds = %48
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.NET_BUF, ptr %52, i32 0, i32 3
  %54 = load ptr, ptr %53, align 8, !tbaa !24
  %55 = icmp ne ptr %54, null
  br i1 %55, label %57, label %56

56:                                               ; preds = %51
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1199, ptr noundef @.str.10)
  br label %57

57:                                               ; preds = %56, %51
  br label %58

58:                                               ; preds = %57, %48
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  %62 = call zeroext i8 @DebugAssertEnabled()
  %63 = icmp ne i8 %62, 0
  br i1 %63, label %64, label %69

64:                                               ; preds = %61
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1201, ptr noundef @.str.11)
  br label %68

68:                                               ; preds = %67, %64
  br label %69

69:                                               ; preds = %68, %61
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %72, i32 0, i32 18
  %74 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %73, i32 0, i32 11
  %75 = load i8, ptr %74, align 1, !tbaa !25
  store i8 %75, ptr %9, align 1, !tbaa !24
  %76 = load i8, ptr %9, align 1, !tbaa !24
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %114, label %78

78:                                               ; preds = %71
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.NET_BUF, ptr %79, i32 0, i32 3
  %81 = load ptr, ptr %80, align 8, !tbaa !24
  %82 = load i8, ptr %81, align 1
  %83 = and i8 %82, 15
  %84 = zext i8 %83 to i32
  %85 = shl i32 %84, 2
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %86, i32 0, i32 2
  store i32 %85, ptr %87, align 8, !tbaa !32
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.NET_BUF, ptr %88, i32 0, i32 3
  %90 = load ptr, ptr %89, align 8, !tbaa !24
  %91 = call ptr @Ip4NtohHead(ptr noundef %90)
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %92, i32 0, i32 3
  store ptr %91, ptr %93, align 8, !tbaa !33
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %94, i32 0, i32 2
  %96 = load i32, ptr %95, align 8, !tbaa !32
  %97 = sub i32 %96, 20
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %98, i32 0, i32 4
  store i32 %97, ptr %99, align 8, !tbaa !34
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %100, i32 0, i32 5
  store ptr null, ptr %101, align 8, !tbaa !35
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %102, i32 0, i32 4
  %104 = load i32, ptr %103, align 8, !tbaa !34
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %113

106:                                              ; preds = %78
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %107, i32 0, i32 3
  %109 = load ptr, ptr %108, align 8, !tbaa !33
  %110 = getelementptr inbounds %struct.EFI_IP4_HEADER, ptr %109, i64 1
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %111, i32 0, i32 5
  store ptr %110, ptr %112, align 8, !tbaa !35
  br label %113

113:                                              ; preds = %106, %78
  br label %114

114:                                              ; preds = %113, %71
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.NET_BUF, ptr %115, i32 0, i32 9
  %117 = load i32, ptr %116, align 4, !tbaa !36
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %118, i32 0, i32 6
  store i32 %117, ptr %119, align 8, !tbaa !37
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.NET_BUF, ptr %120, i32 0, i32 8
  %122 = load i32, ptr %121, align 8, !tbaa !9
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %123, i32 0, i32 7
  store i32 %122, ptr %124, align 4, !tbaa !38
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %126, i32 0, i32 8
  %128 = getelementptr inbounds [1 x %struct.EFI_IP4_FRAGMENT_DATA], ptr %127, i64 0, i64 0
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.EFI_IP4_RECEIVE_DATA, ptr %129, i32 0, i32 7
  %131 = call i64 @NetbufBuildExt(ptr noundef %125, ptr noundef %128, ptr noundef %130)
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %132, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %133

133:                                              ; preds = %114, %45, %21
  call void @llvm.lifetime.end.p0(i64 1, 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
  %134 = load ptr, ptr %3, align 8
  ret ptr %134
}

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 128}
!10 = !{!"", !11, i64 0, !12, i64 8, !13, 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}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!15, !6, i64 16}
!15 = !{!"", !13, i64 0, !6, i64 16, !6, i64 24, !16, i64 32}
!16 = !{!"", !17, i64 0, !6, i64 16, !11, i64 24, !6, i64 32, !11, i64 40, !6, i64 48, !11, i64 56, !11, i64 60, !7, i64 64}
!17 = !{!"", !18, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !11, i64 8, !18, i64 12, !7, i64 14, !7, i64 15}
!18 = !{!"short", !7, i64 0}
!19 = !{!15, !6, i64 24}
!20 = !{!21, !6, i64 80}
!21 = !{!"", !22, 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}
!22 = !{!"", !12, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!23 = !{!12, !12, i64 0}
!24 = !{!7, !7, i64 0}
!25 = !{!26, !7, i64 325}
!26 = !{!"_IP4_PROTOCOL", !11, i64 0, !27, i64 8, !6, i64 72, !12, i64 80, !6, i64 88, !13, i64 96, !28, i64 112, !28, i64 152, !13, i64 192, !13, i64 208, !29, i64 224, !6, i64 248, !13, i64 256, !6, i64 272, !6, i64 280, !11, i64 288, !6, i64 296, !11, i64 304, !30, i64 308}
!27 = !{!"_EFI_IP4_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}
!28 = !{!"", !13, i64 0, !13, i64 16, !12, i64 32}
!29 = !{!"", !12, i64 0, !12, i64 8, !11, i64 16}
!30 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !31, i64 6, !31, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !11, i64 20, !11, i64 24}
!31 = !{!"", !7, i64 0}
!32 = !{!16, !11, i64 24}
!33 = !{!16, !6, i64 32}
!34 = !{!16, !11, i64 40}
!35 = !{!16, !6, i64 48}
!36 = !{!10, !11, i64 132}
!37 = !{!16, !11, i64 56}
!38 = !{!16, !11, i64 60}


; 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 [150 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #0

declare ptr @InitializeListHead(ptr noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

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

declare i64 @NetbufBuildExt(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @Ip4NtohHead(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @Ip4OnRecyclePacket(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @Ip4WrapRxData(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %1, i64 128
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = add i32 %4, -1
  %6 = zext i32 %5 to i64
  %7 = shl nuw nsw i64 %6, 4
  %8 = add nuw nsw i64 %7, 112
  %9 = tail call ptr @AllocatePool(i64 noundef %8) #2
  %10 = icmp eq ptr %9, null
  br i1 %10, label %62, label %11

11:                                               ; preds = %2
  %12 = tail call ptr @InitializeListHead(ptr noundef nonnull %9) #2
  %13 = getelementptr inbounds i8, ptr %9, i64 16
  store ptr %0, ptr %13, align 8, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %9, i64 24
  store ptr %1, ptr %14, align 8, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %9, i64 32
  %16 = tail call ptr @ZeroMem(ptr noundef nonnull %15, i64 noundef 80) #2
  %17 = load ptr, ptr @gBS, align 8, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %17, i64 80
  %19 = load ptr, ptr %18, align 8, !tbaa !20
  %20 = getelementptr inbounds i8, ptr %9, i64 48
  %21 = tail call i64 %19(i32 noundef 512, i64 noundef 16, ptr noundef nonnull @Ip4OnRecyclePacket, ptr noundef nonnull %9, ptr noundef nonnull %20) #2
  %22 = icmp slt i64 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %11
  tail call void @FreePool(ptr noundef nonnull %9) #2
  br label %62

24:                                               ; preds = %11
  %25 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %25, 0
  br i1 %.not, label %30, label %26

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %1, i64 32
  %28 = load ptr, ptr %27, align 8, !tbaa !23
  %.not37 = icmp eq ptr %28, null
  br i1 %.not37, label %29, label %30

29:                                               ; preds = %26
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1199, ptr noundef nonnull @.str.10) #2
  br label %30

30:                                               ; preds = %24, %29, %26
  %31 = tail call zeroext i8 @DebugAssertEnabled() #2
  %32 = icmp eq i8 %31, 0
  %33 = icmp ne ptr %0, null
  %or.cond = or i1 %33, %32
  br i1 %or.cond, label %35, label %34

34:                                               ; preds = %30
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1201, ptr noundef nonnull @.str.11) #2
  br label %35

35:                                               ; preds = %34, %30
  %36 = getelementptr inbounds i8, ptr %0, i64 325
  %37 = load i8, ptr %36, align 1, !tbaa !24
  %.not38 = icmp eq i8 %37, 0
  br i1 %.not38, label %38, label %55

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %1, i64 32
  %40 = load ptr, ptr %39, align 8, !tbaa !23
  %41 = load i8, ptr %40, align 1
  %42 = shl i8 %41, 2
  %43 = and i8 %42, 60
  %44 = zext nneg i8 %43 to i32
  %45 = getelementptr inbounds i8, ptr %9, i64 56
  store i32 %44, ptr %45, align 8, !tbaa !31
  %46 = load ptr, ptr %39, align 8, !tbaa !23
  %47 = tail call ptr @Ip4NtohHead(ptr noundef %46) #2
  %48 = getelementptr inbounds i8, ptr %9, i64 64
  store ptr %47, ptr %48, align 8, !tbaa !32
  %49 = load i32, ptr %45, align 8, !tbaa !31
  %50 = add i32 %49, -20
  %51 = getelementptr inbounds i8, ptr %9, i64 72
  store i32 %50, ptr %51, align 8, !tbaa !33
  %52 = getelementptr inbounds i8, ptr %9, i64 80
  store ptr null, ptr %52, align 8, !tbaa !34
  %.not39 = icmp eq i32 %50, 0
  br i1 %.not39, label %55, label %53

53:                                               ; preds = %38
  %54 = getelementptr inbounds i8, ptr %47, i64 20
  store ptr %54, ptr %52, align 8, !tbaa !34
  br label %55

55:                                               ; preds = %38, %53, %35
  %56 = getelementptr inbounds i8, ptr %9, i64 88
  %57 = getelementptr inbounds i8, ptr %9, i64 92
  %58 = load <2 x i32>, ptr %3, align 8, !tbaa !35
  %59 = shufflevector <2 x i32> %58, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i32> %59, ptr %56, align 8, !tbaa !35
  %60 = getelementptr inbounds i8, ptr %9, i64 96
  %61 = tail call i64 @NetbufBuildExt(ptr noundef nonnull %1, ptr noundef nonnull %60, ptr noundef nonnull %57) #2
  br label %62

62:                                               ; preds = %2, %55, %23
  %.0 = phi ptr [ null, %23 ], [ %9, %55 ], [ null, %2 ]
  ret ptr %.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, !7, i64 128}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 16, !8, i64 32, !12, i64 40, !12, i64 48, !8, i64 56, !12, i64 120, !7, i64 128, !7, i64 132, !8, i64 136}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!"_LIST_ENTRY", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!14, !12, i64 16}
!14 = !{!"", !11, i64 0, !12, i64 16, !12, i64 24, !15, i64 32}
!15 = !{!"", !16, i64 0, !12, i64 16, !7, i64 24, !12, i64 32, !7, i64 40, !12, i64 48, !7, i64 56, !7, i64 60, !8, i64 64}
!16 = !{!"", !17, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !7, i64 8, !17, i64 12, !8, i64 14, !8, i64 15}
!17 = !{!"short", !8, i64 0}
!18 = !{!14, !12, i64 24}
!19 = !{!12, !12, i64 0}
!20 = !{!21, !12, i64 80}
!21 = !{!"", !22, i64 0, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !12, i64 360, !12, i64 368}
!22 = !{!"", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!23 = !{!8, !8, i64 0}
!24 = !{!25, !8, i64 325}
!25 = !{!"_IP4_PROTOCOL", !7, i64 0, !26, i64 8, !12, i64 72, !10, i64 80, !12, i64 88, !11, i64 96, !27, i64 112, !27, i64 152, !11, i64 192, !11, i64 208, !28, i64 224, !12, i64 248, !11, i64 256, !12, i64 272, !12, i64 280, !7, i64 288, !12, i64 296, !7, i64 304, !29, i64 308}
!26 = !{!"_EFI_IP4_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56}
!27 = !{!"", !11, i64 0, !11, i64 16, !10, i64 32}
!28 = !{!"", !10, i64 0, !10, i64 8, !7, i64 16}
!29 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !30, i64 6, !30, i64 10, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !7, i64 20, !7, i64 24}
!30 = !{!"", !8, i64 0}
!31 = !{!15, !7, i64 24}
!32 = !{!15, !12, i64 32}
!33 = !{!15, !7, i64 40}
!34 = !{!15, !12, i64 48}
!35 = !{!7, !7, i64 0}


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