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

; 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.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._PXEBC_PRIVATE_DATA = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct._EFI_PXE_BASE_CODE_PROTOCOL, %struct._EFI_LOAD_FILE_PROTOCOL, %struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL, ptr, ptr, ptr, ptr, %struct.EFI_IP4_CONFIG_DATA, ptr, ptr, ptr, i16, %struct.EFI_UDP4_CONFIG_DATA, %struct.EFI_PXE_BASE_CODE_MODE, i32, ptr, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, i8, i32, i64, i64, [312 x i8], %struct.EFI_DHCP4_PACKET, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i32, i32, i32, %struct.PXEBC_CACHED_DHCP4_PACKET, %struct.PXEBC_CACHED_DHCP4_PACKET, %struct.PXEBC_CACHED_DHCP4_PACKET, [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], [5 x i32], [5 x [16 x i32]], i32, [5 x i32], [16 x i32], ptr, %struct.EFI_IP4_COMPLETION_TOKEN }
%struct._EFI_PXE_BASE_CODE_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_LOAD_FILE_PROTOCOL = type { ptr }
%struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL = type { i64, ptr }
%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_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_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_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] }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%struct.EFI_DHCP4_PACKET = type <{ i32, i32, %struct.anon }>
%struct.anon = 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.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.PXEBC_CACHED_DHCP4_PACKET = type { %union.PXEBC_DHCP4_PACKET, i8, i8, [7 x ptr], %struct.PXEBC_VENDOR_OPTION }
%union.PXEBC_DHCP4_PACKET = type { [1480 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_IP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon.1 }
%union.anon.1 = type { ptr }

@.str = external hidden unnamed_addr constant [157 x i8], align 1
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1
@.str.11 = external hidden unnamed_addr constant [37 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 @PxeBcCopyEfiDhcp4Packet(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 zeroext i8 @PxeBcParseCachedDhcpPacket(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @PxeBcCacheDhcpOffer(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 i8, align 1
  %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 1, ptr %7) #3
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %9, i32 0, i32 46
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %11, i32 0, i32 40
  %13 = load i32, ptr %12, align 4, !tbaa !9
  %14 = zext i32 %13 to i64
  %15 = getelementptr inbounds [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], 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_CACHED_DHCP4_PACKET, 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 @PxeBcCopyEfiDhcp4Packet(ptr noundef %18, ptr noundef %19)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call zeroext i8 @PxeBcParseCachedDhcpPacket(ptr noundef %20)
  %22 = icmp ne i8 %21, 0
  br i1 %22, label %24, label %23

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_CACHED_DHCP4_PACKET, ptr %25, i32 0, i32 2
  %27 = load i8, ptr %26, align 1, !tbaa !30
  store i8 %27, ptr %7, align 1, !tbaa !31
  %28 = load i8, ptr %7, align 1, !tbaa !31
  %29 = zext i8 %28 to i32
  %30 = icmp sge i32 %29, 5
  br i1 %30, label %31, label %32

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

32:                                               ; preds = %24
  %33 = load i8, ptr %7, align 1, !tbaa !31
  %34 = zext i8 %33 to i32
  %35 = icmp eq i32 %34, 4
  br i1 %35, label %36, label %50

36:                                               ; preds = %32
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %37, i32 0, i32 49
  %39 = load i32, ptr %38, align 4, !tbaa !32
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %42

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

42:                                               ; preds = %36
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %43, i32 0, i32 40
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = add i32 %45, 1
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %47, i32 0, i32 49
  store i32 %46, ptr %48, align 4, !tbaa !32
  br label %49

49:                                               ; preds = %42
  br label %142

50:                                               ; preds = %32
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %51, i32 0, i32 2
  %53 = getelementptr inbounds %struct.anon, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %53, i32 0, i32 8
  %55 = call i64 @CompareMem(ptr noundef %54, ptr noundef @mZeroIp4Addr, i64 noundef 4)
  %56 = icmp eq i64 %55, 0
  br i1 %56, label %57, label %101

57:                                               ; preds = %50
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %58, i32 0, i32 39
  store i8 1, ptr %59, align 1, !tbaa !33
  %60 = load i8, ptr %7, align 1, !tbaa !31
  %61 = zext i8 %60 to i32
  %62 = icmp eq i32 %61, 2
  br i1 %62, label %63, label %80

63:                                               ; preds = %57
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %64, i32 0, i32 40
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %67, i32 0, i32 51
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %69, i32 0, i32 50
  %71 = getelementptr inbounds [5 x i32], ptr %70, i64 0, i64 2
  %72 = load i32, ptr %71, align 8, !tbaa !34
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds [16 x i32], ptr %68, i64 0, i64 %73
  store i32 %66, ptr %74, align 4, !tbaa !34
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %75, i32 0, i32 50
  %77 = getelementptr inbounds [5 x i32], ptr %76, i64 0, i64 2
  %78 = load i32, ptr %77, align 8, !tbaa !34
  %79 = add i32 %78, 1
  store i32 %79, ptr %77, align 8, !tbaa !34
  br label %100

80:                                               ; preds = %57
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %81, i32 0, i32 50
  %83 = load i8, ptr %7, align 1, !tbaa !31
  %84 = zext i8 %83 to i64
  %85 = getelementptr inbounds [5 x i32], ptr %82, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !34
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %89

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

89:                                               ; preds = %80
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %90, i32 0, i32 40
  %92 = load i32, ptr %91, align 4, !tbaa !9
  %93 = add i32 %92, 1
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %94, i32 0, i32 50
  %96 = load i8, ptr %7, align 1, !tbaa !31
  %97 = zext i8 %96 to i64
  %98 = getelementptr inbounds [5 x i32], ptr %95, i64 0, i64 %97
  store i32 %93, ptr %98, align 4, !tbaa !34
  br label %99

99:                                               ; preds = %89
  br label %100

100:                                              ; preds = %99, %63
  br label %141

101:                                              ; preds = %50
  br label %102

102:                                              ; preds = %101
  %103 = call zeroext i8 @DebugAssertEnabled()
  %104 = icmp ne i8 %103, 0
  br i1 %104, label %105, label %115

105:                                              ; preds = %102
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %106, i32 0, i32 47
  %108 = load i8, ptr %7, align 1, !tbaa !31
  %109 = zext i8 %108 to i64
  %110 = getelementptr inbounds [5 x i32], ptr %107, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !34
  %112 = icmp ult i32 %111, 16
  br i1 %112, label %114, label %113

113:                                              ; preds = %105
  call void @DebugAssert(ptr noundef @.str, i64 noundef 638, ptr noundef @.str.11)
  br label %114

114:                                              ; preds = %113, %105
  br label %115

115:                                              ; preds = %114, %102
  br label %116

116:                                              ; preds = %115
  br label %117

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

141:                                              ; preds = %117, %100
  br label %142

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

147:                                              ; preds = %142, %88, %41, %31, %23
  call void @llvm.lifetime.end.p0(i64 1, 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 11468}
!10 = !{!"_PXEBC_PRIVATE_DATA", !11, 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, !12, i64 80, !14, i64 192, !15, i64 200, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !16, i64 248, !6, i64 280, !6, i64 288, !6, i64 296, !18, i64 304, !19, i64 308, !20, i64 344, !11, i64 10768, !6, i64 10776, !7, i64 10784, !7, i64 10800, !7, i64 10816, !7, i64 10832, !7, i64 10848, !11, i64 10852, !13, i64 10856, !13, i64 10864, !7, i64 10872, !24, i64 11184, !17, i64 11433, !7, i64 11465, !7, i64 11466, !7, i64 11467, !11, i64 11468, !11, i64 11472, !11, i64 11476, !27, i64 11480, !27, i64 13152, !27, i64 14824, !7, i64 16496, !7, i64 43248, !7, i64 43268, !11, i64 43588, !7, i64 43592, !7, i64 43612, !6, i64 43680, !29, i64 43688}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_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}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_EFI_LOAD_FILE_PROTOCOL", !6, i64 0}
!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, !17, i64 6, !17, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !11, i64 20, !11, i64 24}
!17 = !{!"", !7, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !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, !17, i64 17, !17, i64 21, !18, i64 26, !17, i64 28, !18, i64 32}
!20 = !{!"", !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, !21, i64 8884, !11, i64 9016, !7, i64 9020, !11, i64 9404, !7, i64 9408, !22, i64 9792, !23, i64 10296}
!21 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4}
!22 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4, !7, i64 8}
!23 = !{!"", !7, i64 0, !7, i64 1}
!24 = !{!"", !11, i64 0, !11, i64 4, !25, i64 8}
!25 = !{!"", !26, i64 0, !11, i64 236, !7, i64 240}
!26 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !18, i64 8, !18, i64 10, !17, i64 12, !17, i64 16, !17, i64 20, !17, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!27 = !{!"", !7, i64 0, !7, i64 1480, !7, i64 1481, !7, i64 1488, !28, i64 1544}
!28 = !{!"", !7, i64 0, !17, i64 32, !18, i64 36, !18, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !17, i64 43, !17, i64 47, !18, i64 52, !18, i64 54, !18, i64 56, !18, i64 58, !6, i64 64, !7, i64 72, !6, i64 80, !7, i64 88, !6, i64 96, !7, i64 104, !6, i64 112, !7, i64 120}
!29 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!30 = !{!27, !7, i64 1481}
!31 = !{!7, !7, i64 0}
!32 = !{!10, !11, i64 43588}
!33 = !{!10, !7, i64 11467}
!34 = !{!11, !11, 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"

%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.PXEBC_CACHED_DHCP4_PACKET = type { %union.PXEBC_DHCP4_PACKET, i8, i8, [7 x ptr], %struct.PXEBC_VENDOR_OPTION }
%union.PXEBC_DHCP4_PACKET = type { [1480 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 }

@.str = external hidden unnamed_addr constant [157 x i8], align 1
@mZeroIp4Addr = external global %struct.EFI_IPv4_ADDRESS, align 1
@.str.11 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @PxeBcCopyEfiDhcp4Packet(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 zeroext i8 @PxeBcParseCachedDhcpPacket(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @PxeBcCacheDhcpOffer(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 16496
  %4 = getelementptr inbounds i8, ptr %0, i64 11468
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = zext i32 %5 to i64
  %7 = getelementptr inbounds [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], ptr %3, i64 0, i64 %6
  tail call void @PxeBcCopyEfiDhcp4Packet(ptr noundef nonnull %7, ptr noundef %1)
  %8 = tail call zeroext i8 @PxeBcParseCachedDhcpPacket(ptr noundef nonnull %7)
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %65, label %9

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %7, i64 1481
  %11 = load i8, ptr %10, align 1, !tbaa !29
  %12 = icmp ugt i8 %11, 4
  br i1 %12, label %65, label %13

13:                                               ; preds = %9
  %14 = icmp eq i8 %11, 4
  br i1 %14, label %15, label %21

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %0, i64 43588
  %17 = load i32, ptr %16, align 4, !tbaa !30
  %.not35 = icmp eq i32 %17, 0
  br i1 %.not35, label %18, label %65

18:                                               ; preds = %15
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = add i32 %19, 1
  store i32 %20, ptr %16, align 4, !tbaa !30
  br label %62

21:                                               ; preds = %13
  %22 = getelementptr inbounds i8, ptr %7, i64 24
  %23 = tail call i64 @CompareMem(ptr noundef nonnull %22, ptr noundef nonnull @mZeroIp4Addr, i64 noundef 4) #2
  %24 = icmp eq i64 %23, 0
  br i1 %24, label %25, label %44

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %0, i64 11467
  store i8 1, ptr %26, align 1, !tbaa !31
  %27 = icmp eq i8 %11, 2
  br i1 %27, label %28, label %36

28:                                               ; preds = %25
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %0, i64 43612
  %31 = getelementptr inbounds i8, ptr %0, i64 43600
  %32 = load i32, ptr %31, align 8, !tbaa !32
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds [16 x i32], ptr %30, i64 0, i64 %33
  store i32 %29, ptr %34, align 4, !tbaa !32
  %35 = add i32 %32, 1
  store i32 %35, ptr %31, align 8, !tbaa !32
  br label %62

36:                                               ; preds = %25
  %37 = getelementptr inbounds i8, ptr %0, i64 43592
  %38 = zext nneg i8 %11 to i64
  %39 = getelementptr inbounds [5 x i32], ptr %37, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !32
  %.not34 = icmp eq i32 %40, 0
  br i1 %.not34, label %41, label %65

41:                                               ; preds = %36
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = add i32 %42, 1
  store i32 %43, ptr %39, align 4, !tbaa !32
  br label %62

44:                                               ; preds = %21
  %45 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not33 = icmp eq i8 %45, 0
  br i1 %.not33, label %._crit_edge, label %46

._crit_edge:                                      ; preds = %44
  %.pre = zext nneg i8 %11 to i64
  br label %53

46:                                               ; preds = %44
  %47 = getelementptr inbounds i8, ptr %0, i64 43248
  %48 = zext nneg i8 %11 to i64
  %49 = getelementptr inbounds [5 x i32], ptr %47, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !32
  %51 = icmp ult i32 %50, 16
  br i1 %51, label %53, label %52

52:                                               ; preds = %46
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 638, ptr noundef nonnull @.str.11) #2
  br label %53

53:                                               ; preds = %._crit_edge, %46, %52
  %.pre-phi = phi i64 [ %.pre, %._crit_edge ], [ %48, %46 ], [ %48, %52 ]
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %0, i64 43268
  %56 = getelementptr inbounds i8, ptr %0, i64 43248
  %57 = getelementptr inbounds [5 x i32], ptr %56, i64 0, i64 %.pre-phi
  %58 = load i32, ptr %57, align 4, !tbaa !32
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds [5 x [16 x i32]], ptr %55, i64 0, i64 %.pre-phi, i64 %59
  store i32 %54, ptr %60, align 4, !tbaa !32
  %61 = add i32 %58, 1
  store i32 %61, ptr %57, align 4, !tbaa !32
  br label %62

62:                                               ; preds = %53, %41, %28, %18
  %63 = phi i32 [ %54, %53 ], [ %42, %41 ], [ %29, %28 ], [ %19, %18 ]
  %64 = add i32 %63, 1
  store i32 %64, ptr %4, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %36, %15, %9, %2, %62
  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 11468}
!6 = !{!"_PXEBC_PRIVATE_DATA", !7, 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, !11, i64 80, !13, i64 192, !14, i64 200, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !15, i64 248, !10, i64 280, !10, i64 288, !10, i64 296, !17, i64 304, !18, i64 308, !19, i64 344, !7, i64 10768, !10, i64 10776, !8, i64 10784, !8, i64 10800, !8, i64 10816, !8, i64 10832, !8, i64 10848, !7, i64 10852, !12, i64 10856, !12, i64 10864, !8, i64 10872, !23, i64 11184, !16, i64 11433, !8, i64 11465, !8, i64 11466, !8, i64 11467, !7, i64 11468, !7, i64 11472, !7, i64 11476, !26, i64 11480, !26, i64 13152, !26, i64 14824, !8, i64 16496, !8, i64 43248, !8, i64 43268, !7, i64 43588, !8, i64 43592, !8, i64 43612, !10, i64 43680, !28, i64 43688}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_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}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"_EFI_LOAD_FILE_PROTOCOL", !10, i64 0}
!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, !16, i64 6, !16, i64 10, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !7, i64 20, !7, i64 24}
!16 = !{!"", !8, i64 0}
!17 = !{!"short", !8, i64 0}
!18 = !{!"", !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, !16, i64 17, !16, i64 21, !17, i64 26, !16, i64 28, !17, i64 32}
!19 = !{!"", !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, !20, i64 8884, !7, i64 9016, !8, i64 9020, !7, i64 9404, !8, i64 9408, !21, i64 9792, !22, i64 10296}
!20 = !{!"", !8, i64 0, !8, i64 1, !17, i64 2, !8, i64 4}
!21 = !{!"", !8, i64 0, !8, i64 1, !17, i64 2, !8, i64 4, !8, i64 8}
!22 = !{!"", !8, i64 0, !8, i64 1}
!23 = !{!"", !7, i64 0, !7, i64 4, !24, i64 8}
!24 = !{!"", !25, i64 0, !7, i64 236, !8, i64 240}
!25 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !7, i64 4, !17, i64 8, !17, i64 10, !16, i64 12, !16, i64 16, !16, i64 20, !16, i64 24, !8, i64 28, !8, i64 44, !8, i64 108}
!26 = !{!"", !8, i64 0, !8, i64 1480, !8, i64 1481, !8, i64 1488, !27, i64 1544}
!27 = !{!"", !8, i64 0, !16, i64 32, !17, i64 36, !17, i64 38, !8, i64 40, !8, i64 41, !8, i64 42, !16, i64 43, !16, i64 47, !17, i64 52, !17, i64 54, !17, i64 56, !17, i64 58, !10, i64 64, !8, i64 72, !10, i64 80, !8, i64 88, !10, i64 96, !8, i64 104, !10, i64 112, !8, i64 120}
!28 = !{!"", !10, i64 0, !12, i64 8, !8, i64 16}
!29 = !{!26, !8, i64 1481}
!30 = !{!6, !7, i64 43588}
!31 = !{!6, !8, i64 11467}
!32 = !{!7, !7, i64 0}


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