; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal (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, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct._EFI_PXE_BASE_CODE_PROTOCOL, %struct._EFI_LOAD_FILE_PROTOCOL, %struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL, ptr, ptr, ptr, ptr, %struct.EFI_IP4_CONFIG_DATA, ptr, ptr, ptr, i16, %struct.EFI_UDP4_CONFIG_DATA, %struct.EFI_PXE_BASE_CODE_MODE, i32, ptr, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, i8, i32, i64, i64, [312 x i8], %struct.EFI_DHCP4_PACKET, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i32, i32, i32, %struct.PXEBC_CACHED_DHCP4_PACKET, %struct.PXEBC_CACHED_DHCP4_PACKET, %struct.PXEBC_CACHED_DHCP4_PACKET, [16 x %struct.PXEBC_CACHED_DHCP4_PACKET], [5 x i32], [5 x [16 x i32]], i32, [5 x i32], [16 x i32], ptr, %struct.EFI_IP4_COMPLETION_TOKEN }
%struct._EFI_PXE_BASE_CODE_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_LOAD_FILE_PROTOCOL = type { ptr }
%struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL = type { i64, ptr }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_UDP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }
%struct.EFI_PXE_BASE_CODE_MODE = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %struct.EFI_PXE_BASE_CODE_IP_FILTER, i32, [8 x %struct.EFI_PXE_BASE_CODE_ARP_ENTRY], i32, [8 x %struct.EFI_PXE_BASE_CODE_ROUTE_ENTRY], %struct.EFI_PXE_BASE_CODE_ICMP_ERROR, %struct.EFI_PXE_BASE_CODE_TFTP_ERROR }
%union.EFI_PXE_BASE_CODE_PACKET = type { %struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET, [444 x i8] }
%struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET = type { i32, [1024 x i8] }
%struct.EFI_PXE_BASE_CODE_IP_FILTER = type { i8, i8, i16, [8 x %union.EFI_IP_ADDRESS] }
%struct.EFI_PXE_BASE_CODE_ARP_ENTRY = type { %union.EFI_IP_ADDRESS, %struct.EFI_MAC_ADDRESS }
%struct.EFI_PXE_BASE_CODE_ROUTE_ENTRY = type { %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS }
%struct.EFI_PXE_BASE_CODE_ICMP_ERROR = type { i8, i8, i16, %union.anon, [494 x i8] }
%union.anon = type { i32 }
%struct.EFI_PXE_BASE_CODE_TFTP_ERROR = type { i8, [127 x i8] }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%struct.EFI_DHCP4_PACKET = type <{ i32, i32, %struct.anon }>
%struct.anon = type <{ %struct.EFI_DHCP4_HEADER, i32, [1 x i8] }>
%struct.EFI_DHCP4_HEADER = type { i8, i8, i8, i8, i32, i16, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, [16 x i8], [64 x i8], [128 x i8] }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.PXEBC_CACHED_DHCP4_PACKET = type { %union.PXEBC_DHCP4_PACKET, i8, i8, [7 x ptr], %struct.PXEBC_VENDOR_OPTION }
%union.PXEBC_DHCP4_PACKET = type { [1480 x i8] }
%struct.PXEBC_VENDOR_OPTION = type { [8 x i32], %struct.EFI_IPv4_ADDRESS, i16, i16, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, i16, i16, i16, ptr, i8, ptr, i8, ptr, i8, ptr, i8 }
%struct.EFI_IP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon.1 }
%union.anon.1 = type { ptr }
%struct.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 }

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

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

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

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

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

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

23:                                               ; preds = %1
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %24, i32 0, i32 43
  store ptr %25, ptr %4, align 8, !tbaa !5
  br label %29

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

29:                                               ; preds = %26, %23
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %30, i32 0, i32 2
  %32 = load i8, ptr %31, align 1, !tbaa !31
  %33 = zext i8 %32 to i32
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %29
  store i64 -9223372036854775794, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %268

36:                                               ; preds = %29
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %37, i32 0, i32 4
  store ptr %38, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %39, i32 0, i32 6
  %41 = load i8, ptr %40, align 2, !tbaa !32
  %42 = zext i8 %41 to i32
  %43 = and i32 %42, 8
  %44 = icmp eq i32 %43, 8
  br i1 %44, label %45, label %52

45:                                               ; preds = %36
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.PXEBC_CACHED_DHCP4_PACKET, ptr %46, i32 0, i32 3
  %48 = getelementptr inbounds [7 x ptr], ptr %47, i64 0, i64 6
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %52

51:                                               ; preds = %45
  store i64 -9223372036854775787, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %268

52:                                               ; preds = %45, %36
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds [8 x i32], ptr %54, i64 0, i64 0
  %56 = load i32, ptr %55, align 8, !tbaa !33
  %57 = and i32 %56, 1024
  %58 = icmp eq i32 %57, 1024
  br i1 %58, label %60, label %59

59:                                               ; preds = %52
  store i64 0, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %268

60:                                               ; preds = %52
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %61, i32 0, i32 17
  %63 = load ptr, ptr %62, align 8, !tbaa !34
  %64 = getelementptr inbounds %struct.PXEBC_MENU_PROMPT, ptr %63, i32 0, i32 0
  %65 = load i8, ptr %64, align 1, !tbaa !35
  store i8 %65, ptr %10, align 1, !tbaa !36
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %66, i32 0, i32 17
  %68 = load ptr, ptr %67, align 8, !tbaa !34
  %69 = getelementptr inbounds %struct.PXEBC_MENU_PROMPT, ptr %68, i32 0, i32 1
  %70 = getelementptr inbounds [1 x i8], ptr %69, i64 0, i64 0
  store ptr %70, ptr %11, align 8, !tbaa !5
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.PXEBC_VENDOR_OPTION, ptr %71, i32 0, i32 18
  %73 = load i8, ptr %72, align 8, !tbaa !37
  %74 = zext i8 %73 to i32
  %75 = sub nsw i32 %74, 1
  %76 = trunc i32 %75 to i8
  store i8 %76, ptr %12, align 1, !tbaa !36
  %77 = load i8, ptr %10, align 1, !tbaa !36
  %78 = zext i8 %77 to i32
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %60
  store i64 0, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %268

81:                                               ; preds = %60
  %82 = load i8, ptr %10, align 1, !tbaa !36
  %83 = zext i8 %82 to i32
  %84 = icmp eq i32 %83, 255
  br i1 %84, label %85, label %86

85:                                               ; preds = %81
  store i64 -9223372036854775790, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %268

86:                                               ; preds = %81
  %87 = load ptr, ptr @gBS, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %87, i32 0, i32 8
  %89 = load ptr, ptr %88, align 8, !tbaa !38
  %90 = call i64 %89(i32 noundef -2147483648, i64 noundef 8, ptr noundef null, ptr noundef null, ptr noundef %6)
  store i64 %90, ptr %9, align 8, !tbaa !41
  %91 = load i64, ptr %9, align 8, !tbaa !41
  %92 = icmp slt i64 %91, 0
  br i1 %92, label %93, label %95

93:                                               ; preds = %86
  %94 = load i64, ptr %9, align 8, !tbaa !41
  store i64 %94, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %268

95:                                               ; preds = %86
  %96 = load ptr, ptr @gBS, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %96, i32 0, i32 9
  %98 = load ptr, ptr %97, align 8, !tbaa !42
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = load i8, ptr %10, align 1, !tbaa !36
  %101 = zext i8 %100 to i32
  %102 = mul i32 %101, 10000000
  %103 = zext i32 %102 to i64
  %104 = call i64 %98(ptr noundef %99, i32 noundef 2, i64 noundef %103)
  store i64 %104, ptr %9, align 8, !tbaa !41
  %105 = load i64, ptr %9, align 8, !tbaa !41
  %106 = icmp slt i64 %105, 0
  br i1 %106, label %107, label %108

107:                                              ; preds = %95
  br label %248

108:                                              ; preds = %95
  %109 = load ptr, ptr @gBS, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %109, i32 0, i32 8
  %111 = load ptr, ptr %110, align 8, !tbaa !38
  %112 = call i64 %111(i32 noundef -2147483648, i64 noundef 8, ptr noundef null, ptr noundef null, ptr noundef %7)
  store i64 %112, ptr %9, align 8, !tbaa !41
  %113 = load i64, ptr %9, align 8, !tbaa !41
  %114 = icmp slt i64 %113, 0
  br i1 %114, label %115, label %116

115:                                              ; preds = %108
  br label %248

116:                                              ; preds = %108
  %117 = load ptr, ptr @gBS, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %117, i32 0, i32 9
  %119 = load ptr, ptr %118, align 8, !tbaa !42
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = call i64 %119(ptr noundef %120, i32 noundef 1, i64 noundef 10000000)
  store i64 %121, ptr %9, align 8, !tbaa !41
  %122 = load i64, ptr %9, align 8, !tbaa !41
  %123 = icmp slt i64 %122, 0
  br i1 %123, label %124, label %125

124:                                              ; preds = %116
  br label %248

125:                                              ; preds = %116
  %126 = load ptr, ptr @gST, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %126, i32 0, i32 6
  %128 = load ptr, ptr %127, align 8, !tbaa !43
  %129 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %128, i32 0, i32 9
  %130 = load ptr, ptr %129, align 8, !tbaa !45
  %131 = getelementptr inbounds %struct.EFI_SIMPLE_TEXT_OUTPUT_MODE, ptr %130, i32 0, i32 3
  %132 = load i32, ptr %131, align 4, !tbaa !47
  store i32 %132, ptr %13, align 4, !tbaa !33
  %133 = load ptr, ptr @gST, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %133, i32 0, i32 6
  %135 = load ptr, ptr %134, align 8, !tbaa !43
  %136 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %135, i32 0, i32 9
  %137 = load ptr, ptr %136, align 8, !tbaa !45
  %138 = getelementptr inbounds %struct.EFI_SIMPLE_TEXT_OUTPUT_MODE, ptr %137, i32 0, i32 4
  %139 = load i32, ptr %138, align 4, !tbaa !49
  store i32 %139, ptr %14, align 4, !tbaa !33
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = load i8, ptr %12, align 1, !tbaa !36
  call void @PxeBcDisplayBootItem(ptr noundef %140, i8 noundef zeroext %141)
  %142 = load ptr, ptr @gST, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %142, i32 0, i32 6
  %144 = load ptr, ptr %143, align 8, !tbaa !43
  %145 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %144, i32 0, i32 7
  %146 = load ptr, ptr %145, align 8, !tbaa !50
  %147 = load ptr, ptr @gST, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %147, i32 0, i32 6
  %149 = load ptr, ptr %148, align 8, !tbaa !43
  %150 = load i32, ptr %13, align 4, !tbaa !33
  %151 = load i8, ptr %12, align 1, !tbaa !36
  %152 = zext i8 %151 to i32
  %153 = add nsw i32 %150, %152
  %154 = sext i32 %153 to i64
  %155 = load i32, ptr %14, align 4, !tbaa !33
  %156 = sext i32 %155 to i64
  %157 = call i64 %146(ptr noundef %149, i64 noundef %154, i64 noundef %156)
  %158 = load i8, ptr %10, align 1, !tbaa !36
  %159 = add i8 %158, -1
  store i8 %159, ptr %10, align 1, !tbaa !36
  %160 = zext i8 %158 to i32
  %161 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.14, i32 noundef %160)
  br label %162

162:                                              ; preds = %232, %224, %208, %125
  %163 = load ptr, ptr @gBS, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %163, i32 0, i32 13
  %165 = load ptr, ptr %164, align 8, !tbaa !51
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = call i64 %165(ptr noundef %166)
  %168 = icmp slt i64 %167, 0
  br i1 %168, label %169, label %235

169:                                              ; preds = %162
  %170 = load ptr, ptr @gBS, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %170, i32 0, i32 13
  %172 = load ptr, ptr %171, align 8, !tbaa !51
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = call i64 %172(ptr noundef %173)
  %175 = icmp slt i64 %174, 0
  br i1 %175, label %197, label %176

176:                                              ; preds = %169
  %177 = load ptr, ptr @gST, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %177, i32 0, i32 6
  %179 = load ptr, ptr %178, align 8, !tbaa !43
  %180 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL, ptr %179, i32 0, i32 7
  %181 = load ptr, ptr %180, align 8, !tbaa !50
  %182 = load ptr, ptr @gST, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %182, i32 0, i32 6
  %184 = load ptr, ptr %183, align 8, !tbaa !43
  %185 = load i32, ptr %13, align 4, !tbaa !33
  %186 = load i8, ptr %12, align 1, !tbaa !36
  %187 = zext i8 %186 to i32
  %188 = add nsw i32 %185, %187
  %189 = sext i32 %188 to i64
  %190 = load i32, ptr %14, align 4, !tbaa !33
  %191 = sext i32 %190 to i64
  %192 = call i64 %181(ptr noundef %184, i64 noundef %189, i64 noundef %191)
  %193 = load i8, ptr %10, align 1, !tbaa !36
  %194 = add i8 %193, -1
  store i8 %194, ptr %10, align 1, !tbaa !36
  %195 = zext i8 %193 to i32
  %196 = call i64 (ptr, ...) @AsciiPrint(ptr noundef @.str.14, i32 noundef %195)
  br label %197

197:                                              ; preds = %176, %169
  %198 = load ptr, ptr @gST, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %198, i32 0, i32 4
  %200 = load ptr, ptr %199, align 8, !tbaa !52
  %201 = getelementptr inbounds %struct._EFI_SIMPLE_TEXT_INPUT_PROTOCOL, ptr %200, i32 0, i32 1
  %202 = load ptr, ptr %201, align 8, !tbaa !53
  %203 = load ptr, ptr @gST, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %203, i32 0, i32 4
  %205 = load ptr, ptr %204, align 8, !tbaa !52
  %206 = call i64 %202(ptr noundef %205, ptr noundef %8)
  %207 = icmp eq i64 %206, -9223372036854775802
  br i1 %207, label %208, label %213

208:                                              ; preds = %197
  %209 = load ptr, ptr @gBS, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %209, i32 0, i32 29
  %211 = load ptr, ptr %210, align 8, !tbaa !55
  %212 = call i64 %211(i64 noundef 100000)
  br label %162, !llvm.loop !56

213:                                              ; preds = %197
  %214 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %8, i32 0, i32 0
  %215 = load i16, ptr %214, align 2, !tbaa !58
  %216 = zext i16 %215 to i32
  %217 = icmp eq i32 %216, 0
  br i1 %217, label %218, label %226

218:                                              ; preds = %213
  %219 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %8, i32 0, i32 1
  %220 = load i16, ptr %219, align 2, !tbaa !60
  %221 = zext i16 %220 to i32
  switch i32 %221, label %224 [
    i32 3, label %222
    i32 13, label %223
    i32 109, label %223
    i32 77, label %223
  ]

222:                                              ; preds = %218
  store i64 -9223372036854775787, ptr %9, align 8, !tbaa !41
  br label %225

223:                                              ; preds = %218, %218, %218
  store i64 -9223372036854775790, ptr %9, align 8, !tbaa !41
  br label %225

224:                                              ; preds = %218
  br label %162, !llvm.loop !56

225:                                              ; preds = %223, %222
  br label %234

226:                                              ; preds = %213
  %227 = getelementptr inbounds %struct.EFI_INPUT_KEY, ptr %8, i32 0, i32 0
  %228 = load i16, ptr %227, align 2, !tbaa !58
  %229 = zext i16 %228 to i32
  switch i32 %229, label %232 [
    i32 18, label %230
    i32 23, label %231
  ]

230:                                              ; preds = %226
  store i64 -9223372036854775790, ptr %9, align 8, !tbaa !41
  br label %233

231:                                              ; preds = %226
  store i64 -9223372036854775787, ptr %9, align 8, !tbaa !41
  br label %233

232:                                              ; preds = %226
  br label %162, !llvm.loop !56

233:                                              ; preds = %231, %230
  br label %234

234:                                              ; preds = %233, %225
  br label %235

235:                                              ; preds = %234, %162
  %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 !50
  %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 %14, align 4, !tbaa !33
  %245 = add nsw i32 %244, 1
  %246 = sext i32 %245 to i64
  %247 = call i64 %240(ptr noundef %243, i64 noundef 0, i64 noundef %246)
  br label %248

248:                                              ; preds = %235, %124, %115, %107
  %249 = load ptr, ptr %7, align 8, !tbaa !5
  %250 = icmp ne ptr %249, null
  br i1 %250, label %251, label %257

251:                                              ; preds = %248
  %252 = load ptr, ptr @gBS, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %252, i32 0, i32 12
  %254 = load ptr, ptr %253, align 8, !tbaa !61
  %255 = load ptr, ptr %7, align 8, !tbaa !5
  %256 = call i64 %254(ptr noundef %255)
  br label %257

257:                                              ; preds = %251, %248
  %258 = load ptr, ptr %6, align 8, !tbaa !5
  %259 = icmp ne ptr %258, null
  br i1 %259, label %260, label %266

260:                                              ; preds = %257
  %261 = load ptr, ptr @gBS, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %261, i32 0, i32 12
  %263 = load ptr, ptr %262, align 8, !tbaa !61
  %264 = load ptr, ptr %6, align 8, !tbaa !5
  %265 = call i64 %263(ptr noundef %264)
  br label %266

266:                                              ; preds = %260, %257
  %267 = load i64, ptr %9, align 8, !tbaa !41
  store i64 %267, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %268

268:                                              ; preds = %266, %93, %85, %80, %59, %51, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  %269 = load i64, ptr %2, align 8
  ret i64 %269
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 184}
!10 = !{!"_PXEBC_PRIVATE_DATA", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !12, i64 80, !14, i64 192, !15, i64 200, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !16, i64 248, !6, i64 280, !6, i64 288, !6, i64 296, !18, i64 304, !19, i64 308, !20, i64 344, !11, i64 10768, !6, i64 10776, !7, i64 10784, !7, i64 10800, !7, i64 10816, !7, i64 10832, !7, i64 10848, !11, i64 10852, !13, i64 10856, !13, i64 10864, !7, i64 10872, !24, i64 11184, !17, i64 11433, !7, i64 11465, !7, i64 11466, !7, i64 11467, !11, i64 11468, !11, i64 11472, !11, i64 11476, !27, i64 11480, !27, i64 13152, !27, i64 14824, !7, i64 16496, !7, i64 43248, !7, i64 43268, !11, i64 43588, !7, i64 43592, !7, i64 43612, !6, i64 43680, !29, i64 43688}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_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}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_EFI_LOAD_FILE_PROTOCOL", !6, i64 0}
!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, !17, i64 6, !17, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !11, i64 20, !11, i64 24}
!17 = !{!"", !7, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !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, !17, i64 17, !17, i64 21, !18, i64 26, !17, i64 28, !18, i64 32}
!20 = !{!"", !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, !21, i64 8884, !11, i64 9016, !7, i64 9020, !11, i64 9404, !7, i64 9408, !22, i64 9792, !23, i64 10296}
!21 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4}
!22 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4, !7, i64 8}
!23 = !{!"", !7, i64 0, !7, i64 1}
!24 = !{!"", !11, i64 0, !11, i64 4, !25, i64 8}
!25 = !{!"", !26, i64 0, !11, i64 236, !7, i64 240}
!26 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !18, i64 8, !18, i64 10, !17, i64 12, !17, i64 16, !17, i64 20, !17, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!27 = !{!"", !7, i64 0, !7, i64 1480, !7, i64 1481, !7, i64 1488, !28, i64 1544}
!28 = !{!"", !7, i64 0, !17, i64 32, !18, i64 36, !18, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !17, i64 43, !17, 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}
!29 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!30 = !{!20, !7, i64 10}
!31 = !{!27, !7, i64 1481}
!32 = !{!28, !7, i64 42}
!33 = !{!11, !11, i64 0}
!34 = !{!28, !6, i64 96}
!35 = !{!23, !7, i64 0}
!36 = !{!7, !7, i64 0}
!37 = !{!28, !7, i64 104}
!38 = !{!39, !6, i64 80}
!39 = !{!"", !40, 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}
!40 = !{!"", !13, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!41 = !{!13, !13, i64 0}
!42 = !{!39, !6, i64 88}
!43 = !{!44, !6, i64 64}
!44 = !{!"", !40, 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 = !{!39, !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 = !{!39, !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 = !{!39, !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 }

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcSelectBootPrompt(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %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 184
  %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
  %.031.v = select i1 %.not, i64 13152, i64 11480
  %.031 = getelementptr inbounds i8, ptr %0, i64 %.031.v
  %9 = getelementptr inbounds i8, ptr %.031, i64 1481
  %10 = load i8, ptr %9, align 1, !tbaa !31
  %.not44 = icmp eq i8 %10, 0
  br i1 %.not44, label %11, label %151

11:                                               ; preds = %1
  %12 = getelementptr inbounds i8, ptr %.031, i64 1544
  %13 = getelementptr inbounds i8, ptr %.031, i64 1586
  %14 = load i8, ptr %13, align 2, !tbaa !32
  %15 = and i8 %14, 8
  %.not45 = icmp eq i8 %15, 0
  br i1 %.not45, label %19, label %16

16:                                               ; preds = %11
  %17 = getelementptr inbounds i8, ptr %.031, i64 1536
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %.not46 = icmp eq ptr %18, null
  br i1 %.not46, label %19, label %151

19:                                               ; preds = %16, %11
  %20 = load i32, ptr %12, align 8, !tbaa !33
  %21 = and i32 %20, 1024
  %.not47 = icmp eq i32 %21, 0
  br i1 %.not47, label %151, label %22

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %.031, i64 1640
  %24 = load ptr, ptr %23, align 8, !tbaa !34
  %25 = load i8, ptr %24, align 1, !tbaa !35
  %26 = getelementptr inbounds i8, ptr %24, i64 1
  %27 = getelementptr inbounds i8, ptr %.031, i64 1648
  %28 = load i8, ptr %27, align 8, !tbaa !36
  %29 = add i8 %28, -1
  %30 = zext i8 %25 to i32
  switch i8 %25, label %32 [
    i8 0, label %151
    i8 -1, label %31
  ]

31:                                               ; preds = %22
  br label %151

32:                                               ; preds = %22
  %33 = load ptr, ptr @gBS, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 80
  %35 = load ptr, ptr %34, align 8, !tbaa !37
  %36 = call i64 %35(i32 noundef -2147483648, i64 noundef 8, ptr noundef null, ptr noundef null, ptr noundef nonnull %2) #3
  %37 = icmp slt i64 %36, 0
  br i1 %37, label %151, label %38

38:                                               ; preds = %32
  %39 = load ptr, ptr @gBS, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 88
  %41 = load ptr, ptr %40, align 8, !tbaa !40
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = mul nuw i32 %30, 10000000
  %44 = zext i32 %43 to i64
  %45 = call i64 %41(ptr noundef %42, i32 noundef 2, i64 noundef %44) #3
  %46 = icmp slt i64 %45, 0
  br i1 %46, label %137, label %47

47:                                               ; preds = %38
  %48 = load ptr, ptr @gBS, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 80
  %50 = load ptr, ptr %49, align 8, !tbaa !37
  %51 = call i64 %50(i32 noundef -2147483648, i64 noundef 8, ptr noundef null, ptr noundef null, ptr noundef nonnull %3) #3
  %52 = icmp slt i64 %51, 0
  br i1 %52, label %137, label %53

53:                                               ; preds = %47
  %54 = load ptr, ptr @gBS, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 88
  %56 = load ptr, ptr %55, align 8, !tbaa !40
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = call i64 %56(ptr noundef %57, i32 noundef 1, i64 noundef 10000000) #3
  %59 = icmp slt i64 %58, 0
  br i1 %59, label %137, label %60

60:                                               ; preds = %53
  %61 = load ptr, ptr @gST, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 64
  %63 = load ptr, ptr %62, align 8, !tbaa !41
  %64 = getelementptr inbounds i8, ptr %63, i64 72
  %65 = load ptr, ptr %64, align 8, !tbaa !43
  %66 = getelementptr inbounds i8, ptr %65, i64 12
  %67 = load i32, ptr %66, align 4, !tbaa !45
  %68 = getelementptr inbounds i8, ptr %65, i64 16
  %69 = load i32, ptr %68, align 4, !tbaa !47
  call void @PxeBcDisplayBootItem(ptr noundef nonnull %26, i8 noundef zeroext %29)
  %70 = load ptr, ptr @gST, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %70, i64 64
  %72 = load ptr, ptr %71, align 8, !tbaa !41
  %73 = getelementptr inbounds i8, ptr %72, i64 56
  %74 = load ptr, ptr %73, align 8, !tbaa !48
  %75 = zext i8 %29 to i32
  %76 = add nsw i32 %67, %75
  %77 = sext i32 %76 to i64
  %78 = sext i32 %69 to i64
  %79 = call i64 %74(ptr noundef %72, i64 noundef %77, i64 noundef %78) #3
  %80 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.14, i32 noundef %30) #3
  %81 = load ptr, ptr @gBS, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 120
  %83 = load ptr, ptr %82, align 8, !tbaa !49
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = call i64 %83(ptr noundef %84) #3
  %86 = icmp slt i64 %85, 0
  br i1 %86, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %60
  %87 = add i8 %25, -1
  %88 = getelementptr inbounds i8, ptr %4, i64 2
  br label %89

89:                                               ; preds = %.lr.ph, %.backedge
  %.03350 = phi i8 [ %87, %.lr.ph ], [ %.134, %.backedge ]
  %90 = load ptr, ptr @gBS, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %90, i64 120
  %92 = load ptr, ptr %91, align 8, !tbaa !49
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = call i64 %92(ptr noundef %93) #3
  %95 = icmp slt i64 %94, 0
  br i1 %95, label %106, label %96

96:                                               ; preds = %89
  %97 = load ptr, ptr @gST, align 8, !tbaa !5
  %98 = getelementptr inbounds i8, ptr %97, i64 64
  %99 = load ptr, ptr %98, align 8, !tbaa !41
  %100 = getelementptr inbounds i8, ptr %99, i64 56
  %101 = load ptr, ptr %100, align 8, !tbaa !48
  %102 = call i64 %101(ptr noundef %99, i64 noundef %77, i64 noundef %78) #3
  %103 = add i8 %.03350, -1
  %104 = zext i8 %.03350 to i32
  %105 = call i64 (ptr, ...) @AsciiPrint(ptr noundef nonnull @.str.14, i32 noundef %104) #3
  br label %106

106:                                              ; preds = %96, %89
  %.134 = phi i8 [ %.03350, %89 ], [ %103, %96 ]
  %107 = load ptr, ptr @gST, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i64 48
  %109 = load ptr, ptr %108, align 8, !tbaa !50
  %110 = getelementptr inbounds i8, ptr %109, i64 8
  %111 = load ptr, ptr %110, align 8, !tbaa !51
  %112 = call i64 %111(ptr noundef %109, ptr noundef nonnull %4) #3
  %113 = icmp eq i64 %112, -9223372036854775802
  br i1 %113, label %114, label %125

114:                                              ; preds = %106
  %115 = load ptr, ptr @gBS, align 8, !tbaa !5
  %116 = getelementptr inbounds i8, ptr %115, i64 248
  %117 = load ptr, ptr %116, align 8, !tbaa !53
  %118 = call i64 %117(i64 noundef 100000) #3
  br label %.backedge

.backedge:                                        ; preds = %114, %127, %125
  %119 = load ptr, ptr @gBS, align 8, !tbaa !5
  %120 = getelementptr inbounds i8, ptr %119, i64 120
  %121 = load ptr, ptr %120, align 8, !tbaa !49
  %122 = load ptr, ptr %2, align 8, !tbaa !5
  %123 = call i64 %121(ptr noundef %122) #3
  %124 = icmp slt i64 %123, 0
  br i1 %124, label %89, label %.loopexit.loopexit, !llvm.loop !54

125:                                              ; preds = %106
  %126 = load i16, ptr %4, align 2, !tbaa !56
  switch i16 %126, label %.backedge [
    i16 0, label %127
    i16 18, label %.loopexit.loopexit
    i16 23, label %.loopexit
  ]

127:                                              ; preds = %125
  %128 = load i16, ptr %88, align 2, !tbaa !58
  switch i16 %128, label %.backedge [
    i16 3, label %.loopexit.loopexit
    i16 13, label %.loopexit
    i16 109, label %.loopexit
    i16 77, label %.loopexit
  ]

.loopexit.loopexit:                               ; preds = %125, %127, %.backedge
  %.032.ph = phi i64 [ -9223372036854775790, %125 ], [ -9223372036854775787, %127 ], [ %58, %.backedge ]
  br label %.loopexit

.loopexit:                                        ; preds = %125, %127, %127, %127, %.loopexit.loopexit, %60
  %.032 = phi i64 [ %58, %60 ], [ %.032.ph, %.loopexit.loopexit ], [ -9223372036854775790, %127 ], [ -9223372036854775790, %127 ], [ -9223372036854775790, %127 ], [ -9223372036854775787, %125 ]
  %129 = load ptr, ptr @gST, align 8, !tbaa !5
  %130 = getelementptr inbounds i8, ptr %129, i64 64
  %131 = load ptr, ptr %130, align 8, !tbaa !41
  %132 = getelementptr inbounds i8, ptr %131, i64 56
  %133 = load ptr, ptr %132, align 8, !tbaa !48
  %134 = add nsw i32 %69, 1
  %135 = sext i32 %134 to i64
  %136 = call i64 %133(ptr noundef %131, i64 noundef 0, i64 noundef %135) #3
  br label %137

137:                                              ; preds = %53, %47, %38, %.loopexit
  %.1 = phi i64 [ %45, %38 ], [ %51, %47 ], [ %58, %53 ], [ %.032, %.loopexit ]
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %.not48 = icmp eq ptr %138, null
  br i1 %.not48, label %144, label %139

139:                                              ; preds = %137
  %140 = load ptr, ptr @gBS, align 8, !tbaa !5
  %141 = getelementptr inbounds i8, ptr %140, i64 112
  %142 = load ptr, ptr %141, align 8, !tbaa !59
  %143 = call i64 %142(ptr noundef nonnull %138) #3
  br label %144

144:                                              ; preds = %139, %137
  %145 = load ptr, ptr %2, align 8, !tbaa !5
  %.not49 = icmp eq ptr %145, null
  br i1 %.not49, label %151, label %146

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

151:                                              ; preds = %144, %146, %32, %22, %19, %16, %1, %31
  %.0 = phi i64 [ -9223372036854775790, %31 ], [ -9223372036854775794, %1 ], [ -9223372036854775787, %16 ], [ 0, %19 ], [ 0, %22 ], [ %36, %32 ], [ %.1, %146 ], [ %.1, %144 ]
  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
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 184}
!10 = !{!"_PXEBC_PRIVATE_DATA", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !12, i64 80, !14, i64 192, !15, i64 200, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !16, i64 248, !6, i64 280, !6, i64 288, !6, i64 296, !18, i64 304, !19, i64 308, !20, i64 344, !11, i64 10768, !6, i64 10776, !7, i64 10784, !7, i64 10800, !7, i64 10816, !7, i64 10832, !7, i64 10848, !11, i64 10852, !13, i64 10856, !13, i64 10864, !7, i64 10872, !24, i64 11184, !17, i64 11433, !7, i64 11465, !7, i64 11466, !7, i64 11467, !11, i64 11468, !11, i64 11472, !11, i64 11476, !27, i64 11480, !27, i64 13152, !27, i64 14824, !7, i64 16496, !7, i64 43248, !7, i64 43268, !11, i64 43588, !7, i64 43592, !7, i64 43612, !6, i64 43680, !29, i64 43688}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_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}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_EFI_LOAD_FILE_PROTOCOL", !6, i64 0}
!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, !17, i64 6, !17, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !11, i64 20, !11, i64 24}
!17 = !{!"", !7, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!"", !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, !17, i64 17, !17, i64 21, !18, i64 26, !17, i64 28, !18, i64 32}
!20 = !{!"", !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, !21, i64 8884, !11, i64 9016, !7, i64 9020, !11, i64 9404, !7, i64 9408, !22, i64 9792, !23, i64 10296}
!21 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4}
!22 = !{!"", !7, i64 0, !7, i64 1, !18, i64 2, !7, i64 4, !7, i64 8}
!23 = !{!"", !7, i64 0, !7, i64 1}
!24 = !{!"", !11, i64 0, !11, i64 4, !25, i64 8}
!25 = !{!"", !26, i64 0, !11, i64 236, !7, i64 240}
!26 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !18, i64 8, !18, i64 10, !17, i64 12, !17, i64 16, !17, i64 20, !17, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!27 = !{!"", !7, i64 0, !7, i64 1480, !7, i64 1481, !7, i64 1488, !28, i64 1544}
!28 = !{!"", !7, i64 0, !17, i64 32, !18, i64 36, !18, i64 38, !7, i64 40, !7, i64 41, !7, i64 42, !17, i64 43, !17, 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}
!29 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!30 = !{!20, !7, i64 10}
!31 = !{!27, !7, i64 1481}
!32 = !{!28, !7, i64 42}
!33 = !{!11, !11, i64 0}
!34 = !{!28, !6, i64 96}
!35 = !{!23, !7, i64 0}
!36 = !{!28, !7, i64 104}
!37 = !{!38, !6, i64 80}
!38 = !{!"", !39, 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}
!39 = !{!"", !13, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!40 = !{!38, !6, i64 88}
!41 = !{!42, !6, i64 64}
!42 = !{!"", !39, 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}
!43 = !{!44, !6, i64 72}
!44 = !{!"_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}
!45 = !{!46, !11, i64 12}
!46 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !7, i64 20}
!47 = !{!46, !11, i64 16}
!48 = !{!44, !6, i64 56}
!49 = !{!38, !6, i64 120}
!50 = !{!42, !6, i64 48}
!51 = !{!52, !6, i64 8}
!52 = !{!"_EFI_SIMPLE_TEXT_INPUT_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!53 = !{!38, !6, i64 248}
!54 = distinct !{!54, !55}
!55 = !{!"llvm.loop.mustprogress"}
!56 = !{!57, !18, i64 0}
!57 = !{!"", !18, i64 0, !18, i64 2}
!58 = !{!57, !18, i64 2}
!59 = !{!38, !6, i64 112}


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