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

; 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_INPUT_KEY = type { i16, i16 }
%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] }
%struct.PXEBC_DHCP6_PACKET_CACHE = type { %union.PXEBC_DHCP6_PACKET, i32, [4 x ptr] }
%union.PXEBC_DHCP6_PACKET = type { [1472 x i8] }
%struct.PXEBC_MENU_PROMPT = type { i8, [1 x i8] }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, 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, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct.EFI_SYSTEM_TABLE = type { %struct.EFI_TABLE_HEADER, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_SIMPLE_TEXT_OUTPUT_MODE = type { i32, i32, i32, i32, i32, i8 }
%struct._EFI_SIMPLE_TEXT_INPUT_PROTOCOL = type { ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [137 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@gBS = external global ptr, align 8
@gST = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

declare i64 @AsciiPrint(ptr noundef, ...) #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcSelectBootPrompt(ptr noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.EFI_INPUT_KEY, align 2
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store ptr null, ptr %7, align 8, !tbaa !5
  store ptr null, ptr %8, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %18, i32 0, i32 31
  %20 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %19, i32 0, i32 13
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  store ptr %21, ptr %6, align 8, !tbaa !5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %22, i32 0, i32 10
  %24 = load i8, ptr %23, align 2, !tbaa !30
  %25 = zext i8 %24 to i32
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %30

27:                                               ; preds = %1
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %28, i32 0, i32 63
  br label %33

30:                                               ; preds = %1
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %31, i32 0, i32 64
  br label %33

33:                                               ; preds = %30, %27
  %34 = phi ptr [ %29, %27 ], [ %32, %30 ]
  store ptr %34, ptr %4, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %35, i32 0, i32 3
  %37 = load i8, ptr %36, align 1, !tbaa !31
  %38 = zext i8 %37 to i32
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %44

40:                                               ; preds = %33
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 8, !tbaa !32
  br label %48

44:                                               ; preds = %33
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 8, !tbaa !32
  br label %48

48:                                               ; preds = %44, %40
  %49 = phi i32 [ %43, %40 ], [ %47, %44 ]
  store i32 %49, ptr %11, align 4, !tbaa !33
  %50 = load i32, ptr %11, align 4, !tbaa !33
  %51 = icmp ne i32 %50, 4
  br i1 %51, label %52, label %56

52:                                               ; preds = %48
  %53 = load i32, ptr %11, align 4, !tbaa !33
  %54 = icmp ne i32 %53, 1
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  store i64 -9223372036854775794, ptr %2, align 8
  store i32 1, ptr %17, align 4
  br label %301

56:                                               ; preds = %52, %48
  br label %57

57:                                               ; preds = %56
  %58 = call zeroext i8 @DebugAssertEnabled()
  %59 = icmp ne i8 %58, 0
  br i1 %59, label %60, label %67

60:                                               ; preds = %57
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %61, i32 0, i32 3
  %63 = load i8, ptr %62, align 1, !tbaa !31
  %64 = icmp ne i8 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %60
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 98, ptr noundef @.str.2)
  br label %66

66:                                               ; preds = %65, %60
  br label %67

67:                                               ; preds = %66, %57
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %70, i32 0, i32 3
  store ptr %71, ptr %5, align 8, !tbaa !5
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %72, i32 0, i32 6
  %74 = load i8, ptr %73, align 2, !tbaa !34
  %75 = zext i8 %74 to i32
  %76 = and i32 %75, 8
  %77 = icmp eq i32 %76, 8
  br i1 %77, label %78, label %85

78:                                               ; preds = %69
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %79, i32 0, i32 2
  %81 = getelementptr inbounds [7 x ptr], ptr %80, i64 0, i64 6
  %82 = load ptr, ptr %81, align 8, !tbaa !32
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %85

84:                                               ; preds = %78
  store i64 -9223372036854775787, ptr %2, align 8
  store i32 1, ptr %17, align 4
  br label %301

85:                                               ; preds = %78, %69
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds [8 x i32], ptr %87, i64 0, i64 0
  %89 = load i32, ptr %88, align 8, !tbaa !33
  %90 = and i32 %89, 1024
  %91 = icmp eq i32 %90, 1024
  br i1 %91, label %93, label %92

92:                                               ; preds = %85
  store i64 -9223372036854775790, ptr %2, align 8
  store i32 1, ptr %17, align 4
  br label %301

93:                                               ; preds = %85
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %94, i32 0, i32 17
  %96 = load ptr, ptr %95, align 8, !tbaa !36
  %97 = getelementptr inbounds %struct.PXEBC_MENU_PROMPT, ptr %96, i32 0, i32 0
  %98 = load i8, ptr %97, align 1, !tbaa !37
  store i8 %98, ptr %12, align 1, !tbaa !32
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %99, i32 0, i32 17
  %101 = load ptr, ptr %100, align 8, !tbaa !36
  %102 = getelementptr inbounds %struct.PXEBC_MENU_PROMPT, ptr %101, i32 0, i32 1
  %103 = getelementptr inbounds [1 x i8], ptr %102, i64 0, i64 0
  store ptr %103, ptr %13, align 8, !tbaa !5
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %104, i32 0, i32 18
  %106 = load i8, ptr %105, align 8, !tbaa !38
  %107 = zext i8 %106 to i32
  %108 = sub nsw i32 %107, 1
  %109 = trunc i32 %108 to i8
  store i8 %109, ptr %14, align 1, !tbaa !32
  %110 = load i8, ptr %12, align 1, !tbaa !32
  %111 = zext i8 %110 to i32
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %93
  store i64 -9223372036854775790, ptr %2, align 8
  store i32 1, ptr %17, align 4
  br label %301

114:                                              ; preds = %93
  %115 = load i8, ptr %12, align 1, !tbaa !32
  %116 = zext i8 %115 to i32
  %117 = icmp eq i32 %116, 255
  br i1 %117, label %118, label %119

118:                                              ; preds = %114
  store i64 0, ptr %2, align 8
  store i32 1, ptr %17, align 4
  br label %301

119:                                              ; preds = %114
  %120 = load ptr, ptr @gBS, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %120, i32 0, i32 8
  %122 = load ptr, ptr %121, align 8, !tbaa !39
  %123 = call i64 %122(i32 noundef -2147483648, i64 noundef 8, ptr noundef null, ptr noundef null, ptr noundef %7)
  store i64 %123, ptr %10, align 8, !tbaa !42
  %124 = load i64, ptr %10, align 8, !tbaa !42
  %125 = icmp slt i64 %124, 0
  br i1 %125, label %126, label %128

126:                                              ; preds = %119
  %127 = load i64, ptr %10, align 8, !tbaa !42
  store i64 %127, ptr %2, align 8
  store i32 1, ptr %17, align 4
  br label %301

128:                                              ; preds = %119
  %129 = load ptr, ptr @gBS, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %129, i32 0, i32 9
  %131 = load ptr, ptr %130, align 8, !tbaa !43
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = load i8, ptr %12, align 1, !tbaa !32
  %134 = zext i8 %133 to i32
  %135 = mul i32 %134, 10000000
  %136 = zext i32 %135 to i64
  %137 = call i64 %131(ptr noundef %132, i32 noundef 2, i64 noundef %136)
  store i64 %137, ptr %10, align 8, !tbaa !42
  %138 = load i64, ptr %10, align 8, !tbaa !42
  %139 = icmp slt i64 %138, 0
  br i1 %139, label %140, label %141

140:                                              ; preds = %128
  br label %281

141:                                              ; preds = %128
  %142 = load ptr, ptr @gBS, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %142, i32 0, i32 8
  %144 = load ptr, ptr %143, align 8, !tbaa !39
  %145 = call i64 %144(i32 noundef -2147483648, i64 noundef 8, ptr noundef null, ptr noundef null, ptr noundef %8)
  store i64 %145, ptr %10, align 8, !tbaa !42
  %146 = load i64, ptr %10, align 8, !tbaa !42
  %147 = icmp slt i64 %146, 0
  br i1 %147, label %148, label %149

148:                                              ; preds = %141
  br label %281

149:                                              ; preds = %141
  %150 = load ptr, ptr @gBS, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %150, i32 0, i32 9
  %152 = load ptr, ptr %151, align 8, !tbaa !43
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = call i64 %152(ptr noundef %153, i32 noundef 1, i64 noundef 10000000)
  store i64 %154, ptr %10, align 8, !tbaa !42
  %155 = load i64, ptr %10, align 8, !tbaa !42
  %156 = icmp slt i64 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %149
  br label %281

158:                                              ; preds = %149
  %159 = load ptr, ptr @gST, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %159, i32 0, i32 6
  %161 = load ptr, ptr %160, align 8, !tbaa !44
  %162 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %161, i32 0, i32 9
  %163 = load ptr, ptr %162, align 8, !tbaa !46
  %164 = getelementptr inbounds %struct.EFI_SIMPLE_TEXT_OUTPUT_MODE, ptr %163, i32 0, i32 3
  %165 = load i32, ptr %164, align 4, !tbaa !48
  store i32 %165, ptr %15, align 4, !tbaa !33
  %166 = load ptr, ptr @gST, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %166, i32 0, i32 6
  %168 = load ptr, ptr %167, align 8, !tbaa !44
  %169 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %168, i32 0, i32 9
  %170 = load ptr, ptr %169, align 8, !tbaa !46
  %171 = getelementptr inbounds %struct.EFI_SIMPLE_TEXT_OUTPUT_MODE, ptr %170, i32 0, i32 4
  %172 = load i32, ptr %171, align 4, !tbaa !50
  store i32 %172, ptr %16, align 4, !tbaa !33
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = load i8, ptr %14, align 1, !tbaa !32
  call void @PxeBcDisplayBootItem(ptr noundef %173, i8 noundef zeroext %174)
  %175 = load ptr, ptr @gST, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %175, i32 0, i32 6
  %177 = load ptr, ptr %176, align 8, !tbaa !44
  %178 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %177, i32 0, i32 7
  %179 = load ptr, ptr %178, align 8, !tbaa !51
  %180 = load ptr, ptr @gST, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %180, i32 0, i32 6
  %182 = load ptr, ptr %181, align 8, !tbaa !44
  %183 = load i32, ptr %15, align 4, !tbaa !33
  %184 = load i8, ptr %14, align 1, !tbaa !32
  %185 = zext i8 %184 to i32
  %186 = add nsw i32 %183, %185
  %187 = sext i32 %186 to i64
  %188 = load i32, ptr %16, align 4, !tbaa !33
  %189 = sext i32 %188 to i64
  %190 = call i64 %179(ptr noundef %182, i64 noundef %187, i64 noundef %189)
  %191 = load i8, ptr %12, align 1, !tbaa !32
  %192 = add i8 %191, -1
  store i8 %192, ptr %12, align 1, !tbaa !32
  %193 = zext i8 %191 to i32
  %194 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.3, i32 noundef %193)
  store i64 -9223372036854775790, ptr %10, align 8, !tbaa !42
  br label %195

195:                                              ; preds = %265, %257, %241, %158
  %196 = load ptr, ptr @gBS, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %196, i32 0, i32 13
  %198 = load ptr, ptr %197, align 8, !tbaa !52
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = call i64 %198(ptr noundef %199)
  %201 = icmp slt i64 %200, 0
  br i1 %201, label %202, label %268

202:                                              ; preds = %195
  %203 = load ptr, ptr @gBS, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %203, i32 0, i32 13
  %205 = load ptr, ptr %204, align 8, !tbaa !52
  %206 = load ptr, ptr %8, align 8, !tbaa !5
  %207 = call i64 %205(ptr noundef %206)
  %208 = icmp slt i64 %207, 0
  br i1 %208, label %230, label %209

209:                                              ; preds = %202
  %210 = load ptr, ptr @gST, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %210, i32 0, i32 6
  %212 = load ptr, ptr %211, align 8, !tbaa !44
  %213 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %212, i32 0, i32 7
  %214 = load ptr, ptr %213, align 8, !tbaa !51
  %215 = load ptr, ptr @gST, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %215, i32 0, i32 6
  %217 = load ptr, ptr %216, align 8, !tbaa !44
  %218 = load i32, ptr %15, align 4, !tbaa !33
  %219 = load i8, ptr %14, align 1, !tbaa !32
  %220 = zext i8 %219 to i32
  %221 = add nsw i32 %218, %220
  %222 = sext i32 %221 to i64
  %223 = load i32, ptr %16, align 4, !tbaa !33
  %224 = sext i32 %223 to i64
  %225 = call i64 %214(ptr noundef %217, i64 noundef %222, i64 noundef %224)
  %226 = load i8, ptr %12, align 1, !tbaa !32
  %227 = add i8 %226, -1
  store i8 %227, ptr %12, align 1, !tbaa !32
  %228 = zext i8 %226 to i32
  %229 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.3, i32 noundef %228)
  br label %230

230:                                              ; preds = %209, %202
  %231 = load ptr, ptr @gST, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %231, i32 0, i32 4
  %233 = load ptr, ptr %232, align 8, !tbaa !53
  %234 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_INPUT_PROTOCOL, ptr %233, i32 0, i32 1
  %235 = load ptr, ptr %234, align 8, !tbaa !54
  %236 = load ptr, ptr @gST, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %236, i32 0, i32 4
  %238 = load ptr, ptr %237, align 8, !tbaa !53
  %239 = call i64 %235(ptr noundef %238, ptr noundef %9)
  %240 = icmp eq i64 %239, -9223372036854775802
  br i1 %240, label %241, label %246

241:                                              ; preds = %230
  %242 = load ptr, ptr @gBS, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %242, i32 0, i32 29
  %244 = load ptr, ptr %243, align 8, !tbaa !56
  %245 = call i64 %244(i64 noundef 100000)
  br label %195, !llvm.loop !57

246:                                              ; preds = %230
  %247 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %9, i32 0, i32 0
  %248 = load i16, ptr %247, align 2, !tbaa !59
  %249 = zext i16 %248 to i32
  %250 = icmp eq i32 %249, 0
  br i1 %250, label %251, label %259

251:                                              ; preds = %246
  %252 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %9, i32 0, i32 1
  %253 = load i16, ptr %252, align 2, !tbaa !61
  %254 = zext i16 %253 to i32
  switch i32 %254, label %257 [
    i32 3, label %255
    i32 13, label %256
    i32 109, label %256
    i32 77, label %256
  ]

255:                                              ; preds = %251
  store i64 -9223372036854775787, ptr %10, align 8, !tbaa !42
  br label %258

256:                                              ; preds = %251, %251, %251
  store i64 0, ptr %10, align 8, !tbaa !42
  br label %258

257:                                              ; preds = %251
  br label %195, !llvm.loop !57

258:                                              ; preds = %256, %255
  br label %267

259:                                              ; preds = %246
  %260 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %9, i32 0, i32 0
  %261 = load i16, ptr %260, align 2, !tbaa !59
  %262 = zext i16 %261 to i32
  switch i32 %262, label %265 [
    i32 18, label %263
    i32 23, label %264
  ]

263:                                              ; preds = %259
  store i64 0, ptr %10, align 8, !tbaa !42
  br label %266

264:                                              ; preds = %259
  store i64 -9223372036854775787, ptr %10, align 8, !tbaa !42
  br label %266

265:                                              ; preds = %259
  br label %195, !llvm.loop !57

266:                                              ; preds = %264, %263
  br label %267

267:                                              ; preds = %266, %258
  br label %268

268:                                              ; preds = %267, %195
  %269 = load ptr, ptr @gST, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %269, i32 0, i32 6
  %271 = load ptr, ptr %270, align 8, !tbaa !44
  %272 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %271, i32 0, i32 7
  %273 = load ptr, ptr %272, align 8, !tbaa !51
  %274 = load ptr, ptr @gST, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %274, i32 0, i32 6
  %276 = load ptr, ptr %275, align 8, !tbaa !44
  %277 = load i32, ptr %16, align 4, !tbaa !33
  %278 = add nsw i32 %277, 1
  %279 = sext i32 %278 to i64
  %280 = call i64 %273(ptr noundef %276, i64 noundef 0, i64 noundef %279)
  br label %281

281:                                              ; preds = %268, %157, %148, %140
  %282 = load ptr, ptr %8, align 8, !tbaa !5
  %283 = icmp ne ptr %282, null
  br i1 %283, label %284, label %290

284:                                              ; preds = %281
  %285 = load ptr, ptr @gBS, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %285, i32 0, i32 12
  %287 = load ptr, ptr %286, align 8, !tbaa !62
  %288 = load ptr, ptr %8, align 8, !tbaa !5
  %289 = call i64 %287(ptr noundef %288)
  br label %290

290:                                              ; preds = %284, %281
  %291 = load ptr, ptr %7, align 8, !tbaa !5
  %292 = icmp ne ptr %291, null
  br i1 %292, label %293, label %299

293:                                              ; preds = %290
  %294 = load ptr, ptr @gBS, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %294, i32 0, i32 12
  %296 = load ptr, ptr %295, align 8, !tbaa !62
  %297 = load ptr, ptr %7, align 8, !tbaa !5
  %298 = call i64 %296(ptr noundef %297)
  br label %299

299:                                              ; preds = %293, %290
  %300 = load i64, ptr %10, align 8, !tbaa !42
  store i64 %300, ptr %2, align 8
  store i32 1, ptr %17, align 4
  br label %301

301:                                              ; preds = %299, %126, %118, %113, %92, %84, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %302 = load i64, ptr %2, align 8
  ret i64 %302
}

declare zeroext i8 @DebugAssertEnabled() #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 352}
!10 = !{!"_PXEBC_PRIVATE_DATA", !11, i64 0, !6, i64 8, !6, i64 16, !12, 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, !14, i64 248, !15, i64 360, !6, i64 376, !6, i64 384, !16, i64 392, !11, i64 10816, !11, i64 10820, !11, i64 10824, !13, i64 10832, !21, i64 10840, !23, i64 10876, !24, i64 10928, !25, i64 10956, !6, i64 11008, !6, i64 11016, !26, i64 11024, !26, 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, !18, i64 11140, !11, i64 11144, !11, i64 11148, !11, i64 11152, !6, i64 11160, !13, i64 11168, !13, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !6, i64 16176, !27, i64 16184, !11, i64 16436, !11, i64 16440, !7, i64 16448, !11, i64 43072, !7, i64 43076, !7, i64 43108}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_PXEBC_PRIVATE_PROTOCOL", !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104}
!15 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !13, i64 0, !6, i64 8}
!16 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !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, !17, i64 8884, !11, i64 9016, !7, i64 9020, !11, i64 9404, !7, i64 9408, !19, i64 9792, !20, i64 10296}
!17 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4, !7, i64 8}
!20 = !{!"", !7, i64 0, !7, i64 1}
!21 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !11, i64 8, !11, i64 12, !7, i64 16, !22, i64 17, !22, i64 21, !18, i64 26, !22, i64 28, !18, i64 32}
!22 = !{!"", !7, i64 0}
!23 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !11, i64 8, !11, i64 12, !22, i64 16, !18, i64 32, !22, i64 34, !18, i64 50}
!24 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !22, i64 6, !22, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !11, i64 20, !11, i64 24}
!25 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !22, i64 4, !22, i64 20, !7, i64 36, !7, i64 37, !11, i64 40, !11, i64 44, !11, i64 48}
!26 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!27 = !{!"", !11, i64 0, !11, i64 4, !28, i64 8}
!28 = !{!"", !29, i64 0, !11, i64 236, !7, i64 240}
!29 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !18, i64 8, !18, i64 10, !22, i64 12, !22, i64 16, !22, i64 20, !22, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!30 = !{!16, !7, i64 10}
!31 = !{!16, !7, i64 3}
!32 = !{!7, !7, i64 0}
!33 = !{!11, !11, i64 0}
!34 = !{!35, !7, i64 42}
!35 = !{!"", !7, i64 0, !22, i64 32, !18, i64 36, !18, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !22, i64 43, !22, i64 47, !18, i64 52, !18, i64 54, !18, i64 56, !18, i64 58, !6, i64 64, !7, i64 72, !6, i64 80, !7, i64 88, !6, i64 96, !7, i64 104, !6, i64 112, !7, i64 120}
!36 = !{!35, !6, i64 96}
!37 = !{!20, !7, i64 0}
!38 = !{!35, !7, i64 104}
!39 = !{!40, !6, i64 80}
!40 = !{!"", !41, i64 0, !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, !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, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!41 = !{!"", !13, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!42 = !{!13, !13, i64 0}
!43 = !{!40, !6, i64 88}
!44 = !{!45, !6, i64 64}
!45 = !{!"", !41, i64 0, !6, i64 24, !11, 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, !13, i64 104, !6, i64 112}
!46 = !{!47, !6, i64 72}
!47 = !{!"_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL", !6, 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}
!48 = !{!49, !11, i64 12}
!49 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !7, i64 20}
!50 = !{!49, !11, i64 16}
!51 = !{!47, !6, i64 56}
!52 = !{!40, !6, i64 120}
!53 = !{!45, !6, i64 48}
!54 = !{!55, !6, i64 8}
!55 = !{!"_EFI_SIMPLE_TEXT_INPUT_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!56 = !{!40, !6, i64 248}
!57 = distinct !{!57, !58}
!58 = !{!"llvm.loop.mustprogress"}
!59 = !{!60, !18, i64 0}
!60 = !{!"", !18, i64 0, !18, i64 2}
!61 = !{!60, !18, i64 2}
!62 = !{!40, !6, i64 112}


; 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_INPUT_KEY = type { i16, i16 }

@.str.1 = external hidden unnamed_addr constant [137 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@gST = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

declare i64 @AsciiPrint(ptr noundef, ...) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @PxeBcSelectBootPrompt(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.EFI_INPUT_KEY, align 2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  store ptr null, ptr %2, align 8, !tbaa !5
  store ptr null, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 352
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = getelementptr inbounds i8, ptr %6, i64 10
  %8 = load i8, ptr %7, align 2, !tbaa !30
  %.not = icmp eq i8 %8, 0
  %.v = select i1 %.not, i64 12848, i64 11184
  %9 = getelementptr inbounds i8, ptr %0, i64 %.v
  %10 = getelementptr inbounds i8, ptr %6, i64 3
  %.in = getelementptr inbounds i8, ptr %9, i64 1472
  %11 = load i32, ptr %.in, align 8, !tbaa !31
  switch i32 %11, label %157 [
    i32 4, label %12
    i32 1, label %12
  ]

12:                                               ; preds = %1, %1
  %13 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not50 = icmp eq i8 %13, 0
  br i1 %.not50, label %17, label %14

14:                                               ; preds = %12
  %15 = load i8, ptr %10, align 1, !tbaa !32
  %.not51 = icmp eq i8 %15, 0
  br i1 %.not51, label %17, label %16

16:                                               ; preds = %14
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 98, ptr noundef nonnull @.str.2) #3
  br label %17

17:                                               ; preds = %14, %16, %12
  %18 = getelementptr inbounds i8, ptr %9, i64 1536
  %19 = getelementptr inbounds i8, ptr %9, i64 1578
  %20 = load i8, ptr %19, align 2, !tbaa !33
  %21 = and i8 %20, 8
  %.not52 = icmp eq i8 %21, 0
  br i1 %.not52, label %25, label %22

22:                                               ; preds = %17
  %23 = getelementptr inbounds i8, ptr %9, i64 1528
  %24 = load ptr, ptr %23, align 8, !tbaa !31
  %.not53 = icmp eq ptr %24, null
  br i1 %.not53, label %25, label %157

25:                                               ; preds = %22, %17
  %26 = load i32, ptr %18, align 8, !tbaa !35
  %27 = and i32 %26, 1024
  %.not54 = icmp eq i32 %27, 0
  br i1 %.not54, label %157, label %28

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %9, i64 1632
  %30 = load ptr, ptr %29, align 8, !tbaa !36
  %31 = load i8, ptr %30, align 1, !tbaa !37
  %32 = getelementptr inbounds i8, ptr %30, i64 1
  %33 = getelementptr inbounds i8, ptr %9, i64 1640
  %34 = load i8, ptr %33, align 8, !tbaa !38
  %35 = add i8 %34, -1
  %36 = zext i8 %31 to i32
  switch i8 %31, label %38 [
    i8 0, label %157
    i8 -1, label %37
  ]

37:                                               ; preds = %28
  br label %157

38:                                               ; preds = %28
  %39 = load ptr, ptr @gBS, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 80
  %41 = load ptr, ptr %40, align 8, !tbaa !39
  %42 = call i64 %41(i32 noundef -2147483648, i64 noundef 8, ptr noundef null, ptr noundef null, ptr noundef nonnull %2) #3
  %43 = icmp slt i64 %42, 0
  br i1 %43, label %157, label %44

44:                                               ; preds = %38
  %45 = load ptr, ptr @gBS, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 88
  %47 = load ptr, ptr %46, align 8, !tbaa !42
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = mul nuw i32 %36, 10000000
  %50 = zext i32 %49 to i64
  %51 = call i64 %47(ptr noundef %48, i32 noundef 2, i64 noundef %50) #3
  %52 = icmp slt i64 %51, 0
  br i1 %52, label %143, label %53

53:                                               ; preds = %44
  %54 = load ptr, ptr @gBS, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 80
  %56 = load ptr, ptr %55, align 8, !tbaa !39
  %57 = call i64 %56(i32 noundef -2147483648, i64 noundef 8, ptr noundef null, ptr noundef null, ptr noundef nonnull %3) #3
  %58 = icmp slt i64 %57, 0
  br i1 %58, label %143, label %59

59:                                               ; preds = %53
  %60 = load ptr, ptr @gBS, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 88
  %62 = load ptr, ptr %61, align 8, !tbaa !42
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = call i64 %62(ptr noundef %63, i32 noundef 1, i64 noundef 10000000) #3
  %65 = icmp slt i64 %64, 0
  br i1 %65, label %143, label %66

66:                                               ; preds = %59
  %67 = load ptr, ptr @gST, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 64
  %69 = load ptr, ptr %68, align 8, !tbaa !43
  %70 = getelementptr inbounds i8, ptr %69, i64 72
  %71 = load ptr, ptr %70, align 8, !tbaa !45
  %72 = getelementptr inbounds i8, ptr %71, i64 12
  %73 = load i32, ptr %72, align 4, !tbaa !47
  %74 = getelementptr inbounds i8, ptr %71, i64 16
  %75 = load i32, ptr %74, align 4, !tbaa !49
  call void @PxeBcDisplayBootItem(ptr noundef nonnull %32, i8 noundef zeroext %35)
  %76 = load ptr, ptr @gST, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 64
  %78 = load ptr, ptr %77, align 8, !tbaa !43
  %79 = getelementptr inbounds i8, ptr %78, i64 56
  %80 = load ptr, ptr %79, align 8, !tbaa !50
  %81 = zext i8 %35 to i32
  %82 = add nsw i32 %73, %81
  %83 = sext i32 %82 to i64
  %84 = sext i32 %75 to i64
  %85 = call i64 %80(ptr noundef %78, i64 noundef %83, i64 noundef %84) #3
  %86 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.3, i32 noundef %36) #3
  %87 = load ptr, ptr @gBS, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 120
  %89 = load ptr, ptr %88, align 8, !tbaa !51
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = call i64 %89(ptr noundef %90) #3
  %92 = icmp slt i64 %91, 0
  br i1 %92, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %66
  %93 = add i8 %31, -1
  %94 = getelementptr inbounds i8, ptr %4, i64 2
  br label %95

95:                                               ; preds = %.lr.ph, %.backedge
  %.03957 = phi i8 [ %93, %.lr.ph ], [ %.140, %.backedge ]
  %96 = load ptr, ptr @gBS, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 120
  %98 = load ptr, ptr %97, align 8, !tbaa !51
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = call i64 %98(ptr noundef %99) #3
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %112, label %102

102:                                              ; preds = %95
  %103 = load ptr, ptr @gST, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i64 64
  %105 = load ptr, ptr %104, align 8, !tbaa !43
  %106 = getelementptr inbounds i8, ptr %105, i64 56
  %107 = load ptr, ptr %106, align 8, !tbaa !50
  %108 = call i64 %107(ptr noundef %105, i64 noundef %83, i64 noundef %84) #3
  %109 = add i8 %.03957, -1
  %110 = zext i8 %.03957 to i32
  %111 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.3, i32 noundef %110) #3
  br label %112

112:                                              ; preds = %102, %95
  %.140 = phi i8 [ %.03957, %95 ], [ %109, %102 ]
  %113 = load ptr, ptr @gST, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i64 48
  %115 = load ptr, ptr %114, align 8, !tbaa !52
  %116 = getelementptr inbounds i8, ptr %115, i64 8
  %117 = load ptr, ptr %116, align 8, !tbaa !53
  %118 = call i64 %117(ptr noundef %115, ptr noundef nonnull %4) #3
  %119 = icmp eq i64 %118, -9223372036854775802
  br i1 %119, label %120, label %131

120:                                              ; preds = %112
  %121 = load ptr, ptr @gBS, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i64 248
  %123 = load ptr, ptr %122, align 8, !tbaa !55
  %124 = call i64 %123(i64 noundef 100000) #3
  br label %.backedge

.backedge:                                        ; preds = %120, %133, %131
  %125 = load ptr, ptr @gBS, align 8, !tbaa !5
  %126 = getelementptr inbounds i8, ptr %125, i64 120
  %127 = load ptr, ptr %126, align 8, !tbaa !51
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = call i64 %127(ptr noundef %128) #3
  %130 = icmp slt i64 %129, 0
  br i1 %130, label %95, label %.loopexit.loopexit, !llvm.loop !56

131:                                              ; preds = %112
  %132 = load i16, ptr %4, align 2, !tbaa !58
  switch i16 %132, label %.backedge [
    i16 0, label %133
    i16 18, label %.loopexit.loopexit
    i16 23, label %.loopexit
  ]

133:                                              ; preds = %131
  %134 = load i16, ptr %94, align 2, !tbaa !60
  switch i16 %134, label %.backedge [
    i16 3, label %.loopexit.loopexit
    i16 13, label %.loopexit
    i16 109, label %.loopexit
    i16 77, label %.loopexit
  ]

.loopexit.loopexit:                               ; preds = %131, %133, %.backedge
  %.038.ph = phi i64 [ 0, %131 ], [ -9223372036854775787, %133 ], [ -9223372036854775790, %.backedge ]
  br label %.loopexit

.loopexit:                                        ; preds = %131, %133, %133, %133, %.loopexit.loopexit, %66
  %.038 = phi i64 [ -9223372036854775790, %66 ], [ %.038.ph, %.loopexit.loopexit ], [ 0, %133 ], [ 0, %133 ], [ 0, %133 ], [ -9223372036854775787, %131 ]
  %135 = load ptr, ptr @gST, align 8, !tbaa !5
  %136 = getelementptr inbounds i8, ptr %135, i64 64
  %137 = load ptr, ptr %136, align 8, !tbaa !43
  %138 = getelementptr inbounds i8, ptr %137, i64 56
  %139 = load ptr, ptr %138, align 8, !tbaa !50
  %140 = add nsw i32 %75, 1
  %141 = sext i32 %140 to i64
  %142 = call i64 %139(ptr noundef %137, i64 noundef 0, i64 noundef %141) #3
  br label %143

143:                                              ; preds = %59, %53, %44, %.loopexit
  %.1 = phi i64 [ %51, %44 ], [ %57, %53 ], [ %64, %59 ], [ %.038, %.loopexit ]
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %.not55 = icmp eq ptr %144, null
  br i1 %.not55, label %150, label %145

145:                                              ; preds = %143
  %146 = load ptr, ptr @gBS, align 8, !tbaa !5
  %147 = getelementptr inbounds i8, ptr %146, i64 112
  %148 = load ptr, ptr %147, align 8, !tbaa !61
  %149 = call i64 %148(ptr noundef nonnull %144) #3
  br label %150

150:                                              ; preds = %145, %143
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %.not56 = icmp eq ptr %151, null
  br i1 %.not56, label %157, label %152

152:                                              ; preds = %150
  %153 = load ptr, ptr @gBS, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i64 112
  %155 = load ptr, ptr %154, align 8, !tbaa !61
  %156 = call i64 %155(ptr noundef nonnull %151) #3
  br label %157

157:                                              ; preds = %1, %150, %152, %38, %28, %25, %22, %37
  %.0 = phi i64 [ 0, %37 ], [ -9223372036854775794, %1 ], [ -9223372036854775787, %22 ], [ -9223372036854775790, %25 ], [ -9223372036854775790, %28 ], [ %42, %38 ], [ %.1, %152 ], [ %.1, %150 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret i64 %.0
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 352}
!10 = !{!"_PXEBC_PRIVATE_DATA", !11, i64 0, !6, i64 8, !6, i64 16, !12, 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, !14, i64 248, !15, i64 360, !6, i64 376, !6, i64 384, !16, i64 392, !11, i64 10816, !11, i64 10820, !11, i64 10824, !13, i64 10832, !21, i64 10840, !23, i64 10876, !24, i64 10928, !25, i64 10956, !6, i64 11008, !6, i64 11016, !26, i64 11024, !26, 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, !18, i64 11140, !11, i64 11144, !11, i64 11148, !11, i64 11152, !6, i64 11160, !13, i64 11168, !13, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !6, i64 16176, !27, i64 16184, !11, i64 16436, !11, i64 16440, !7, i64 16448, !11, i64 43072, !7, i64 43076, !7, i64 43108}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_PXEBC_PRIVATE_PROTOCOL", !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104}
!15 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !13, i64 0, !6, i64 8}
!16 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !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, !17, i64 8884, !11, i64 9016, !7, i64 9020, !11, i64 9404, !7, i64 9408, !19, i64 9792, !20, i64 10296}
!17 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4, !7, i64 8}
!20 = !{!"", !7, i64 0, !7, i64 1}
!21 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !11, i64 8, !11, i64 12, !7, i64 16, !22, i64 17, !22, i64 21, !18, i64 26, !22, i64 28, !18, i64 32}
!22 = !{!"", !7, i64 0}
!23 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !11, i64 8, !11, i64 12, !22, i64 16, !18, i64 32, !22, i64 34, !18, i64 50}
!24 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !22, i64 6, !22, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !11, i64 20, !11, i64 24}
!25 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !22, i64 4, !22, i64 20, !7, i64 36, !7, i64 37, !11, i64 40, !11, i64 44, !11, i64 48}
!26 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!27 = !{!"", !11, i64 0, !11, i64 4, !28, i64 8}
!28 = !{!"", !29, i64 0, !11, i64 236, !7, i64 240}
!29 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !18, i64 8, !18, i64 10, !22, i64 12, !22, i64 16, !22, i64 20, !22, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!30 = !{!16, !7, i64 10}
!31 = !{!7, !7, i64 0}
!32 = !{!16, !7, i64 3}
!33 = !{!34, !7, i64 42}
!34 = !{!"", !7, i64 0, !22, i64 32, !18, i64 36, !18, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !22, i64 43, !22, i64 47, !18, i64 52, !18, i64 54, !18, i64 56, !18, i64 58, !6, i64 64, !7, i64 72, !6, i64 80, !7, i64 88, !6, i64 96, !7, i64 104, !6, i64 112, !7, i64 120}
!35 = !{!11, !11, i64 0}
!36 = !{!34, !6, i64 96}
!37 = !{!20, !7, i64 0}
!38 = !{!34, !7, i64 104}
!39 = !{!40, !6, i64 80}
!40 = !{!"", !41, i64 0, !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, !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, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!41 = !{!"", !13, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!42 = !{!40, !6, i64 88}
!43 = !{!44, !6, i64 64}
!44 = !{!"", !41, i64 0, !6, i64 24, !11, 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, !13, i64 104, !6, i64 112}
!45 = !{!46, !6, i64 72}
!46 = !{!"_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL", !6, 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}
!47 = !{!48, !11, i64 12}
!48 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !7, i64 20}
!49 = !{!48, !11, i64 16}
!50 = !{!46, !6, i64 56}
!51 = !{!40, !6, i64 120}
!52 = !{!44, !6, i64 48}
!53 = !{!54, !6, i64 8}
!54 = !{!"_EFI_SIMPLE_TEXT_INPUT_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!55 = !{!40, !6, i64 248}
!56 = distinct !{!56, !57}
!57 = !{!"llvm.loop.mustprogress"}
!58 = !{!59, !18, i64 0}
!59 = !{!"", !18, i64 0, !18, i64 2}
!60 = !{!59, !18, i64 2}
!61 = !{!40, !6, i64 112}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass