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

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

%union.EFI_IP_ADDRESS = type { [4 x i32] }
%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.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.EFI_DHCP4_PACKET_OPTION = type { i8, i8, [1 x i8] }

@.str = external hidden unnamed_addr constant [138 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [140 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 zeroext i8 @DebugAssertEnabled() #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcRetryBinlOffer(ptr noundef %0, i32 noundef %1) #2 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %union.EFI_IP_ADDRESS, align 4
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  br label %12

12:                                               ; preds = %2
  %13 = call zeroext i8 @DebugAssertEnabled()
  %14 = icmp ne i8 %13, 0
  br i1 %14, label %15, label %20

15:                                               ; preds = %12
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = icmp ult i32 %16, 16
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  call void @DebugAssert(ptr noundef @.str, i64 noundef 703, ptr noundef @.str.6)
  br label %19

19:                                               ; preds = %18, %15
  br label %20

20:                                               ; preds = %19, %12
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  %24 = call zeroext i8 @DebugAssertEnabled()
  %25 = icmp ne i8 %24, 0
  br i1 %25, label %26, label %46

26:                                               ; preds = %23
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %27, i32 0, i32 70
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %28, i64 0, i64 %30
  %32 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 8, !tbaa !11
  %34 = icmp eq i32 %33, 3
  br i1 %34, label %45, label %35

35:                                               ; preds = %26
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %36, i32 0, i32 70
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %37, i64 0, i64 %39
  %41 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %40, i32 0, i32 1
  %42 = load i32, ptr %41, align 8, !tbaa !11
  %43 = icmp eq i32 %42, 6
  br i1 %43, label %45, label %44

44:                                               ; preds = %35
  call void @DebugAssert(ptr noundef @.str, i64 noundef 705, ptr noundef @.str.7)
  br label %45

45:                                               ; preds = %44, %35, %26
  br label %46

46:                                               ; preds = %45, %23
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %49, i32 0, i32 70
  %51 = load i32, ptr %5, align 4, !tbaa !9
  %52 = zext i32 %51 to i64
  %53 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %50, i64 0, i64 %52
  %54 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %53, i32 0, i32 0
  store ptr %54, ptr %6, align 8, !tbaa !5
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %55, i32 0, i32 2
  %57 = getelementptr inbounds %struct.anon.2, ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %57, i32 0, i32 9
  %59 = getelementptr inbounds %struct.EFI_IPv4_ADDRESS, ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds [4 x i8], ptr %59, i64 0, i64 0
  %61 = load i8, ptr %60, align 1, !tbaa !11
  %62 = zext i8 %61 to i32
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %77

64:                                               ; preds = %48
  %65 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 0
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %66, i32 0, i32 70
  %68 = load i32, ptr %5, align 4, !tbaa !9
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %67, i64 0, i64 %69
  %71 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %70, i32 0, i32 2
  %72 = getelementptr inbounds [7 x ptr], ptr %71, i64 0, i64 4
  %73 = load ptr, ptr %72, align 8, !tbaa !11
  %74 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %73, i32 0, i32 2
  %75 = getelementptr inbounds [1 x i8], ptr %74, i64 0, i64 0
  %76 = call ptr @CopyMem(ptr noundef %65, ptr noundef %75, i64 noundef 4)
  br label %84

77:                                               ; preds = %48
  %78 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 0
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %79, i32 0, i32 2
  %81 = getelementptr inbounds %struct.anon.2, ptr %80, i32 0, i32 0
  %82 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %81, i32 0, i32 9
  %83 = call ptr @CopyMem(ptr noundef %78, ptr noundef %82, i64 noundef 4)
  br label %84

84:                                               ; preds = %77, %64
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %85, i32 0, i32 51
  store i8 0, ptr %86, align 1, !tbaa !12
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %87, i32 0, i32 63
  store ptr %88, ptr %9, align 8, !tbaa !5
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %89, i32 0, i32 0
  store ptr %90, ptr %10, align 8, !tbaa !5
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = call i64 @PxeBcDhcp4Discover(ptr noundef %91, i16 noundef zeroext 0, ptr noundef null, i8 noundef zeroext 0, ptr noundef %7, i16 noundef zeroext 0, ptr noundef null)
  store i64 %92, ptr %8, align 8, !tbaa !32
  %93 = load i64, ptr %8, align 8, !tbaa !32
  %94 = icmp slt i64 %93, 0
  br i1 %94, label %95, label %97

95:                                               ; preds = %84
  %96 = load i64, ptr %8, align 8, !tbaa !32
  store i64 %96, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %139

97:                                               ; preds = %84
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = call i64 @PxeBcParseDhcp4Packet(ptr noundef %98)
  store i64 %99, ptr %8, align 8, !tbaa !32
  %100 = load i64, ptr %8, align 8, !tbaa !32
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %102, label %104

102:                                              ; preds = %97
  %103 = load i64, ptr %8, align 8, !tbaa !32
  store i64 %103, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %139

104:                                              ; preds = %97
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 8, !tbaa !33
  %108 = icmp ne i32 %107, 4
  br i1 %108, label %109, label %121

109:                                              ; preds = %104
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 8, !tbaa !33
  %113 = icmp ne i32 %112, 5
  br i1 %113, label %114, label %121

114:                                              ; preds = %109
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %115, i32 0, i32 2
  %117 = getelementptr inbounds [7 x ptr], ptr %116, i64 0, i64 6
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = icmp eq ptr %118, null
  br i1 %119, label %120, label %121

120:                                              ; preds = %114
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %139

121:                                              ; preds = %114, %109, %104
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %122, i32 0, i32 31
  %124 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %123, i32 0, i32 13
  %125 = load ptr, ptr %124, align 8, !tbaa !36
  %126 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %125, i32 0, i32 10
  store i8 1, ptr %126, align 2, !tbaa !37
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %127, i32 0, i32 31
  %129 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %128, i32 0, i32 13
  %130 = load ptr, ptr %129, align 8, !tbaa !36
  %131 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %130, i32 0, i32 23
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %134, i32 0, i32 1
  %136 = load i32, ptr %135, align 1, !tbaa !38
  %137 = zext i32 %136 to i64
  %138 = call ptr @CopyMem(ptr noundef %131, ptr noundef %133, i64 noundef %137)
  store i64 0, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %139

139:                                              ; preds = %121, %120, %102, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %140 = load i64, ptr %3, align 8
  ret i64 %140
}

; Function Attrs: nounwind uwtable
declare dso_local i64 @PxeBcDhcp4Discover(ptr noundef, i16 noundef zeroext, ptr noundef, i8 noundef zeroext, ptr noundef, i16 noundef zeroext, ptr noundef) #2

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 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 11075}
!13 = !{!"_PXEBC_PRIVATE_DATA", !10, i64 0, !6, i64 8, !6, i64 16, !14, 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, !16, i64 248, !17, i64 360, !6, i64 376, !6, i64 384, !18, i64 392, !10, i64 10816, !10, i64 10820, !10, i64 10824, !15, i64 10832, !23, i64 10840, !25, i64 10876, !26, i64 10928, !27, i64 10956, !6, i64 11008, !6, i64 11016, !28, i64 11024, !28, 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, !20, i64 11140, !10, i64 11144, !10, i64 11148, !10, i64 11152, !6, i64 11160, !15, i64 11168, !15, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !6, i64 16176, !29, i64 16184, !10, i64 16436, !10, i64 16440, !7, i64 16448, !10, i64 43072, !7, i64 43076, !7, i64 43108}
!14 = !{!"_PXEBC_PRIVATE_PROTOCOL", !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !15, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104}
!17 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !15, i64 0, !6, i64 8}
!18 = !{!"", !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, !19, i64 8884, !10, i64 9016, !7, i64 9020, !10, i64 9404, !7, i64 9408, !21, i64 9792, !22, i64 10296}
!19 = !{!"", !7, i64 0, !7, i64 1, !20, i64 2, !7, i64 4}
!20 = !{!"short", !7, i64 0}
!21 = !{!"", !7, i64 0, !7, i64 1, !20, i64 2, !7, i64 4, !7, i64 8}
!22 = !{!"", !7, i64 0, !7, i64 1}
!23 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !10, i64 8, !10, i64 12, !7, i64 16, !24, i64 17, !24, i64 21, !20, i64 26, !24, i64 28, !20, i64 32}
!24 = !{!"", !7, i64 0}
!25 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !10, i64 8, !10, i64 12, !24, i64 16, !20, i64 32, !24, i64 34, !20, i64 50}
!26 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !24, i64 6, !24, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !10, i64 20, !10, i64 24}
!27 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !24, i64 4, !24, i64 20, !7, i64 36, !7, i64 37, !10, i64 40, !10, i64 44, !10, i64 48}
!28 = !{!"", !6, i64 0, !15, i64 8, !7, i64 16}
!29 = !{!"", !10, i64 0, !10, i64 4, !30, i64 8}
!30 = !{!"", !31, i64 0, !10, i64 236, !7, i64 240}
!31 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !20, i64 8, !20, i64 10, !24, i64 12, !24, i64 16, !24, i64 20, !24, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!32 = !{!15, !15, i64 0}
!33 = !{!34, !10, i64 1472}
!34 = !{!"", !7, i64 0, !10, i64 1472, !7, i64 1480, !35, i64 1536}
!35 = !{!"", !7, i64 0, !24, i64 32, !20, i64 36, !20, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !24, i64 43, !24, i64 47, !20, i64 52, !20, i64 54, !20, i64 56, !20, 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}
!36 = !{!13, !6, i64 352}
!37 = !{!18, !7, i64 10}
!38 = !{!29, !10, i64 4}


; 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.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_IPv4_ADDRESS = type { [4 x i8] }

@.str = external hidden unnamed_addr constant [138 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [140 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 zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @PxeBcRetryBinlOffer(ptr noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca %union.EFI_IP_ADDRESS, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  %4 = tail call zeroext i8 @DebugAssertEnabled() #3
  %5 = icmp eq i8 %4, 0
  %6 = icmp ult i32 %1, 16
  %or.cond = or i1 %6, %5
  br i1 %or.cond, label %8, label %7

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

8:                                                ; preds = %2, %7
  %9 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %9, 0
  br i1 %.not, label %._crit_edge, label %10

._crit_edge:                                      ; preds = %8
  %.pre = zext i32 %1 to i64
  br label %16

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %0, i64 16448
  %12 = zext i32 %1 to i64
  %13 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %11, i64 0, i64 %12, i32 0, i32 1
  %14 = load i32, ptr %13, align 8, !tbaa !5
  switch i32 %14, label %15 [
    i32 3, label %16
    i32 6, label %16
  ]

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

16:                                               ; preds = %._crit_edge, %10, %10, %15
  %.pre-phi = phi i64 [ %.pre, %._crit_edge ], [ %12, %10 ], [ %12, %10 ], [ %12, %15 ]
  %17 = getelementptr inbounds i8, ptr %0, i64 16448
  %18 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %17, i64 0, i64 %.pre-phi
  %19 = getelementptr inbounds i8, ptr %18, i64 28
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = icmp eq i8 %20, 0
  br i1 %21, label %22, label %26

22:                                               ; preds = %16
  %23 = getelementptr inbounds i8, ptr %18, i64 1512
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 2
  br label %26

26:                                               ; preds = %16, %22
  %.sink = phi ptr [ %25, %22 ], [ %19, %16 ]
  %27 = call ptr @CopyMem(ptr noundef nonnull %3, ptr noundef nonnull %.sink, i64 noundef 4) #3
  %28 = getelementptr inbounds i8, ptr %0, i64 11075
  store i8 0, ptr %28, align 1, !tbaa !8
  %29 = call i64 @PxeBcDhcp4Discover(ptr noundef nonnull %0, i16 noundef zeroext 0, ptr noundef null, i8 noundef zeroext 0, ptr noundef nonnull %3, i16 noundef zeroext 0, ptr noundef null)
  %30 = icmp slt i64 %29, 0
  br i1 %30, label %53, label %31

31:                                               ; preds = %26
  %32 = getelementptr inbounds i8, ptr %0, i64 11184
  %33 = call i64 @PxeBcParseDhcp4Packet(ptr noundef nonnull %32)
  %34 = icmp slt i64 %33, 0
  br i1 %34, label %53, label %35

35:                                               ; preds = %31
  %36 = getelementptr inbounds i8, ptr %0, i64 12656
  %37 = load i32, ptr %36, align 8, !tbaa !30
  %38 = and i32 %37, -2
  %switch = icmp eq i32 %38, 4
  br i1 %switch, label %43, label %39

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %0, i64 12712
  %41 = load ptr, ptr %40, align 8, !tbaa !33
  %42 = icmp eq ptr %41, null
  br i1 %42, label %53, label %43

43:                                               ; preds = %35, %39
  %44 = getelementptr inbounds i8, ptr %0, i64 352
  %45 = load ptr, ptr %44, align 8, !tbaa !34
  %46 = getelementptr inbounds i8, ptr %45, i64 10
  store i8 1, ptr %46, align 2, !tbaa !35
  %47 = getelementptr inbounds i8, ptr %45, i64 2996
  %48 = getelementptr inbounds i8, ptr %0, i64 11192
  %49 = getelementptr inbounds i8, ptr %0, i64 11188
  %50 = load i32, ptr %49, align 1, !tbaa !36
  %51 = zext i32 %50 to i64
  %52 = call ptr @CopyMem(ptr noundef nonnull %47, ptr noundef nonnull %48, i64 noundef %51) #3
  br label %53

53:                                               ; preds = %39, %31, %26, %43
  %.0 = phi i64 [ 0, %43 ], [ %29, %26 ], [ %33, %31 ], [ -9223372036854775801, %39 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret i64 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i64 @PxeBcDhcp4Discover(ptr noundef, i16 noundef zeroext, ptr noundef, i8 noundef zeroext, ptr noundef, i16 noundef zeroext, ptr noundef) local_unnamed_addr #2

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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !6, i64 11075}
!9 = !{!"_PXEBC_PRIVATE_DATA", !10, i64 0, !11, i64 8, !11, i64 16, !12, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !14, i64 248, !15, i64 360, !11, i64 376, !11, i64 384, !16, i64 392, !10, i64 10816, !10, i64 10820, !10, i64 10824, !13, i64 10832, !21, i64 10840, !23, i64 10876, !24, i64 10928, !25, i64 10956, !11, i64 11008, !11, i64 11016, !26, i64 11024, !26, i64 11048, !6, i64 11072, !6, i64 11073, !6, i64 11074, !6, i64 11075, !6, i64 11076, !6, i64 11092, !6, i64 11108, !6, i64 11124, !18, i64 11140, !10, i64 11144, !10, i64 11148, !10, i64 11152, !11, i64 11160, !13, i64 11168, !13, i64 11176, !6, i64 11184, !6, i64 12848, !6, i64 14512, !11, i64 16176, !27, i64 16184, !10, i64 16436, !10, i64 16440, !6, i64 16448, !10, i64 43072, !6, i64 43076, !6, i64 43108}
!10 = !{!"int", !6, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = !{!"_PXEBC_PRIVATE_PROTOCOL", !13, i64 0}
!13 = !{!"long long", !6, i64 0}
!14 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !13, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104}
!15 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !13, i64 0, !11, i64 8}
!16 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !6, i64 5, !6, i64 6, !6, i64 7, !6, i64 8, !6, i64 9, !6, i64 10, !6, i64 11, !6, i64 12, !6, i64 13, !6, i64 14, !6, i64 15, !6, i64 16, !6, i64 17, !6, i64 18, !6, i64 20, !6, i64 36, !6, i64 52, !6, i64 1524, !6, i64 2996, !6, i64 4468, !6, i64 5940, !6, i64 7412, !17, i64 8884, !10, i64 9016, !6, i64 9020, !10, i64 9404, !6, i64 9408, !19, i64 9792, !20, i64 10296}
!17 = !{!"", !6, i64 0, !6, i64 1, !18, i64 2, !6, i64 4}
!18 = !{!"short", !6, i64 0}
!19 = !{!"", !6, i64 0, !6, i64 1, !18, i64 2, !6, i64 4, !6, i64 8}
!20 = !{!"", !6, i64 0, !6, i64 1}
!21 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !6, i64 5, !6, i64 6, !10, i64 8, !10, i64 12, !6, i64 16, !22, i64 17, !22, i64 21, !18, i64 26, !22, i64 28, !18, i64 32}
!22 = !{!"", !6, i64 0}
!23 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !10, i64 8, !10, i64 12, !22, i64 16, !18, i64 32, !22, i64 34, !18, i64 50}
!24 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !6, i64 5, !22, i64 6, !22, i64 10, !6, i64 14, !6, i64 15, !6, i64 16, !6, i64 17, !10, i64 20, !10, i64 24}
!25 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !22, i64 4, !22, i64 20, !6, i64 36, !6, i64 37, !10, i64 40, !10, i64 44, !10, i64 48}
!26 = !{!"", !11, i64 0, !13, i64 8, !6, i64 16}
!27 = !{!"", !10, i64 0, !10, i64 4, !28, i64 8}
!28 = !{!"", !29, i64 0, !10, i64 236, !6, i64 240}
!29 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !10, i64 4, !18, i64 8, !18, i64 10, !22, i64 12, !22, i64 16, !22, i64 20, !22, i64 24, !6, i64 28, !6, i64 44, !6, i64 108}
!30 = !{!31, !10, i64 1472}
!31 = !{!"", !6, i64 0, !10, i64 1472, !6, i64 1480, !32, i64 1536}
!32 = !{!"", !6, i64 0, !22, i64 32, !18, i64 36, !18, i64 38, !6, i64 40, !6, i64 41, !6, i64 42, !22, i64 43, !22, i64 47, !18, i64 52, !18, i64 54, !18, i64 56, !18, i64 58, !11, i64 64, !6, i64 72, !11, i64 80, !6, i64 88, !11, i64 96, !6, i64 104, !11, i64 112, !6, i64 120}
!33 = !{!11, !11, i64 0}
!34 = !{!9, !11, i64 352}
!35 = !{!16, !6, i64 10}
!36 = !{!27, !10, i64 4}


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