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

; 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.9 = external hidden unnamed_addr constant [18 x i8], align 1
@gBS = external global ptr, align 8
@gEfiBlockIoProtocolGuid = external global %struct.GUID, align 4
@mEdd11Buffer = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [83 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: 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 @Edd11BiosReadBlocks(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 %292

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 %292

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 %292

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 %292

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 %292

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 %292

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 851, 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 @mEdd11Buffer, align 8, !tbaa !5
  %97 = ptrtoint ptr %96 to i64
  store i64 %97, ptr %16, align 8, !tbaa !11
  br label %98

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

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 i64, ptr %16, align 8, !tbaa !11
  %125 = lshr i64 %124, 4
  %126 = shl i64 %125, 16
  %127 = trunc i64 %126 to i32
  %128 = load ptr, ptr %14, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.EDD_DEVICE_ADDRESS_PACKET, ptr %128, i32 0, i32 4
  store i32 %127, ptr %129, align 1, !tbaa !29
  %130 = load i64, ptr %9, align 8, !tbaa !11
  %131 = load ptr, ptr %14, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.EDD_DEVICE_ADDRESS_PACKET, ptr %131, i32 0, i32 5
  store i64 %130, ptr %132, align 1, !tbaa !30
  %133 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %15, i32 0, i32 1
  store i8 66, ptr %133, align 1, !tbaa !31
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %134, i32 0, i32 8
  %136 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %135, i32 0, i32 1
  %137 = load i8, ptr %136, align 1, !tbaa !32
  %138 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %15, i32 0, i32 9
  store i8 %137, ptr %138, align 4, !tbaa !31
  %139 = load ptr, ptr %14, align 8, !tbaa !5
  %140 = ptrtoint ptr %139 to i64
  %141 = trunc i64 %140 to i16
  %142 = zext i16 %141 to i32
  %143 = and i32 %142, 65535
  %144 = trunc i32 %143 to i16
  %145 = getelementptr inbounds %struct.EFI_WORD_REGS, ptr %15, i32 0, i32 8
  store i16 %144, ptr %145, align 4, !tbaa !31
  %146 = load ptr, ptr %14, align 8, !tbaa !5
  %147 = ptrtoint ptr %146 to i64
  %148 = lshr i64 %147, 4
  %149 = trunc i64 %148 to i16
  %150 = zext i16 %149 to i32
  %151 = and i32 %150, 61440
  %152 = trunc i32 %151 to i16
  %153 = getelementptr inbounds %struct.EFI_WORD_REGS, ptr %15, i32 0, i32 17
  store i16 %152, ptr %153, align 2, !tbaa !31
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %154, i32 0, i32 7
  %156 = load ptr, ptr %155, align 8, !tbaa !33
  %157 = getelementptr inbounds %struct._EFI_LEGACY_BIOS_PROTOCOL, ptr %156, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8, !tbaa !34
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %159, i32 0, i32 7
  %161 = load ptr, ptr %160, align 8, !tbaa !33
  %162 = call zeroext i8 %158(ptr noundef %161, i8 noundef zeroext 19, ptr noundef %15)
  %163 = zext i8 %162 to i64
  store i64 %163, ptr %21, align 8, !tbaa !11
  br label %164

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

167:                                              ; preds = %164
  br label %168

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

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

183:                                              ; preds = %171, %168
  br label %184

184:                                              ; preds = %183
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185, %164
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  %189 = load ptr, ptr %12, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %189, i32 0, i32 2
  store i8 1, ptr %190, align 1, !tbaa !36
  %191 = load i64, ptr %21, align 8, !tbaa !11
  %192 = icmp ne i64 %191, 0
  br i1 %192, label %193, label %273

193:                                              ; preds = %188
  %194 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %15, i32 0, i32 1
  %195 = load i8, ptr %194, align 1, !tbaa !31
  %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
  store i8 %195, ptr %198, align 8, !tbaa !37
  %199 = load ptr, ptr %13, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %199, i32 0, i32 8
  %201 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %200, i32 0, i32 8
  %202 = load i8, ptr %201, align 8, !tbaa !37
  %203 = zext i8 %202 to i32
  %204 = icmp eq i32 %203, 6
  br i1 %204, label %205, label %264

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

216:                                              ; preds = %205
  %217 = load ptr, ptr %13, align 8, !tbaa !5
  %218 = load ptr, ptr %20, align 8, !tbaa !5
  %219 = call i64 @Int13Extensions(ptr noundef %217, ptr noundef %218)
  %220 = icmp ne i64 %219, 0
  br i1 %220, label %221, label %236

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

236:                                              ; preds = %216
  br label %237

237:                                              ; preds = %236
  %238 = call zeroext i8 @DebugAssertEnabled()
  %239 = icmp ne i8 %238, 0
  br i1 %239, label %240, label %241

240:                                              ; preds = %237
  call void @DebugAssert(ptr noundef @.str.5, i64 noundef 902, ptr noundef @.str.9)
  br label %241

241:                                              ; preds = %240, %237
  br label %242

242:                                              ; preds = %241
  br label %243

243:                                              ; preds = %242
  br label %244

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

263:                                              ; preds = %205
  br label %264

264:                                              ; preds = %263, %193
  %265 = load ptr, ptr %12, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %265, i32 0, i32 1
  %267 = load i8, ptr %266, align 4, !tbaa !46
  %268 = icmp ne i8 %267, 0
  br i1 %268, label %269, label %272

269:                                              ; preds = %264
  %270 = load ptr, ptr %12, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.EFI_BLOCK_IO_MEDIA, ptr %270, i32 0, i32 2
  store i8 0, ptr %271, align 1, !tbaa !36
  br label %272

272:                                              ; preds = %269, %264
  store i64 -9223372036854775801, ptr %6, align 8
  store i32 1, ptr %24, align 4
  br label %292

273:                                              ; preds = %188
  %274 = load i64, ptr %17, align 8, !tbaa !11
  %275 = load i64, ptr %19, align 8, !tbaa !11
  %276 = mul i64 %274, %275
  store i64 %276, ptr %18, align 8, !tbaa !11
  %277 = load ptr, ptr %11, align 8, !tbaa !5
  %278 = load i64, ptr %16, align 8, !tbaa !11
  %279 = inttoptr i64 %278 to ptr
  %280 = load i64, ptr %18, align 8, !tbaa !11
  %281 = call ptr @CopyMem(ptr noundef %277, ptr noundef %279, i64 noundef %280)
  %282 = load i64, ptr %10, align 8, !tbaa !11
  %283 = load i64, ptr %18, align 8, !tbaa !11
  %284 = sub i64 %282, %283
  store i64 %284, ptr %10, align 8, !tbaa !11
  %285 = load ptr, ptr %11, align 8, !tbaa !5
  %286 = load i64, ptr %18, align 8, !tbaa !11
  %287 = getelementptr inbounds i8, ptr %285, i64 %286
  store ptr %287, ptr %11, align 8, !tbaa !5
  %288 = load i64, ptr %17, align 8, !tbaa !11
  %289 = load i64, ptr %9, align 8, !tbaa !11
  %290 = add i64 %289, %288
  store i64 %290, ptr %9, align 8, !tbaa !11
  br label %98, !llvm.loop !47

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

292:                                              ; preds = %291, %272, %244, %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
  %293 = load i64, ptr %6, align 8
  ret i64 %293
}

; 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 ptr @CopyMem(ptr noundef, 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 = !{!7, !7, i64 0}
!32 = !{!20, !7, i64 145}
!33 = !{!20, !6, i64 136}
!34 = !{!35, !6, i64 0}
!35 = !{!"_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}
!36 = !{!16, !7, i64 5}
!37 = !{!20, !7, i64 152}
!38 = !{!21, !12, i64 48}
!39 = !{!21, !22, i64 56}
!40 = !{!16, !7, i64 7}
!41 = !{!42, !6, i64 152}
!42 = !{!"", !43, 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}
!43 = !{!"", !12, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!44 = !{!20, !6, i64 8}
!45 = !{!42, !6, i64 136}
!46 = !{!16, !7, i64 4}
!47 = distinct !{!47, !48}
!48 = !{!"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.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
@mEdd11Buffer = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [83 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: 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 @Edd11BiosReadBlocks(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
  %.not80 = icmp eq i64 %21, 0
  br i1 %.not80, 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
  %.not81 = icmp eq i8 %31, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre96 = add i64 %.pre, -24
  %.pre98 = inttoptr i64 %.pre96 to ptr
  br i1 %.not81, label %._crit_edge, label %32

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

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

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

59:                                               ; preds = %._crit_edge, %116
  %.07395 = phi i64 [ %2, %._crit_edge ], [ %121, %116 ]
  %.07494 = phi i64 [ %3, %._crit_edge ], [ %119, %116 ]
  %.07593 = phi ptr [ %4, %._crit_edge ], [ %120, %116 ]
  %60 = udiv i64 %.07494, %12
  %61 = call i64 @llvm.umin.i64(i64 %60, i64 %.zext)
  store i8 32, ptr %36, align 1, !tbaa !22
  store i8 0, ptr %40, align 1, !tbaa !24
  %62 = trunc i64 %61 to i8
  store i8 %62, ptr %41, align 1, !tbaa !25
  store i8 0, ptr %42, align 1, !tbaa !26
  store i32 %44, ptr %45, align 1, !tbaa !27
  store i64 %.07395, ptr %46, align 1, !tbaa !28
  store i8 66, ptr %47, align 1, !tbaa !29
  %63 = load i8, ptr %48, align 1, !tbaa !30
  store i8 %63, ptr %49, align 4, !tbaa !29
  store i16 %51, ptr %52, align 4, !tbaa !29
  store i16 %55, ptr %56, align 2, !tbaa !29
  %64 = load ptr, ptr %57, align 8, !tbaa !31
  %65 = load ptr, ptr %64, align 8, !tbaa !32
  %66 = call zeroext i8 %65(ptr noundef nonnull %64, i8 noundef zeroext 19, ptr noundef nonnull %6) #4
  %67 = zext i8 %66 to i64
  %68 = call zeroext i8 @DebugPrintEnabled() #4
  %.not84 = icmp eq i8 %68, 0
  br i1 %.not84, label %76, label %69

69:                                               ; preds = %59
  %70 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 4096) #4
  %.not85 = icmp eq i8 %70, 0
  br i1 %.not85, label %76, label %71

71:                                               ; preds = %69
  %72 = load i8, ptr %48, align 1, !tbaa !30
  %73 = zext i8 %72 to i32
  %74 = load i8, ptr %47, align 1, !tbaa !29
  %75 = zext i8 %74 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 4096, ptr noundef nonnull @.str.12, i32 noundef %73, i64 noundef %67, i32 noundef %75, i64 noundef %.07395, i64 noundef %61) #4
  br label %76

76:                                               ; preds = %69, %71, %59
  store i8 1, ptr %58, align 1, !tbaa !34
  %.not86 = icmp eq i8 %66, 0
  br i1 %.not86, label %116, label %77

77:                                               ; preds = %76
  %78 = getelementptr inbounds i8, ptr %35, i64 144
  %79 = load i8, ptr %47, align 1, !tbaa !29
  %80 = getelementptr inbounds i8, ptr %35, i64 152
  store i8 %79, ptr %80, align 8, !tbaa !35
  %81 = icmp eq i8 %79, 6
  br i1 %81, label %82, label %112

82:                                               ; preds = %77
  %83 = load i32, ptr %9, align 8, !tbaa !14
  %84 = add i32 %83, 1
  store i32 %84, ptr %9, align 8, !tbaa !14
  %85 = call i64 @Int13GetDeviceParameters(ptr noundef nonnull %35, ptr noundef nonnull %78)
  %.not87 = icmp eq i64 %85, 0
  br i1 %.not87, label %112, label %86

86:                                               ; preds = %82
  %87 = call i64 @Int13Extensions(ptr noundef nonnull %35, ptr noundef nonnull %78)
  %.not89 = icmp eq i64 %87, 0
  br i1 %.not89, label %95, label %88

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

95:                                               ; preds = %86
  %96 = call zeroext i8 @DebugAssertEnabled() #4
  %.not90 = icmp eq i8 %96, 0
  br i1 %.not90, label %98, label %97

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

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

112:                                              ; preds = %82, %77
  %113 = getelementptr inbounds i8, ptr %9, i64 4
  %114 = load i8, ptr %113, align 4, !tbaa !44
  %.not88 = icmp eq i8 %114, 0
  br i1 %.not88, label %.loopexit, label %115

115:                                              ; preds = %112
  store i8 0, ptr %58, align 1, !tbaa !34
  br label %.loopexit

116:                                              ; preds = %76
  %117 = mul nuw nsw i64 %61, %12
  %118 = call ptr @CopyMem(ptr noundef %.07593, ptr noundef %38, i64 noundef %117) #4
  %119 = sub i64 %.07494, %117
  %120 = getelementptr inbounds i8, ptr %.07593, i64 %117
  %121 = add i64 %61, %.07395
  %.not83 = icmp eq i64 %119, 0
  br i1 %.not83, label %.loopexit, label %59, !llvm.loop !45

.loopexit:                                        ; preds = %116, %112, %115, %28, %26, %25, %19, %15, %5, %98
  %.0 = phi i64 [ -9223372036854775795, %98 ], [ -9223372036854775795, %5 ], [ -9223372036854775806, %15 ], [ -9223372036854775806, %19 ], [ -9223372036854775804, %25 ], [ -9223372036854775806, %26 ], [ 0, %28 ], [ -9223372036854775801, %115 ], [ -9223372036854775801, %112 ], [ 0, %116 ]
  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 ptr @CopyMem(ptr noundef, 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 = !{!8, !8, i64 0}
!30 = !{!17, !8, i64 145}
!31 = !{!17, !10, i64 136}
!32 = !{!33, !10, i64 0}
!33 = !{!"_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}
!34 = !{!12, !8, i64 5}
!35 = !{!17, !8, i64 152}
!36 = !{!18, !7, i64 48}
!37 = !{!18, !19, i64 56}
!38 = !{!12, !8, i64 7}
!39 = !{!40, !10, i64 152}
!40 = !{!"", !41, 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}
!41 = !{!"", !7, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!42 = !{!17, !10, i64 8}
!43 = !{!40, !10, i64 136}
!44 = !{!12, !8, i64 4}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}


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