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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._PXEBC_PRIVATE_DATA = type { i32, ptr, ptr, 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_IPv4_ADDRESS = type { [4 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_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 }
%struct.EFI_DHCP4_PACKET_OPTION = type { i8, i8, [1 x i8] }

@.str = external hidden unnamed_addr constant [157 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

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

; 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) #2

declare zeroext i8 @DebugAssertEnabled() #1

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @PxeBcParseExtendOptions(ptr noundef, i32 noundef, i8 noundef zeroext) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcDhcpCallBack(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i16, align 2
  %19 = alloca i64, align 8
  %20 = alloca i8, align 1
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %23 = load i32, ptr %11, align 4, !tbaa !9
  %24 = icmp ne i32 %23, 2
  br i1 %24, label %25, label %38

25:                                               ; preds = %6
  %26 = load i32, ptr %11, align 4, !tbaa !9
  %27 = icmp ne i32 %26, 3
  br i1 %27, label %28, label %38

28:                                               ; preds = %25
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = icmp ne i32 %29, 1
  br i1 %30, label %31, label %38

31:                                               ; preds = %28
  %32 = load i32, ptr %11, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 5
  br i1 %33, label %34, label %38

34:                                               ; preds = %31
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = icmp ne i32 %35, 4
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  store i64 0, ptr %7, align 8
  store i32 1, ptr %22, align 4
  br label %190

38:                                               ; preds = %34, %31, %28, %25, %6
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %39, ptr %14, align 8, !tbaa !5
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %40, i32 0, i32 10
  %42 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %41, i32 0, i32 13
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  store ptr %43, ptr %15, align 8, !tbaa !5
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %44, i32 0, i32 13
  %46 = load ptr, ptr %45, align 8, !tbaa !31
  store ptr %46, ptr %16, align 8, !tbaa !5
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %47, i32 0, i32 2
  %49 = getelementptr inbounds %struct.anon, ptr %48, i32 0, i32 2
  %50 = getelementptr inbounds [1 x i8], ptr %49, i64 0, i64 0
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 1, !tbaa !32
  %54 = zext i32 %53 to i64
  %55 = sub i64 %54, 236
  %56 = sub i64 %55, 4
  %57 = trunc i64 %56 to i32
  %58 = call ptr @PxeBcParseExtendOptions(ptr noundef %50, i32 noundef %57, i8 noundef zeroext 57)
  store ptr %58, ptr %17, align 8, !tbaa !5
  %59 = load ptr, ptr %17, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %67

61:                                               ; preds = %38
  %62 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 1472)
  store i16 %62, ptr %18, align 2, !tbaa !33
  %63 = load ptr, ptr %17, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %63, i32 0, i32 2
  %65 = getelementptr inbounds [1 x i8], ptr %64, i64 0, i64 0
  %66 = call ptr @CopyMem(ptr noundef %65, ptr noundef %18, i64 noundef 2)
  br label %67

67:                                               ; preds = %61, %38
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 3
  br i1 %69, label %70, label %102

70:                                               ; preds = %67
  %71 = load ptr, ptr %16, align 8, !tbaa !5
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %102

73:                                               ; preds = %70
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = icmp eq i32 %74, 2
  br i1 %75, label %79, label %76

76:                                               ; preds = %73
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = icmp eq i32 %77, 5
  br label %79

79:                                               ; preds = %76, %73
  %80 = phi i1 [ true, %73 ], [ %78, %76 ]
  %81 = zext i1 %80 to i32
  %82 = trunc i32 %81 to i8
  store i8 %82, ptr %20, align 1, !tbaa !34
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !35
  %86 = load ptr, ptr %16, align 8, !tbaa !5
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %87, i32 0, i32 24
  %89 = load i32, ptr %88, align 8, !tbaa !36
  %90 = load i8, ptr %20, align 1, !tbaa !34
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 1, !tbaa !32
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %94, i32 0, i32 2
  %96 = call i32 %85(ptr noundef %86, i32 noundef %89, i8 noundef zeroext %90, i32 noundef %93, ptr noundef %95)
  %97 = zext i32 %96 to i64
  store i64 %97, ptr %19, align 8, !tbaa !37
  %98 = load i64, ptr %19, align 8, !tbaa !37
  %99 = icmp ne i64 %98, 1
  br i1 %99, label %100, label %101

100:                                              ; preds = %79
  store i64 -9223372036854775787, ptr %7, align 8
  store i32 1, ptr %22, align 4
  br label %190

101:                                              ; preds = %79
  br label %102

102:                                              ; preds = %101, %70, %67
  store i64 0, ptr %19, align 8, !tbaa !37
  %103 = load i32, ptr %11, align 4, !tbaa !9
  switch i32 %103, label %187 [
    i32 1, label %104
    i32 4, label %104
    i32 2, label %141
    i32 3, label %150
    i32 5, label %169
  ]

104:                                              ; preds = %102, %102
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %105, i32 0, i32 7
  %107 = load i8, ptr %106, align 1, !tbaa !38
  %108 = icmp ne i8 %107, 0
  br i1 %108, label %109, label %126

109:                                              ; preds = %104
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %110, i32 0, i32 2
  %112 = getelementptr inbounds %struct.anon, ptr %111, i32 0, i32 0
  store ptr %112, ptr %21, align 8, !tbaa !5
  %113 = load ptr, ptr %21, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %113, i32 0, i32 11
  %115 = getelementptr inbounds [16 x i8], ptr %114, i64 0, i64 0
  %116 = call i64 @NetLibGetSystemGuid(ptr noundef %115)
  %117 = icmp slt i64 %116, 0
  br i1 %117, label %118, label %123

118:                                              ; preds = %109
  %119 = load ptr, ptr %21, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %119, i32 0, i32 11
  %121 = getelementptr inbounds [16 x i8], ptr %120, i64 0, i64 0
  %122 = call ptr @ZeroMem(ptr noundef %121, i64 noundef 16)
  br label %123

123:                                              ; preds = %118, %109
  %124 = load ptr, ptr %21, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.EFI_DHCP4_HEADER, ptr %124, i32 0, i32 2
  store i8 16, ptr %125, align 1, !tbaa !39
  br label %126

126:                                              ; preds = %123, %104
  %127 = load i32, ptr %11, align 4, !tbaa !9
  %128 = icmp eq i32 %127, 1
  br i1 %128, label %129, label %140

129:                                              ; preds = %126
  %130 = load ptr, ptr %15, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %130, i32 0, i32 21
  %132 = getelementptr inbounds [1472 x i8], ptr %131, i64 0, i64 0
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %133, i32 0, i32 2
  %135 = load ptr, ptr %12, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 1, !tbaa !32
  %138 = zext i32 %137 to i64
  %139 = call ptr @CopyMem(ptr noundef %132, ptr noundef %134, i64 noundef %138)
  br label %140

140:                                              ; preds = %129, %126
  br label %188

141:                                              ; preds = %102
  store i64 -9223372036854775802, ptr %19, align 8, !tbaa !37
  %142 = load ptr, ptr %14, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %142, i32 0, i32 40
  %144 = load i32, ptr %143, align 4, !tbaa !40
  %145 = icmp ult i32 %144, 16
  br i1 %145, label %146, label %149

146:                                              ; preds = %141
  %147 = load ptr, ptr %14, align 8, !tbaa !5
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  call void @PxeBcCacheDhcpOffer(ptr noundef %147, ptr noundef %148)
  br label %149

149:                                              ; preds = %146, %141
  br label %188

150:                                              ; preds = %102
  %151 = load ptr, ptr %14, align 8, !tbaa !5
  call void @PxeBcSelectOffer(ptr noundef %151)
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %152, i32 0, i32 41
  %154 = load i32, ptr %153, align 8, !tbaa !41
  %155 = icmp eq i32 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %150
  store i64 -9223372036854775787, ptr %19, align 8, !tbaa !37
  br label %168

157:                                              ; preds = %150
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %158, i32 0, i32 46
  %160 = load ptr, ptr %14, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %160, i32 0, i32 41
  %162 = load i32, ptr %161, align 8, !tbaa !41
  %163 = sub i32 %162, 1
  %164 = zext i32 %163 to i64
  %165 = getelementptr inbounds [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], ptr %159, i64 0, i64 %164
  %166 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %166, ptr %167, align 8, !tbaa !5
  br label %168

168:                                              ; preds = %157, %156
  br label %188

169:                                              ; preds = %102
  br label %170

170:                                              ; preds = %169
  %171 = call zeroext i8 @DebugAssertEnabled()
  %172 = icmp ne i8 %171, 0
  br i1 %172, label %173, label %180

173:                                              ; preds = %170
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %174, i32 0, i32 41
  %176 = load i32, ptr %175, align 8, !tbaa !41
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %179, label %178

178:                                              ; preds = %173
  call void @DebugAssert(ptr noundef @.str, i64 noundef 922, ptr noundef @.str.7)
  br label %179

179:                                              ; preds = %178, %173
  br label %180

180:                                              ; preds = %179, %170
  br label %181

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181
  %183 = load ptr, ptr %14, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %183, i32 0, i32 44
  %185 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %12, align 8, !tbaa !5
  call void @PxeBcCopyEfiDhcp4Packet(ptr noundef %185, ptr noundef %186)
  br label %188

187:                                              ; preds = %102
  br label %188

188:                                              ; preds = %187, %182, %168, %149, %140
  %189 = load i64, ptr %19, align 8, !tbaa !37
  store i64 %189, ptr %7, align 8
  store i32 1, ptr %22, align 4
  br label %190

190:                                              ; preds = %188, %100, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %191 = load i64, ptr %7, align 8
  ret i64 %191
}

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) #1

declare i64 @NetLibGetSystemGuid(ptr noundef) #1

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 = !{!12, !6, i64 184}
!12 = !{!"_PXEBC_PRIVATE_DATA", !10, 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, !13, i64 80, !15, i64 192, !16, i64 200, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !17, i64 248, !6, i64 280, !6, i64 288, !6, i64 296, !19, i64 304, !20, i64 308, !21, i64 344, !10, i64 10768, !6, i64 10776, !7, i64 10784, !7, i64 10800, !7, i64 10816, !7, i64 10832, !7, i64 10848, !10, i64 10852, !14, i64 10856, !14, i64 10864, !7, i64 10872, !25, i64 11184, !18, i64 11433, !7, i64 11465, !7, i64 11466, !7, i64 11467, !10, i64 11468, !10, i64 11472, !10, i64 11476, !28, i64 11480, !28, i64 13152, !28, i64 14824, !7, i64 16496, !7, i64 43248, !7, i64 43268, !10, i64 43588, !7, i64 43592, !7, i64 43612, !6, i64 43680, !30, i64 43688}
!13 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !14, 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}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"_EFI_LOAD_FILE_PROTOCOL", !6, i64 0}
!16 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !14, i64 0, !6, i64 8}
!17 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !18, i64 6, !18, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !10, i64 20, !10, i64 24}
!18 = !{!"", !7, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = !{!"", !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, !18, i64 17, !18, i64 21, !19, i64 26, !18, i64 28, !19, i64 32}
!21 = !{!"", !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, !22, i64 8884, !10, i64 9016, !7, i64 9020, !10, i64 9404, !7, i64 9408, !23, i64 9792, !24, i64 10296}
!22 = !{!"", !7, i64 0, !7, i64 1, !19, i64 2, !7, i64 4}
!23 = !{!"", !7, i64 0, !7, i64 1, !19, i64 2, !7, i64 4, !7, i64 8}
!24 = !{!"", !7, i64 0, !7, i64 1}
!25 = !{!"", !10, i64 0, !10, i64 4, !26, i64 8}
!26 = !{!"", !27, i64 0, !10, i64 236, !7, i64 240}
!27 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !19, i64 8, !19, i64 10, !18, i64 12, !18, i64 16, !18, i64 20, !18, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!28 = !{!"", !7, i64 0, !7, i64 1480, !7, i64 1481, !7, i64 1488, !29, i64 1544}
!29 = !{!"", !7, i64 0, !18, i64 32, !19, i64 36, !19, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !18, i64 43, !18, i64 47, !19, i64 52, !19, i64 54, !19, i64 56, !19, 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}
!30 = !{!"", !6, i64 0, !14, i64 8, !7, i64 16}
!31 = !{!12, !6, i64 216}
!32 = !{!25, !10, i64 4}
!33 = !{!19, !19, i64 0}
!34 = !{!7, !7, i64 0}
!35 = !{!16, !6, i64 8}
!36 = !{!12, !10, i64 10768}
!37 = !{!14, !14, i64 0}
!38 = !{!21, !7, i64 7}
!39 = !{!27, !7, i64 2}
!40 = !{!12, !10, i64 11468}
!41 = !{!12, !10, i64 11472}


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

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

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

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

; Function Attrs: mustprogress 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) local_unnamed_addr #2

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 ptr @PxeBcParseExtendOptions(ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775802, 1) i64 @PxeBcDhcpCallBack(ptr nocapture noundef readnone %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #2 {
  %7 = alloca i16, align 2
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %7) #3
  %8 = icmp ne i32 %3, 3
  %9 = add i32 %3, -6
  %or.cond7 = icmp ult i32 %9, -5
  br i1 %or.cond7, label %79, label %10

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %1, i64 184
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %1, i64 216
  %14 = load ptr, ptr %13, align 8, !tbaa !29
  %15 = getelementptr inbounds i8, ptr %4, i64 8
  %16 = getelementptr inbounds i8, ptr %4, i64 248
  %17 = getelementptr inbounds i8, ptr %4, i64 4
  %18 = load i32, ptr %17, align 1, !tbaa !30
  %19 = add i32 %18, -240
  %20 = tail call ptr @PxeBcParseExtendOptions(ptr noundef nonnull %16, i32 noundef %19, i8 noundef zeroext 57)
  %.not = icmp eq ptr %20, null
  br i1 %.not, label %25, label %21

21:                                               ; preds = %10
  %22 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext 1472) #3
  store i16 %22, ptr %7, align 2, !tbaa !31
  %23 = getelementptr inbounds i8, ptr %20, i64 2
  %24 = call ptr @CopyMem(ptr noundef nonnull %23, ptr noundef nonnull %7, i64 noundef 2) #3
  br label %25

25:                                               ; preds = %21, %10
  %26 = icmp ne ptr %14, null
  %or.cond9 = select i1 %8, i1 %26, i1 false
  br i1 %or.cond9, label %27, label %38

27:                                               ; preds = %25
  %28 = icmp eq i32 %3, 2
  %29 = icmp eq i32 %3, 5
  %30 = or i1 %28, %29
  %31 = zext i1 %30 to i8
  %32 = getelementptr inbounds i8, ptr %14, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !32
  %34 = getelementptr inbounds i8, ptr %1, i64 10768
  %35 = load i32, ptr %34, align 8, !tbaa !33
  %36 = load i32, ptr %17, align 1, !tbaa !30
  %37 = call i32 %33(ptr noundef nonnull %14, i32 noundef %35, i8 noundef zeroext %31, i32 noundef %36, ptr noundef nonnull %15) #3
  %.not59 = icmp eq i32 %37, 1
  br i1 %.not59, label %38, label %79

38:                                               ; preds = %27, %25
  switch i32 %3, label %default.unreachable [
    i32 1, label %39
    i32 4, label %39
    i32 2, label %57
    i32 3, label %62
    i32 5, label %71
  ]

39:                                               ; preds = %38, %38
  %40 = getelementptr inbounds i8, ptr %12, i64 7
  %41 = load i8, ptr %40, align 1, !tbaa !34
  %.not62 = icmp eq i8 %41, 0
  br i1 %.not62, label %50, label %42

42:                                               ; preds = %39
  %43 = getelementptr inbounds i8, ptr %4, i64 36
  %44 = call i64 @NetLibGetSystemGuid(ptr noundef nonnull %43) #3
  %45 = icmp slt i64 %44, 0
  br i1 %45, label %46, label %48

46:                                               ; preds = %42
  %47 = call ptr @ZeroMem(ptr noundef nonnull %43, i64 noundef 16) #3
  br label %48

48:                                               ; preds = %46, %42
  %49 = getelementptr inbounds i8, ptr %4, i64 10
  store i8 16, ptr %49, align 1, !tbaa !35
  br label %50

50:                                               ; preds = %48, %39
  %51 = icmp eq i32 %3, 1
  br i1 %51, label %52, label %79

52:                                               ; preds = %50
  %53 = getelementptr inbounds i8, ptr %12, i64 52
  %54 = load i32, ptr %17, align 1, !tbaa !30
  %55 = zext i32 %54 to i64
  %56 = call ptr @CopyMem(ptr noundef nonnull %53, ptr noundef nonnull %15, i64 noundef %55) #3
  br label %79

57:                                               ; preds = %38
  %58 = getelementptr inbounds i8, ptr %1, i64 11468
  %59 = load i32, ptr %58, align 4, !tbaa !36
  %60 = icmp ult i32 %59, 16
  br i1 %60, label %61, label %79

61:                                               ; preds = %57
  call void @PxeBcCacheDhcpOffer(ptr noundef nonnull %1, ptr noundef nonnull %4)
  br label %79

62:                                               ; preds = %38
  call void @PxeBcSelectOffer(ptr noundef nonnull %1)
  %63 = getelementptr inbounds i8, ptr %1, i64 11472
  %64 = load i32, ptr %63, align 8, !tbaa !37
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %79, label %66

66:                                               ; preds = %62
  %67 = getelementptr inbounds i8, ptr %1, i64 16496
  %68 = add i32 %64, -1
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], ptr %67, i64 0, i64 %69
  store ptr %70, ptr %5, align 8, !tbaa !38
  br label %79

71:                                               ; preds = %38
  %72 = call zeroext i8 @DebugAssertEnabled() #3
  %.not60 = icmp eq i8 %72, 0
  br i1 %.not60, label %77, label %73

73:                                               ; preds = %71
  %74 = getelementptr inbounds i8, ptr %1, i64 11472
  %75 = load i32, ptr %74, align 8, !tbaa !37
  %.not61 = icmp eq i32 %75, 0
  br i1 %.not61, label %76, label %77

76:                                               ; preds = %73
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 922, ptr noundef nonnull @.str.7) #3
  br label %77

77:                                               ; preds = %73, %76, %71
  %78 = getelementptr inbounds i8, ptr %1, i64 13152
  call void @PxeBcCopyEfiDhcp4Packet(ptr noundef nonnull %78, ptr noundef nonnull %4)
  br label %79

default.unreachable:                              ; preds = %38
  unreachable

79:                                               ; preds = %77, %52, %50, %61, %57, %66, %62, %27, %6
  %.0 = phi i64 [ 0, %6 ], [ -9223372036854775787, %27 ], [ 0, %77 ], [ 0, %66 ], [ -9223372036854775802, %61 ], [ -9223372036854775802, %57 ], [ 0, %52 ], [ 0, %50 ], [ -9223372036854775787, %62 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %7) #3
  ret i64 %.0
}

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

declare i64 @NetLibGetSystemGuid(ptr noundef) local_unnamed_addr #1

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, !10, i64 184}
!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 = !{!6, !10, i64 216}
!30 = !{!23, !7, i64 4}
!31 = !{!17, !17, i64 0}
!32 = !{!14, !10, i64 8}
!33 = !{!6, !7, i64 10768}
!34 = !{!19, !8, i64 7}
!35 = !{!25, !8, i64 2}
!36 = !{!6, !7, i64 11468}
!37 = !{!6, !7, i64 11472}
!38 = !{!10, !10, i64 0}


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