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

; 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_BOOT_MENU_ENTRY = type { i16, i8, [1 x i8] }
%struct.EFI_SYSTEM_TABLE = type { %struct.EFI_TABLE_HEADER, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%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 }
%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 }

@.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.4 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [38 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

declare zeroext i8 @DebugAssertEnabled() #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcSelectBootMenu(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2) #0 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.EFI_INPUT_KEY, align 2
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca i16, align 2
  %17 = alloca i16, align 2
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca [70 x i8], align 16
  %21 = alloca ptr, align 8
  %22 = alloca [24 x ptr], align 16
  %23 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i8 %2, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 1, 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 2, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 70, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 192, ptr %22) #3
  store i8 0, ptr %19, align 1, !tbaa !9
  store i16 0, ptr %16, align 2, !tbaa !10
  store i8 0, ptr %18, align 1, !tbaa !9
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  store i16 0, ptr %24, align 2, !tbaa !10
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %25, i32 0, i32 31
  %27 = getelementptr inbounds %struct._EFI_PXE_BASE_CODE_PROTOCOL, ptr %26, i32 0, i32 13
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  store ptr %28, ptr %8, align 8, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %29, i32 0, i32 10
  %31 = load i8, ptr %30, align 2, !tbaa !32
  %32 = zext i8 %31 to i32
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %37

34:                                               ; preds = %3
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %35, i32 0, i32 63
  br label %40

37:                                               ; preds = %3
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %38, i32 0, i32 64
  br label %40

40:                                               ; preds = %37, %34
  %41 = phi ptr [ %36, %34 ], [ %39, %37 ]
  store ptr %41, ptr %9, align 8, !tbaa !5
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.EFI_PXE_BASE_CODE_MODE, ptr %42, i32 0, i32 3
  %44 = load i8, ptr %43, align 1, !tbaa !33
  %45 = zext i8 %44 to i32
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %51

47:                                               ; preds = %40
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 8, !tbaa !9
  br label %55

51:                                               ; preds = %40
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 8, !tbaa !9
  br label %55

55:                                               ; preds = %51, %47
  %56 = phi i32 [ %50, %47 ], [ %54, %51 ]
  store i32 %56, ptr %12, align 4, !tbaa !34
  br label %57

57:                                               ; preds = %55
  %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 %8, 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 !33
  %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 302, 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
  br label %70

70:                                               ; preds = %69
  %71 = call zeroext i8 @DebugAssertEnabled()
  %72 = icmp ne i8 %71, 0
  br i1 %72, label %73, label %81

73:                                               ; preds = %70
  %74 = load i32, ptr %12, align 4, !tbaa !34
  %75 = icmp eq i32 %74, 4
  br i1 %75, label %80, label %76

76:                                               ; preds = %73
  %77 = load i32, ptr %12, align 4, !tbaa !34
  %78 = icmp eq i32 %77, 1
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 303, ptr noundef @.str.4)
  br label %80

80:                                               ; preds = %79, %76, %73
  br label %81

81:                                               ; preds = %80, %70
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.PXEBC_DHCP4_PACKET_CACHE, ptr %84, i32 0, i32 3
  store ptr %85, ptr %10, align 8, !tbaa !5
  %86 = load ptr, ptr %10, 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 !34
  %90 = and i32 %89, 512
  %91 = icmp eq i32 %90, 512
  br i1 %91, label %93, label %92

92:                                               ; preds = %83
  store i64 0, ptr %4, align 8
  store i32 1, ptr %23, align 4
  br label %506

93:                                               ; preds = %83
  %94 = getelementptr inbounds [70 x i8], ptr %20, i64 0, i64 0
  %95 = call ptr @SetMem(ptr noundef %94, i64 noundef 70, i8 noundef zeroext 32)
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %96, i32 0, i32 16
  %98 = load i8, ptr %97, align 8, !tbaa !35
  store i8 %98, ptr %13, align 1, !tbaa !9
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %99, i32 0, i32 15
  %101 = load ptr, ptr %100, align 8, !tbaa !37
  store ptr %101, ptr %21, align 8, !tbaa !5
  %102 = load i8, ptr %13, align 1, !tbaa !9
  %103 = zext i8 %102 to i32
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %93
  store i64 -9223372036854775801, ptr %4, align 8
  store i32 1, ptr %23, align 4
  br label %506

106:                                              ; preds = %93
  br label %107

107:                                              ; preds = %128, %106
  %108 = load i8, ptr %13, align 1, !tbaa !9
  %109 = zext i8 %108 to i32
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %111, label %115

111:                                              ; preds = %107
  %112 = load i8, ptr %18, align 1, !tbaa !9
  %113 = zext i8 %112 to i32
  %114 = icmp slt i32 %113, 24
  br label %115

115:                                              ; preds = %111, %107
  %116 = phi i1 [ false, %107 ], [ %114, %111 ]
  br i1 %116, label %117, label %152

117:                                              ; preds = %115
  br label %118

118:                                              ; preds = %117
  %119 = call zeroext i8 @DebugAssertEnabled()
  %120 = icmp ne i8 %119, 0
  br i1 %120, label %121, label %126

121:                                              ; preds = %118
  %122 = load ptr, ptr %21, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %125, label %124

124:                                              ; preds = %121
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 323, ptr noundef @.str.5)
  br label %125

125:                                              ; preds = %124, %121
  br label %126

126:                                              ; preds = %125, %118
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %21, align 8, !tbaa !5
  %130 = load i8, ptr %18, align 1, !tbaa !9
  %131 = zext i8 %130 to i64
  %132 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %131
  store ptr %129, ptr %132, align 8, !tbaa !5
  %133 = load i8, ptr %13, align 1, !tbaa !9
  %134 = zext i8 %133 to i32
  %135 = load ptr, ptr %21, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %135, i32 0, i32 1
  %137 = load i8, ptr %136, align 1, !tbaa !38
  %138 = zext i8 %137 to i32
  %139 = add nsw i32 %138, 3
  %140 = sub nsw i32 %134, %139
  %141 = trunc i32 %140 to i8
  store i8 %141, ptr %13, align 1, !tbaa !9
  %142 = load ptr, ptr %21, align 8, !tbaa !5
  %143 = load ptr, ptr %21, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %143, i32 0, i32 1
  %145 = load i8, ptr %144, align 1, !tbaa !38
  %146 = zext i8 %145 to i32
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i8, ptr %142, i64 %147
  %149 = getelementptr inbounds i8, ptr %148, i64 3
  store ptr %149, ptr %21, align 8, !tbaa !5
  %150 = load i8, ptr %18, align 1, !tbaa !9
  %151 = add i8 %150, 1
  store i8 %151, ptr %18, align 1, !tbaa !9
  br label %107, !llvm.loop !40

152:                                              ; preds = %115
  %153 = load i8, ptr %7, align 1, !tbaa !9
  %154 = icmp ne i8 %153, 0
  br i1 %154, label %155, label %177

155:                                              ; preds = %152
  br label %156

156:                                              ; preds = %155
  %157 = call zeroext i8 @DebugAssertEnabled()
  %158 = icmp ne i8 %157, 0
  br i1 %158, label %159, label %165

159:                                              ; preds = %156
  %160 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 0
  %161 = load ptr, ptr %160, align 16, !tbaa !5
  %162 = icmp ne ptr %161, null
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 331, ptr noundef @.str.6)
  br label %164

164:                                              ; preds = %163, %159
  br label %165

165:                                              ; preds = %164, %156
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 0
  %170 = load ptr, ptr %169, align 16, !tbaa !5
  %171 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %170, i32 0, i32 0
  %172 = call ptr @CopyMem(ptr noundef %168, ptr noundef %171, i64 noundef 2)
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = load i16, ptr %173, align 2, !tbaa !10
  %175 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %174)
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  store i16 %175, ptr %176, align 2, !tbaa !10
  store i64 0, ptr %4, align 8
  store i32 1, ptr %23, align 4
  br label %506

177:                                              ; preds = %152
  %178 = load i8, ptr %18, align 1, !tbaa !9
  store i8 %178, ptr %14, align 1, !tbaa !9
  store i8 0, ptr %18, align 1, !tbaa !9
  br label %179

179:                                              ; preds = %212, %177
  %180 = load i8, ptr %18, align 1, !tbaa !9
  %181 = zext i8 %180 to i32
  %182 = load i8, ptr %14, align 1, !tbaa !9
  %183 = zext i8 %182 to i32
  %184 = icmp slt i32 %181, %183
  br i1 %184, label %185, label %215

185:                                              ; preds = %179
  br label %186

186:                                              ; preds = %185
  %187 = call zeroext i8 @DebugAssertEnabled()
  %188 = icmp ne i8 %187, 0
  br i1 %188, label %189, label %197

189:                                              ; preds = %186
  %190 = load i8, ptr %18, align 1, !tbaa !9
  %191 = zext i8 %190 to i64
  %192 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %191
  %193 = load ptr, ptr %192, align 8, !tbaa !5
  %194 = icmp ne ptr %193, null
  br i1 %194, label %196, label %195

195:                                              ; preds = %189
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 340, ptr noundef @.str.7)
  br label %196

196:                                              ; preds = %195, %189
  br label %197

197:                                              ; preds = %196, %186
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198
  %200 = load i8, ptr %18, align 1, !tbaa !9
  %201 = zext i8 %200 to i64
  %202 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %201
  %203 = load ptr, ptr %202, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %203, i32 0, i32 2
  %205 = getelementptr inbounds [1 x i8], ptr %204, i64 0, i64 0
  %206 = load i8, ptr %18, align 1, !tbaa !9
  %207 = zext i8 %206 to i64
  %208 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %207
  %209 = load ptr, ptr %208, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %209, i32 0, i32 1
  %211 = load i8, ptr %210, align 1, !tbaa !38
  call void @PxeBcDisplayBootItem(ptr noundef %205, i8 noundef zeroext %211)
  br label %212

212:                                              ; preds = %199
  %213 = load i8, ptr %18, align 1, !tbaa !9
  %214 = add i8 %213, 1
  store i8 %214, ptr %18, align 1, !tbaa !9
  br label %179, !llvm.loop !42

215:                                              ; preds = %179
  %216 = load ptr, ptr @gST, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %216, i32 0, i32 6
  %218 = load ptr, ptr %217, align 8, !tbaa !43
  %219 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %218, i32 0, i32 9
  %220 = load ptr, ptr %219, align 8, !tbaa !46
  %221 = getelementptr inbounds %struct.EFI_SIMPLE_TEXT_OUTPUT_MODE, ptr %220, i32 0, i32 4
  %222 = load i32, ptr %221, align 4, !tbaa !48
  %223 = load i8, ptr %14, align 1, !tbaa !9
  %224 = zext i8 %223 to i32
  %225 = sub nsw i32 %222, %224
  store i32 %225, ptr %15, align 4, !tbaa !34
  br label %226

226:                                              ; preds = %464, %215
  %227 = load ptr, ptr @gST, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %227, i32 0, i32 6
  %229 = load ptr, ptr %228, align 8, !tbaa !43
  %230 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %229, i32 0, i32 5
  %231 = load ptr, ptr %230, align 8, !tbaa !50
  %232 = load ptr, ptr @gST, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %232, i32 0, i32 6
  %234 = load ptr, ptr %233, align 8, !tbaa !43
  %235 = call i64 %231(ptr noundef %234, i64 noundef 112)
  %236 = load ptr, ptr @gST, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %236, i32 0, i32 6
  %238 = load ptr, ptr %237, align 8, !tbaa !43
  %239 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %238, i32 0, i32 7
  %240 = load ptr, ptr %239, align 8, !tbaa !51
  %241 = load ptr, ptr @gST, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %241, i32 0, i32 6
  %243 = load ptr, ptr %242, align 8, !tbaa !43
  %244 = load i32, ptr %15, align 4, !tbaa !34
  %245 = load i16, ptr %16, align 2, !tbaa !10
  %246 = zext i16 %245 to i32
  %247 = add nsw i32 %244, %246
  %248 = sext i32 %247 to i64
  %249 = call i64 %240(ptr noundef %243, i64 noundef 0, i64 noundef %248)
  br label %250

250:                                              ; preds = %226
  %251 = call zeroext i8 @DebugAssertEnabled()
  %252 = icmp ne i8 %251, 0
  br i1 %252, label %253, label %259

253:                                              ; preds = %250
  %254 = load i16, ptr %16, align 2, !tbaa !10
  %255 = zext i16 %254 to i32
  %256 = icmp slt i32 %255, 24
  br i1 %256, label %258, label %257

257:                                              ; preds = %253
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 355, ptr noundef @.str.8)
  br label %258

258:                                              ; preds = %257, %253
  br label %259

259:                                              ; preds = %258, %250
  br label %260

260:                                              ; preds = %259
  br label %261

261:                                              ; preds = %260
  br label %262

262:                                              ; preds = %261
  %263 = call zeroext i8 @DebugAssertEnabled()
  %264 = icmp ne i8 %263, 0
  br i1 %264, label %265, label %273

265:                                              ; preds = %262
  %266 = load i16, ptr %16, align 2, !tbaa !10
  %267 = zext i16 %266 to i64
  %268 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %267
  %269 = load ptr, ptr %268, align 8, !tbaa !5
  %270 = icmp ne ptr %269, null
  br i1 %270, label %272, label %271

271:                                              ; preds = %265
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 356, ptr noundef @.str.9)
  br label %272

272:                                              ; preds = %271, %265
  br label %273

273:                                              ; preds = %272, %262
  br label %274

274:                                              ; preds = %273
  br label %275

275:                                              ; preds = %274
  %276 = load i16, ptr %16, align 2, !tbaa !10
  %277 = zext i16 %276 to i64
  %278 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %277
  %279 = load ptr, ptr %278, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %279, i32 0, i32 1
  %281 = load i8, ptr %280, align 1, !tbaa !38
  %282 = zext i8 %281 to i64
  %283 = getelementptr inbounds [70 x i8], ptr %20, i64 0, i64 %282
  store i8 0, ptr %283, align 1, !tbaa !9
  %284 = getelementptr inbounds [70 x i8], ptr %20, i64 0, i64 0
  %285 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.10, ptr noundef %284)
  %286 = load i16, ptr %16, align 2, !tbaa !10
  %287 = zext i16 %286 to i64
  %288 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %287
  %289 = load ptr, ptr %288, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %289, i32 0, i32 2
  %291 = getelementptr inbounds [1 x i8], ptr %290, i64 0, i64 0
  %292 = load i16, ptr %16, align 2, !tbaa !10
  %293 = zext i16 %292 to i64
  %294 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %293
  %295 = load ptr, ptr %294, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %295, i32 0, i32 1
  %297 = load i8, ptr %296, align 1, !tbaa !38
  call void @PxeBcDisplayBootItem(ptr noundef %291, i8 noundef zeroext %297)
  %298 = load ptr, ptr @gST, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %298, i32 0, i32 6
  %300 = load ptr, ptr %299, align 8, !tbaa !43
  %301 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %300, i32 0, i32 7
  %302 = load ptr, ptr %301, align 8, !tbaa !51
  %303 = load ptr, ptr @gST, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %303, i32 0, i32 6
  %305 = load ptr, ptr %304, align 8, !tbaa !43
  %306 = load i32, ptr %15, align 4, !tbaa !34
  %307 = load i8, ptr %14, align 1, !tbaa !9
  %308 = zext i8 %307 to i32
  %309 = add nsw i32 %306, %308
  %310 = sext i32 %309 to i64
  %311 = call i64 %302(ptr noundef %305, i64 noundef 0, i64 noundef %310)
  %312 = load i16, ptr %16, align 2, !tbaa !10
  store i16 %312, ptr %17, align 2, !tbaa !10
  br label %313

313:                                              ; preds = %324, %275
  %314 = load ptr, ptr @gST, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %314, i32 0, i32 4
  %316 = load ptr, ptr %315, align 8, !tbaa !52
  %317 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_INPUT_PROTOCOL, ptr %316, i32 0, i32 1
  %318 = load ptr, ptr %317, align 8, !tbaa !53
  %319 = load ptr, ptr @gST, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %319, i32 0, i32 4
  %321 = load ptr, ptr %320, align 8, !tbaa !52
  %322 = call i64 %318(ptr noundef %321, ptr noundef %11)
  %323 = icmp eq i64 %322, -9223372036854775802
  br i1 %323, label %324, label %329

324:                                              ; preds = %313
  %325 = load ptr, ptr @gBS, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %325, i32 0, i32 29
  %327 = load ptr, ptr %326, align 8, !tbaa !55
  %328 = call i64 %327(i64 noundef 100000)
  br label %313, !llvm.loop !57

329:                                              ; preds = %313
  %330 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %11, i32 0, i32 0
  %331 = load i16, ptr %330, align 2, !tbaa !58
  %332 = zext i16 %331 to i32
  %333 = icmp eq i32 %332, 0
  br i1 %333, label %334, label %348

334:                                              ; preds = %329
  %335 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %11, i32 0, i32 1
  %336 = load i16, ptr %335, align 2, !tbaa !60
  %337 = zext i16 %336 to i32
  switch i32 %337, label %345 [
    i32 3, label %338
    i32 10, label %340
    i32 13, label %340
    i32 9, label %341
    i32 32, label %341
    i32 100, label %341
    i32 68, label %341
    i32 8, label %343
    i32 117, label %343
    i32 85, label %343
  ]

338:                                              ; preds = %334
  %339 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %11, i32 0, i32 0
  store i16 23, ptr %339, align 2, !tbaa !58
  br label %347

340:                                              ; preds = %334, %334
  store i8 1, ptr %19, align 1, !tbaa !9
  br label %347

341:                                              ; preds = %334, %334, %334, %334
  %342 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %11, i32 0, i32 0
  store i16 2, ptr %342, align 2, !tbaa !58
  br label %347

343:                                              ; preds = %334, %334, %334
  %344 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %11, i32 0, i32 0
  store i16 1, ptr %344, align 2, !tbaa !58
  br label %347

345:                                              ; preds = %334
  %346 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %11, i32 0, i32 0
  store i16 0, ptr %346, align 2, !tbaa !58
  br label %347

347:                                              ; preds = %345, %343, %341, %340, %338
  br label %348

348:                                              ; preds = %347, %329
  %349 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %11, i32 0, i32 0
  %350 = load i16, ptr %349, align 2, !tbaa !58
  %351 = zext i16 %350 to i32
  switch i32 %351, label %378 [
    i32 4, label %352
    i32 1, label %352
    i32 2, label %360
    i32 3, label %360
    i32 9, label %371
    i32 5, label %371
    i32 10, label %372
    i32 6, label %372
    i32 23, label %377
  ]

352:                                              ; preds = %348, %348
  %353 = load i16, ptr %16, align 2, !tbaa !10
  %354 = zext i16 %353 to i32
  %355 = icmp ne i32 %354, 0
  br i1 %355, label %356, label %359

356:                                              ; preds = %352
  %357 = load i16, ptr %16, align 2, !tbaa !10
  %358 = add i16 %357, -1
  store i16 %358, ptr %16, align 2, !tbaa !10
  br label %359

359:                                              ; preds = %356, %352
  br label %378

360:                                              ; preds = %348, %348
  %361 = load i16, ptr %16, align 2, !tbaa !10
  %362 = add i16 %361, 1
  store i16 %362, ptr %16, align 2, !tbaa !10
  %363 = zext i16 %362 to i32
  %364 = load i8, ptr %14, align 1, !tbaa !9
  %365 = zext i8 %364 to i32
  %366 = icmp eq i32 %363, %365
  br i1 %366, label %367, label %370

367:                                              ; preds = %360
  %368 = load i16, ptr %16, align 2, !tbaa !10
  %369 = add i16 %368, -1
  store i16 %369, ptr %16, align 2, !tbaa !10
  br label %370

370:                                              ; preds = %367, %360
  br label %378

371:                                              ; preds = %348, %348
  store i16 0, ptr %16, align 2, !tbaa !10
  br label %378

372:                                              ; preds = %348, %348
  %373 = load i8, ptr %14, align 1, !tbaa !9
  %374 = zext i8 %373 to i32
  %375 = sub nsw i32 %374, 1
  %376 = trunc i32 %375 to i16
  store i16 %376, ptr %16, align 2, !tbaa !10
  br label %378

377:                                              ; preds = %348
  store i64 -9223372036854775787, ptr %4, align 8
  store i32 1, ptr %23, align 4
  br label %506

378:                                              ; preds = %372, %371, %370, %359, %348
  %379 = load ptr, ptr @gST, align 8, !tbaa !5
  %380 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %379, i32 0, i32 6
  %381 = load ptr, ptr %380, align 8, !tbaa !43
  %382 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %381, i32 0, i32 5
  %383 = load ptr, ptr %382, align 8, !tbaa !50
  %384 = load ptr, ptr @gST, align 8, !tbaa !5
  %385 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %384, i32 0, i32 6
  %386 = load ptr, ptr %385, align 8, !tbaa !43
  %387 = call i64 %383(ptr noundef %386, i64 noundef 7)
  %388 = load ptr, ptr @gST, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %388, i32 0, i32 6
  %390 = load ptr, ptr %389, align 8, !tbaa !43
  %391 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %390, i32 0, i32 7
  %392 = load ptr, ptr %391, align 8, !tbaa !51
  %393 = load ptr, ptr @gST, align 8, !tbaa !5
  %394 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %393, i32 0, i32 6
  %395 = load ptr, ptr %394, align 8, !tbaa !43
  %396 = load i32, ptr %15, align 4, !tbaa !34
  %397 = load i16, ptr %17, align 2, !tbaa !10
  %398 = zext i16 %397 to i32
  %399 = add nsw i32 %396, %398
  %400 = sext i32 %399 to i64
  %401 = call i64 %392(ptr noundef %395, i64 noundef 0, i64 noundef %400)
  br label %402

402:                                              ; preds = %378
  %403 = call zeroext i8 @DebugAssertEnabled()
  %404 = icmp ne i8 %403, 0
  br i1 %404, label %405, label %411

405:                                              ; preds = %402
  %406 = load i16, ptr %17, align 2, !tbaa !10
  %407 = zext i16 %406 to i32
  %408 = icmp slt i32 %407, 24
  br i1 %408, label %410, label %409

409:                                              ; preds = %405
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 430, ptr noundef @.str.11)
  br label %410

410:                                              ; preds = %409, %405
  br label %411

411:                                              ; preds = %410, %402
  br label %412

412:                                              ; preds = %411
  br label %413

413:                                              ; preds = %412
  br label %414

414:                                              ; preds = %413
  %415 = call zeroext i8 @DebugAssertEnabled()
  %416 = icmp ne i8 %415, 0
  br i1 %416, label %417, label %425

417:                                              ; preds = %414
  %418 = load i16, ptr %17, align 2, !tbaa !10
  %419 = zext i16 %418 to i64
  %420 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %419
  %421 = load ptr, ptr %420, align 8, !tbaa !5
  %422 = icmp ne ptr %421, null
  br i1 %422, label %424, label %423

423:                                              ; preds = %417
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 431, ptr noundef @.str.12)
  br label %424

424:                                              ; preds = %423, %417
  br label %425

425:                                              ; preds = %424, %414
  br label %426

426:                                              ; preds = %425
  br label %427

427:                                              ; preds = %426
  %428 = load i16, ptr %17, align 2, !tbaa !10
  %429 = zext i16 %428 to i64
  %430 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %429
  %431 = load ptr, ptr %430, align 8, !tbaa !5
  %432 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %431, i32 0, i32 1
  %433 = load i8, ptr %432, align 1, !tbaa !38
  %434 = zext i8 %433 to i64
  %435 = getelementptr inbounds [70 x i8], ptr %20, i64 0, i64 %434
  store i8 0, ptr %435, align 1, !tbaa !9
  %436 = getelementptr inbounds [70 x i8], ptr %20, i64 0, i64 0
  %437 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.10, ptr noundef %436)
  %438 = load i16, ptr %17, align 2, !tbaa !10
  %439 = zext i16 %438 to i64
  %440 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %439
  %441 = load ptr, ptr %440, align 8, !tbaa !5
  %442 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %441, i32 0, i32 2
  %443 = getelementptr inbounds [1 x i8], ptr %442, i64 0, i64 0
  %444 = load i16, ptr %17, align 2, !tbaa !10
  %445 = zext i16 %444 to i64
  %446 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %445
  %447 = load ptr, ptr %446, align 8, !tbaa !5
  %448 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %447, i32 0, i32 1
  %449 = load i8, ptr %448, align 1, !tbaa !38
  call void @PxeBcDisplayBootItem(ptr noundef %443, i8 noundef zeroext %449)
  %450 = load ptr, ptr @gST, align 8, !tbaa !5
  %451 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %450, i32 0, i32 6
  %452 = load ptr, ptr %451, align 8, !tbaa !43
  %453 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %452, i32 0, i32 7
  %454 = load ptr, ptr %453, align 8, !tbaa !51
  %455 = load ptr, ptr @gST, align 8, !tbaa !5
  %456 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %455, i32 0, i32 6
  %457 = load ptr, ptr %456, align 8, !tbaa !43
  %458 = load i32, ptr %15, align 4, !tbaa !34
  %459 = load i8, ptr %14, align 1, !tbaa !9
  %460 = zext i8 %459 to i32
  %461 = add nsw i32 %458, %460
  %462 = sext i32 %461 to i64
  %463 = call i64 %454(ptr noundef %457, i64 noundef 0, i64 noundef %462)
  br label %464

464:                                              ; preds = %427
  %465 = load i8, ptr %19, align 1, !tbaa !9
  %466 = icmp ne i8 %465, 0
  %467 = xor i1 %466, true
  br i1 %467, label %226, label %468, !llvm.loop !61

468:                                              ; preds = %464
  br label %469

469:                                              ; preds = %468
  %470 = call zeroext i8 @DebugAssertEnabled()
  %471 = icmp ne i8 %470, 0
  br i1 %471, label %472, label %478

472:                                              ; preds = %469
  %473 = load i16, ptr %16, align 2, !tbaa !10
  %474 = zext i16 %473 to i32
  %475 = icmp slt i32 %474, 24
  br i1 %475, label %477, label %476

476:                                              ; preds = %472
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 441, ptr noundef @.str.8)
  br label %477

477:                                              ; preds = %476, %472
  br label %478

478:                                              ; preds = %477, %469
  br label %479

479:                                              ; preds = %478
  br label %480

480:                                              ; preds = %479
  br label %481

481:                                              ; preds = %480
  %482 = call zeroext i8 @DebugAssertEnabled()
  %483 = icmp ne i8 %482, 0
  br i1 %483, label %484, label %492

484:                                              ; preds = %481
  %485 = load i16, ptr %16, align 2, !tbaa !10
  %486 = zext i16 %485 to i64
  %487 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %486
  %488 = load ptr, ptr %487, align 8, !tbaa !5
  %489 = icmp ne ptr %488, null
  br i1 %489, label %491, label %490

490:                                              ; preds = %484
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 442, ptr noundef @.str.9)
  br label %491

491:                                              ; preds = %490, %484
  br label %492

492:                                              ; preds = %491, %481
  br label %493

493:                                              ; preds = %492
  br label %494

494:                                              ; preds = %493
  %495 = load ptr, ptr %6, align 8, !tbaa !5
  %496 = load i16, ptr %16, align 2, !tbaa !10
  %497 = zext i16 %496 to i64
  %498 = getelementptr inbounds [24 x ptr], ptr %22, i64 0, i64 %497
  %499 = load ptr, ptr %498, align 8, !tbaa !5
  %500 = getelementptr inbounds %struct.PXEBC_BOOT_MENU_ENTRY, ptr %499, i32 0, i32 0
  %501 = call ptr @CopyMem(ptr noundef %495, ptr noundef %500, i64 noundef 2)
  %502 = load ptr, ptr %6, align 8, !tbaa !5
  %503 = load i16, ptr %502, align 2, !tbaa !10
  %504 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %503)
  %505 = load ptr, ptr %6, align 8, !tbaa !5
  store i16 %504, ptr %505, align 2, !tbaa !10
  store i64 0, ptr %4, align 8
  store i32 1, ptr %23, align 4
  br label %506

506:                                              ; preds = %494, %377, %167, %105, %92
  call void @llvm.lifetime.end.p0(i64 192, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 70, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 2, 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 1, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %507 = load i64, ptr %4, align 8
  ret i64 %507
}

declare ptr @SetMem(ptr noundef, i64 noundef, i8 noundef zeroext) #2

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

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) #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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !7, i64 0}
!12 = !{!13, !6, i64 352}
!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, !17, i64 248, !18, i64 360, !6, i64 376, !6, i64 384, !19, i64 392, !14, i64 10816, !14, i64 10820, !14, i64 10824, !16, 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, !11, i64 11140, !14, i64 11144, !14, i64 11148, !14, i64 11152, !6, i64 11160, !16, i64 11168, !16, 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", !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !16, 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}
!18 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !16, i64 0, !6, i64 8}
!19 = !{!"", !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, !20, i64 8884, !14, i64 9016, !7, i64 9020, !14, i64 9404, !7, i64 9408, !21, i64 9792, !22, i64 10296}
!20 = !{!"", !7, i64 0, !7, i64 1, !11, i64 2, !7, i64 4}
!21 = !{!"", !7, i64 0, !7, i64 1, !11, 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, !11, i64 26, !24, i64 28, !11, 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, !11, i64 32, !24, i64 34, !11, 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, !16, 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, !11, i64 8, !11, i64 10, !24, i64 12, !24, i64 16, !24, i64 20, !24, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!32 = !{!19, !7, i64 10}
!33 = !{!19, !7, i64 3}
!34 = !{!14, !14, i64 0}
!35 = !{!36, !7, i64 88}
!36 = !{!"", !7, i64 0, !24, i64 32, !11, i64 36, !11, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !24, i64 43, !24, i64 47, !11, i64 52, !11, i64 54, !11, i64 56, !11, 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}
!37 = !{!36, !6, i64 80}
!38 = !{!39, !7, i64 2}
!39 = !{!"", !11, i64 0, !7, i64 2, !7, i64 3}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = distinct !{!42, !41}
!43 = !{!44, !6, i64 64}
!44 = !{!"", !45, i64 0, !6, i64 24, !14, 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, !16, i64 104, !6, i64 112}
!45 = !{!"", !16, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!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, !14, i64 16}
!49 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !7, i64 20}
!50 = !{!47, !6, i64 40}
!51 = !{!47, !6, i64 56}
!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 = !{!56, !6, i64 248}
!56 = !{!"", !45, 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}
!57 = distinct !{!57, !41}
!58 = !{!59, !11, i64 0}
!59 = !{!"", !11, i64 0, !11, i64 2}
!60 = !{!59, !11, i64 2}
!61 = distinct !{!61, !41}


; 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.4 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [38 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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775801, 1) i64 @PxeBcSelectBootMenu(ptr nocapture noundef readonly %0, ptr noundef %1, i8 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = alloca %struct.EFI_INPUT_KEY, align 2
  %5 = alloca [70 x i8], align 16
  %6 = alloca [24 x ptr], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 70, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %6) #4
  store i16 0, ptr %1, align 2, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 352
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %8, i64 10
  %10 = load i8, ptr %9, align 2, !tbaa !30
  %.not = icmp eq i8 %10, 0
  %.v = select i1 %.not, i64 12848, i64 11184
  %11 = getelementptr inbounds i8, ptr %0, i64 %.v
  %.in = getelementptr inbounds i8, ptr %11, i64 1472
  %12 = load i32, ptr %.in, align 8, !tbaa !31
  %13 = tail call zeroext i8 @DebugAssertEnabled() #4
  %.not95 = icmp eq i8 %13, 0
  br i1 %.not95, label %18, label %14

14:                                               ; preds = %3
  %15 = getelementptr inbounds i8, ptr %8, i64 3
  %16 = load i8, ptr %15, align 1, !tbaa !32
  %.not96 = icmp eq i8 %16, 0
  br i1 %.not96, label %18, label %17

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

18:                                               ; preds = %3, %17, %14
  %19 = tail call zeroext i8 @DebugAssertEnabled() #4
  %.not97 = icmp eq i8 %19, 0
  br i1 %.not97, label %22, label %20

20:                                               ; preds = %18
  switch i32 %12, label %21 [
    i32 4, label %22
    i32 1, label %22
  ]

21:                                               ; preds = %20
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 303, ptr noundef nonnull @.str.4) #4
  br label %22

22:                                               ; preds = %20, %20, %21, %18
  %23 = getelementptr inbounds i8, ptr %11, i64 1536
  %24 = load i32, ptr %23, align 8, !tbaa !33
  %25 = and i32 %24, 512
  %.not98 = icmp eq i32 %25, 0
  br i1 %.not98, label %.loopexit, label %26

26:                                               ; preds = %22
  %27 = call ptr @SetMem(ptr noundef nonnull %5, i64 noundef 70, i8 noundef zeroext 32) #4
  %28 = getelementptr inbounds i8, ptr %11, i64 1624
  %29 = load i8, ptr %28, align 8, !tbaa !34
  %30 = icmp eq i8 %29, 0
  br i1 %30, label %.loopexit, label %.preheader123.preheader

.preheader123.preheader:                          ; preds = %26
  %31 = getelementptr inbounds i8, ptr %11, i64 1616
  %32 = load ptr, ptr %31, align 8, !tbaa !36
  br label %.preheader123

.preheader123:                                    ; preds = %.preheader123.preheader, %37
  %indvars.iv133 = phi i8 [ 1, %.preheader123.preheader ], [ %indvars.iv.next134, %37 ]
  %indvars.iv = phi i64 [ 0, %.preheader123.preheader ], [ %indvars.iv.next, %37 ]
  %.0127 = phi ptr [ %32, %.preheader123.preheader ], [ %44, %37 ]
  %.091125 = phi i8 [ %29, %.preheader123.preheader ], [ %41, %37 ]
  %33 = call zeroext i8 @DebugAssertEnabled() #4
  %34 = icmp eq i8 %33, 0
  %35 = icmp ne ptr %.0127, null
  %or.cond3 = select i1 %34, i1 true, i1 %35
  br i1 %or.cond3, label %37, label %36

36:                                               ; preds = %.preheader123
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 323, ptr noundef nonnull @.str.5) #4
  br label %37

37:                                               ; preds = %36, %.preheader123
  %38 = getelementptr inbounds [24 x ptr], ptr %6, i64 0, i64 %indvars.iv
  store ptr %.0127, ptr %38, align 8, !tbaa !37
  %39 = getelementptr inbounds i8, ptr %.0127, i64 2
  %40 = load i8, ptr %39, align 1, !tbaa !38
  %.neg122 = add i8 %.091125, -3
  %41 = sub i8 %.neg122, %40
  %42 = zext i8 %40 to i64
  %43 = getelementptr inbounds i8, ptr %.0127, i64 %42
  %44 = getelementptr inbounds i8, ptr %43, i64 3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = icmp ne i8 %41, 0
  %46 = icmp ult i64 %indvars.iv, 23
  %47 = select i1 %45, i1 %46, i1 false
  %indvars.iv.next134 = add nuw nsw i8 %indvars.iv133, 1
  br i1 %47, label %.preheader123, label %48, !llvm.loop !40

48:                                               ; preds = %37
  %49 = trunc i64 %indvars.iv to i16
  %50 = trunc i64 %indvars.iv.next to i16
  %51 = trunc i64 %indvars.iv.next to i32
  %52 = and i32 %51, 255
  %.not99 = icmp eq i8 %2, 0
  br i1 %.not99, label %.preheader.preheader, label %53

.preheader.preheader:                             ; preds = %48
  %wide.trip.count = zext nneg i8 %indvars.iv133 to i64
  br label %.preheader

53:                                               ; preds = %48
  %54 = call zeroext i8 @DebugAssertEnabled() #4
  %55 = icmp eq i8 %54, 0
  %56 = load ptr, ptr %6, align 16
  %57 = icmp ne ptr %56, null
  %or.cond6 = select i1 %55, i1 true, i1 %57
  br i1 %or.cond6, label %.loopexit.sink.split, label %58

58:                                               ; preds = %53
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 331, ptr noundef nonnull @.str.6) #4
  br label %.loopexit.sink.split

.preheader:                                       ; preds = %.preheader.preheader, %.preheader._crit_edge
  %indvars.iv130 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next131, %.preheader._crit_edge ]
  %59 = call zeroext i8 @DebugAssertEnabled() #4
  %.not108 = icmp ne i8 %59, 0
  %.phi.trans.insert = getelementptr inbounds [24 x ptr], ptr %6, i64 0, i64 %indvars.iv130
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !37
  %.not109 = icmp eq ptr %.pre, null
  %or.cond144 = select i1 %.not108, i1 %.not109, i1 false
  br i1 %or.cond144, label %60, label %.preheader._crit_edge

60:                                               ; preds = %.preheader
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 340, ptr noundef nonnull @.str.7) #4
  unreachable

.preheader._crit_edge:                            ; preds = %.preheader
  %61 = getelementptr inbounds i8, ptr %.pre, i64 3
  %62 = getelementptr inbounds i8, ptr %.pre, i64 2
  %63 = load i8, ptr %62, align 1, !tbaa !38
  call void @PxeBcDisplayBootItem(ptr noundef nonnull %61, i8 noundef zeroext %63)
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count
  br i1 %exitcond.not, label %64, label %.preheader, !llvm.loop !42

64:                                               ; preds = %.preheader._crit_edge
  %65 = load ptr, ptr @gST, align 8, !tbaa !37
  %66 = getelementptr inbounds i8, ptr %65, i64 64
  %67 = load ptr, ptr %66, align 8, !tbaa !43
  %68 = getelementptr inbounds i8, ptr %67, i64 72
  %69 = load ptr, ptr %68, align 8, !tbaa !46
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %71 = load i32, ptr %70, align 4, !tbaa !48
  %72 = sub i32 %71, %52
  %73 = sext i32 %71 to i64
  %74 = and i16 %49, 255
  %75 = getelementptr inbounds i8, ptr %4, i64 2
  %76 = and i16 %50, 255
  br label %77

77:                                               ; preds = %160, %64
  %.089 = phi i16 [ 0, %64 ], [ %.190, %160 ]
  %78 = load ptr, ptr @gST, align 8, !tbaa !37
  %79 = getelementptr inbounds i8, ptr %78, i64 64
  %80 = load ptr, ptr %79, align 8, !tbaa !43
  %81 = getelementptr inbounds i8, ptr %80, i64 40
  %82 = load ptr, ptr %81, align 8, !tbaa !50
  %83 = call i64 %82(ptr noundef %80, i64 noundef 112) #4
  %84 = load ptr, ptr @gST, align 8, !tbaa !37
  %85 = getelementptr inbounds i8, ptr %84, i64 64
  %86 = load ptr, ptr %85, align 8, !tbaa !43
  %87 = getelementptr inbounds i8, ptr %86, i64 56
  %88 = load ptr, ptr %87, align 8, !tbaa !51
  %89 = zext i16 %.089 to i32
  %90 = add nsw i32 %72, %89
  %91 = sext i32 %90 to i64
  %92 = call i64 %88(ptr noundef %86, i64 noundef 0, i64 noundef %91) #4
  %93 = call zeroext i8 @DebugAssertEnabled() #4
  %94 = icmp eq i8 %93, 0
  %95 = icmp ult i16 %.089, 24
  %or.cond9 = select i1 %94, i1 true, i1 %95
  br i1 %or.cond9, label %97, label %96

96:                                               ; preds = %77
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 355, ptr noundef nonnull @.str.8) #4
  br label %97

97:                                               ; preds = %77, %96
  %98 = call zeroext i8 @DebugAssertEnabled() #4
  %.not100 = icmp ne i8 %98, 0
  %.phi.trans.insert136 = zext i16 %.089 to i64
  %.phi.trans.insert137 = getelementptr inbounds [24 x ptr], ptr %6, i64 0, i64 %.phi.trans.insert136
  %.pre138 = load ptr, ptr %.phi.trans.insert137, align 8, !tbaa !37
  %.not101 = icmp eq ptr %.pre138, null
  %or.cond145 = select i1 %.not100, i1 %.not101, i1 false
  br i1 %or.cond145, label %99, label %._crit_edge135

99:                                               ; preds = %97
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 356, ptr noundef nonnull @.str.9) #4
  br label %._crit_edge135

._crit_edge135:                                   ; preds = %97, %99
  %100 = phi ptr [ null, %99 ], [ %.pre138, %97 ]
  %101 = getelementptr inbounds i8, ptr %100, i64 2
  %102 = load i8, ptr %101, align 1, !tbaa !38
  %103 = zext i8 %102 to i64
  %104 = getelementptr inbounds [70 x i8], ptr %5, i64 0, i64 %103
  store i8 0, ptr %104, align 1, !tbaa !31
  %105 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.10, ptr noundef nonnull %5) #4
  %106 = getelementptr inbounds i8, ptr %100, i64 3
  %107 = load i8, ptr %101, align 1, !tbaa !38
  call void @PxeBcDisplayBootItem(ptr noundef nonnull %106, i8 noundef zeroext %107)
  %108 = load ptr, ptr @gST, align 8, !tbaa !37
  %109 = getelementptr inbounds i8, ptr %108, i64 64
  %110 = load ptr, ptr %109, align 8, !tbaa !43
  %111 = getelementptr inbounds i8, ptr %110, i64 56
  %112 = load ptr, ptr %111, align 8, !tbaa !51
  %113 = call i64 %112(ptr noundef %110, i64 noundef 0, i64 noundef %73) #4
  %114 = load ptr, ptr @gST, align 8, !tbaa !37
  %115 = getelementptr inbounds i8, ptr %114, i64 48
  %116 = load ptr, ptr %115, align 8, !tbaa !52
  %117 = getelementptr inbounds i8, ptr %116, i64 8
  %118 = load ptr, ptr %117, align 8, !tbaa !53
  %119 = call i64 %118(ptr noundef %116, ptr noundef nonnull %4) #4
  %120 = icmp eq i64 %119, -9223372036854775802
  br i1 %120, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %._crit_edge135, %.lr.ph
  %121 = load ptr, ptr @gBS, align 8, !tbaa !37
  %122 = getelementptr inbounds i8, ptr %121, i64 248
  %123 = load ptr, ptr %122, align 8, !tbaa !55
  %124 = call i64 %123(i64 noundef 100000) #4
  %125 = load ptr, ptr @gST, align 8, !tbaa !37
  %126 = getelementptr inbounds i8, ptr %125, i64 48
  %127 = load ptr, ptr %126, align 8, !tbaa !52
  %128 = getelementptr inbounds i8, ptr %127, i64 8
  %129 = load ptr, ptr %128, align 8, !tbaa !53
  %130 = call i64 %129(ptr noundef %127, ptr noundef nonnull %4) #4
  %131 = icmp eq i64 %130, -9223372036854775802
  br i1 %131, label %.lr.ph, label %._crit_edge, !llvm.loop !57

._crit_edge:                                      ; preds = %.lr.ph, %._crit_edge135
  %132 = load i16, ptr %4, align 2, !tbaa !58
  switch i16 %132, label %.thread [
    i16 0, label %133
    i16 4, label %136
    i16 1, label %136
    i16 2, label %137
    i16 3, label %137
    i16 9, label %140
    i16 5, label %140
    i16 10, label %141
    i16 6, label %141
    i16 23, label %.loopexit
  ]

133:                                              ; preds = %._crit_edge
  %134 = load i16, ptr %75, align 2, !tbaa !60
  switch i16 %134, label %135 [
    i16 3, label %.loopexit
    i16 10, label %.thread
    i16 13, label %.thread
    i16 9, label %.thread116
    i16 32, label %.thread116
    i16 100, label %.thread116
    i16 68, label %.thread116
    i16 8, label %.thread113
    i16 117, label %.thread113
    i16 85, label %.thread113
  ]

.thread116:                                       ; preds = %133, %133, %133, %133
  store i16 2, ptr %4, align 2, !tbaa !58
  br label %137

.thread113:                                       ; preds = %133, %133, %133
  store i16 1, ptr %4, align 2, !tbaa !58
  br label %136

135:                                              ; preds = %133
  store i16 0, ptr %4, align 2, !tbaa !58
  br label %.thread

136:                                              ; preds = %._crit_edge, %._crit_edge, %.thread113
  %spec.select = call i16 @llvm.usub.sat.i16(i16 %.089, i16 1)
  br label %.thread

137:                                              ; preds = %._crit_edge, %._crit_edge, %.thread116
  %138 = add i16 %.089, 1
  %139 = icmp eq i16 %138, %76
  %spec.select110 = select i1 %139, i16 %.089, i16 %138
  br label %.thread

140:                                              ; preds = %._crit_edge, %._crit_edge
  br label %.thread

141:                                              ; preds = %._crit_edge, %._crit_edge
  br label %.thread

.thread:                                          ; preds = %._crit_edge, %135, %133, %133, %137, %136, %141, %140
  %.not105 = phi i1 [ true, %141 ], [ true, %140 ], [ true, %136 ], [ true, %137 ], [ false, %133 ], [ false, %133 ], [ true, %135 ], [ true, %._crit_edge ]
  %.190 = phi i16 [ %74, %141 ], [ 0, %140 ], [ %spec.select, %136 ], [ %spec.select110, %137 ], [ %.089, %133 ], [ %.089, %133 ], [ %.089, %135 ], [ %.089, %._crit_edge ]
  %142 = load ptr, ptr @gST, align 8, !tbaa !37
  %143 = getelementptr inbounds i8, ptr %142, i64 64
  %144 = load ptr, ptr %143, align 8, !tbaa !43
  %145 = getelementptr inbounds i8, ptr %144, i64 40
  %146 = load ptr, ptr %145, align 8, !tbaa !50
  %147 = call i64 %146(ptr noundef %144, i64 noundef 7) #4
  %148 = load ptr, ptr @gST, align 8, !tbaa !37
  %149 = getelementptr inbounds i8, ptr %148, i64 64
  %150 = load ptr, ptr %149, align 8, !tbaa !43
  %151 = getelementptr inbounds i8, ptr %150, i64 56
  %152 = load ptr, ptr %151, align 8, !tbaa !51
  %153 = call i64 %152(ptr noundef %150, i64 noundef 0, i64 noundef %91) #4
  %154 = call zeroext i8 @DebugAssertEnabled() #4
  %155 = icmp eq i8 %154, 0
  %or.cond12 = select i1 %155, i1 true, i1 %95
  br i1 %or.cond12, label %157, label %156

156:                                              ; preds = %.thread
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 430, ptr noundef nonnull @.str.11) #4
  br label %157

157:                                              ; preds = %.thread, %156
  %158 = call zeroext i8 @DebugAssertEnabled() #4
  %.not103 = icmp ne i8 %158, 0
  %.not104 = icmp eq ptr %100, null
  %or.cond = and i1 %.not104, %.not103
  br i1 %or.cond, label %159, label %160

159:                                              ; preds = %157
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 431, ptr noundef nonnull @.str.12) #4
  br label %160

160:                                              ; preds = %159, %157
  %161 = load i8, ptr %101, align 1, !tbaa !38
  %162 = zext i8 %161 to i64
  %163 = getelementptr inbounds [70 x i8], ptr %5, i64 0, i64 %162
  store i8 0, ptr %163, align 1, !tbaa !31
  %164 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.10, ptr noundef nonnull %5) #4
  %165 = load i8, ptr %101, align 1, !tbaa !38
  call void @PxeBcDisplayBootItem(ptr noundef nonnull %106, i8 noundef zeroext %165)
  %166 = load ptr, ptr @gST, align 8, !tbaa !37
  %167 = getelementptr inbounds i8, ptr %166, i64 64
  %168 = load ptr, ptr %167, align 8, !tbaa !43
  %169 = getelementptr inbounds i8, ptr %168, i64 56
  %170 = load ptr, ptr %169, align 8, !tbaa !51
  %171 = call i64 %170(ptr noundef %168, i64 noundef 0, i64 noundef %73) #4
  br i1 %.not105, label %77, label %172, !llvm.loop !61

172:                                              ; preds = %160
  %173 = call zeroext i8 @DebugAssertEnabled() #4
  %174 = icmp eq i8 %173, 0
  %175 = icmp ult i16 %.190, 24
  %or.cond15 = select i1 %174, i1 true, i1 %175
  br i1 %or.cond15, label %177, label %176

176:                                              ; preds = %172
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 441, ptr noundef nonnull @.str.8) #4
  br label %177

177:                                              ; preds = %172, %176
  %178 = call zeroext i8 @DebugAssertEnabled() #4
  %.not106 = icmp ne i8 %178, 0
  %.phi.trans.insert140 = zext i16 %.190 to i64
  %.phi.trans.insert141 = getelementptr inbounds [24 x ptr], ptr %6, i64 0, i64 %.phi.trans.insert140
  %.pre142 = load ptr, ptr %.phi.trans.insert141, align 8, !tbaa !37
  %.not107 = icmp eq ptr %.pre142, null
  %or.cond146 = select i1 %.not106, i1 %.not107, i1 false
  br i1 %or.cond146, label %179, label %.loopexit.sink.split

179:                                              ; preds = %177
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 442, ptr noundef nonnull @.str.9) #4
  br label %.loopexit.sink.split

.loopexit.sink.split:                             ; preds = %179, %177, %53, %58
  %.sink = phi ptr [ %56, %58 ], [ %56, %53 ], [ null, %179 ], [ %.pre142, %177 ]
  %180 = call ptr @CopyMem(ptr noundef nonnull %1, ptr noundef %.sink, i64 noundef 2) #4
  %181 = load i16, ptr %1, align 2, !tbaa !5
  %182 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %181) #4
  store i16 %182, ptr %1, align 2, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %._crit_edge, %133, %.loopexit.sink.split, %26, %22
  %.088 = phi i64 [ 0, %22 ], [ -9223372036854775801, %26 ], [ 0, %.loopexit.sink.split ], [ -9223372036854775787, %133 ], [ -9223372036854775787, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 70, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  ret i64 %.088
}

declare ptr @SetMem(ptr noundef, i64 noundef, i8 noundef zeroext) local_unnamed_addr #2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.usub.sat.i16(i16, i16) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 352}
!10 = !{!"_PXEBC_PRIVATE_DATA", !11, i64 0, !12, i64 8, !12, i64 16, !13, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !15, i64 248, !16, i64 360, !12, i64 376, !12, i64 384, !17, i64 392, !11, i64 10816, !11, i64 10820, !11, i64 10824, !14, i64 10832, !21, i64 10840, !23, i64 10876, !24, i64 10928, !25, i64 10956, !12, i64 11008, !12, 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, !6, i64 11140, !11, i64 11144, !11, i64 11148, !11, i64 11152, !12, i64 11160, !14, i64 11168, !14, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !12, 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 = !{!"any pointer", !7, i64 0}
!13 = !{!"_PXEBC_PRIVATE_PROTOCOL", !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !14, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104}
!16 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !14, i64 0, !12, i64 8}
!17 = !{!"", !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, !18, i64 8884, !11, i64 9016, !7, i64 9020, !11, i64 9404, !7, i64 9408, !19, i64 9792, !20, i64 10296}
!18 = !{!"", !7, i64 0, !7, i64 1, !6, i64 2, !7, i64 4}
!19 = !{!"", !7, i64 0, !7, i64 1, !6, 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, !6, i64 26, !22, i64 28, !6, 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, !6, i64 32, !22, i64 34, !6, 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 = !{!"", !12, i64 0, !14, 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, !6, i64 8, !6, i64 10, !22, i64 12, !22, i64 16, !22, i64 20, !22, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!30 = !{!17, !7, i64 10}
!31 = !{!7, !7, i64 0}
!32 = !{!17, !7, i64 3}
!33 = !{!11, !11, i64 0}
!34 = !{!35, !7, i64 88}
!35 = !{!"", !7, i64 0, !22, i64 32, !6, i64 36, !6, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !22, i64 43, !22, i64 47, !6, i64 52, !6, i64 54, !6, i64 56, !6, i64 58, !12, i64 64, !7, i64 72, !12, i64 80, !7, i64 88, !12, i64 96, !7, i64 104, !12, i64 112, !7, i64 120}
!36 = !{!35, !12, i64 80}
!37 = !{!12, !12, i64 0}
!38 = !{!39, !7, i64 2}
!39 = !{!"", !6, i64 0, !7, i64 2, !7, i64 3}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = distinct !{!42, !41}
!43 = !{!44, !12, i64 64}
!44 = !{!"", !45, i64 0, !12, i64 24, !11, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !14, i64 104, !12, i64 112}
!45 = !{!"", !14, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!46 = !{!47, !12, i64 72}
!47 = !{!"_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72}
!48 = !{!49, !11, i64 16}
!49 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !7, i64 20}
!50 = !{!47, !12, i64 40}
!51 = !{!47, !12, i64 56}
!52 = !{!44, !12, i64 48}
!53 = !{!54, !12, i64 8}
!54 = !{!"_EFI_SIMPLE_TEXT_INPUT_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16}
!55 = !{!56, !12, i64 248}
!56 = !{!"", !45, i64 0, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !12, i64 360, !12, i64 368}
!57 = distinct !{!57, !41}
!58 = !{!59, !6, i64 0}
!59 = !{!"", !6, i64 0, !6, i64 2}
!60 = !{!59, !6, i64 2}
!61 = distinct !{!61, !41}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass