; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/OvmfPkg/QemuVideoDxe (InstallVbeShim)

; 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.IVT_ENTRY = type { i16, i16 }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct.VBE_INFO = type { %struct.VBE_INFO_BASE, [222 x i8] }
%struct.VBE_INFO_BASE = type <{ [4 x i8], i16, i32, i32, i32, i16, i16, i32, i32, i32 }>
%struct.VBE_MODE_INFO = type <{ i16, i8, i8, i16, i16, i16, i16, i32, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, [190 x i8] }>

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [43 x i8], align 1
@__FUNCTION__.InstallVbeShim = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@mVbeShim = external hidden constant [852 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@mProductRevision = external hidden constant [19 x i8], align 16
@.str.10 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @InstallVbeShim(ptr noundef %0, i64 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i8, align 1
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 1, 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 8, 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
  store i64 0, ptr %5, align 8, !tbaa !9
  store i64 786432, ptr %6, align 8, !tbaa !9
  store i64 983040, ptr %7, align 8, !tbaa !9
  store i64 1, ptr %8, align 8, !tbaa !9
  %21 = load i64, ptr %5, align 8, !tbaa !9
  %22 = inttoptr i64 %21 to ptr
  %23 = getelementptr inbounds %struct.IVT_ENTRY, ptr %22, i64 16
  store ptr %23, ptr %9, align 8, !tbaa !5
  %24 = load ptr, ptr @gBS, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = load i64, ptr %8, align 8, !tbaa !9
  %28 = call i64 %26(i32 noundef 2, i32 noundef 3, i64 noundef %27, ptr noundef %5)
  store i64 %28, ptr %10, align 8, !tbaa !9
  %29 = load i64, ptr %10, align 8, !tbaa !9
  %30 = icmp slt i64 %29, 0
  br i1 %30, label %31, label %92

31:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.IVT_ENTRY, ptr %32, i32 0, i32 1
  %34 = load i16, ptr %33, align 1, !tbaa !15
  %35 = zext i16 %34 to i32
  %36 = shl i32 %35, 4
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.IVT_ENTRY, ptr %37, i32 0, i32 0
  %39 = load i16, ptr %38, align 1, !tbaa !18
  %40 = zext i16 %39 to i32
  %41 = add nsw i32 %36, %40
  %42 = sext i32 %41 to i64
  store i64 %42, ptr %19, align 8, !tbaa !9
  %43 = load i64, ptr %19, align 8, !tbaa !9
  %44 = load i64, ptr %6, align 8, !tbaa !9
  %45 = icmp uge i64 %43, %44
  br i1 %45, label %46, label %73

46:                                               ; preds = %31
  %47 = load i64, ptr %19, align 8, !tbaa !9
  %48 = load i64, ptr %7, align 8, !tbaa !9
  %49 = icmp ult i64 %47, %48
  br i1 %49, label %50, label %73

50:                                               ; preds = %46
  br label %51

51:                                               ; preds = %50
  %52 = call zeroext i8 @DebugPrintEnabled()
  %53 = icmp ne i8 %52, 0
  br i1 %53, label %54, label %70

54:                                               ; preds = %51
  br label %55

55:                                               ; preds = %54
  %56 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 4194304)
  %57 = icmp ne i8 %56, 0
  br i1 %57, label %58, label %67

58:                                               ; preds = %55
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.IVT_ENTRY, ptr %59, i32 0, i32 1
  %61 = load i16, ptr %60, align 1, !tbaa !15
  %62 = zext i16 %61 to i32
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.IVT_ENTRY, ptr %63, i32 0, i32 0
  %65 = load i16, ptr %64, align 1, !tbaa !18
  %66 = zext i16 %65 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 4194304, ptr noundef @.str, ptr noundef @__FUNCTION__.InstallVbeShim, i32 noundef %62, i32 noundef %66)
  br label %67

67:                                               ; preds = %58, %55
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69, %51
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  store i32 1, ptr %20, align 4
  br label %89

73:                                               ; preds = %46, %31
  br label %74

74:                                               ; preds = %73
  %75 = call zeroext i8 @DebugPrintEnabled()
  %76 = icmp ne i8 %75, 0
  br i1 %76, label %77, label %86

77:                                               ; preds = %74
  br label %78

78:                                               ; preds = %77
  %79 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 4194304)
  %80 = icmp ne i8 %79, 0
  br i1 %80, label %81, label %83

81:                                               ; preds = %78
  %82 = load i64, ptr %10, align 8, !tbaa !9
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 4194304, ptr noundef @.str.1, ptr noundef @__FUNCTION__.InstallVbeShim, i64 noundef %82)
  br label %83

83:                                               ; preds = %81, %78
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85, %74
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  store i32 0, ptr %20, align 4
  br label %89

89:                                               ; preds = %88, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  %90 = load i32, ptr %20, align 4
  switch i32 %90, label %404 [
    i32 0, label %91
  ]

91:                                               ; preds = %89
  br label %121

92:                                               ; preds = %2
  br label %93

93:                                               ; preds = %92
  %94 = call zeroext i8 @DebugAssertEnabled()
  %95 = icmp ne i8 %94, 0
  br i1 %95, label %96, label %104

96:                                               ; preds = %93
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.IVT_ENTRY, ptr %97, i32 0, i32 1
  %99 = load i16, ptr %98, align 1, !tbaa !15
  %100 = zext i16 %99 to i32
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %103, label %102

102:                                              ; preds = %96
  call void @DebugAssert(ptr noundef @.str.2, i64 noundef 119, ptr noundef @.str.3)
  br label %103

103:                                              ; preds = %102, %96
  br label %104

104:                                              ; preds = %103, %93
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  %108 = call zeroext i8 @DebugAssertEnabled()
  %109 = icmp ne i8 %108, 0
  br i1 %109, label %110, label %118

110:                                              ; preds = %107
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.IVT_ENTRY, ptr %111, i32 0, i32 0
  %113 = load i16, ptr %112, align 1, !tbaa !18
  %114 = zext i16 %113 to i32
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %117, label %116

116:                                              ; preds = %110
  call void @DebugAssert(ptr noundef @.str.2, i64 noundef 120, ptr noundef @.str.4)
  br label %117

117:                                              ; preds = %116, %110
  br label %118

118:                                              ; preds = %117, %107
  br label %119

119:                                              ; preds = %118
  br label %120

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120, %91
  store i64 90, ptr %11, align 8, !tbaa !9
  %122 = load i64, ptr %11, align 8, !tbaa !9
  %123 = call zeroext i8 @PciRead8(i64 noundef %122)
  store i8 %123, ptr %12, align 1, !tbaa !19
  %124 = load i64, ptr %11, align 8, !tbaa !9
  %125 = load i8, ptr %12, align 1, !tbaa !19
  %126 = zext i8 %125 to i32
  %127 = or i32 %126, 3
  %128 = trunc i32 %127 to i8
  %129 = call zeroext i8 @PciWrite8(i64 noundef %124, i8 noundef zeroext %128)
  store i64 4, ptr %13, align 8, !tbaa !9
  br label %130

130:                                              ; preds = %121
  %131 = call zeroext i8 @DebugAssertEnabled()
  %132 = icmp ne i8 %131, 0
  br i1 %132, label %133, label %139

133:                                              ; preds = %130
  %134 = load i64, ptr %13, align 8, !tbaa !9
  %135 = shl i64 %134, 12
  %136 = icmp ule i64 852, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  call void @DebugAssert(ptr noundef @.str.2, i64 noundef 143, ptr noundef @.str.5)
  br label %138

138:                                              ; preds = %137, %133
  br label %139

139:                                              ; preds = %138, %130
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140
  %142 = load i64, ptr %6, align 8, !tbaa !9
  %143 = inttoptr i64 %142 to ptr
  %144 = call ptr @CopyMem(ptr noundef %143, ptr noundef @mVbeShim, i64 noundef 852)
  %145 = load i64, ptr %6, align 8, !tbaa !9
  %146 = inttoptr i64 %145 to ptr
  store ptr %146, ptr %14, align 8, !tbaa !5
  %147 = load ptr, ptr %14, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.VBE_INFO, ptr %147, i32 0, i32 0
  store ptr %148, ptr %15, align 8, !tbaa !5
  %149 = load ptr, ptr %14, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.VBE_INFO, ptr %149, i32 0, i32 1
  %151 = getelementptr inbounds [222 x i8], ptr %150, i64 0, i64 0
  store ptr %151, ptr %16, align 8, !tbaa !5
  %152 = load ptr, ptr %15, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds [4 x i8], ptr %153, i64 0, i64 0
  %155 = call ptr @CopyMem(ptr noundef %154, ptr noundef @.str.6, i64 noundef 4)
  %156 = load ptr, ptr %15, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %156, i32 0, i32 1
  store i16 768, ptr %157, align 1, !tbaa !20
  %158 = load i64, ptr %6, align 8, !tbaa !9
  %159 = shl i64 %158, 12
  %160 = load ptr, ptr %16, align 8, !tbaa !5
  %161 = ptrtoint ptr %160 to i64
  %162 = trunc i64 %161 to i16
  %163 = zext i16 %162 to i64
  %164 = or i64 %159, %163
  %165 = trunc i64 %164 to i32
  %166 = load ptr, ptr %15, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %166, i32 0, i32 2
  store i32 %165, ptr %167, align 1, !tbaa !22
  %168 = load ptr, ptr %16, align 8, !tbaa !5
  %169 = call ptr @CopyMem(ptr noundef %168, ptr noundef @.str.7, i64 noundef 5)
  %170 = load ptr, ptr %16, align 8, !tbaa !5
  %171 = getelementptr inbounds i8, ptr %170, i64 5
  store ptr %171, ptr %16, align 8, !tbaa !5
  %172 = load ptr, ptr %15, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %172, i32 0, i32 3
  store i32 1, ptr %173, align 1, !tbaa !23
  %174 = load i64, ptr %6, align 8, !tbaa !9
  %175 = shl i64 %174, 12
  %176 = load ptr, ptr %16, align 8, !tbaa !5
  %177 = ptrtoint ptr %176 to i64
  %178 = trunc i64 %177 to i16
  %179 = zext i16 %178 to i64
  %180 = or i64 %175, %179
  %181 = trunc i64 %180 to i32
  %182 = load ptr, ptr %15, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %182, i32 0, i32 4
  store i32 %181, ptr %183, align 1, !tbaa !24
  %184 = load ptr, ptr %16, align 8, !tbaa !5
  store i16 241, ptr %184, align 2, !tbaa !25
  %185 = load ptr, ptr %16, align 8, !tbaa !5
  %186 = getelementptr inbounds i8, ptr %185, i64 2
  store ptr %186, ptr %16, align 8, !tbaa !5
  %187 = load ptr, ptr %16, align 8, !tbaa !5
  store i16 -1, ptr %187, align 2, !tbaa !25
  %188 = load ptr, ptr %16, align 8, !tbaa !5
  %189 = getelementptr inbounds i8, ptr %188, i64 2
  store ptr %189, ptr %16, align 8, !tbaa !5
  %190 = load ptr, ptr %15, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %190, i32 0, i32 5
  store i16 48, ptr %191, align 1, !tbaa !26
  %192 = load ptr, ptr %15, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %192, i32 0, i32 6
  store i16 0, ptr %193, align 1, !tbaa !27
  %194 = load i64, ptr %6, align 8, !tbaa !9
  %195 = shl i64 %194, 12
  %196 = load ptr, ptr %16, align 8, !tbaa !5
  %197 = ptrtoint ptr %196 to i64
  %198 = trunc i64 %197 to i16
  %199 = zext i16 %198 to i64
  %200 = or i64 %195, %199
  %201 = trunc i64 %200 to i32
  %202 = load ptr, ptr %15, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %202, i32 0, i32 7
  store i32 %201, ptr %203, align 1, !tbaa !28
  %204 = load ptr, ptr %16, align 8, !tbaa !5
  %205 = call ptr @CopyMem(ptr noundef %204, ptr noundef @.str.8, i64 noundef 5)
  %206 = load ptr, ptr %16, align 8, !tbaa !5
  %207 = getelementptr inbounds i8, ptr %206, i64 5
  store ptr %207, ptr %16, align 8, !tbaa !5
  %208 = load i64, ptr %6, align 8, !tbaa !9
  %209 = shl i64 %208, 12
  %210 = load ptr, ptr %16, align 8, !tbaa !5
  %211 = ptrtoint ptr %210 to i64
  %212 = trunc i64 %211 to i16
  %213 = zext i16 %212 to i64
  %214 = or i64 %209, %213
  %215 = trunc i64 %214 to i32
  %216 = load ptr, ptr %15, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %216, i32 0, i32 8
  store i32 %215, ptr %217, align 1, !tbaa !29
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  %219 = load ptr, ptr %16, align 8, !tbaa !5
  %220 = load ptr, ptr %14, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.VBE_INFO, ptr %220, i32 0, i32 1
  %222 = getelementptr inbounds [222 x i8], ptr %221, i64 0, i64 0
  %223 = ptrtoint ptr %219 to i64
  %224 = ptrtoint ptr %222 to i64
  %225 = sub i64 %223, %224
  %226 = sub i64 222, %225
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = call i64 (ptr, i64, ptr, ...) @AsciiSPrint(ptr noundef %218, i64 noundef %226, ptr noundef @.str.9, ptr noundef %227)
  store i64 %228, ptr %17, align 8, !tbaa !9
  %229 = load i64, ptr %17, align 8, !tbaa !9
  %230 = add i64 %229, 1
  %231 = load ptr, ptr %16, align 8, !tbaa !5
  %232 = getelementptr inbounds i8, ptr %231, i64 %230
  store ptr %232, ptr %16, align 8, !tbaa !5
  %233 = load i64, ptr %6, align 8, !tbaa !9
  %234 = shl i64 %233, 12
  %235 = load ptr, ptr %16, align 8, !tbaa !5
  %236 = ptrtoint ptr %235 to i64
  %237 = trunc i64 %236 to i16
  %238 = zext i16 %237 to i64
  %239 = or i64 %234, %238
  %240 = trunc i64 %239 to i32
  %241 = load ptr, ptr %15, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.VBE_INFO_BASE, ptr %241, i32 0, i32 9
  store i32 %240, ptr %242, align 1, !tbaa !30
  %243 = load ptr, ptr %16, align 8, !tbaa !5
  %244 = call ptr @CopyMem(ptr noundef %243, ptr noundef @mProductRevision, i64 noundef 19)
  %245 = load ptr, ptr %16, align 8, !tbaa !5
  %246 = getelementptr inbounds i8, ptr %245, i64 19
  store ptr %246, ptr %16, align 8, !tbaa !5
  br label %247

247:                                              ; preds = %141
  %248 = call zeroext i8 @DebugAssertEnabled()
  %249 = icmp ne i8 %248, 0
  br i1 %249, label %250, label %261

250:                                              ; preds = %247
  %251 = load ptr, ptr %16, align 8, !tbaa !5
  %252 = load ptr, ptr %14, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.VBE_INFO, ptr %252, i32 0, i32 1
  %254 = getelementptr inbounds [222 x i8], ptr %253, i64 0, i64 0
  %255 = ptrtoint ptr %251 to i64
  %256 = ptrtoint ptr %254 to i64
  %257 = sub i64 %255, %256
  %258 = icmp uge i64 222, %257
  br i1 %258, label %260, label %259

259:                                              ; preds = %250
  call void @DebugAssert(ptr noundef @.str.2, i64 noundef 185, ptr noundef @.str.10)
  br label %260

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

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

262:                                              ; preds = %261
  br label %263

263:                                              ; preds = %262
  %264 = load ptr, ptr %16, align 8, !tbaa !5
  %265 = load ptr, ptr %16, align 8, !tbaa !5
  %266 = load ptr, ptr %14, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.VBE_INFO, ptr %266, i32 0, i32 1
  %268 = getelementptr inbounds [222 x i8], ptr %267, i64 0, i64 0
  %269 = ptrtoint ptr %265 to i64
  %270 = ptrtoint ptr %268 to i64
  %271 = sub i64 %269, %270
  %272 = sub i64 222, %271
  %273 = call ptr @ZeroMem(ptr noundef %264, i64 noundef %272)
  %274 = load ptr, ptr %14, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.VBE_INFO, ptr %274, i64 1
  store ptr %275, ptr %18, align 8, !tbaa !5
  %276 = load ptr, ptr %18, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %276, i32 0, i32 0
  store i16 187, ptr %277, align 1, !tbaa !31
  %278 = load ptr, ptr %18, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %278, i32 0, i32 1
  store i8 7, ptr %279, align 1, !tbaa !33
  %280 = load ptr, ptr %18, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %280, i32 0, i32 2
  store i8 0, ptr %281, align 1, !tbaa !34
  %282 = load ptr, ptr %18, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %282, i32 0, i32 3
  store i16 64, ptr %283, align 1, !tbaa !35
  %284 = load ptr, ptr %18, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %284, i32 0, i32 4
  store i16 64, ptr %285, align 1, !tbaa !36
  %286 = load ptr, ptr %18, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %286, i32 0, i32 5
  store i16 -24576, ptr %287, align 1, !tbaa !37
  %288 = load ptr, ptr %18, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %288, i32 0, i32 6
  store i16 0, ptr %289, align 1, !tbaa !38
  %290 = load ptr, ptr %18, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %290, i32 0, i32 7
  store i32 0, ptr %291, align 1, !tbaa !39
  %292 = load ptr, ptr %18, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %292, i32 0, i32 8
  store i16 4096, ptr %293, align 1, !tbaa !40
  %294 = load ptr, ptr %18, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %294, i32 0, i32 9
  store i16 1024, ptr %295, align 1, !tbaa !41
  %296 = load ptr, ptr %18, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %296, i32 0, i32 10
  store i16 768, ptr %297, align 1, !tbaa !42
  %298 = load ptr, ptr %18, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %298, i32 0, i32 11
  store i8 8, ptr %299, align 1, !tbaa !43
  %300 = load ptr, ptr %18, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %300, i32 0, i32 12
  store i8 16, ptr %301, align 1, !tbaa !44
  %302 = load ptr, ptr %18, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %302, i32 0, i32 13
  store i8 1, ptr %303, align 1, !tbaa !45
  %304 = load ptr, ptr %18, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %304, i32 0, i32 14
  store i8 32, ptr %305, align 1, !tbaa !46
  %306 = load ptr, ptr %18, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %306, i32 0, i32 15
  store i8 1, ptr %307, align 1, !tbaa !47
  %308 = load ptr, ptr %18, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %308, i32 0, i32 16
  store i8 6, ptr %309, align 1, !tbaa !48
  %310 = load ptr, ptr %18, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %310, i32 0, i32 17
  store i8 0, ptr %311, align 1, !tbaa !49
  %312 = load ptr, ptr %18, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %312, i32 0, i32 18
  store i8 0, ptr %313, align 1, !tbaa !50
  %314 = load ptr, ptr %18, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %314, i32 0, i32 19
  store i8 1, ptr %315, align 1, !tbaa !51
  %316 = load ptr, ptr %18, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %316, i32 0, i32 20
  store i8 8, ptr %317, align 1, !tbaa !52
  %318 = load ptr, ptr %18, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %318, i32 0, i32 21
  store i8 16, ptr %319, align 1, !tbaa !53
  %320 = load ptr, ptr %18, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %320, i32 0, i32 22
  store i8 8, ptr %321, align 1, !tbaa !54
  %322 = load ptr, ptr %18, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %322, i32 0, i32 23
  store i8 8, ptr %323, align 1, !tbaa !55
  %324 = load ptr, ptr %18, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %324, i32 0, i32 24
  store i8 8, ptr %325, align 1, !tbaa !56
  %326 = load ptr, ptr %18, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %326, i32 0, i32 25
  store i8 0, ptr %327, align 1, !tbaa !57
  %328 = load ptr, ptr %18, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %328, i32 0, i32 26
  store i8 8, ptr %329, align 1, !tbaa !58
  %330 = load ptr, ptr %18, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %330, i32 0, i32 27
  store i8 24, ptr %331, align 1, !tbaa !59
  %332 = load ptr, ptr %18, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %332, i32 0, i32 28
  store i8 2, ptr %333, align 1, !tbaa !60
  %334 = load i64, ptr %4, align 8, !tbaa !9
  %335 = trunc i64 %334 to i32
  %336 = load ptr, ptr %18, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %336, i32 0, i32 29
  store i32 %335, ptr %337, align 1, !tbaa !61
  %338 = load ptr, ptr %18, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %338, i32 0, i32 30
  store i32 0, ptr %339, align 1, !tbaa !62
  %340 = load ptr, ptr %18, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %340, i32 0, i32 31
  store i16 0, ptr %341, align 1, !tbaa !63
  %342 = load ptr, ptr %18, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %342, i32 0, i32 32
  store i16 4096, ptr %343, align 1, !tbaa !64
  %344 = load ptr, ptr %18, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %344, i32 0, i32 33
  store i8 0, ptr %345, align 1, !tbaa !65
  %346 = load ptr, ptr %18, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %346, i32 0, i32 34
  store i8 0, ptr %347, align 1, !tbaa !66
  %348 = load ptr, ptr %18, align 8, !tbaa !5
  %349 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %348, i32 0, i32 35
  store i8 8, ptr %349, align 1, !tbaa !67
  %350 = load ptr, ptr %18, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %350, i32 0, i32 36
  store i8 16, ptr %351, align 1, !tbaa !68
  %352 = load ptr, ptr %18, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %352, i32 0, i32 37
  store i8 8, ptr %353, align 1, !tbaa !69
  %354 = load ptr, ptr %18, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %354, i32 0, i32 38
  store i8 8, ptr %355, align 1, !tbaa !70
  %356 = load ptr, ptr %18, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %356, i32 0, i32 39
  store i8 8, ptr %357, align 1, !tbaa !71
  %358 = load ptr, ptr %18, align 8, !tbaa !5
  %359 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %358, i32 0, i32 40
  store i8 0, ptr %359, align 1, !tbaa !72
  %360 = load ptr, ptr %18, align 8, !tbaa !5
  %361 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %360, i32 0, i32 41
  store i8 8, ptr %361, align 1, !tbaa !73
  %362 = load ptr, ptr %18, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %362, i32 0, i32 42
  store i8 24, ptr %363, align 1, !tbaa !74
  %364 = load ptr, ptr %18, align 8, !tbaa !5
  %365 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %364, i32 0, i32 43
  store i32 0, ptr %365, align 1, !tbaa !75
  %366 = load ptr, ptr %18, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %366, i32 0, i32 44
  %368 = getelementptr inbounds [190 x i8], ptr %367, i64 0, i64 0
  %369 = call ptr @ZeroMem(ptr noundef %368, i64 noundef 190)
  %370 = load i64, ptr %11, align 8, !tbaa !9
  %371 = load i8, ptr %12, align 1, !tbaa !19
  %372 = zext i8 %371 to i32
  %373 = and i32 %372, -3
  %374 = or i32 %373, 1
  %375 = trunc i32 %374 to i8
  %376 = call zeroext i8 @PciWrite8(i64 noundef %370, i8 noundef zeroext %375)
  %377 = load i64, ptr %6, align 8, !tbaa !9
  %378 = lshr i64 %377, 4
  %379 = trunc i64 %378 to i16
  %380 = load ptr, ptr %9, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.IVT_ENTRY, ptr %380, i32 0, i32 1
  store i16 %379, ptr %381, align 1, !tbaa !15
  %382 = load ptr, ptr %18, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.VBE_MODE_INFO, ptr %382, i64 1
  %384 = ptrtoint ptr %383 to i64
  %385 = load i64, ptr %6, align 8, !tbaa !9
  %386 = sub i64 %384, %385
  %387 = trunc i64 %386 to i16
  %388 = load ptr, ptr %9, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.IVT_ENTRY, ptr %388, i32 0, i32 0
  store i16 %387, ptr %389, align 1, !tbaa !18
  br label %390

390:                                              ; preds = %263
  %391 = call zeroext i8 @DebugPrintEnabled()
  %392 = icmp ne i8 %391, 0
  br i1 %392, label %393, label %401

393:                                              ; preds = %390
  br label %394

394:                                              ; preds = %393
  %395 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %396 = icmp ne i8 %395, 0
  br i1 %396, label %397, label %398

397:                                              ; preds = %394
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.11, ptr noundef @__FUNCTION__.InstallVbeShim)
  br label %398

398:                                              ; preds = %397, %394
  br label %399

399:                                              ; preds = %398
  br label %400

400:                                              ; preds = %399
  br label %401

401:                                              ; preds = %400, %390
  br label %402

402:                                              ; preds = %401
  br label %403

403:                                              ; preds = %402
  store i32 0, ptr %20, align 4
  br label %404

404:                                              ; preds = %403, %89
  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 8, 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 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %405 = load i32, ptr %20, align 4
  switch i32 %405, label %407 [
    i32 0, label %406
    i32 1, label %406
  ]

406:                                              ; preds = %404, %404
  ret void

407:                                              ; preds = %404
  unreachable
}

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

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

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

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

declare zeroext i8 @DebugAssertEnabled() #2

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

declare zeroext i8 @PciRead8(i64 noundef) #2

declare zeroext i8 @PciWrite8(i64 noundef, i8 noundef zeroext) #2

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 40}
!12 = !{!"", !13, 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}
!13 = !{!"", !10, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !17, i64 2}
!16 = !{!"", !17, i64 0, !17, i64 2}
!17 = !{!"short", !7, i64 0}
!18 = !{!16, !17, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !17, i64 4}
!21 = !{!"", !7, i64 0, !17, i64 4, !14, i64 6, !14, i64 10, !14, i64 14, !17, i64 18, !17, i64 20, !14, i64 22, !14, i64 26, !14, i64 30}
!22 = !{!21, !14, i64 6}
!23 = !{!21, !14, i64 10}
!24 = !{!21, !14, i64 14}
!25 = !{!17, !17, i64 0}
!26 = !{!21, !17, i64 18}
!27 = !{!21, !17, i64 20}
!28 = !{!21, !14, i64 22}
!29 = !{!21, !14, i64 26}
!30 = !{!21, !14, i64 30}
!31 = !{!32, !17, i64 0}
!32 = !{!"", !17, i64 0, !7, i64 2, !7, i64 3, !17, i64 4, !17, i64 6, !17, i64 8, !17, i64 10, !14, i64 12, !17, i64 16, !17, i64 18, !17, i64 20, !7, i64 22, !7, i64 23, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39, !14, i64 40, !14, i64 44, !17, i64 48, !17, i64 50, !7, i64 52, !7, i64 53, !7, i64 54, !7, i64 55, !7, i64 56, !7, i64 57, !7, i64 58, !7, i64 59, !7, i64 60, !7, i64 61, !14, i64 62, !7, i64 66}
!33 = !{!32, !7, i64 2}
!34 = !{!32, !7, i64 3}
!35 = !{!32, !17, i64 4}
!36 = !{!32, !17, i64 6}
!37 = !{!32, !17, i64 8}
!38 = !{!32, !17, i64 10}
!39 = !{!32, !14, i64 12}
!40 = !{!32, !17, i64 16}
!41 = !{!32, !17, i64 18}
!42 = !{!32, !17, i64 20}
!43 = !{!32, !7, i64 22}
!44 = !{!32, !7, i64 23}
!45 = !{!32, !7, i64 24}
!46 = !{!32, !7, i64 25}
!47 = !{!32, !7, i64 26}
!48 = !{!32, !7, i64 27}
!49 = !{!32, !7, i64 28}
!50 = !{!32, !7, i64 29}
!51 = !{!32, !7, i64 30}
!52 = !{!32, !7, i64 31}
!53 = !{!32, !7, i64 32}
!54 = !{!32, !7, i64 33}
!55 = !{!32, !7, i64 34}
!56 = !{!32, !7, i64 35}
!57 = !{!32, !7, i64 36}
!58 = !{!32, !7, i64 37}
!59 = !{!32, !7, i64 38}
!60 = !{!32, !7, i64 39}
!61 = !{!32, !14, i64 40}
!62 = !{!32, !14, i64 44}
!63 = !{!32, !17, i64 48}
!64 = !{!32, !17, i64 50}
!65 = !{!32, !7, i64 52}
!66 = !{!32, !7, i64 53}
!67 = !{!32, !7, i64 54}
!68 = !{!32, !7, i64 55}
!69 = !{!32, !7, i64 56}
!70 = !{!32, !7, i64 57}
!71 = !{!32, !7, i64 58}
!72 = !{!32, !7, i64 59}
!73 = !{!32, !7, i64 60}
!74 = !{!32, !7, i64 61}
!75 = !{!32, !14, i64 62}


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

@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [43 x i8], align 1
@__FUNCTION__.InstallVbeShim = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@mVbeShim = external hidden constant [852 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@mProductRevision = external hidden constant [19 x i8], align 16
@.str.10 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @InstallVbeShim(ptr noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store i64 0, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr @gBS, align 8, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %4, i64 40
  %6 = load ptr, ptr %5, align 8, !tbaa !11
  %7 = call i64 %6(i32 noundef 2, i32 noundef 3, i64 noundef 1, ptr noundef nonnull %3) #3
  %8 = icmp slt i64 %7, 0
  br i1 %8, label %9, label %30

9:                                                ; preds = %2
  %10 = load i16, ptr inttoptr (i64 66 to ptr), align 2, !tbaa !15
  %11 = zext i16 %10 to i64
  %12 = shl nuw nsw i64 %11, 4
  %13 = load i16, ptr inttoptr (i64 64 to ptr), align 64, !tbaa !18
  %14 = zext i16 %13 to i64
  %15 = or disjoint i64 %14, -786432
  %16 = add nsw i64 %15, %12
  %or.cond = icmp ult i64 %16, 196608
  %17 = call zeroext i8 @DebugPrintEnabled() #3
  %.not121 = icmp eq i8 %17, 0
  br i1 %or.cond, label %18, label %26

18:                                               ; preds = %9
  br i1 %.not121, label %.critedge, label %19

19:                                               ; preds = %18
  %20 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 4194304) #3
  %.not122 = icmp eq i8 %20, 0
  br i1 %.not122, label %.critedge, label %21

21:                                               ; preds = %19
  %22 = load i16, ptr inttoptr (i64 66 to ptr), align 2, !tbaa !15
  %23 = zext i16 %22 to i32
  %24 = load i16, ptr inttoptr (i64 64 to ptr), align 64, !tbaa !18
  %25 = zext i16 %24 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 4194304, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__.InstallVbeShim, i32 noundef %23, i32 noundef %25) #3
  br label %.critedge

26:                                               ; preds = %9
  br i1 %.not121, label %42, label %27

27:                                               ; preds = %26
  %28 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 4194304) #3
  %.not120 = icmp eq i8 %28, 0
  br i1 %.not120, label %42, label %29

29:                                               ; preds = %27
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 4194304, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__.InstallVbeShim, i64 noundef %7) #3
  br label %42

30:                                               ; preds = %2
  %31 = call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %31, 0
  br i1 %.not, label %36, label %32

32:                                               ; preds = %30
  %33 = load i16, ptr inttoptr (i64 66 to ptr), align 2, !tbaa !15
  %34 = icmp eq i16 %33, 0
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  call void @DebugAssert(ptr noundef nonnull @.str.2, i64 noundef 119, ptr noundef nonnull @.str.3) #3
  br label %36

36:                                               ; preds = %30, %35, %32
  %37 = call zeroext i8 @DebugAssertEnabled() #3
  %.not118 = icmp eq i8 %37, 0
  br i1 %.not118, label %42, label %38

38:                                               ; preds = %36
  %39 = load i16, ptr inttoptr (i64 64 to ptr), align 64, !tbaa !18
  %40 = icmp eq i16 %39, 0
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  call void @DebugAssert(ptr noundef nonnull @.str.2, i64 noundef 120, ptr noundef nonnull @.str.4) #3
  br label %42

42:                                               ; preds = %27, %29, %26, %36, %41, %38
  %43 = call zeroext i8 @PciRead8(i64 noundef 90) #3
  %44 = or i8 %43, 3
  %45 = call zeroext i8 @PciWrite8(i64 noundef 90, i8 noundef zeroext %44) #3
  %46 = call zeroext i8 @DebugAssertEnabled() #3
  %47 = call ptr @CopyMem(ptr noundef nonnull inttoptr (i64 786432 to ptr), ptr noundef nonnull @mVbeShim, i64 noundef 852) #3
  %48 = call ptr @CopyMem(ptr noundef nonnull inttoptr (i64 786432 to ptr), ptr noundef nonnull @.str.6, i64 noundef 4) #3
  store i16 768, ptr inttoptr (i64 786436 to ptr), align 4, !tbaa !19
  store i32 -1073741790, ptr inttoptr (i64 786438 to ptr), align 2, !tbaa !21
  %49 = call ptr @CopyMem(ptr noundef nonnull inttoptr (i64 786466 to ptr), ptr noundef nonnull @.str.7, i64 noundef 5) #3
  store i32 1, ptr inttoptr (i64 786442 to ptr), align 2, !tbaa !22
  store i32 -1073741785, ptr inttoptr (i64 786446 to ptr), align 2, !tbaa !23
  store i16 241, ptr inttoptr (i64 786471 to ptr), align 2, !tbaa !24
  store i16 -1, ptr inttoptr (i64 786473 to ptr), align 2, !tbaa !24
  store i16 48, ptr inttoptr (i64 786450 to ptr), align 2, !tbaa !25
  store i16 0, ptr inttoptr (i64 786452 to ptr), align 4, !tbaa !26
  store i32 -1073741781, ptr inttoptr (i64 786454 to ptr), align 2, !tbaa !27
  %50 = call ptr @CopyMem(ptr noundef nonnull inttoptr (i64 786475 to ptr), ptr noundef nonnull @.str.8, i64 noundef 5) #3
  store i32 -1073741776, ptr inttoptr (i64 786458 to ptr), align 2, !tbaa !28
  %51 = call i64 (ptr, i64, ptr, ...) @AsciiSPrint(ptr noundef nonnull inttoptr (i64 786480 to ptr), i64 noundef 208, ptr noundef nonnull @.str.9, ptr noundef %0) #3
  %52 = getelementptr i8, ptr inttoptr (i64 786480 to ptr), i64 %51
  %53 = getelementptr i8, ptr %52, i64 1
  %54 = ptrtoint ptr %53 to i64
  %55 = trunc i64 %54 to i32
  %56 = and i32 %55, 65535
  %57 = or disjoint i32 %56, -1073741824
  store i32 %57, ptr inttoptr (i64 786462 to ptr), align 2, !tbaa !29
  %58 = call ptr @CopyMem(ptr noundef %53, ptr noundef nonnull @mProductRevision, i64 noundef 19) #3
  %59 = getelementptr i8, ptr %52, i64 20
  %60 = call zeroext i8 @DebugAssertEnabled() #3
  %.not124 = icmp eq i8 %60, 0
  %61 = ptrtoint ptr %59 to i64
  %62 = add i64 %61, -786466
  %63 = icmp ult i64 %62, 223
  %or.cond129 = or i1 %.not124, %63
  br i1 %or.cond129, label %65, label %64

64:                                               ; preds = %42
  call void @DebugAssert(ptr noundef nonnull @.str.2, i64 noundef 185, ptr noundef nonnull @.str.10) #3
  br label %65

65:                                               ; preds = %64, %42
  %66 = sub i64 786688, %61
  %67 = call ptr @ZeroMem(ptr noundef %59, i64 noundef %66) #3
  store i16 187, ptr inttoptr (i64 786688 to ptr), align 256, !tbaa !30
  store i8 7, ptr inttoptr (i64 786690 to ptr), align 2, !tbaa !32
  store i8 0, ptr inttoptr (i64 786691 to ptr), align 1, !tbaa !33
  store i16 64, ptr inttoptr (i64 786692 to ptr), align 4, !tbaa !34
  store i16 64, ptr inttoptr (i64 786694 to ptr), align 2, !tbaa !35
  store i16 -24576, ptr inttoptr (i64 786696 to ptr), align 8, !tbaa !36
  store i16 0, ptr inttoptr (i64 786698 to ptr), align 2, !tbaa !37
  store i32 0, ptr inttoptr (i64 786700 to ptr), align 4, !tbaa !38
  store i16 4096, ptr inttoptr (i64 786704 to ptr), align 16, !tbaa !39
  store i16 1024, ptr inttoptr (i64 786706 to ptr), align 2, !tbaa !40
  store i16 768, ptr inttoptr (i64 786708 to ptr), align 4, !tbaa !41
  store i8 8, ptr inttoptr (i64 786710 to ptr), align 2, !tbaa !42
  store i8 16, ptr inttoptr (i64 786711 to ptr), align 1, !tbaa !43
  store i8 1, ptr inttoptr (i64 786712 to ptr), align 8, !tbaa !44
  store i8 32, ptr inttoptr (i64 786713 to ptr), align 1, !tbaa !45
  store i8 1, ptr inttoptr (i64 786714 to ptr), align 2, !tbaa !46
  store i8 6, ptr inttoptr (i64 786715 to ptr), align 1, !tbaa !47
  store i8 0, ptr inttoptr (i64 786716 to ptr), align 4, !tbaa !48
  store i8 0, ptr inttoptr (i64 786717 to ptr), align 1, !tbaa !49
  store i8 1, ptr inttoptr (i64 786718 to ptr), align 2, !tbaa !50
  store i8 8, ptr inttoptr (i64 786719 to ptr), align 1, !tbaa !51
  store i8 16, ptr inttoptr (i64 786720 to ptr), align 32, !tbaa !52
  store i8 8, ptr inttoptr (i64 786721 to ptr), align 1, !tbaa !53
  store i8 8, ptr inttoptr (i64 786722 to ptr), align 2, !tbaa !54
  store i8 8, ptr inttoptr (i64 786723 to ptr), align 1, !tbaa !55
  store i8 0, ptr inttoptr (i64 786724 to ptr), align 4, !tbaa !56
  store i8 8, ptr inttoptr (i64 786725 to ptr), align 1, !tbaa !57
  store i8 24, ptr inttoptr (i64 786726 to ptr), align 2, !tbaa !58
  store i8 2, ptr inttoptr (i64 786727 to ptr), align 1, !tbaa !59
  %68 = trunc i64 %1 to i32
  store i32 %68, ptr inttoptr (i64 786728 to ptr), align 8, !tbaa !60
  store i32 0, ptr inttoptr (i64 786732 to ptr), align 4, !tbaa !61
  store i16 0, ptr inttoptr (i64 786736 to ptr), align 16, !tbaa !62
  store i16 4096, ptr inttoptr (i64 786738 to ptr), align 2, !tbaa !63
  store i8 0, ptr inttoptr (i64 786740 to ptr), align 4, !tbaa !64
  store i8 0, ptr inttoptr (i64 786741 to ptr), align 1, !tbaa !65
  store i8 8, ptr inttoptr (i64 786742 to ptr), align 2, !tbaa !66
  store i8 16, ptr inttoptr (i64 786743 to ptr), align 1, !tbaa !67
  store i8 8, ptr inttoptr (i64 786744 to ptr), align 8, !tbaa !68
  store i8 8, ptr inttoptr (i64 786745 to ptr), align 1, !tbaa !69
  store i8 8, ptr inttoptr (i64 786746 to ptr), align 2, !tbaa !70
  store i8 0, ptr inttoptr (i64 786747 to ptr), align 1, !tbaa !71
  store i8 8, ptr inttoptr (i64 786748 to ptr), align 4, !tbaa !72
  store i8 24, ptr inttoptr (i64 786749 to ptr), align 1, !tbaa !73
  store i32 0, ptr inttoptr (i64 786750 to ptr), align 2, !tbaa !74
  %69 = call ptr @ZeroMem(ptr noundef nonnull inttoptr (i64 786754 to ptr), i64 noundef 190) #3
  %70 = and i8 %43, -4
  %71 = or disjoint i8 %70, 1
  %72 = call zeroext i8 @PciWrite8(i64 noundef 90, i8 noundef zeroext %71) #3
  store i16 -16384, ptr inttoptr (i64 66 to ptr), align 2, !tbaa !15
  store i16 512, ptr inttoptr (i64 64 to ptr), align 64, !tbaa !18
  %73 = call zeroext i8 @DebugPrintEnabled() #3
  %.not125 = icmp eq i8 %73, 0
  br i1 %.not125, label %.critedge, label %74

74:                                               ; preds = %65
  %75 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #3
  %.not126 = icmp eq i8 %75, 0
  br i1 %.not126, label %.critedge, label %76

76:                                               ; preds = %74
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef nonnull @.str.11, ptr noundef nonnull @__FUNCTION__.InstallVbeShim) #3
  br label %.critedge

.critedge:                                        ; preds = %19, %21, %18, %65, %76, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

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

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 40}
!12 = !{!"", !13, 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}
!13 = !{!"", !6, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !17, i64 2}
!16 = !{!"", !17, i64 0, !17, i64 2}
!17 = !{!"short", !7, i64 0}
!18 = !{!16, !17, i64 0}
!19 = !{!20, !17, i64 4}
!20 = !{!"", !7, i64 0, !17, i64 4, !14, i64 6, !14, i64 10, !14, i64 14, !17, i64 18, !17, i64 20, !14, i64 22, !14, i64 26, !14, i64 30}
!21 = !{!20, !14, i64 6}
!22 = !{!20, !14, i64 10}
!23 = !{!20, !14, i64 14}
!24 = !{!17, !17, i64 0}
!25 = !{!20, !17, i64 18}
!26 = !{!20, !17, i64 20}
!27 = !{!20, !14, i64 22}
!28 = !{!20, !14, i64 26}
!29 = !{!20, !14, i64 30}
!30 = !{!31, !17, i64 0}
!31 = !{!"", !17, i64 0, !7, i64 2, !7, i64 3, !17, i64 4, !17, i64 6, !17, i64 8, !17, i64 10, !14, i64 12, !17, i64 16, !17, i64 18, !17, i64 20, !7, i64 22, !7, i64 23, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39, !14, i64 40, !14, i64 44, !17, i64 48, !17, i64 50, !7, i64 52, !7, i64 53, !7, i64 54, !7, i64 55, !7, i64 56, !7, i64 57, !7, i64 58, !7, i64 59, !7, i64 60, !7, i64 61, !14, i64 62, !7, i64 66}
!32 = !{!31, !7, i64 2}
!33 = !{!31, !7, i64 3}
!34 = !{!31, !17, i64 4}
!35 = !{!31, !17, i64 6}
!36 = !{!31, !17, i64 8}
!37 = !{!31, !17, i64 10}
!38 = !{!31, !14, i64 12}
!39 = !{!31, !17, i64 16}
!40 = !{!31, !17, i64 18}
!41 = !{!31, !17, i64 20}
!42 = !{!31, !7, i64 22}
!43 = !{!31, !7, i64 23}
!44 = !{!31, !7, i64 24}
!45 = !{!31, !7, i64 25}
!46 = !{!31, !7, i64 26}
!47 = !{!31, !7, i64 27}
!48 = !{!31, !7, i64 28}
!49 = !{!31, !7, i64 29}
!50 = !{!31, !7, i64 30}
!51 = !{!31, !7, i64 31}
!52 = !{!31, !7, i64 32}
!53 = !{!31, !7, i64 33}
!54 = !{!31, !7, i64 34}
!55 = !{!31, !7, i64 35}
!56 = !{!31, !7, i64 36}
!57 = !{!31, !7, i64 37}
!58 = !{!31, !7, i64 38}
!59 = !{!31, !7, i64 39}
!60 = !{!31, !14, i64 40}
!61 = !{!31, !14, i64 44}
!62 = !{!31, !17, i64 48}
!63 = !{!31, !17, i64 50}
!64 = !{!31, !7, i64 52}
!65 = !{!31, !7, i64 53}
!66 = !{!31, !7, i64 54}
!67 = !{!31, !7, i64 55}
!68 = !{!31, !7, i64 56}
!69 = !{!31, !7, i64 57}
!70 = !{!31, !7, i64 58}
!71 = !{!31, !7, i64 59}
!72 = !{!31, !7, i64 60}
!73 = !{!31, !7, i64 61}
!74 = !{!31, !14, i64 62}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass