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

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

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

@.str.18 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [39 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 i64 @AsciiPrint(ptr 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 i64 @PxeBcDiscoverBootFile(ptr noundef, ptr noundef) #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcLoadBootFile(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store i8 0, ptr %8, align 1, !tbaa !9
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %15, i32 0, i32 31
  store ptr %16, ptr %12, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %17, i32 0, i32 35
  store ptr %18, ptr %13, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = load i64, ptr %19, align 8, !tbaa !10
  store i64 %20, ptr %10, align 8, !tbaa !10
  store i64 0, ptr %9, align 8, !tbaa !10
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = call i64 @PxeBcInstallCallback(ptr noundef %21, ptr noundef %8)
  store i64 %22, ptr %11, align 8, !tbaa !10
  %23 = load i64, ptr %11, align 8, !tbaa !10
  %24 = icmp slt i64 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %3
  %26 = load i64, ptr %11, align 8, !tbaa !10
  store i64 %26, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %186

27:                                               ; preds = %3
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %28, i32 0, i32 61
  %30 = load i64, ptr %29, align 8, !tbaa !12
  %31 = icmp eq i64 %30, 0
  br i1 %31, label %32, label %67

32:                                               ; preds = %27
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call i64 @PxeBcDiscoverBootFile(ptr noundef %33, ptr noundef %9)
  store i64 %34, ptr %11, align 8, !tbaa !10
  %35 = load i64, ptr %11, align 8, !tbaa !10
  %36 = icmp slt i64 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %32
  br label %106

38:                                               ; preds = %32
  %39 = load i64, ptr %9, align 8, !tbaa !10
  %40 = icmp ugt i64 %39, 0
  br i1 %40, label %41, label %52

41:                                               ; preds = %38
  %42 = load i64, ptr %10, align 8, !tbaa !10
  %43 = load i64, ptr %9, align 8, !tbaa !10
  %44 = icmp ult i64 %42, %43
  br i1 %44, label %48, label %45

45:                                               ; preds = %41
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %50

48:                                               ; preds = %45, %41
  %49 = load i64, ptr %9, align 8, !tbaa !10
  store i64 %49, ptr %10, align 8, !tbaa !10
  store i64 -9223372036854775803, ptr %11, align 8, !tbaa !10
  br label %106

50:                                               ; preds = %45
  %51 = load i64, ptr %9, align 8, !tbaa !10
  store i64 %51, ptr %10, align 8, !tbaa !10
  br label %66

52:                                               ; preds = %38
  %53 = load i64, ptr %9, align 8, !tbaa !10
  %54 = icmp eq i64 %53, 0
  br i1 %54, label %55, label %65

55:                                               ; preds = %52
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %56, i32 0, i32 3
  %58 = load i8, ptr %57, align 1, !tbaa !32
  %59 = zext i8 %58 to i32
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %65

61:                                               ; preds = %55
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = call i64 @PxeBcReadBootFileList(ptr noundef %62, ptr noundef %10, ptr noundef %63)
  store i64 %64, ptr %11, align 8, !tbaa !10
  br label %106

65:                                               ; preds = %55, %52
  br label %66

66:                                               ; preds = %65, %50
  br label %81

67:                                               ; preds = %27
  %68 = load i64, ptr %10, align 8, !tbaa !10
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %69, i32 0, i32 61
  %71 = load i64, ptr %70, align 8, !tbaa !12
  %72 = icmp ult i64 %68, %71
  br i1 %72, label %76, label %73

73:                                               ; preds = %67
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %80

76:                                               ; preds = %73, %67
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %77, i32 0, i32 61
  %79 = load i64, ptr %78, align 8, !tbaa !12
  store i64 %79, ptr %10, align 8, !tbaa !10
  store i64 -9223372036854775803, ptr %11, align 8, !tbaa !10
  br label %106

80:                                               ; preds = %73
  br label %81

81:                                               ; preds = %80, %66
  %82 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.18)
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %83, i32 0, i32 3
  %85 = load i8, ptr %84, align 1, !tbaa !32
  %86 = icmp ne i8 %85, 0
  br i1 %86, label %87, label %91

87:                                               ; preds = %81
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = call i64 @PxeBcReadBootFileList(ptr noundef %88, ptr noundef %10, ptr noundef %89)
  store i64 %90, ptr %11, align 8, !tbaa !10
  br label %105

91:                                               ; preds = %81
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %92, i32 0, i32 5
  %94 = load ptr, ptr %93, align 8, !tbaa !33
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %97, i32 0, i32 62
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %99, i32 0, i32 55
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %101, i32 0, i32 60
  %103 = load ptr, ptr %102, align 8, !tbaa !34
  %104 = call i64 %94(ptr noundef %95, i32 noundef 2, ptr noundef %96, i8 noundef zeroext 0, ptr noundef %10, ptr noundef %98, ptr noundef %100, ptr noundef %103, ptr noundef null, i8 noundef zeroext 0)
  store i64 %104, ptr %11, align 8, !tbaa !10
  br label %105

105:                                              ; preds = %91, %87
  br label %106

106:                                              ; preds = %105, %76, %61, %48, %37
  %107 = load i64, ptr %10, align 8, !tbaa !10
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  store i64 %107, ptr %108, align 8, !tbaa !10
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = load i8, ptr %8, align 1, !tbaa !9
  call void @PxeBcUninstallCallback(ptr noundef %109, i8 noundef zeroext %110)
  %111 = load i64, ptr %11, align 8, !tbaa !10
  %112 = icmp eq i64 %111, 0
  br i1 %112, label %113, label %115

113:                                              ; preds = %106
  %114 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.19)
  store i64 0, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %186

115:                                              ; preds = %106
  %116 = load i64, ptr %11, align 8, !tbaa !10
  %117 = icmp eq i64 %116, -9223372036854775803
  br i1 %117, label %118, label %123

118:                                              ; preds = %115
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %123

121:                                              ; preds = %118
  %122 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.20)
  br label %183

123:                                              ; preds = %118, %115
  %124 = load i64, ptr %11, align 8, !tbaa !10
  %125 = icmp eq i64 %124, -9223372036854775801
  br i1 %125, label %126, label %128

126:                                              ; preds = %123
  %127 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.21)
  br label %182

128:                                              ; preds = %123
  %129 = load i64, ptr %11, align 8, !tbaa !10
  %130 = icmp eq i64 %129, -9223372036854775799
  br i1 %130, label %131, label %133

131:                                              ; preds = %128
  %132 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.22)
  br label %181

133:                                              ; preds = %128
  %134 = load i64, ptr %11, align 8, !tbaa !10
  %135 = icmp eq i64 %134, -9223372036854775796
  br i1 %135, label %136, label %138

136:                                              ; preds = %133
  %137 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.23)
  br label %180

138:                                              ; preds = %133
  %139 = load i64, ptr %11, align 8, !tbaa !10
  %140 = icmp eq i64 %139, -9223372036854775792
  br i1 %140, label %141, label %143

141:                                              ; preds = %138
  %142 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.24)
  br label %179

143:                                              ; preds = %138
  %144 = load i64, ptr %11, align 8, !tbaa !10
  %145 = icmp eq i64 %144, -9223372036854775790
  br i1 %145, label %146, label %148

146:                                              ; preds = %143
  %147 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.25)
  br label %178

148:                                              ; preds = %143
  %149 = load i64, ptr %11, align 8, !tbaa !10
  %150 = icmp eq i64 %149, -9223372036854775787
  br i1 %150, label %151, label %153

151:                                              ; preds = %148
  %152 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.26)
  br label %177

153:                                              ; preds = %148
  %154 = load i64, ptr %11, align 8, !tbaa !10
  %155 = icmp eq i64 %154, -9223372036854775786
  br i1 %155, label %156, label %158

156:                                              ; preds = %153
  %157 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.27)
  br label %176

158:                                              ; preds = %153
  %159 = load i64, ptr %11, align 8, !tbaa !10
  %160 = icmp eq i64 %159, -9223372036854775785
  br i1 %160, label %161, label %163

161:                                              ; preds = %158
  %162 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.28)
  br label %175

163:                                              ; preds = %158
  %164 = load i64, ptr %11, align 8, !tbaa !10
  %165 = icmp eq i64 %164, -9223372036854775794
  br i1 %165, label %166, label %168

166:                                              ; preds = %163
  %167 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.29)
  br label %174

168:                                              ; preds = %163
  %169 = load i64, ptr %11, align 8, !tbaa !10
  %170 = icmp ne i64 %169, -9223372036854775803
  br i1 %170, label %171, label %173

171:                                              ; preds = %168
  %172 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.30)
  br label %173

173:                                              ; preds = %171, %168
  br label %174

174:                                              ; preds = %173, %166
  br label %175

175:                                              ; preds = %174, %161
  br label %176

176:                                              ; preds = %175, %156
  br label %177

177:                                              ; preds = %176, %151
  br label %178

178:                                              ; preds = %177, %146
  br label %179

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

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

181:                                              ; preds = %180, %131
  br label %182

182:                                              ; preds = %181, %126
  br label %183

183:                                              ; preds = %182, %121
  br label %184

184:                                              ; preds = %183
  %185 = load i64, ptr %11, align 8, !tbaa !10
  store i64 %185, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %186

186:                                              ; preds = %184, %113, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  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 1, ptr %8) #3
  %187 = load i64, ptr %4, align 8
  ret i64 %187
}

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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !11, i64 11168}
!13 = !{!"_PXEBC_PRIVATE_DATA", !14, i64 0, !6, i64 8, !6, i64 16, !15, 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, !14, i64 10816, !14, i64 10820, !14, i64 10824, !11, 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, !14, i64 11144, !14, i64 11148, !14, i64 11152, !6, i64 11160, !11, i64 11168, !11, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !6, i64 16176, !29, i64 16184, !14, i64 16436, !14, i64 16440, !7, i64 16448, !14, i64 43072, !7, i64 43076, !7, i64 43108}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_PXEBC_PRIVATE_PROTOCOL", !11, i64 0}
!16 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104}
!17 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !11, 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, !14, i64 9016, !7, i64 9020, !14, 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, !14, i64 8, !14, 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, !14, i64 8, !14, 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, !14, i64 20, !14, 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, !14, i64 40, !14, i64 44, !14, i64 48}
!28 = !{!"", !6, i64 0, !11, i64 8, !7, i64 16}
!29 = !{!"", !14, i64 0, !14, i64 4, !30, i64 8}
!30 = !{!"", !31, i64 0, !14, i64 236, !7, i64 240}
!31 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !14, 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 = !{!18, !7, i64 3}
!33 = !{!16, !6, i64 40}
!34 = !{!13, !6, i64 11160}


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

@.str.18 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [39 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 i64 @AsciiPrint(ptr 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 i64 @PxeBcDiscoverBootFile(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcLoadBootFile(ptr noundef %0, ptr nocapture noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca i8, align 1
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  store i8 0, ptr %4, align 1, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 248
  %8 = load i64, ptr %1, align 8, !tbaa !8
  store i64 %8, ptr %6, align 8, !tbaa !8
  store i64 0, ptr %5, align 8, !tbaa !8
  %9 = call i64 @PxeBcInstallCallback(ptr noundef %0, ptr noundef nonnull %4)
  %10 = icmp slt i64 %9, 0
  br i1 %10, label %65, label %11

11:                                               ; preds = %3
  %12 = getelementptr inbounds i8, ptr %0, i64 11168
  %13 = load i64, ptr %12, align 8, !tbaa !10
  %14 = icmp eq i64 %13, 0
  br i1 %14, label %15, label %29

15:                                               ; preds = %11
  %16 = call i64 @PxeBcDiscoverBootFile(ptr noundef nonnull %0, ptr noundef nonnull %5)
  %17 = icmp slt i64 %16, 0
  br i1 %17, label %47, label %18

18:                                               ; preds = %15
  %19 = load i64, ptr %5, align 8, !tbaa !8
  %.not = icmp eq i64 %19, 0
  br i1 %.not, label %24, label %20

20:                                               ; preds = %18
  %21 = load i64, ptr %6, align 8, !tbaa !8
  %22 = icmp ult i64 %21, %19
  %23 = icmp eq ptr %2, null
  %or.cond = or i1 %23, %22
  store i64 %19, ptr %6, align 8, !tbaa !8
  br i1 %or.cond, label %47, label %33

24:                                               ; preds = %18
  %25 = getelementptr inbounds i8, ptr %0, i64 395
  %26 = load i8, ptr %25, align 1, !tbaa !31
  %.not51 = icmp eq i8 %26, 0
  br i1 %.not51, label %33, label %27

27:                                               ; preds = %24
  %28 = call i64 @PxeBcReadBootFileList(ptr noundef nonnull %0, ptr noundef nonnull %6, ptr noundef %2)
  br label %47

29:                                               ; preds = %11
  %30 = icmp ult i64 %8, %13
  %31 = icmp eq ptr %2, null
  %or.cond3 = or i1 %31, %30
  br i1 %or.cond3, label %32, label %33

32:                                               ; preds = %29
  store i64 %13, ptr %6, align 8, !tbaa !8
  br label %47

33:                                               ; preds = %20, %29, %24
  %34 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.18) #3
  %35 = getelementptr inbounds i8, ptr %0, i64 395
  %36 = load i8, ptr %35, align 1, !tbaa !31
  %.not52 = icmp eq i8 %36, 0
  br i1 %.not52, label %39, label %37

37:                                               ; preds = %33
  %38 = call i64 @PxeBcReadBootFileList(ptr noundef nonnull %0, ptr noundef nonnull %6, ptr noundef %2)
  br label %47

39:                                               ; preds = %33
  %40 = getelementptr inbounds i8, ptr %0, i64 288
  %41 = load ptr, ptr %40, align 8, !tbaa !32
  %42 = getelementptr inbounds i8, ptr %0, i64 11176
  %43 = getelementptr inbounds i8, ptr %0, i64 11124
  %44 = getelementptr inbounds i8, ptr %0, i64 11160
  %45 = load ptr, ptr %44, align 8, !tbaa !33
  %46 = call i64 %41(ptr noundef nonnull %7, i32 noundef 2, ptr noundef %2, i8 noundef zeroext 0, ptr noundef nonnull %6, ptr noundef nonnull %42, ptr noundef nonnull %43, ptr noundef %45, ptr noundef null, i8 noundef zeroext 0) #3
  br label %47

47:                                               ; preds = %20, %37, %39, %15, %32, %27
  %.046 = phi i64 [ %16, %15 ], [ %38, %37 ], [ %46, %39 ], [ %28, %27 ], [ -9223372036854775803, %32 ], [ -9223372036854775803, %20 ]
  %48 = load i64, ptr %6, align 8, !tbaa !8
  store i64 %48, ptr %1, align 8, !tbaa !8
  %49 = load i8, ptr %4, align 1, !tbaa !5
  call void @PxeBcUninstallCallback(ptr noundef nonnull %0, i8 noundef zeroext %49)
  %50 = icmp eq i64 %.046, 0
  br i1 %50, label %.sink.split, label %51

51:                                               ; preds = %47
  %52 = icmp eq i64 %.046, -9223372036854775803
  %53 = icmp ne ptr %2, null
  %or.cond5 = and i1 %53, %52
  br i1 %or.cond5, label %.sink.split, label %54

54:                                               ; preds = %51
  switch i64 %.046, label %63 [
    i64 -9223372036854775801, label %.sink.split
    i64 -9223372036854775799, label %55
    i64 -9223372036854775796, label %56
    i64 -9223372036854775792, label %57
    i64 -9223372036854775790, label %58
    i64 -9223372036854775787, label %59
    i64 -9223372036854775786, label %60
    i64 -9223372036854775785, label %61
    i64 -9223372036854775794, label %62
    i64 -9223372036854775803, label %65
  ]

55:                                               ; preds = %54
  br label %.sink.split

56:                                               ; preds = %54
  br label %.sink.split

57:                                               ; preds = %54
  br label %.sink.split

58:                                               ; preds = %54
  br label %.sink.split

59:                                               ; preds = %54
  br label %.sink.split

60:                                               ; preds = %54
  br label %.sink.split

61:                                               ; preds = %54
  br label %.sink.split

62:                                               ; preds = %54
  br label %.sink.split

63:                                               ; preds = %54
  br label %.sink.split

.sink.split:                                      ; preds = %54, %51, %47, %55, %57, %59, %61, %63, %62, %60, %58, %56
  %.str.21.sink = phi ptr [ @.str.23, %56 ], [ @.str.25, %58 ], [ @.str.27, %60 ], [ @.str.29, %62 ], [ @.str.30, %63 ], [ @.str.28, %61 ], [ @.str.26, %59 ], [ @.str.24, %57 ], [ @.str.22, %55 ], [ @.str.19, %47 ], [ @.str.20, %51 ], [ @.str.21, %54 ]
  %.0.ph = phi i64 [ %.046, %56 ], [ %.046, %58 ], [ %.046, %60 ], [ %.046, %62 ], [ %.046, %63 ], [ %.046, %61 ], [ %.046, %59 ], [ %.046, %57 ], [ %.046, %55 ], [ 0, %47 ], [ -9223372036854775803, %51 ], [ %.046, %54 ]
  %64 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull %.str.21.sink) #3
  br label %65

65:                                               ; preds = %.sink.split, %54, %3
  %.0 = phi i64 [ %9, %3 ], [ %.046, %54 ], [ %.0.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  ret i64 %.0
}

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, !9, i64 0}
!9 = !{!"long long", !6, i64 0}
!10 = !{!11, !9, i64 11168}
!11 = !{!"_PXEBC_PRIVATE_DATA", !12, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !13, i64 224, !13, i64 232, !13, i64 240, !15, i64 248, !16, i64 360, !13, i64 376, !13, i64 384, !17, i64 392, !12, i64 10816, !12, i64 10820, !12, i64 10824, !9, i64 10832, !22, i64 10840, !24, i64 10876, !25, i64 10928, !26, i64 10956, !13, i64 11008, !13, i64 11016, !27, i64 11024, !27, 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, !19, i64 11140, !12, i64 11144, !12, i64 11148, !12, i64 11152, !13, i64 11160, !9, i64 11168, !9, i64 11176, !6, i64 11184, !6, i64 12848, !6, i64 14512, !13, i64 16176, !28, i64 16184, !12, i64 16436, !12, i64 16440, !6, i64 16448, !12, i64 43072, !6, i64 43076, !6, i64 43108}
!12 = !{!"int", !6, i64 0}
!13 = !{!"any pointer", !6, i64 0}
!14 = !{!"_PXEBC_PRIVATE_PROTOCOL", !9, i64 0}
!15 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !9, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104}
!16 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !9, i64 0, !13, i64 8}
!17 = !{!"", !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, !18, i64 8884, !12, i64 9016, !6, i64 9020, !12, i64 9404, !6, i64 9408, !20, i64 9792, !21, i64 10296}
!18 = !{!"", !6, i64 0, !6, i64 1, !19, i64 2, !6, i64 4}
!19 = !{!"short", !6, i64 0}
!20 = !{!"", !6, i64 0, !6, i64 1, !19, i64 2, !6, i64 4, !6, i64 8}
!21 = !{!"", !6, i64 0, !6, i64 1}
!22 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !6, i64 5, !6, i64 6, !12, i64 8, !12, i64 12, !6, i64 16, !23, i64 17, !23, i64 21, !19, i64 26, !23, i64 28, !19, i64 32}
!23 = !{!"", !6, i64 0}
!24 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !12, i64 8, !12, i64 12, !23, i64 16, !19, i64 32, !23, i64 34, !19, i64 50}
!25 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !6, i64 5, !23, i64 6, !23, i64 10, !6, i64 14, !6, i64 15, !6, i64 16, !6, i64 17, !12, i64 20, !12, i64 24}
!26 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !23, i64 4, !23, i64 20, !6, i64 36, !6, i64 37, !12, i64 40, !12, i64 44, !12, i64 48}
!27 = !{!"", !13, i64 0, !9, i64 8, !6, i64 16}
!28 = !{!"", !12, i64 0, !12, i64 4, !29, i64 8}
!29 = !{!"", !30, i64 0, !12, i64 236, !6, i64 240}
!30 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !12, i64 4, !19, i64 8, !19, i64 10, !23, i64 12, !23, i64 16, !23, i64 20, !23, i64 24, !6, i64 28, !6, i64 44, !6, i64 108}
!31 = !{!17, !6, i64 3}
!32 = !{!15, !13, i64 40}
!33 = !{!11, !13, i64 11160}


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