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

; 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"

%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_BYTE_REGS = type { i8, i8, i16, i8, i8, i16, i8, i8, i16, i8, i8, i16 }
%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.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.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._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._EFI_LEGACY_BIOS_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@mLegacyDriverUnder1Mb = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [162 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 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

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

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

; 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) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @GetDriveParameters(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca %union.EFI_IA32_REGISTER_SET, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %10 = call ptr @ZeroMem(ptr noundef %7, i64 noundef 48)
  %11 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %7, i32 0, i32 1
  store i8 72, ptr %11, align 1, !tbaa !9
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %12, i32 0, i32 1
  %14 = load i8, ptr %13, align 1, !tbaa !10
  %15 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %7, i32 0, i32 9
  store i8 %14, ptr %15, align 4, !tbaa !9
  %16 = load ptr, ptr @mLegacyDriverUnder1Mb, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %16, i32 0, i32 16
  %18 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %17, i32 0, i32 0
  store i16 74, ptr %18, align 8, !tbaa !16
  %19 = load ptr, ptr @mLegacyDriverUnder1Mb, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %19, i32 0, i32 16
  %21 = ptrtoint ptr %20 to i64
  %22 = lshr i64 %21, 4
  %23 = trunc i64 %22 to i16
  %24 = zext i16 %23 to i32
  %25 = and i32 %24, 61440
  %26 = trunc i32 %25 to i16
  %27 = getelementptr inbounds %struct.EFI_WORD_REGS, ptr %7, i32 0, i32 17
  store i16 %26, ptr %27, align 2, !tbaa !9
  %28 = load ptr, ptr @mLegacyDriverUnder1Mb, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %28, i32 0, i32 16
  %30 = ptrtoint ptr %29 to i64
  %31 = trunc i64 %30 to i16
  %32 = zext i16 %31 to i32
  %33 = and i32 %32, 65535
  %34 = trunc i32 %33 to i16
  %35 = getelementptr inbounds %struct.EFI_WORD_REGS, ptr %7, i32 0, i32 8
  store i16 %34, ptr %35, align 4, !tbaa !9
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %36, i32 0, i32 7
  %38 = load ptr, ptr %37, align 8, !tbaa !17
  %39 = getelementptr inbounds %struct._EFI_LEGACY_BIOS_PROTOCOL, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %41, i32 0, i32 7
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  %44 = call zeroext i8 %40(ptr noundef %43, i8 noundef zeroext 19, ptr noundef %7)
  %45 = zext i8 %44 to i64
  store i64 %45, ptr %6, align 8, !tbaa !23
  br label %46

46:                                               ; preds = %2
  %47 = call zeroext i8 @DebugPrintEnabled()
  %48 = icmp ne i8 %47, 0
  br i1 %48, label %49, label %65

49:                                               ; preds = %46
  br label %50

50:                                               ; preds = %49
  %51 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1)
  %52 = icmp ne i8 %51, 0
  br i1 %52, label %53, label %62

53:                                               ; preds = %50
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %54, i32 0, i32 1
  %56 = load i8, ptr %55, align 1, !tbaa !10
  %57 = zext i8 %56 to i32
  %58 = load i64, ptr %6, align 8, !tbaa !23
  %59 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %7, i32 0, i32 1
  %60 = load i8, ptr %59, align 1, !tbaa !9
  %61 = zext i8 %60 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef @.str.3, i32 noundef %57, i64 noundef %58, i32 noundef %61)
  br label %62

62:                                               ; preds = %53, %50
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64, %46
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  %68 = load i64, ptr %6, align 8, !tbaa !23
  %69 = icmp ne i64 %68, 0
  br i1 %69, label %75, label %70

70:                                               ; preds = %67
  %71 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %7, i32 0, i32 1
  %72 = load i8, ptr %71, align 1, !tbaa !9
  %73 = zext i8 %72 to i32
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %83

75:                                               ; preds = %70, %67
  %76 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %7, i32 0, i32 1
  %77 = load i8, ptr %76, align 1, !tbaa !9
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %78, i32 0, i32 8
  store i8 %77, ptr %79, align 8, !tbaa !24
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %80, i32 0, i32 16
  %82 = call ptr @SetMem(ptr noundef %81, i64 noundef 74, i8 noundef zeroext -81)
  store i64 0, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %342

83:                                               ; preds = %70
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %84, i32 0, i32 16
  %86 = load ptr, ptr @mLegacyDriverUnder1Mb, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %86, i32 0, i32 16
  %88 = call ptr @CopyMem(ptr noundef %85, ptr noundef %87, i64 noundef 74)
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %89, i32 0, i32 11
  %91 = load i8, ptr %90, align 1, !tbaa !25
  %92 = icmp ne i8 %91, 0
  br i1 %92, label %93, label %312

93:                                               ; preds = %83
  %94 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %7, i32 0, i32 1
  store i8 32, ptr %94, align 1, !tbaa !9
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %95, i32 0, i32 1
  %97 = load i8, ptr %96, align 1, !tbaa !10
  %98 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %7, i32 0, i32 9
  store i8 %97, ptr %98, align 4, !tbaa !9
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %99, i32 0, i32 7
  %101 = load ptr, ptr %100, align 8, !tbaa !17
  %102 = getelementptr inbounds %struct._EFI_LEGACY_BIOS_PROTOCOL, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !21
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.BIOS_BLOCK_IO_DEV, ptr %104, i32 0, i32 7
  %106 = load ptr, ptr %105, align 8, !tbaa !17
  %107 = call zeroext i8 %103(ptr noundef %106, i8 noundef zeroext 19, ptr noundef %7)
  %108 = zext i8 %107 to i64
  store i64 %108, ptr %6, align 8, !tbaa !23
  br label %109

109:                                              ; preds = %93
  %110 = call zeroext i8 @DebugPrintEnabled()
  %111 = icmp ne i8 %110, 0
  br i1 %111, label %112, label %128

112:                                              ; preds = %109
  br label %113

113:                                              ; preds = %112
  %114 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1)
  %115 = icmp ne i8 %114, 0
  br i1 %115, label %116, label %125

116:                                              ; preds = %113
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %117, i32 0, i32 1
  %119 = load i8, ptr %118, align 1, !tbaa !10
  %120 = zext i8 %119 to i32
  %121 = load i64, ptr %6, align 8, !tbaa !23
  %122 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %7, i32 0, i32 0
  %123 = load i8, ptr %122, align 4, !tbaa !9
  %124 = zext i8 %123 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef @.str.4, i32 noundef %120, i64 noundef %121, i32 noundef %124)
  br label %125

125:                                              ; preds = %116, %113
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127, %109
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129
  %131 = load i64, ptr %6, align 8, !tbaa !23
  %132 = icmp ne i64 %131, 0
  br i1 %132, label %133, label %187

133:                                              ; preds = %130
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %134, i32 0, i32 16
  %136 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %135, i32 0, i32 1
  %137 = load i16, ptr %136, align 2, !tbaa !26
  %138 = zext i16 %137 to i32
  %139 = and i32 %138, 2
  %140 = icmp eq i32 %139, 2
  br i1 %140, label %141, label %179

141:                                              ; preds = %133
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %142, i32 0, i32 16
  %144 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %143, i32 0, i32 3
  %145 = load i32, ptr %144, align 8, !tbaa !27
  %146 = sub i32 %145, 1
  %147 = trunc i32 %146 to i8
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %148, i32 0, i32 12
  store i8 %147, ptr %149, align 2, !tbaa !28
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %150, i32 0, i32 16
  %152 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %151, i32 0, i32 4
  %153 = load i32, ptr %152, align 4, !tbaa !29
  %154 = trunc i32 %153 to i8
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %155, i32 0, i32 13
  store i8 %154, ptr %156, align 1, !tbaa !30
  br label %157

157:                                              ; preds = %141
  %158 = call zeroext i8 @DebugAssertEnabled()
  %159 = icmp ne i8 %158, 0
  br i1 %159, label %160, label %168

160:                                              ; preds = %157
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %161, i32 0, i32 13
  %163 = load i8, ptr %162, align 1, !tbaa !30
  %164 = zext i8 %163 to i32
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %167, label %166

166:                                              ; preds = %160
  call void @DebugAssert(ptr noundef @.str.5, i64 noundef 284, ptr noundef @.str.6)
  br label %167

167:                                              ; preds = %166, %160
  br label %168

168:                                              ; preds = %167, %157
  br label %169

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169
  %171 = load ptr, ptr %5, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %171, i32 0, i32 16
  %173 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %172, i32 0, i32 2
  %174 = load i32, ptr %173, align 4, !tbaa !31
  %175 = sub i32 %174, 1
  %176 = trunc i32 %175 to i16
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %177, i32 0, i32 14
  store i16 %176, ptr %178, align 4, !tbaa !32
  br label %186

179:                                              ; preds = %133
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %180, i32 0, i32 12
  store i8 0, ptr %181, align 2, !tbaa !28
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %182, i32 0, i32 13
  store i8 1, ptr %183, align 1, !tbaa !30
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %184, i32 0, i32 14
  store i16 0, ptr %185, align 4, !tbaa !32
  br label %186

186:                                              ; preds = %179, %170
  br label %288

187:                                              ; preds = %130
  %188 = getelementptr inbounds %struct.EFI_BYTE_REGS, ptr %7, i32 0, i32 0
  %189 = load i8, ptr %188, align 4, !tbaa !9
  %190 = zext i8 %189 to i32
  switch i32 %190, label %280 [
    i32 3, label %191
    i32 4, label %198
    i32 6, label %205
    i32 12, label %212
    i32 13, label %219
    i32 14, label %226
    i32 15, label %226
    i32 16, label %226
  ]

191:                                              ; preds = %187
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %192, i32 0, i32 12
  store i8 1, ptr %193, align 2, !tbaa !28
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %194, i32 0, i32 13
  store i8 9, ptr %195, align 1, !tbaa !30
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %196, i32 0, i32 14
  store i16 79, ptr %197, align 4, !tbaa !32
  br label %287

198:                                              ; preds = %187
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %199, i32 0, i32 12
  store i8 1, ptr %200, align 2, !tbaa !28
  %201 = load ptr, ptr %5, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %201, i32 0, i32 13
  store i8 18, ptr %202, align 1, !tbaa !30
  %203 = load ptr, ptr %5, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %203, i32 0, i32 14
  store i16 79, ptr %204, align 4, !tbaa !32
  br label %287

205:                                              ; preds = %187
  %206 = load ptr, ptr %5, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %206, i32 0, i32 12
  store i8 1, ptr %207, align 2, !tbaa !28
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %208, i32 0, i32 13
  store i8 36, ptr %209, align 1, !tbaa !30
  %210 = load ptr, ptr %5, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %210, i32 0, i32 14
  store i16 79, ptr %211, align 4, !tbaa !32
  br label %287

212:                                              ; preds = %187
  %213 = load ptr, ptr %5, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %213, i32 0, i32 12
  store i8 1, ptr %214, align 2, !tbaa !28
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %215, i32 0, i32 13
  store i8 9, ptr %216, align 1, !tbaa !30
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %217, i32 0, i32 14
  store i16 39, ptr %218, align 4, !tbaa !32
  br label %287

219:                                              ; preds = %187
  %220 = load ptr, ptr %5, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %220, i32 0, i32 12
  store i8 1, ptr %221, align 2, !tbaa !28
  %222 = load ptr, ptr %5, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %222, i32 0, i32 13
  store i8 15, ptr %223, align 1, !tbaa !30
  %224 = load ptr, ptr %5, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %224, i32 0, i32 14
  store i16 79, ptr %225, align 4, !tbaa !32
  br label %287

226:                                              ; preds = %187, %187, %187
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %227, i32 0, i32 16
  %229 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %228, i32 0, i32 1
  %230 = load i16, ptr %229, align 2, !tbaa !26
  %231 = zext i16 %230 to i32
  %232 = and i32 %231, 2
  %233 = icmp eq i32 %232, 2
  br i1 %233, label %234, label %272

234:                                              ; preds = %226
  %235 = load ptr, ptr %5, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %235, i32 0, i32 16
  %237 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %236, i32 0, i32 3
  %238 = load i32, ptr %237, align 8, !tbaa !27
  %239 = sub i32 %238, 1
  %240 = trunc i32 %239 to i8
  %241 = load ptr, ptr %5, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %241, i32 0, i32 12
  store i8 %240, ptr %242, align 2, !tbaa !28
  %243 = load ptr, ptr %5, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %243, i32 0, i32 16
  %245 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %244, i32 0, i32 4
  %246 = load i32, ptr %245, align 4, !tbaa !29
  %247 = trunc i32 %246 to i8
  %248 = load ptr, ptr %5, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %248, i32 0, i32 13
  store i8 %247, ptr %249, align 1, !tbaa !30
  br label %250

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

253:                                              ; preds = %250
  %254 = load ptr, ptr %5, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %254, i32 0, i32 13
  %256 = load i8, ptr %255, align 1, !tbaa !30
  %257 = zext i8 %256 to i32
  %258 = icmp ne i32 %257, 0
  br i1 %258, label %260, label %259

259:                                              ; preds = %253
  call void @DebugAssert(ptr noundef @.str.5, i64 noundef 357, ptr noundef @.str.6)
  br label %260

260:                                              ; preds = %259, %253
  br label %261

261:                                              ; preds = %260, %250
  br label %262

262:                                              ; preds = %261
  br label %263

263:                                              ; preds = %262
  %264 = load ptr, ptr %5, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %264, i32 0, i32 16
  %266 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %265, i32 0, i32 2
  %267 = load i32, ptr %266, align 4, !tbaa !31
  %268 = sub i32 %267, 1
  %269 = trunc i32 %268 to i16
  %270 = load ptr, ptr %5, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %270, i32 0, i32 14
  store i16 %269, ptr %271, align 4, !tbaa !32
  br label %279

272:                                              ; preds = %226
  %273 = load ptr, ptr %5, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %273, i32 0, i32 12
  store i8 0, ptr %274, align 2, !tbaa !28
  %275 = load ptr, ptr %5, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %275, i32 0, i32 13
  store i8 1, ptr %276, align 1, !tbaa !30
  %277 = load ptr, ptr %5, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %277, i32 0, i32 14
  store i16 0, ptr %278, align 4, !tbaa !32
  br label %279

279:                                              ; preds = %272, %263
  br label %287

280:                                              ; preds = %187
  %281 = load ptr, ptr %5, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %281, i32 0, i32 12
  store i8 0, ptr %282, align 2, !tbaa !28
  %283 = load ptr, ptr %5, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %283, i32 0, i32 13
  store i8 1, ptr %284, align 1, !tbaa !30
  %285 = load ptr, ptr %5, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %285, i32 0, i32 14
  store i16 0, ptr %286, align 4, !tbaa !32
  br label %287

287:                                              ; preds = %280, %279, %219, %212, %205, %198, %191
  br label %288

288:                                              ; preds = %287, %186
  %289 = load ptr, ptr %5, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %289, i32 0, i32 12
  %291 = load i8, ptr %290, align 2, !tbaa !28
  %292 = zext i8 %291 to i32
  %293 = add nsw i32 %292, 1
  %294 = load ptr, ptr %5, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %294, i32 0, i32 13
  %296 = load i8, ptr %295, align 1, !tbaa !30
  %297 = zext i8 %296 to i32
  %298 = mul nsw i32 %293, %297
  %299 = load ptr, ptr %5, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %299, i32 0, i32 14
  %301 = load i16, ptr %300, align 4, !tbaa !32
  %302 = zext i16 %301 to i32
  %303 = add nsw i32 %302, 1
  %304 = mul nsw i32 %298, %303
  %305 = sext i32 %304 to i64
  %306 = load ptr, ptr %5, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %306, i32 0, i32 16
  %308 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %307, i32 0, i32 5
  store i64 %305, ptr %308, align 8, !tbaa !33
  %309 = load ptr, ptr %5, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %309, i32 0, i32 16
  %311 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %310, i32 0, i32 6
  store i16 512, ptr %311, align 8, !tbaa !34
  br label %312

312:                                              ; preds = %288, %83
  %313 = load ptr, ptr %5, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %313, i32 0, i32 16
  %315 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %314, i32 0, i32 7
  %316 = load i32, ptr %315, align 2, !tbaa !35
  %317 = zext i32 %316 to i64
  %318 = lshr i64 %317, 4
  %319 = trunc i64 %318 to i16
  %320 = zext i16 %319 to i32
  %321 = and i32 %320, 61440
  %322 = trunc i32 %321 to i16
  %323 = zext i16 %322 to i32
  %324 = shl i32 %323, 4
  %325 = sext i32 %324 to i64
  store i64 %325, ptr %8, align 8, !tbaa !23
  %326 = load ptr, ptr %5, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %326, i32 0, i32 16
  %328 = getelementptr inbounds %struct.EDD_DRIVE_PARAMETERS, ptr %327, i32 0, i32 7
  %329 = load i32, ptr %328, align 2, !tbaa !35
  %330 = zext i32 %329 to i64
  %331 = trunc i64 %330 to i16
  %332 = zext i16 %331 to i32
  %333 = and i32 %332, 65535
  %334 = trunc i32 %333 to i16
  %335 = zext i16 %334 to i64
  %336 = load i64, ptr %8, align 8, !tbaa !23
  %337 = add i64 %336, %335
  store i64 %337, ptr %8, align 8, !tbaa !23
  %338 = load i64, ptr %8, align 8, !tbaa !23
  %339 = inttoptr i64 %338 to ptr
  %340 = load ptr, ptr %5, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.BIOS_LEGACY_DRIVE, ptr %340, i32 0, i32 9
  store ptr %339, ptr %341, align 8, !tbaa !36
  store i64 1, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %342

342:                                              ; preds = %312, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %343 = load i64, ptr %3, align 8
  ret i64 %343
}

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

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

declare zeroext i8 @DebugAssertEnabled() #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !7, i64 1}
!11 = !{!"", !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, !12, i64 28, !12, i64 30, !13, i64 32}
!12 = !{!"short", !7, i64 0}
!13 = !{!"", !12, i64 0, !12, i64 2, !14, i64 4, !14, i64 8, !14, i64 12, !15, i64 16, !12, i64 24, !14, i64 26, !12, i64 30, !7, i64 32, !7, i64 33, !12, i64 34, !7, i64 36, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 72, !7, i64 73}
!14 = !{!"int", !7, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!11, !12, i64 32}
!17 = !{!18, !6, i64 136}
!18 = !{!"", !15, i64 0, !6, i64 8, !6, i64 16, !19, i64 24, !20, i64 72, !6, i64 120, !6, i64 128, !6, i64 136, !11, i64 144}
!19 = !{!"_EFI_BLOCK_IO_PROTOCOL", !15, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!20 = !{!"", !14, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !14, i64 12, !14, i64 16, !15, i64 24, !15, i64 32, !14, i64 40, !14, i64 44}
!21 = !{!22, !6, i64 0}
!22 = !{!"_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}
!23 = !{!15, !15, i64 0}
!24 = !{!11, !7, i64 8}
!25 = !{!11, !7, i64 25}
!26 = !{!11, !12, i64 34}
!27 = !{!11, !14, i64 40}
!28 = !{!11, !7, i64 26}
!29 = !{!11, !14, i64 44}
!30 = !{!11, !7, i64 27}
!31 = !{!11, !14, i64 36}
!32 = !{!11, !12, i64 28}
!33 = !{!11, !15, i64 48}
!34 = !{!11, !12, i64 56}
!35 = !{!11, !14, i64 58}
!36 = !{!11, !6, i64 16}


; 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"

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

@mLegacyDriverUnder1Mb = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [162 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 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

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #1

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

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

; 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 #1

; Function Attrs: nounwind uwtable
define dso_local range(i64 0, 2) i64 @GetDriveParameters(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %union.EFI_IA32_REGISTER_SET, align 4
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #3
  %4 = call ptr @ZeroMem(ptr noundef nonnull %3, i64 noundef 48) #3
  %5 = getelementptr inbounds i8, ptr %3, i64 1
  store i8 72, ptr %5, align 1, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 1
  %7 = load i8, ptr %6, align 1, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %3, i64 12
  store i8 %7, ptr %8, align 4, !tbaa !5
  %9 = load ptr, ptr @mLegacyDriverUnder1Mb, align 8, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %9, i64 32
  store i16 74, ptr %10, align 8, !tbaa !16
  %11 = ptrtoint ptr %10 to i64
  %12 = lshr i64 %11, 4
  %13 = trunc i64 %12 to i16
  %14 = and i16 %13, -4096
  %15 = getelementptr inbounds i8, ptr %3, i64 34
  store i16 %14, ptr %15, align 2, !tbaa !5
  %16 = trunc i64 %11 to i16
  %17 = getelementptr inbounds i8, ptr %3, i64 16
  store i16 %16, ptr %17, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 136
  %19 = load ptr, ptr %18, align 8, !tbaa !17
  %20 = load ptr, ptr %19, align 8, !tbaa !21
  %21 = call zeroext i8 %20(ptr noundef nonnull %19, i8 noundef zeroext 19, ptr noundef nonnull %3) #3
  %22 = zext i8 %21 to i64
  %23 = call zeroext i8 @DebugPrintEnabled() #3
  %.not = icmp eq i8 %23, 0
  br i1 %.not, label %31, label %24

24:                                               ; preds = %2
  %25 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1) #3
  %.not69 = icmp eq i8 %25, 0
  br i1 %.not69, label %31, label %26

26:                                               ; preds = %24
  %27 = load i8, ptr %6, align 1, !tbaa !8
  %28 = zext i8 %27 to i32
  %29 = load i8, ptr %5, align 1, !tbaa !5
  %30 = zext i8 %29 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef nonnull @.str.3, i32 noundef %28, i64 noundef %22, i32 noundef %30) #3
  br label %31

31:                                               ; preds = %24, %26, %2
  %32 = icmp ne i8 %21, 0
  %33 = load i8, ptr %5, align 1
  %34 = icmp ne i8 %33, 0
  %or.cond = select i1 %32, i1 true, i1 %34
  br i1 %or.cond, label %35, label %39

35:                                               ; preds = %31
  %36 = getelementptr inbounds i8, ptr %1, i64 8
  store i8 %33, ptr %36, align 8, !tbaa !23
  %37 = getelementptr inbounds i8, ptr %1, i64 32
  %38 = call ptr @SetMem(ptr noundef nonnull %37, i64 noundef 74, i8 noundef zeroext -81) #3
  br label %155

39:                                               ; preds = %31
  %40 = getelementptr inbounds i8, ptr %1, i64 32
  %41 = load ptr, ptr @mLegacyDriverUnder1Mb, align 8, !tbaa !15
  %42 = getelementptr inbounds i8, ptr %41, i64 32
  %43 = call ptr @CopyMem(ptr noundef nonnull %40, ptr noundef nonnull %42, i64 noundef 74) #3
  %44 = getelementptr inbounds i8, ptr %1, i64 25
  %45 = load i8, ptr %44, align 1, !tbaa !24
  %.not70 = icmp eq i8 %45, 0
  br i1 %.not70, label %148, label %46

46:                                               ; preds = %39
  store i8 32, ptr %5, align 1, !tbaa !5
  %47 = load i8, ptr %6, align 1, !tbaa !8
  store i8 %47, ptr %8, align 4, !tbaa !5
  %48 = load ptr, ptr %18, align 8, !tbaa !17
  %49 = load ptr, ptr %48, align 8, !tbaa !21
  %50 = call zeroext i8 %49(ptr noundef nonnull %48, i8 noundef zeroext 19, ptr noundef nonnull %3) #3
  %51 = zext i8 %50 to i64
  %52 = call zeroext i8 @DebugPrintEnabled() #3
  %.not71 = icmp eq i8 %52, 0
  br i1 %.not71, label %60, label %53

53:                                               ; preds = %46
  %54 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 1) #3
  %.not72 = icmp eq i8 %54, 0
  br i1 %.not72, label %60, label %55

55:                                               ; preds = %53
  %56 = load i8, ptr %6, align 1, !tbaa !8
  %57 = zext i8 %56 to i32
  %58 = load i8, ptr %3, align 4, !tbaa !5
  %59 = zext i8 %58 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 1, ptr noundef nonnull @.str.4, i32 noundef %57, i64 noundef %51, i32 noundef %59) #3
  br label %60

60:                                               ; preds = %53, %55, %46
  %.not73 = icmp eq i8 %50, 0
  br i1 %.not73, label %87, label %61

61:                                               ; preds = %60
  %62 = getelementptr inbounds i8, ptr %1, i64 34
  %63 = load i16, ptr %62, align 2, !tbaa !25
  %64 = and i16 %63, 2
  %.not77 = icmp eq i16 %64, 0
  br i1 %.not77, label %84, label %65

65:                                               ; preds = %61
  %66 = getelementptr inbounds i8, ptr %1, i64 40
  %67 = load i32, ptr %66, align 8, !tbaa !26
  %68 = trunc i32 %67 to i8
  %69 = add i8 %68, -1
  %70 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 %69, ptr %70, align 2, !tbaa !27
  %71 = getelementptr inbounds i8, ptr %1, i64 44
  %72 = load i32, ptr %71, align 4, !tbaa !28
  %73 = trunc i32 %72 to i8
  %74 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 %73, ptr %74, align 1, !tbaa !29
  %75 = call zeroext i8 @DebugAssertEnabled() #3
  %.not78 = icmp eq i8 %75, 0
  br i1 %.not78, label %79, label %76

76:                                               ; preds = %65
  %77 = load i8, ptr %74, align 1, !tbaa !29
  %.not79 = icmp eq i8 %77, 0
  br i1 %.not79, label %78, label %79

78:                                               ; preds = %76
  call void @DebugAssert(ptr noundef nonnull @.str.5, i64 noundef 284, ptr noundef nonnull @.str.6) #3
  br label %79

79:                                               ; preds = %76, %78, %65
  %80 = getelementptr inbounds i8, ptr %1, i64 36
  %81 = load i32, ptr %80, align 4, !tbaa !30
  %82 = trunc i32 %81 to i16
  %83 = add i16 %82, -1
  br label %133

84:                                               ; preds = %61
  %85 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 0, ptr %85, align 2, !tbaa !27
  %86 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 1, ptr %86, align 1, !tbaa !29
  br label %133

87:                                               ; preds = %60
  %88 = load i8, ptr %3, align 4, !tbaa !5
  switch i8 %88, label %130 [
    i8 3, label %89
    i8 4, label %92
    i8 6, label %95
    i8 12, label %98
    i8 13, label %101
    i8 14, label %104
    i8 15, label %104
    i8 16, label %104
  ]

89:                                               ; preds = %87
  %90 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 1, ptr %90, align 2, !tbaa !27
  %91 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 9, ptr %91, align 1, !tbaa !29
  br label %133

92:                                               ; preds = %87
  %93 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 1, ptr %93, align 2, !tbaa !27
  %94 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 18, ptr %94, align 1, !tbaa !29
  br label %133

95:                                               ; preds = %87
  %96 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 1, ptr %96, align 2, !tbaa !27
  %97 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 36, ptr %97, align 1, !tbaa !29
  br label %133

98:                                               ; preds = %87
  %99 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 1, ptr %99, align 2, !tbaa !27
  %100 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 9, ptr %100, align 1, !tbaa !29
  br label %133

101:                                              ; preds = %87
  %102 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 1, ptr %102, align 2, !tbaa !27
  %103 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 15, ptr %103, align 1, !tbaa !29
  br label %133

104:                                              ; preds = %87, %87, %87
  %105 = getelementptr inbounds i8, ptr %1, i64 34
  %106 = load i16, ptr %105, align 2, !tbaa !25
  %107 = and i16 %106, 2
  %.not74 = icmp eq i16 %107, 0
  br i1 %.not74, label %127, label %108

108:                                              ; preds = %104
  %109 = getelementptr inbounds i8, ptr %1, i64 40
  %110 = load i32, ptr %109, align 8, !tbaa !26
  %111 = trunc i32 %110 to i8
  %112 = add i8 %111, -1
  %113 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 %112, ptr %113, align 2, !tbaa !27
  %114 = getelementptr inbounds i8, ptr %1, i64 44
  %115 = load i32, ptr %114, align 4, !tbaa !28
  %116 = trunc i32 %115 to i8
  %117 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 %116, ptr %117, align 1, !tbaa !29
  %118 = call zeroext i8 @DebugAssertEnabled() #3
  %.not75 = icmp eq i8 %118, 0
  br i1 %.not75, label %122, label %119

119:                                              ; preds = %108
  %120 = load i8, ptr %117, align 1, !tbaa !29
  %.not76 = icmp eq i8 %120, 0
  br i1 %.not76, label %121, label %122

121:                                              ; preds = %119
  call void @DebugAssert(ptr noundef nonnull @.str.5, i64 noundef 357, ptr noundef nonnull @.str.6) #3
  br label %122

122:                                              ; preds = %119, %121, %108
  %123 = getelementptr inbounds i8, ptr %1, i64 36
  %124 = load i32, ptr %123, align 4, !tbaa !30
  %125 = trunc i32 %124 to i16
  %126 = add i16 %125, -1
  br label %133

127:                                              ; preds = %104
  %128 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 0, ptr %128, align 2, !tbaa !27
  %129 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 1, ptr %129, align 1, !tbaa !29
  br label %133

130:                                              ; preds = %87
  %131 = getelementptr inbounds i8, ptr %1, i64 26
  store i8 0, ptr %131, align 2, !tbaa !27
  %132 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 1, ptr %132, align 1, !tbaa !29
  br label %133

133:                                              ; preds = %89, %92, %95, %98, %101, %130, %127, %122, %79, %84
  %.sink = phi i16 [ 79, %89 ], [ 79, %92 ], [ 79, %95 ], [ 39, %98 ], [ 79, %101 ], [ 0, %130 ], [ 0, %127 ], [ %126, %122 ], [ %83, %79 ], [ 0, %84 ]
  %134 = getelementptr inbounds i8, ptr %1, i64 28
  store i16 %.sink, ptr %134, align 4, !tbaa !31
  %135 = getelementptr inbounds i8, ptr %1, i64 26
  %136 = load i8, ptr %135, align 2, !tbaa !27
  %137 = zext i8 %136 to i64
  %138 = add nuw nsw i64 %137, 1
  %139 = getelementptr inbounds i8, ptr %1, i64 27
  %140 = load i8, ptr %139, align 1, !tbaa !29
  %141 = zext i8 %140 to i64
  %142 = mul nuw nsw i64 %138, %141
  %143 = zext i16 %.sink to i64
  %144 = add nuw nsw i64 %143, 1
  %145 = mul nuw nsw i64 %142, %144
  %146 = getelementptr inbounds i8, ptr %1, i64 48
  store i64 %145, ptr %146, align 8, !tbaa !32
  %147 = getelementptr inbounds i8, ptr %1, i64 56
  store i16 512, ptr %147, align 8, !tbaa !33
  br label %148

148:                                              ; preds = %133, %39
  %149 = getelementptr inbounds i8, ptr %1, i64 58
  %150 = load i32, ptr %149, align 2, !tbaa !34
  %151 = and i32 %150, 1048575
  %152 = zext nneg i32 %151 to i64
  %153 = inttoptr i64 %152 to ptr
  %154 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr %153, ptr %154, align 8, !tbaa !35
  br label %155

155:                                              ; preds = %148, %35
  %.0 = phi i64 [ 0, %35 ], [ 1, %148 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #3
  ret i64 %.0
}

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

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !6, i64 1}
!9 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !6, i64 5, !6, i64 6, !6, i64 7, !6, i64 8, !10, i64 16, !6, i64 24, !6, i64 25, !6, i64 26, !6, i64 27, !11, i64 28, !11, i64 30, !12, i64 32}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"short", !6, i64 0}
!12 = !{!"", !11, i64 0, !11, i64 2, !13, i64 4, !13, i64 8, !13, i64 12, !14, i64 16, !11, i64 24, !13, i64 26, !11, i64 30, !6, i64 32, !6, i64 33, !11, i64 34, !6, i64 36, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 72, !6, i64 73}
!13 = !{!"int", !6, i64 0}
!14 = !{!"long long", !6, i64 0}
!15 = !{!10, !10, i64 0}
!16 = !{!9, !11, i64 32}
!17 = !{!18, !10, i64 136}
!18 = !{!"", !14, i64 0, !10, i64 8, !10, i64 16, !19, i64 24, !20, i64 72, !10, i64 120, !10, i64 128, !10, i64 136, !9, i64 144}
!19 = !{!"_EFI_BLOCK_IO_PROTOCOL", !14, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!20 = !{!"", !13, i64 0, !6, i64 4, !6, i64 5, !6, i64 6, !6, i64 7, !6, i64 8, !13, i64 12, !13, i64 16, !14, i64 24, !14, i64 32, !13, i64 40, !13, i64 44}
!21 = !{!22, !10, i64 0}
!22 = !{!"_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}
!23 = !{!9, !6, i64 8}
!24 = !{!9, !6, i64 25}
!25 = !{!9, !11, i64 34}
!26 = !{!9, !13, i64 40}
!27 = !{!9, !6, i64 26}
!28 = !{!9, !13, i64 44}
!29 = !{!9, !6, i64 27}
!30 = !{!9, !13, i64 36}
!31 = !{!9, !11, i64 28}
!32 = !{!9, !14, i64 48}
!33 = !{!9, !11, i64 56}
!34 = !{!9, !13, i64 58}
!35 = !{!9, !10, i64 16}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass