; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe_ (PxeBcCacheDhcp6Offer)

; 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._PXEBC_PRIVATE_DATA = type { i32, ptr, ptr, %struct._PXEBC_PRIVATE_PROTOCOL, 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_PXE_BASE_CODE_PROTOCOL, %struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL, ptr, ptr, %struct.EFI_PXE_BASE_CODE_MODE, i32, i32, i32, i64, %struct.EFI_UDP4_CONFIG_DATA, %struct.EFI_UDP6_CONFIG_DATA, %struct.EFI_IP4_CONFIG_DATA, %struct.EFI_IP6_CONFIG_DATA, ptr, ptr, %struct.EFI_IP4_COMPLETION_TOKEN, %struct.EFI_IP6_COMPLETION_TOKEN, i8, i8, i8, i8, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, i16, i32, i32, i32, ptr, i64, i64, %union.PXEBC_DHCP_PACKET_CACHE, %union.PXEBC_DHCP_PACKET_CACHE, %union.PXEBC_DHCP_PACKET_CACHE, ptr, %struct.EFI_DHCP4_PACKET, i32, i32, [16 x %union.PXEBC_DHCP_PACKET_CACHE], i32, [8 x i32], [8 x [16 x i32]] }
%struct._PXEBC_PRIVATE_PROTOCOL = type { i64 }
%struct._EFI_PXE_BASE_CODE_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL = type { i64, ptr }
%struct.EFI_PXE_BASE_CODE_MODE = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %struct.EFI_PXE_BASE_CODE_IP_FILTER, i32, [8 x %struct.EFI_PXE_BASE_CODE_ARP_ENTRY], i32, [8 x %struct.EFI_PXE_BASE_CODE_ROUTE_ENTRY], %struct.EFI_PXE_BASE_CODE_ICMP_ERROR, %struct.EFI_PXE_BASE_CODE_TFTP_ERROR }
%union.EFI_PXE_BASE_CODE_PACKET = type { %struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET, [444 x i8] }
%struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET = type { i32, [1024 x i8] }
%struct.EFI_PXE_BASE_CODE_IP_FILTER = type { i8, i8, i16, [8 x %union.EFI_IP_ADDRESS] }
%struct.EFI_PXE_BASE_CODE_ARP_ENTRY = type { %union.EFI_IP_ADDRESS, %struct.EFI_MAC_ADDRESS }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.EFI_PXE_BASE_CODE_ROUTE_ENTRY = type { %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS }
%struct.EFI_PXE_BASE_CODE_ICMP_ERROR = type { i8, i8, i16, %union.anon, [494 x i8] }
%union.anon = type { i32 }
%struct.EFI_PXE_BASE_CODE_TFTP_ERROR = type { i8, [127 x i8] }
%struct.EFI_UDP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_UDP6_CONFIG_DATA = type { i8, i8, i8, i8, i8, i32, i32, %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%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_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon.0 }
%union.anon.0 = type { ptr }
%struct.EFI_IP6_COMPLETION_TOKEN = type { ptr, i64, %union.anon.1 }
%union.anon.1 = type { ptr }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%union.PXEBC_DHCP_PACKET_CACHE = type { %struct.PXEBC_DHCP4_PACKET_CACHE }
%struct.PXEBC_DHCP4_PACKET_CACHE = type { %union.PXEBC_DHCP4_PACKET, i32, [7 x ptr], %struct.PXEBC_VENDOR_OPTION }
%union.PXEBC_DHCP4_PACKET = type { [1472 x i8] }
%struct.PXEBC_VENDOR_OPTION = type { [8 x i32], %struct.EFI_IPv4_ADDRESS, i16, i16, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, i16, i16, i16, ptr, i8, ptr, i8, ptr, i8, ptr, i8 }
%struct.EFI_DHCP4_PACKET = type <{ i32, i32, %struct.anon.2 }>
%struct.anon.2 = type <{ %struct.EFI_DHCP4_HEADER, i32, [1 x i8] }>
%struct.EFI_DHCP4_HEADER = type { i8, i8, i8, i8, i32, i16, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, [16 x i8], [64 x i8], [128 x i8] }
%struct.PXEBC_DHCP6_PACKET_CACHE = type { %union.PXEBC_DHCP6_PACKET, i32, [4 x ptr] }
%union.PXEBC_DHCP6_PACKET = type { [1472 x i8] }

@.str.1 = external hidden unnamed_addr constant [138 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [36 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

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

declare zeroext i8 @DebugAssertEnabled() #2

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @PxeBcParseDhcp6Packet(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @PxeBcCacheDhcp6Offer(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  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 4, ptr %7) #3
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %9, i32 0, i32 70
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %11, i32 0, i32 71
  %13 = load i32, ptr %12, align 8, !tbaa !9
  %14 = zext i32 %13 to i64
  %15 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %10, i64 0, i64 %14
  store ptr %15, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %16, i32 0, i32 0
  store ptr %17, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PxeBcCacheDhcp6Packet(ptr noundef %18, ptr noundef %19)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call i64 @PxeBcParseDhcp6Packet(ptr noundef %20)
  %22 = icmp slt i64 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %2
  store i32 1, ptr %8, align 4
  br label %147

24:                                               ; preds = %2
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !30
  store i32 %27, ptr %7, align 4, !tbaa !32
  br label %28

28:                                               ; preds = %24
  %29 = call zeroext i8 @DebugAssertEnabled()
  %30 = icmp ne i8 %29, 0
  br i1 %30, label %31, label %36

31:                                               ; preds = %28
  %32 = load i32, ptr %7, align 4, !tbaa !32
  %33 = icmp ult i32 %32, 8
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 950, ptr noundef @.str.11)
  br label %35

35:                                               ; preds = %34, %31
  br label %36

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

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = call zeroext i8 @DebugAssertEnabled()
  %41 = icmp ne i8 %40, 0
  br i1 %41, label %42, label %52

42:                                               ; preds = %39
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %43, i32 0, i32 72
  %45 = load i32, ptr %7, align 4, !tbaa !32
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds [8 x i32], ptr %44, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !32
  %49 = icmp ult i32 %48, 16
  br i1 %49, label %51, label %50

50:                                               ; preds = %42
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 951, ptr noundef @.str.12)
  br label %51

51:                                               ; preds = %50, %42
  br label %52

52:                                               ; preds = %51, %39
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %7, align 4, !tbaa !32
  %56 = icmp eq i32 %55, 6
  br i1 %56, label %63, label %57

57:                                               ; preds = %54
  %58 = load i32, ptr %7, align 4, !tbaa !32
  %59 = icmp eq i32 %58, 4
  br i1 %59, label %63, label %60

60:                                               ; preds = %57
  %61 = load i32, ptr %7, align 4, !tbaa !32
  %62 = icmp eq i32 %61, 5
  br i1 %62, label %63, label %118

63:                                               ; preds = %60, %57, %54
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %64, i32 0, i32 50
  store i8 1, ptr %65, align 2, !tbaa !33
  %66 = load i32, ptr %7, align 4, !tbaa !32
  %67 = icmp eq i32 %66, 6
  br i1 %67, label %68, label %92

68:                                               ; preds = %63
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %69, i32 0, i32 71
  %71 = load i32, ptr %70, align 8, !tbaa !9
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %72, i32 0, i32 73
  %74 = load i32, ptr %7, align 4, !tbaa !32
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds [8 x [16 x i32]], ptr %73, i64 0, i64 %75
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %77, i32 0, i32 72
  %79 = load i32, ptr %7, align 4, !tbaa !32
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds [8 x i32], ptr %78, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !32
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds [16 x i32], ptr %76, i64 0, i64 %83
  store i32 %71, ptr %84, align 4, !tbaa !32
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %85, i32 0, i32 72
  %87 = load i32, ptr %7, align 4, !tbaa !32
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds [8 x i32], ptr %86, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !32
  %91 = add i32 %90, 1
  store i32 %91, ptr %89, align 4, !tbaa !32
  br label %117

92:                                               ; preds = %63
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %93, i32 0, i32 72
  %95 = load i32, ptr %7, align 4, !tbaa !32
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds [8 x i32], ptr %94, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !32
  %99 = icmp ugt i32 %98, 0
  br i1 %99, label %100, label %115

100:                                              ; preds = %92
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %101, i32 0, i32 71
  %103 = load i32, ptr %102, align 8, !tbaa !9
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %104, i32 0, i32 73
  %106 = load i32, ptr %7, align 4, !tbaa !32
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds [8 x [16 x i32]], ptr %105, i64 0, i64 %107
  %109 = getelementptr inbounds [16 x i32], ptr %108, i64 0, i64 0
  store i32 %103, ptr %109, align 4, !tbaa !32
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %110, i32 0, i32 72
  %112 = load i32, ptr %7, align 4, !tbaa !32
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds [8 x i32], ptr %111, i64 0, i64 %113
  store i32 1, ptr %114, align 4, !tbaa !32
  br label %116

115:                                              ; preds = %92
  store i32 1, ptr %8, align 4
  br label %147

116:                                              ; preds = %100
  br label %117

117:                                              ; preds = %116, %68
  br label %142

118:                                              ; preds = %60
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %119, i32 0, i32 71
  %121 = load i32, ptr %120, align 8, !tbaa !9
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %122, i32 0, i32 73
  %124 = load i32, ptr %7, align 4, !tbaa !32
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds [8 x [16 x i32]], ptr %123, i64 0, i64 %125
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %127, i32 0, i32 72
  %129 = load i32, ptr %7, align 4, !tbaa !32
  %130 = zext i32 %129 to i64
  %131 = getelementptr inbounds [8 x i32], ptr %128, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !32
  %133 = zext i32 %132 to i64
  %134 = getelementptr inbounds [16 x i32], ptr %126, i64 0, i64 %133
  store i32 %121, ptr %134, align 4, !tbaa !32
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %135, i32 0, i32 72
  %137 = load i32, ptr %7, align 4, !tbaa !32
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds [8 x i32], ptr %136, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !32
  %141 = add i32 %140, 1
  store i32 %141, ptr %139, align 4, !tbaa !32
  br label %142

142:                                              ; preds = %118, %117
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %143, i32 0, i32 71
  %145 = load i32, ptr %144, align 8, !tbaa !9
  %146 = add i32 %145, 1
  store i32 %146, ptr %144, align 8, !tbaa !9
  store i32 0, ptr %8, align 4
  br label %147

147:                                              ; preds = %142, %115, %23
  call void @llvm.lifetime.end.p0(i64 4, 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
  %148 = load i32, ptr %8, align 4
  switch i32 %148, label %150 [
    i32 0, label %149
    i32 1, label %149
  ]

149:                                              ; preds = %147, %147
  ret void

150:                                              ; preds = %147
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 43072}
!10 = !{!"_PXEBC_PRIVATE_DATA", !11, i64 0, !6, i64 8, !6, i64 16, !12, 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, !14, i64 248, !15, i64 360, !6, i64 376, !6, i64 384, !16, i64 392, !11, i64 10816, !11, i64 10820, !11, i64 10824, !13, i64 10832, !21, i64 10840, !23, i64 10876, !24, i64 10928, !25, i64 10956, !6, i64 11008, !6, i64 11016, !26, i64 11024, !26, i64 11048, !7, i64 11072, !7, i64 11073, !7, i64 11074, !7, i64 11075, !7, i64 11076, !7, i64 11092, !7, i64 11108, !7, i64 11124, !18, i64 11140, !11, i64 11144, !11, i64 11148, !11, i64 11152, !6, i64 11160, !13, i64 11168, !13, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !6, i64 16176, !27, i64 16184, !11, i64 16436, !11, i64 16440, !7, i64 16448, !11, i64 43072, !7, i64 43076, !7, i64 43108}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_PXEBC_PRIVATE_PROTOCOL", !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !13, 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}
!15 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !13, i64 0, !6, i64 8}
!16 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 20, !7, i64 36, !7, i64 52, !7, i64 1524, !7, i64 2996, !7, i64 4468, !7, i64 5940, !7, i64 7412, !17, i64 8884, !11, i64 9016, !7, i64 9020, !11, i64 9404, !7, i64 9408, !19, i64 9792, !20, i64 10296}
!17 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4, !7, i64 8}
!20 = !{!"", !7, i64 0, !7, i64 1}
!21 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !11, i64 8, !11, i64 12, !7, i64 16, !22, i64 17, !22, i64 21, !18, i64 26, !22, i64 28, !18, i64 32}
!22 = !{!"", !7, i64 0}
!23 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !11, i64 8, !11, i64 12, !22, i64 16, !18, i64 32, !22, i64 34, !18, i64 50}
!24 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !22, i64 6, !22, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !11, i64 20, !11, i64 24}
!25 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !22, i64 4, !22, i64 20, !7, i64 36, !7, i64 37, !11, i64 40, !11, i64 44, !11, i64 48}
!26 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!27 = !{!"", !11, i64 0, !11, i64 4, !28, i64 8}
!28 = !{!"", !29, i64 0, !11, i64 236, !7, i64 240}
!29 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !18, i64 8, !18, i64 10, !22, i64 12, !22, i64 16, !22, i64 20, !22, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!30 = !{!31, !11, i64 1472}
!31 = !{!"", !7, i64 0, !11, i64 1472, !7, i64 1480}
!32 = !{!11, !11, i64 0}
!33 = !{!10, !7, i64 11074}


; 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"

%union.PXEBC_DHCP_PACKET_CACHE = type { %struct.PXEBC_DHCP4_PACKET_CACHE }
%struct.PXEBC_DHCP4_PACKET_CACHE = type { %union.PXEBC_DHCP4_PACKET, i32, [7 x ptr], %struct.PXEBC_VENDOR_OPTION }
%union.PXEBC_DHCP4_PACKET = type { [1472 x i8] }
%struct.PXEBC_VENDOR_OPTION = type { [8 x i32], %struct.EFI_IPv4_ADDRESS, i16, i16, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, i16, i16, i16, ptr, i8, ptr, i8, ptr, i8, ptr, i8 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }

@.str.1 = external hidden unnamed_addr constant [138 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @PxeBcCacheDhcp6Packet(ptr noundef, ptr noundef) local_unnamed_addr #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 i64 @PxeBcParseDhcp6Packet(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @PxeBcCacheDhcp6Offer(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 16448
  %4 = getelementptr inbounds i8, ptr %0, i64 43072
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = zext i32 %5 to i64
  %7 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %3, i64 0, i64 %6
  tail call void @PxeBcCacheDhcp6Packet(ptr noundef nonnull %7, ptr noundef %1)
  %8 = tail call i64 @PxeBcParseDhcp6Packet(ptr noundef nonnull %7)
  %9 = icmp slt i64 %8, 0
  br i1 %9, label %61, label %10

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %7, i64 1472
  %12 = load i32, ptr %11, align 8, !tbaa !29
  %13 = tail call zeroext i8 @DebugAssertEnabled() #2
  %14 = icmp eq i8 %13, 0
  %15 = icmp ult i32 %12, 8
  %or.cond5 = select i1 %14, i1 true, i1 %15
  br i1 %or.cond5, label %17, label %16

16:                                               ; preds = %10
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 950, ptr noundef nonnull @.str.11) #2
  br label %17

17:                                               ; preds = %10, %16
  %18 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %18, 0
  br i1 %.not, label %26, label %19

19:                                               ; preds = %17
  %20 = getelementptr inbounds i8, ptr %0, i64 43076
  %21 = zext i32 %12 to i64
  %22 = getelementptr inbounds [8 x i32], ptr %20, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !31
  %24 = icmp ult i32 %23, 16
  br i1 %24, label %26, label %25

25:                                               ; preds = %19
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 951, ptr noundef nonnull @.str.12) #2
  br label %26

26:                                               ; preds = %19, %25, %17
  %27 = add i32 %12, -4
  %or.cond3 = icmp ult i32 %27, 3
  br i1 %or.cond3, label %28, label %48

28:                                               ; preds = %26
  %29 = icmp eq i32 %12, 6
  %30 = getelementptr inbounds i8, ptr %0, i64 11074
  store i8 1, ptr %30, align 2, !tbaa !32
  br i1 %29, label %31, label %39

31:                                               ; preds = %28
  %32 = load i32, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %0, i64 43492
  %34 = getelementptr inbounds i8, ptr %0, i64 43100
  %35 = load i32, ptr %34, align 4, !tbaa !31
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds [16 x i32], ptr %33, i64 0, i64 %36
  store i32 %32, ptr %37, align 4, !tbaa !31
  %38 = add i32 %35, 1
  store i32 %38, ptr %34, align 4, !tbaa !31
  br label %58

39:                                               ; preds = %28
  %40 = getelementptr inbounds i8, ptr %0, i64 43076
  %41 = zext nneg i32 %12 to i64
  %42 = getelementptr inbounds [8 x i32], ptr %40, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !31
  %.not41 = icmp eq i32 %43, 0
  br i1 %.not41, label %61, label %44

44:                                               ; preds = %39
  %45 = load i32, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %0, i64 43108
  %47 = getelementptr inbounds [8 x [16 x i32]], ptr %46, i64 0, i64 %41
  store i32 %45, ptr %47, align 4, !tbaa !31
  store i32 1, ptr %42, align 4, !tbaa !31
  br label %58

48:                                               ; preds = %26
  %49 = load i32, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %0, i64 43108
  %51 = zext i32 %12 to i64
  %52 = getelementptr inbounds i8, ptr %0, i64 43076
  %53 = getelementptr inbounds [8 x i32], ptr %52, i64 0, i64 %51
  %54 = load i32, ptr %53, align 4, !tbaa !31
  %55 = zext i32 %54 to i64
  %56 = getelementptr inbounds [8 x [16 x i32]], ptr %50, i64 0, i64 %51, i64 %55
  store i32 %49, ptr %56, align 4, !tbaa !31
  %57 = add i32 %54, 1
  store i32 %57, ptr %53, align 4, !tbaa !31
  br label %58

58:                                               ; preds = %31, %44, %48
  %59 = phi i32 [ %32, %31 ], [ %45, %44 ], [ %49, %48 ]
  %60 = add i32 %59, 1
  store i32 %60, ptr %4, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %39, %2, %58
  ret void
}

attributes #0 = { 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 #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 }

!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 43072}
!6 = !{!"_PXEBC_PRIVATE_DATA", !7, i64 0, !10, i64 8, !10, i64 16, !11, 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, !13, i64 248, !14, i64 360, !10, i64 376, !10, i64 384, !15, i64 392, !7, i64 10816, !7, i64 10820, !7, i64 10824, !12, i64 10832, !20, i64 10840, !22, i64 10876, !23, i64 10928, !24, i64 10956, !10, i64 11008, !10, i64 11016, !25, i64 11024, !25, i64 11048, !8, i64 11072, !8, i64 11073, !8, i64 11074, !8, i64 11075, !8, i64 11076, !8, i64 11092, !8, i64 11108, !8, i64 11124, !17, i64 11140, !7, i64 11144, !7, i64 11148, !7, i64 11152, !10, i64 11160, !12, i64 11168, !12, i64 11176, !8, i64 11184, !8, i64 12848, !8, i64 14512, !10, i64 16176, !26, i64 16184, !7, i64 16436, !7, i64 16440, !8, i64 16448, !7, i64 43072, !8, i64 43076, !8, i64 43108}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_PXEBC_PRIVATE_PROTOCOL", !12, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !12, 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}
!14 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !12, i64 0, !10, i64 8}
!15 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !8, i64 9, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !8, i64 18, !8, i64 20, !8, i64 36, !8, i64 52, !8, i64 1524, !8, i64 2996, !8, i64 4468, !8, i64 5940, !8, i64 7412, !16, i64 8884, !7, i64 9016, !8, i64 9020, !7, i64 9404, !8, i64 9408, !18, i64 9792, !19, i64 10296}
!16 = !{!"", !8, i64 0, !8, i64 1, !17, i64 2, !8, i64 4}
!17 = !{!"short", !8, i64 0}
!18 = !{!"", !8, i64 0, !8, i64 1, !17, i64 2, !8, i64 4, !8, i64 8}
!19 = !{!"", !8, i64 0, !8, i64 1}
!20 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !7, i64 8, !7, i64 12, !8, i64 16, !21, i64 17, !21, i64 21, !17, i64 26, !21, i64 28, !17, i64 32}
!21 = !{!"", !8, i64 0}
!22 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !7, i64 8, !7, i64 12, !21, i64 16, !17, i64 32, !21, i64 34, !17, i64 50}
!23 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !21, i64 6, !21, i64 10, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !7, i64 20, !7, i64 24}
!24 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !21, i64 4, !21, i64 20, !8, i64 36, !8, i64 37, !7, i64 40, !7, i64 44, !7, i64 48}
!25 = !{!"", !10, i64 0, !12, i64 8, !8, i64 16}
!26 = !{!"", !7, i64 0, !7, i64 4, !27, i64 8}
!27 = !{!"", !28, i64 0, !7, i64 236, !8, i64 240}
!28 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !7, i64 4, !17, i64 8, !17, i64 10, !21, i64 12, !21, i64 16, !21, i64 20, !21, i64 24, !8, i64 28, !8, i64 44, !8, i64 108}
!29 = !{!30, !7, i64 1472}
!30 = !{!"", !8, i64 0, !7, i64 1472, !8, i64 1480}
!31 = !{!7, !7, i64 0}
!32 = !{!6, !8, i64 11074}


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