; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/IntelFrameworkModulePkg (Edd30BiosReadBlocks)

; 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.GUID = type { i32, i16, i16, [8 x i8] }
%union.EFI_IA32_REGISTER_SET = type { %struct.EFI_DWORD_REGS }
%struct.EFI_DWORD_REGS = type { i32, i32, i32, i32, i32, i32, %struct.EFI_EFLAGS_REG, i16, i16, i16, i16, i16, i16, i32, i32 }
%struct.EFI_EFLAGS_REG = type { i32 }
%struct._EFI_BLOCK_IO_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_BLOCK_IO_MEDIA = type { i32, i8, i8, i8, i8, i8, i32, i32, i64, i64, i32, i32 }
%struct.BIOS_BLOCK_IO_DEV = type { i64, ptr, ptr, %struct._EFI_BLOCK_IO_PROTOCOL, %struct.EFI_BLOCK_IO_MEDIA, ptr, ptr, ptr, %struct.BIOS_LEGACY_DRIVE }
%struct.BIOS_LEGACY_DRIVE = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr, i8, i8, i8, i8, i16, i16, %struct.EDD_DRIVE_PARAMETERS }
%struct.EDD_DRIVE_PARAMETERS = type <{ i16, i16, i32, i32, i32, i64, i16, i32, i16, i8, i8, i16, [4 x i8], [8 x i8], %union.EDD_INTERFACE_PATH, %union.EDD_DEVICE_PATH, i8, i8 }>
%union.EDD_INTERFACE_PATH = type { %struct.EDD_PCI }
%struct.EDD_PCI = type { i8, i8, i8, i8, i32 }
%union.EDD_DEVICE_PATH = type { %struct.EDD_USB }
%struct.EDD_USB = type { i64, i64 }
%struct.EDD_DEVICE_ADDRESS_PACKET = type { i8, i8, i8, i8, i32, i64, i64, i32, i32 }
%struct.EFI_BYTE_REGS = type { i8, i8, i16, i8, i8, i16, i8, i8, i16, i8, i8, i16 }
%struct.EFI_WORD_REGS = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, %struct.EFI_FLAGS_REG, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
%struct.EFI_FLAGS_REG = type { i16 }
%struct._EFI_LEGACY_BIOS_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, 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 }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }

@.str.5 = external hidden unnamed_addr constant [162 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@mEddBufferUnder1Mb = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@gBS = external global ptr, align 8
@gEfiBlockIoProtocolGuid = external global %struct.GUID, align 4

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

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

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

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Edd30BiosReadBlocks(ptr noundef %0, i32 noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4) #1 {
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %union.EFI_IA32_REGISTER_SET, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i64 %2, ptr %9, align 8, !tbaa !11
  store i64 %3, ptr %10, align 8, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._EFI_BLOCK_IO_PROTOCOL, ptr %25, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  store ptr %27, ptr %12, align 8, !tbaa !5
  %28 = load ptr, ptr %12, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %28, i32 0, i32 6
  %30 = load i32, ptr %29, align 4, !tbaa !15
  %31 = zext i32 %30 to i64
  store i64 %31, ptr %19, align 8, !tbaa !11
  %32 = call ptr @ZeroMem(ptr noundef %15, i64 noundef 48)
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !17
  %37 = icmp ne i32 %33, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %5
  store i64 -9223372036854775795, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %284

39:                                               ; preds = %5
  %40 = load i64, ptr %9, align 8, !tbaa !11
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %41, i32 0, i32 8
  %43 = load i64, ptr %42, align 8, !tbaa !18
  %44 = icmp ugt i64 %40, %43
  br i1 %44, label %45, label %46

45:                                               ; preds = %39
  store i64 -9223372036854775806, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %284

46:                                               ; preds = %39
  %47 = load i64, ptr %9, align 8, !tbaa !11
  %48 = load i64, ptr %10, align 8, !tbaa !11
  %49 = load i64, ptr %19, align 8, !tbaa !11
  %50 = udiv i64 %48, %49
  %51 = add i64 %47, %50
  %52 = sub i64 %51, 1
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %53, i32 0, i32 8
  %55 = load i64, ptr %54, align 8, !tbaa !18
  %56 = icmp ugt i64 %52, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %46
  store i64 -9223372036854775806, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %284

58:                                               ; preds = %46
  %59 = load i64, ptr %10, align 8, !tbaa !11
  %60 = load i64, ptr %19, align 8, !tbaa !11
  %61 = urem i64 %59, %60
  %62 = icmp ne i64 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %58
  store i64 -9223372036854775804, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %284

64:                                               ; preds = %58
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %68

67:                                               ; preds = %64
  store i64 -9223372036854775806, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %284

68:                                               ; preds = %64
  %69 = load i64, ptr %10, align 8, !tbaa !11
  %70 = icmp eq i64 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  store i64 0, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %284

72:                                               ; preds = %68
  %73 = call zeroext i8 @DebugAssertEnabled()
  %74 = zext i8 %73 to i32
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %86

76:                                               ; preds = %72
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = ptrtoint ptr %77 to i64
  %79 = sub i64 %78, ptrtoint (ptr getelementptr inbounds (%struct.BIOS_BLOCK_IO_DEV, ptr null, i32 0, i32 3) to i64)
  %80 = inttoptr i64 %79 to ptr
  %81 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %80, i32 0, i32 0
  %82 = load i64, ptr %81, align 8, !tbaa !19
  %83 = icmp ne i64 %82, 1869177442
  br i1 %83, label %84, label %86

84:                                               ; preds = %76
  call void @DebugAssert(ptr noundef @.str.5, i64 noundef 468, ptr noundef @.str.7)
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  br label %91

86:                                               ; preds = %76, %72
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = ptrtoint ptr %87 to i64
  %89 = sub i64 %88, ptrtoint (ptr getelementptr inbounds (%struct.BIOS_BLOCK_IO_DEV, ptr null, i32 0, i32 3) to i64)
  %90 = inttoptr i64 %89 to ptr
  br label %91

91:                                               ; preds = %86, %84
  %92 = phi ptr [ %85, %84 ], [ %90, %86 ]
  store ptr %92, ptr %13, align 8, !tbaa !5
  %93 = load ptr, ptr @mEddBufferUnder1Mb, align 8, !tbaa !5
  store ptr %93, ptr %14, align 8, !tbaa !5
  %94 = load i64, ptr %19, align 8, !tbaa !11
  %95 = udiv i64 65024, %94
  store i64 %95, ptr %22, align 8, !tbaa !11
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = ptrtoint ptr %96 to i64
  store i64 %97, ptr %16, align 8, !tbaa !11
  br label %98

98:                                               ; preds = %270, %91
  %99 = load i64, ptr %10, align 8, !tbaa !11
  %100 = icmp ugt i64 %99, 0
  br i1 %100, label %101, label %283

101:                                              ; preds = %98
  %102 = load i64, ptr %10, align 8, !tbaa !11
  %103 = load i64, ptr %19, align 8, !tbaa !11
  %104 = udiv i64 %102, %103
  store i64 %104, ptr %17, align 8, !tbaa !11
  %105 = load i64, ptr %17, align 8, !tbaa !11
  %106 = load i64, ptr %22, align 8, !tbaa !11
  %107 = icmp ugt i64 %105, %106
  br i1 %107, label %108, label %110

108:                                              ; preds = %101
  %109 = load i64, ptr %22, align 8, !tbaa !11
  br label %112

110:                                              ; preds = %101
  %111 = load i64, ptr %17, align 8, !tbaa !11
  br label %112

112:                                              ; preds = %110, %108
  %113 = phi i64 [ %109, %108 ], [ %111, %110 ]
  store i64 %113, ptr %17, align 8, !tbaa !11
  %114 = load ptr, ptr %14, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.EDD_DEVICE_ADDRESS_PACKET, ptr %114, i32 0, i32 0
  store i8 32, ptr %115, align 1, !tbaa !24
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.EDD_DEVICE_ADDRESS_PACKET, ptr %116, i32 0, i32 1
  store i8 0, ptr %117, align 1, !tbaa !26
  %118 = load i64, ptr %17, align 8, !tbaa !11
  %119 = trunc i64 %118 to i8
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EDD_DEVICE_ADDRESS_PACKET, ptr %120, i32 0, i32 2
  store i8 %119, ptr %121, align 1, !tbaa !27
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.EDD_DEVICE_ADDRESS_PACKET, ptr %122, i32 0, i32 3
  store i8 0, ptr %123, align 1, !tbaa !28
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.EDD_DEVICE_ADDRESS_PACKET, ptr %124, i32 0, i32 4
  store i32 -1, ptr %125, align 1, !tbaa !29
  %126 = load i64, ptr %9, align 8, !tbaa !11
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.EDD_DEVICE_ADDRESS_PACKET, ptr %127, i32 0, i32 5
  store i64 %126, ptr %128, align 1, !tbaa !30
  %129 = load i64, ptr %16, align 8, !tbaa !11
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.EDD_DEVICE_ADDRESS_PACKET, ptr %130, i32 0, i32 6
  store i64 %129, ptr %131, align 1, !tbaa !31
  %132 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %15, i32 0, i32 1
  store i8 66, ptr %132, align 1, !tbaa !32
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %133, i32 0, i32 8
  %135 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %134, i32 0, i32 1
  %136 = load i8, ptr %135, align 1, !tbaa !33
  %137 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %15, i32 0, i32 9
  store i8 %136, ptr %137, align 4, !tbaa !32
  %138 = load ptr, ptr %14, align 8, !tbaa !5
  %139 = ptrtoint ptr %138 to i64
  %140 = trunc i64 %139 to i16
  %141 = zext i16 %140 to i32
  %142 = and i32 %141, 65535
  %143 = trunc i32 %142 to i16
  %144 = getelementptr inbounds %struct.EFI_WORD_REGS, ptr %15, i32 0, i32 8
  store i16 %143, ptr %144, align 4, !tbaa !32
  %145 = load ptr, ptr %14, align 8, !tbaa !5
  %146 = ptrtoint ptr %145 to i64
  %147 = lshr i64 %146, 4
  %148 = trunc i64 %147 to i16
  %149 = zext i16 %148 to i32
  %150 = and i32 %149, 61440
  %151 = trunc i32 %150 to i16
  %152 = getelementptr inbounds %struct.EFI_WORD_REGS, ptr %15, i32 0, i32 17
  store i16 %151, ptr %152, align 2, !tbaa !32
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %153, i32 0, i32 7
  %155 = load ptr, ptr %154, align 8, !tbaa !34
  %156 = getelementptr inbounds %struct._EFI_LEGACY_BIOS_PROTOCOL, ptr %155, i32 0, i32 0
  %157 = load ptr, ptr %156, align 8, !tbaa !35
  %158 = load ptr, ptr %13, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %158, i32 0, i32 7
  %160 = load ptr, ptr %159, align 8, !tbaa !34
  %161 = call zeroext i8 %157(ptr noundef %160, i8 noundef zeroext 19, ptr noundef %15)
  %162 = zext i8 %161 to i64
  store i64 %162, ptr %21, align 8, !tbaa !11
  br label %163

163:                                              ; preds = %112
  %164 = call zeroext i8 @DebugPrintEnabled()
  %165 = icmp ne i8 %164, 0
  br i1 %165, label %166, label %183

166:                                              ; preds = %163
  br label %167

167:                                              ; preds = %166
  %168 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 4096)
  %169 = icmp ne i8 %168, 0
  br i1 %169, label %170, label %180

170:                                              ; preds = %167
  %171 = load ptr, ptr %13, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %171, i32 0, i32 8
  %173 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %172, i32 0, i32 1
  %174 = load i8, ptr %173, align 1, !tbaa !33
  %175 = zext i8 %174 to i32
  %176 = load i64, ptr %21, align 8, !tbaa !11
  %177 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %15, i32 0, i32 1
  %178 = load i8, ptr %177, align 1, !tbaa !32
  %179 = zext i8 %178 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 4096, ptr noundef @.str.8, i32 noundef %175, i64 noundef %176, i32 noundef %179)
  br label %180

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

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181
  br label %183

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

184:                                              ; preds = %183
  br label %185

185:                                              ; preds = %184
  %186 = load ptr, ptr %12, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %186, i32 0, i32 2
  store i8 1, ptr %187, align 1, !tbaa !37
  %188 = load i64, ptr %21, align 8, !tbaa !11
  %189 = icmp ne i64 %188, 0
  br i1 %189, label %190, label %270

190:                                              ; preds = %185
  %191 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %15, i32 0, i32 1
  %192 = load i8, ptr %191, align 1, !tbaa !32
  %193 = load ptr, ptr %13, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %193, i32 0, i32 8
  %195 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %194, i32 0, i32 8
  store i8 %192, ptr %195, align 8, !tbaa !38
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %196, i32 0, i32 8
  %198 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %197, i32 0, i32 8
  %199 = load i8, ptr %198, align 8, !tbaa !38
  %200 = zext i8 %199 to i32
  %201 = icmp eq i32 %200, 6
  br i1 %201, label %202, label %261

202:                                              ; preds = %190
  %203 = load ptr, ptr %12, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %203, i32 0, i32 0
  %205 = load i32, ptr %204, align 8, !tbaa !17
  %206 = add i32 %205, 1
  store i32 %206, ptr %204, align 8, !tbaa !17
  %207 = load ptr, ptr %13, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %207, i32 0, i32 8
  store ptr %208, ptr %20, align 8, !tbaa !5
  %209 = load ptr, ptr %13, align 8, !tbaa !5
  %210 = load ptr, ptr %20, align 8, !tbaa !5
  %211 = call i64 @Int13GetDeviceParameters(ptr noundef %209, ptr noundef %210)
  %212 = icmp ne i64 %211, 0
  br i1 %212, label %213, label %260

213:                                              ; preds = %202
  %214 = load ptr, ptr %13, align 8, !tbaa !5
  %215 = load ptr, ptr %20, align 8, !tbaa !5
  %216 = call i64 @Int13Extensions(ptr noundef %214, ptr noundef %215)
  %217 = icmp ne i64 %216, 0
  br i1 %217, label %218, label %233

218:                                              ; preds = %213
  %219 = load ptr, ptr %20, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %219, i32 0, i32 16
  %221 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %220, i32 0, i32 5
  %222 = load i64, ptr %221, align 8, !tbaa !39
  %223 = sub i64 %222, 1
  %224 = load ptr, ptr %12, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %224, i32 0, i32 8
  store i64 %223, ptr %225, align 8, !tbaa !18
  %226 = load ptr, ptr %20, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %226, i32 0, i32 16
  %228 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %227, i32 0, i32 6
  %229 = load i16, ptr %228, align 8, !tbaa !40
  %230 = zext i16 %229 to i32
  %231 = load ptr, ptr %12, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %231, i32 0, i32 6
  store i32 %230, ptr %232, align 4, !tbaa !15
  br label %241

233:                                              ; preds = %213
  br label %234

234:                                              ; preds = %233
  %235 = call zeroext i8 @DebugAssertEnabled()
  %236 = icmp ne i8 %235, 0
  br i1 %236, label %237, label %238

237:                                              ; preds = %234
  call void @DebugAssert(ptr noundef @.str.5, i64 noundef 515, ptr noundef @.str.9)
  br label %238

238:                                              ; preds = %237, %234
  br label %239

239:                                              ; preds = %238
  br label %240

240:                                              ; preds = %239
  br label %241

241:                                              ; preds = %240, %218
  %242 = load ptr, ptr %12, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %242, i32 0, i32 4
  store i8 0, ptr %243, align 1, !tbaa !41
  %244 = load ptr, ptr @gBS, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %244, i32 0, i32 17
  %246 = load ptr, ptr %245, align 8, !tbaa !42
  %247 = load ptr, ptr %13, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %247, i32 0, i32 1
  %249 = load ptr, ptr %248, align 8, !tbaa !45
  %250 = call i64 %246(ptr noundef %249, ptr noundef @gEfiBlockIoProtocolGuid, ptr noundef %23)
  %251 = load ptr, ptr @gBS, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %251, i32 0, i32 15
  %253 = load ptr, ptr %252, align 8, !tbaa !46
  %254 = load ptr, ptr %13, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %254, i32 0, i32 1
  %256 = load ptr, ptr %255, align 8, !tbaa !45
  %257 = load ptr, ptr %23, align 8, !tbaa !5
  %258 = load ptr, ptr %23, align 8, !tbaa !5
  %259 = call i64 %253(ptr noundef %256, ptr noundef @gEfiBlockIoProtocolGuid, ptr noundef %257, ptr noundef %258)
  store i64 -9223372036854775795, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %284

260:                                              ; preds = %202
  br label %261

261:                                              ; preds = %260, %190
  %262 = load ptr, ptr %12, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %262, i32 0, i32 1
  %264 = load i8, ptr %263, align 4, !tbaa !47
  %265 = icmp ne i8 %264, 0
  br i1 %265, label %266, label %269

266:                                              ; preds = %261
  %267 = load ptr, ptr %12, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %267, i32 0, i32 2
  store i8 0, ptr %268, align 1, !tbaa !37
  br label %269

269:                                              ; preds = %266, %261
  store i64 -9223372036854775801, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %284

270:                                              ; preds = %185
  %271 = load i64, ptr %17, align 8, !tbaa !11
  %272 = load i64, ptr %19, align 8, !tbaa !11
  %273 = mul i64 %271, %272
  store i64 %273, ptr %18, align 8, !tbaa !11
  %274 = load i64, ptr %10, align 8, !tbaa !11
  %275 = load i64, ptr %18, align 8, !tbaa !11
  %276 = sub i64 %274, %275
  store i64 %276, ptr %10, align 8, !tbaa !11
  %277 = load i64, ptr %18, align 8, !tbaa !11
  %278 = load i64, ptr %16, align 8, !tbaa !11
  %279 = add i64 %278, %277
  store i64 %279, ptr %16, align 8, !tbaa !11
  %280 = load i64, ptr %17, align 8, !tbaa !11
  %281 = load i64, ptr %9, align 8, !tbaa !11
  %282 = add i64 %281, %280
  store i64 %282, ptr %9, align 8, !tbaa !11
  br label %98, !llvm.loop !48

283:                                              ; preds = %98
  store i64 0, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %284

284:                                              ; preds = %283, %269, %241, %71, %67, %63, %57, %45, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %285 = load i64, ptr %6, align 8
  ret i64 %285
}

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

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_EFI_BLOCK_IO_PROTOCOL", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!15 = !{!16, !10, i64 12}
!16 = !{!"", !10, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !10, i64 12, !10, i64 16, !12, i64 24, !12, i64 32, !10, i64 40, !10, i64 44}
!17 = !{!16, !10, i64 0}
!18 = !{!16, !12, i64 24}
!19 = !{!20, !12, i64 0}
!20 = !{!"", !12, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !16, i64 72, !6, i64 120, !6, i64 128, !6, i64 136, !21, i64 144}
!21 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !6, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !22, i64 28, !22, i64 30, !23, i64 32}
!22 = !{!"short", !7, i64 0}
!23 = !{!"", !22, i64 0, !22, i64 2, !10, i64 4, !10, i64 8, !10, i64 12, !12, i64 16, !22, i64 24, !10, i64 26, !22, i64 30, !7, i64 32, !7, i64 33, !22, i64 34, !7, i64 36, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 72, !7, i64 73}
!24 = !{!25, !7, i64 0}
!25 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !12, i64 8, !12, i64 16, !10, i64 24, !10, i64 28}
!26 = !{!25, !7, i64 1}
!27 = !{!25, !7, i64 2}
!28 = !{!25, !7, i64 3}
!29 = !{!25, !10, i64 4}
!30 = !{!25, !12, i64 8}
!31 = !{!25, !12, i64 16}
!32 = !{!7, !7, i64 0}
!33 = !{!20, !7, i64 145}
!34 = !{!20, !6, i64 136}
!35 = !{!36, !6, i64 0}
!36 = !{!"_EFI_LEGACY_BIOS_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, !6, i64 80, !6, i64 88}
!37 = !{!16, !7, i64 5}
!38 = !{!20, !7, i64 152}
!39 = !{!21, !12, i64 48}
!40 = !{!21, !22, i64 56}
!41 = !{!16, !7, i64 7}
!42 = !{!43, !6, i64 152}
!43 = !{!"", !44, 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}
!44 = !{!"", !12, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!45 = !{!20, !6, i64 8}
!46 = !{!43, !6, i64 136}
!47 = !{!16, !7, i64 4}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


; 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.GUID = type { i32, i16, i16, [8 x i8] }
%union.EFI_IA32_REGISTER_SET = type { %struct.EFI_DWORD_REGS }
%struct.EFI_DWORD_REGS = type { i32, i32, i32, i32, i32, i32, %struct.EFI_EFLAGS_REG, i16, i16, i16, i16, i16, i16, i32, i32 }
%struct.EFI_EFLAGS_REG = type { i32 }

@.str.5 = external hidden unnamed_addr constant [162 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@mEddBufferUnder1Mb = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiBlockIoProtocolGuid = external global %struct.GUID, align 4

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

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

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

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @Edd30BiosReadBlocks(ptr noundef %0, i32 noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = alloca %union.EFI_IA32_REGISTER_SET, align 4
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 12
  %11 = load i32, ptr %10, align 4, !tbaa !11
  %12 = zext i32 %11 to i64
  %13 = call ptr @ZeroMem(ptr noundef nonnull %6, i64 noundef 48) #4
  %14 = load i32, ptr %9, align 8, !tbaa !14
  %.not = icmp eq i32 %14, %1
  br i1 %.not, label %15, label %.loopexit

15:                                               ; preds = %5
  %16 = getelementptr inbounds i8, ptr %9, i64 24
  %17 = load i64, ptr %16, align 8, !tbaa !15
  %18 = icmp ult i64 %17, %2
  br i1 %18, label %.loopexit, label %19

19:                                               ; preds = %15
  %20 = udiv i64 %3, %12
  %21 = urem i64 %3, %12
  %22 = add i64 %2, -1
  %23 = add i64 %22, %20
  %24 = icmp ugt i64 %23, %17
  br i1 %24, label %.loopexit, label %25

25:                                               ; preds = %19
  %.not77 = icmp eq i64 %21, 0
  br i1 %.not77, label %26, label %.loopexit

26:                                               ; preds = %25
  %27 = icmp eq ptr %4, null
  br i1 %27, label %.loopexit, label %28

28:                                               ; preds = %26
  %29 = icmp eq i64 %3, 0
  br i1 %29, label %.loopexit, label %30

30:                                               ; preds = %28
  %31 = call zeroext i8 @DebugAssertEnabled() #4
  %.not78 = icmp eq i8 %31, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre93 = add i64 %.pre, -24
  %.pre95 = inttoptr i64 %.pre93 to ptr
  br i1 %.not78, label %._crit_edge, label %32

32:                                               ; preds = %30
  %33 = load i64, ptr %.pre95, align 8, !tbaa !16
  %.not79 = icmp eq i64 %33, 1869177442
  br i1 %.not79, label %._crit_edge, label %34

34:                                               ; preds = %32
  call void @DebugAssert(ptr noundef nonnull @.str.5, i64 noundef 468, ptr noundef nonnull @.str.7) #4
  br label %._crit_edge

._crit_edge:                                      ; preds = %30, %32, %34
  %35 = phi ptr [ %0, %34 ], [ %.pre95, %32 ], [ %.pre95, %30 ]
  %36 = load ptr, ptr @mEddBufferUnder1Mb, align 8, !tbaa !21
  %37 = udiv i32 65024, %11
  %.zext = zext nneg i32 %37 to i64
  %38 = ptrtoint ptr %4 to i64
  %39 = getelementptr inbounds i8, ptr %36, i64 1
  %40 = getelementptr inbounds i8, ptr %36, i64 2
  %41 = getelementptr inbounds i8, ptr %36, i64 3
  %42 = getelementptr inbounds i8, ptr %36, i64 4
  %43 = getelementptr inbounds i8, ptr %36, i64 8
  %44 = getelementptr inbounds i8, ptr %36, i64 16
  %45 = getelementptr inbounds i8, ptr %6, i64 1
  %46 = getelementptr inbounds i8, ptr %35, i64 145
  %47 = getelementptr inbounds i8, ptr %6, i64 12
  %48 = ptrtoint ptr %36 to i64
  %49 = trunc i64 %48 to i16
  %50 = getelementptr inbounds i8, ptr %6, i64 16
  %51 = lshr i64 %48, 4
  %52 = trunc i64 %51 to i16
  %53 = and i16 %52, -4096
  %54 = getelementptr inbounds i8, ptr %6, i64 34
  %55 = getelementptr inbounds i8, ptr %35, i64 136
  %56 = getelementptr inbounds i8, ptr %9, i64 5
  br label %57

57:                                               ; preds = %._crit_edge, %114
  %.07092 = phi i64 [ %2, %._crit_edge ], [ %118, %114 ]
  %.07191 = phi i64 [ %3, %._crit_edge ], [ %116, %114 ]
  %.07290 = phi i64 [ %38, %._crit_edge ], [ %117, %114 ]
  %58 = udiv i64 %.07191, %12
  %59 = call i64 @llvm.umin.i64(i64 %58, i64 %.zext)
  store i8 32, ptr %36, align 1, !tbaa !22
  store i8 0, ptr %39, align 1, !tbaa !24
  %60 = trunc i64 %59 to i8
  store i8 %60, ptr %40, align 1, !tbaa !25
  store i8 0, ptr %41, align 1, !tbaa !26
  store i32 -1, ptr %42, align 1, !tbaa !27
  store i64 %.07092, ptr %43, align 1, !tbaa !28
  store i64 %.07290, ptr %44, align 1, !tbaa !29
  store i8 66, ptr %45, align 1, !tbaa !30
  %61 = load i8, ptr %46, align 1, !tbaa !31
  store i8 %61, ptr %47, align 4, !tbaa !30
  store i16 %49, ptr %50, align 4, !tbaa !30
  store i16 %53, ptr %54, align 2, !tbaa !30
  %62 = load ptr, ptr %55, align 8, !tbaa !32
  %63 = load ptr, ptr %62, align 8, !tbaa !33
  %64 = call zeroext i8 %63(ptr noundef nonnull %62, i8 noundef zeroext 19, ptr noundef nonnull %6) #4
  %65 = zext i8 %64 to i64
  %66 = call zeroext i8 @DebugPrintEnabled() #4
  %.not81 = icmp eq i8 %66, 0
  br i1 %.not81, label %74, label %67

67:                                               ; preds = %57
  %68 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 4096) #4
  %.not82 = icmp eq i8 %68, 0
  br i1 %.not82, label %74, label %69

69:                                               ; preds = %67
  %70 = load i8, ptr %46, align 1, !tbaa !31
  %71 = zext i8 %70 to i32
  %72 = load i8, ptr %45, align 1, !tbaa !30
  %73 = zext i8 %72 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 4096, ptr noundef nonnull @.str.8, i32 noundef %71, i64 noundef %65, i32 noundef %73) #4
  br label %74

74:                                               ; preds = %67, %69, %57
  store i8 1, ptr %56, align 1, !tbaa !35
  %.not83 = icmp eq i8 %64, 0
  br i1 %.not83, label %114, label %75

75:                                               ; preds = %74
  %76 = getelementptr inbounds i8, ptr %35, i64 144
  %77 = load i8, ptr %45, align 1, !tbaa !30
  %78 = getelementptr inbounds i8, ptr %35, i64 152
  store i8 %77, ptr %78, align 8, !tbaa !36
  %79 = icmp eq i8 %77, 6
  br i1 %79, label %80, label %110

80:                                               ; preds = %75
  %81 = load i32, ptr %9, align 8, !tbaa !14
  %82 = add i32 %81, 1
  store i32 %82, ptr %9, align 8, !tbaa !14
  %83 = call i64 @Int13GetDeviceParameters(ptr noundef nonnull %35, ptr noundef nonnull %76)
  %.not84 = icmp eq i64 %83, 0
  br i1 %.not84, label %110, label %84

84:                                               ; preds = %80
  %85 = call i64 @Int13Extensions(ptr noundef nonnull %35, ptr noundef nonnull %76)
  %.not86 = icmp eq i64 %85, 0
  br i1 %.not86, label %93, label %86

86:                                               ; preds = %84
  %87 = getelementptr inbounds i8, ptr %35, i64 192
  %88 = load i64, ptr %87, align 8, !tbaa !37
  %89 = add i64 %88, -1
  store i64 %89, ptr %16, align 8, !tbaa !15
  %90 = getelementptr inbounds i8, ptr %35, i64 200
  %91 = load i16, ptr %90, align 8, !tbaa !38
  %92 = zext i16 %91 to i32
  store i32 %92, ptr %10, align 4, !tbaa !11
  br label %96

93:                                               ; preds = %84
  %94 = call zeroext i8 @DebugAssertEnabled() #4
  %.not87 = icmp eq i8 %94, 0
  br i1 %.not87, label %96, label %95

95:                                               ; preds = %93
  call void @DebugAssert(ptr noundef nonnull @.str.5, i64 noundef 515, ptr noundef nonnull @.str.9) #4
  br label %96

96:                                               ; preds = %93, %95, %86
  %97 = getelementptr inbounds i8, ptr %9, i64 7
  store i8 0, ptr %97, align 1, !tbaa !39
  %98 = load ptr, ptr @gBS, align 8, !tbaa !21
  %99 = getelementptr inbounds i8, ptr %98, i64 152
  %100 = load ptr, ptr %99, align 8, !tbaa !40
  %101 = getelementptr inbounds i8, ptr %35, i64 8
  %102 = load ptr, ptr %101, align 8, !tbaa !43
  %103 = call i64 %100(ptr noundef %102, ptr noundef nonnull @gEfiBlockIoProtocolGuid, ptr noundef nonnull %7) #4
  %104 = load ptr, ptr @gBS, align 8, !tbaa !21
  %105 = getelementptr inbounds i8, ptr %104, i64 136
  %106 = load ptr, ptr %105, align 8, !tbaa !44
  %107 = load ptr, ptr %101, align 8, !tbaa !43
  %108 = load ptr, ptr %7, align 8, !tbaa !21
  %109 = call i64 %106(ptr noundef %107, ptr noundef nonnull @gEfiBlockIoProtocolGuid, ptr noundef %108, ptr noundef %108) #4
  br label %.loopexit

110:                                              ; preds = %80, %75
  %111 = getelementptr inbounds i8, ptr %9, i64 4
  %112 = load i8, ptr %111, align 4, !tbaa !45
  %.not85 = icmp eq i8 %112, 0
  br i1 %.not85, label %.loopexit, label %113

113:                                              ; preds = %110
  store i8 0, ptr %56, align 1, !tbaa !35
  br label %.loopexit

114:                                              ; preds = %74
  %115 = mul nuw nsw i64 %59, %12
  %116 = sub i64 %.07191, %115
  %117 = add i64 %115, %.07290
  %118 = add i64 %59, %.07092
  %.not80 = icmp eq i64 %116, 0
  br i1 %.not80, label %.loopexit, label %57, !llvm.loop !46

.loopexit:                                        ; preds = %114, %110, %113, %28, %26, %25, %19, %15, %5, %96
  %.0 = phi i64 [ -9223372036854775795, %96 ], [ -9223372036854775795, %5 ], [ -9223372036854775806, %15 ], [ -9223372036854775806, %19 ], [ -9223372036854775804, %25 ], [ -9223372036854775806, %26 ], [ 0, %28 ], [ -9223372036854775801, %113 ], [ -9223372036854775801, %110 ], [ 0, %114 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #4
  ret i64 %.0
}

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

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

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

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 = { 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, !10, i64 8}
!6 = !{!"_EFI_BLOCK_IO_PROTOCOL", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !13, i64 12}
!12 = !{!"", !13, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !13, i64 12, !13, i64 16, !7, i64 24, !7, i64 32, !13, i64 40, !13, i64 44}
!13 = !{!"int", !8, i64 0}
!14 = !{!12, !13, i64 0}
!15 = !{!12, !7, i64 24}
!16 = !{!17, !7, i64 0}
!17 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !12, i64 72, !10, i64 120, !10, i64 128, !10, i64 136, !18, i64 144}
!18 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !10, i64 16, !8, i64 24, !8, i64 25, !8, i64 26, !8, i64 27, !19, i64 28, !19, i64 30, !20, i64 32}
!19 = !{!"short", !8, i64 0}
!20 = !{!"", !19, i64 0, !19, i64 2, !13, i64 4, !13, i64 8, !13, i64 12, !7, i64 16, !19, i64 24, !13, i64 26, !19, i64 30, !8, i64 32, !8, i64 33, !19, i64 34, !8, i64 36, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 72, !8, i64 73}
!21 = !{!10, !10, i64 0}
!22 = !{!23, !8, i64 0}
!23 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !13, i64 4, !7, i64 8, !7, i64 16, !13, i64 24, !13, i64 28}
!24 = !{!23, !8, i64 1}
!25 = !{!23, !8, i64 2}
!26 = !{!23, !8, i64 3}
!27 = !{!23, !13, i64 4}
!28 = !{!23, !7, i64 8}
!29 = !{!23, !7, i64 16}
!30 = !{!8, !8, i64 0}
!31 = !{!17, !8, i64 145}
!32 = !{!17, !10, i64 136}
!33 = !{!34, !10, i64 0}
!34 = !{!"_EFI_LEGACY_BIOS_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88}
!35 = !{!12, !8, i64 5}
!36 = !{!17, !8, i64 152}
!37 = !{!18, !7, i64 48}
!38 = !{!18, !19, i64 56}
!39 = !{!12, !8, i64 7}
!40 = !{!41, !10, i64 152}
!41 = !{!"", !42, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!42 = !{!"", !7, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!43 = !{!17, !10, i64 8}
!44 = !{!41, !10, i64 136}
!45 = !{!12, !8, i64 4}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass