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

; 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_IPv6_ADDRESS = type { [16 x i8] }
%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_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] }
%struct.EFI_DHCP6_PACKET_OPTION = type <{ i16, i16, [1 x i8] }>
%struct.EFI_DHCP6_PACKET = type <{ i32, i32, %struct.anon.3 }>
%struct.anon.3 = type <{ %struct.EFI_DHCP6_HEADER, [1 x i8] }>
%struct.EFI_DHCP6_HEADER = type { i32 }

@mAllDhcpRelayAndServersAddress = external dso_local global %struct.EFI_IPv6_ADDRESS, align 1
@.str.1 = external hidden unnamed_addr constant [138 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [140 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 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 zeroext i16 @SwapBytes16(i16 noundef zeroext) #1

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

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

declare zeroext i8 @DebugAssertEnabled() #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcRetryDhcp6Binl(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 ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = 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 8, 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
  br label %11

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

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

17:                                               ; preds = %14
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 846, ptr noundef @.str.8)
  br label %18

18:                                               ; preds = %17, %14
  br label %19

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

20:                                               ; preds = %19
  br label %21

21:                                               ; preds = %20
  br label %22

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

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

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

43:                                               ; preds = %34
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 848, ptr noundef @.str.9)
  br label %44

44:                                               ; preds = %43, %34, %25
  br label %45

45:                                               ; preds = %44, %22
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %48, i32 0, i32 31
  %50 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %49, i32 0, i32 13
  %51 = load ptr, ptr %50, align 8, !tbaa !12
  store ptr %51, ptr %6, align 8, !tbaa !5
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %52, i32 0, i32 51
  store i8 0, ptr %53, align 1, !tbaa !32
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %54, i32 0, i32 70
  %56 = load i32, ptr %5, align 4, !tbaa !9
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %55, i64 0, i64 %57
  store ptr %58, ptr %7, align 8, !tbaa !5
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 8, !tbaa !33
  %62 = icmp eq i32 %61, 3
  br i1 %62, label %63, label %67

63:                                               ; preds = %47
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %64, i32 0, i32 55
  %66 = call ptr @CopyMem(ptr noundef %65, ptr noundef @mAllDhcpRelayAndServersAddress, i64 noundef 16)
  br label %105

67:                                               ; preds = %47
  br label %68

68:                                               ; preds = %67
  %69 = call zeroext i8 @DebugAssertEnabled()
  %70 = icmp ne i8 %69, 0
  br i1 %70, label %71, label %79

71:                                               ; preds = %68
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %72, i32 0, i32 2
  %74 = getelementptr inbounds [4 x ptr], ptr %73, i64 0, i64 1
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %78, label %77

77:                                               ; preds = %71
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 863, ptr noundef @.str.10)
  br label %78

78:                                               ; preds = %77, %71
  br label %79

79:                                               ; preds = %78, %68
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %82, i32 0, i32 60
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %84, i32 0, i32 55
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %86, i32 0, i32 2
  %88 = getelementptr inbounds [4 x ptr], ptr %87, i64 0, i64 1
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %89, i32 0, i32 2
  %91 = getelementptr inbounds [1 x i8], ptr %90, i64 0, i64 0
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %92, i32 0, i32 2
  %94 = getelementptr inbounds [4 x ptr], ptr %93, i64 0, i64 1
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %95, i32 0, i32 1
  %97 = load i16, ptr %96, align 1, !tbaa !35
  %98 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %97)
  %99 = call i64 @PxeBcExtractBootFileUrl(ptr noundef %83, ptr noundef %85, ptr noundef %91, i16 noundef zeroext %98)
  store i64 %99, ptr %9, align 8, !tbaa !37
  %100 = load i64, ptr %9, align 8, !tbaa !37
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %102, label %104

102:                                              ; preds = %81
  %103 = load i64, ptr %9, align 8, !tbaa !37
  store i64 %103, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %153

104:                                              ; preds = %81
  br label %105

105:                                              ; preds = %104, %63
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = load i32, ptr %5, align 4, !tbaa !9
  %108 = call i64 @PxeBcRequestBootService(ptr noundef %106, i32 noundef %107)
  store i64 %108, ptr %9, align 8, !tbaa !37
  %109 = load i64, ptr %9, align 8, !tbaa !37
  %110 = icmp slt i64 %109, 0
  br i1 %110, label %111, label %113

111:                                              ; preds = %105
  %112 = load i64, ptr %9, align 8, !tbaa !37
  store i64 %112, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %153

113:                                              ; preds = %105
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %114, i32 0, i32 63
  store ptr %115, ptr %8, align 8, !tbaa !5
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = call i64 @PxeBcParseDhcp6Packet(ptr noundef %116)
  store i64 %117, ptr %9, align 8, !tbaa !37
  %118 = load i64, ptr %9, align 8, !tbaa !37
  %119 = icmp slt i64 %118, 0
  br i1 %119, label %120, label %122

120:                                              ; preds = %113
  %121 = load i64, ptr %9, align 8, !tbaa !37
  store i64 %121, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %153

122:                                              ; preds = %113
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 8, !tbaa !33
  %126 = icmp ne i32 %125, 4
  br i1 %126, label %127, label %139

127:                                              ; preds = %122
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %128, i32 0, i32 1
  %130 = load i32, ptr %129, align 8, !tbaa !33
  %131 = icmp ne i32 %130, 5
  br i1 %131, label %132, label %139

132:                                              ; preds = %127
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %133, i32 0, i32 2
  %135 = getelementptr inbounds [4 x ptr], ptr %134, i64 0, i64 1
  %136 = load ptr, ptr %135, align 8, !tbaa !5
  %137 = icmp eq ptr %136, null
  br i1 %137, label %138, label %139

138:                                              ; preds = %132
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %153

139:                                              ; preds = %132, %127, %122
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %140, i32 0, i32 10
  store i8 1, ptr %141, align 2, !tbaa !38
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %142, i32 0, i32 23
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %145, i32 0, i32 2
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %147, i32 0, i32 0
  %149 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %148, i32 0, i32 1
  %150 = load i32, ptr %149, align 4, !tbaa !11
  %151 = zext i32 %150 to i64
  %152 = call ptr @CopyMem(ptr noundef %143, ptr noundef %146, i64 noundef %151)
  store i64 0, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %153

153:                                              ; preds = %139, %138, %120, %111, %102
  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 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %154 = load i64, ptr %3, align 8
  ret i64 %154
}

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, !6, i64 352}
!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 = !{!13, !7, i64 11075}
!33 = !{!34, !10, i64 1472}
!34 = !{!"", !7, i64 0, !10, i64 1472, !7, i64 1480}
!35 = !{!36, !20, i64 2}
!36 = !{!"", !20, i64 0, !20, i64 2, !7, i64 4}
!37 = !{!15, !15, i64 0}
!38 = !{!18, !7, i64 10}


; 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_IPv6_ADDRESS = type { [16 x i8] }
%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] }

@mAllDhcpRelayAndServersAddress = external dso_local global %struct.EFI_IPv6_ADDRESS, align 1
@.str.1 = external hidden unnamed_addr constant [138 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [140 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) local_unnamed_addr #0

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 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

; Function Attrs: nounwind uwtable
declare dso_local i64 @PxeBcExtractBootFileUrl(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @PxeBcRetryDhcp6Binl(ptr noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = tail call zeroext i8 @DebugAssertEnabled() #2
  %4 = icmp eq i8 %3, 0
  %5 = icmp ult i32 %1, 16
  %or.cond = or i1 %5, %4
  br i1 %or.cond, label %7, label %6

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

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

._crit_edge:                                      ; preds = %7
  %.pre = zext i32 %1 to i64
  br label %15

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

14:                                               ; preds = %9
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 848, ptr noundef nonnull @.str.9) #2
  br label %15

15:                                               ; preds = %._crit_edge, %9, %9, %14
  %.pre-phi = phi i64 [ %.pre, %._crit_edge ], [ %11, %9 ], [ %11, %9 ], [ %11, %14 ]
  %16 = getelementptr inbounds i8, ptr %0, i64 352
  %17 = load ptr, ptr %16, align 8, !tbaa !8
  %18 = getelementptr inbounds i8, ptr %0, i64 11075
  store i8 0, ptr %18, align 1, !tbaa !30
  %19 = getelementptr inbounds i8, ptr %0, i64 16448
  %20 = getelementptr inbounds [16 x %union.PXEBC_DHCP_PACKET_CACHE], ptr %19, i64 0, i64 %.pre-phi
  %21 = getelementptr inbounds i8, ptr %20, i64 1472
  %22 = load i32, ptr %21, align 8, !tbaa !31
  %23 = icmp eq i32 %22, 3
  br i1 %23, label %24, label %27

24:                                               ; preds = %15
  %25 = getelementptr inbounds i8, ptr %0, i64 11124
  %26 = tail call ptr @CopyMem(ptr noundef nonnull %25, ptr noundef nonnull @mAllDhcpRelayAndServersAddress, i64 noundef 16) #2
  br label %44

27:                                               ; preds = %15
  %28 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not39 = icmp eq i8 %28, 0
  br i1 %.not39, label %33, label %29

29:                                               ; preds = %27
  %30 = getelementptr inbounds i8, ptr %20, i64 1488
  %31 = load ptr, ptr %30, align 8, !tbaa !33
  %.not40 = icmp eq ptr %31, null
  br i1 %.not40, label %32, label %33

32:                                               ; preds = %29
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 863, ptr noundef nonnull @.str.10) #2
  br label %33

33:                                               ; preds = %29, %32, %27
  %34 = getelementptr inbounds i8, ptr %0, i64 11160
  %35 = getelementptr inbounds i8, ptr %0, i64 11124
  %36 = getelementptr inbounds i8, ptr %20, i64 1488
  %37 = load ptr, ptr %36, align 8, !tbaa !33
  %38 = getelementptr inbounds i8, ptr %37, i64 4
  %39 = getelementptr inbounds i8, ptr %37, i64 2
  %40 = load i16, ptr %39, align 1, !tbaa !34
  %41 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %40) #2
  %42 = tail call i64 @PxeBcExtractBootFileUrl(ptr noundef nonnull %34, ptr noundef nonnull %35, ptr noundef nonnull %38, i16 noundef zeroext %41)
  %43 = icmp slt i64 %42, 0
  br i1 %43, label %67, label %44

44:                                               ; preds = %33, %24
  %45 = tail call i64 @PxeBcRequestBootService(ptr noundef nonnull %0, i32 noundef %1)
  %46 = icmp slt i64 %45, 0
  br i1 %46, label %67, label %47

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %0, i64 11184
  %49 = tail call i64 @PxeBcParseDhcp6Packet(ptr noundef nonnull %48)
  %50 = icmp slt i64 %49, 0
  br i1 %50, label %67, label %51

51:                                               ; preds = %47
  %52 = getelementptr inbounds i8, ptr %0, i64 12656
  %53 = load i32, ptr %52, align 8, !tbaa !31
  %54 = and i32 %53, -2
  %switch = icmp eq i32 %54, 4
  br i1 %switch, label %59, label %55

55:                                               ; preds = %51
  %56 = getelementptr inbounds i8, ptr %0, i64 12672
  %57 = load ptr, ptr %56, align 8, !tbaa !33
  %58 = icmp eq ptr %57, null
  br i1 %58, label %67, label %59

59:                                               ; preds = %51, %55
  %60 = getelementptr inbounds i8, ptr %17, i64 10
  store i8 1, ptr %60, align 2, !tbaa !36
  %61 = getelementptr inbounds i8, ptr %17, i64 2996
  %62 = getelementptr inbounds i8, ptr %0, i64 11192
  %63 = getelementptr inbounds i8, ptr %0, i64 11188
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = zext i32 %64 to i64
  %66 = tail call ptr @CopyMem(ptr noundef nonnull %61, ptr noundef nonnull %62, i64 noundef %65) #2
  br label %67

67:                                               ; preds = %55, %47, %44, %33, %59
  %.0 = phi i64 [ 0, %59 ], [ %42, %33 ], [ %45, %44 ], [ %49, %47 ], [ -9223372036854775801, %55 ]
  ret i64 %.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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !11, i64 352}
!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 = !{!9, !6, i64 11075}
!31 = !{!32, !10, i64 1472}
!32 = !{!"", !6, i64 0, !10, i64 1472, !6, i64 1480}
!33 = !{!11, !11, i64 0}
!34 = !{!35, !18, i64 2}
!35 = !{!"", !18, i64 0, !18, i64 2, !6, i64 4}
!36 = !{!16, !6, i64 10}


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