; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal (HiiGetImage)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK = type { %struct._EFI_HII_IMAGE_BLOCK, i8, %struct._EFI_HII_IIBT_IMAGE_1BIT_BASE }
%struct._EFI_HII_IMAGE_BLOCK = type { i8 }
%struct._EFI_HII_IIBT_IMAGE_1BIT_BASE = type <{ i16, i16, [1 x i8] }>
%struct._HII_DATABASE_PRIVATE_DATA = type { i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._EFI_HII_FONT_PROTOCOL, %struct._EFI_HII_IMAGE_PROTOCOL, %struct._EFI_HII_STRING_PROTOCOL, %struct._EFI_HII_DATABASE_PROTOCOL, %struct._EFI_HII_CONFIG_ROUTING_PROTOCOL, %struct._LIST_ENTRY, i64, %struct._LIST_ENTRY, i64, %struct.GUID, ptr }
%struct._EFI_HII_FONT_PROTOCOL = type { ptr, ptr, ptr, ptr }
%struct._EFI_HII_IMAGE_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr }
%struct._EFI_HII_STRING_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr }
%struct._EFI_HII_DATABASE_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_HII_CONFIG_ROUTING_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.GUID = type { i32, i16, i16, [8 x i8] }
%struct._HII_DATABASE_RECORD = type { i64, ptr, ptr, ptr, %struct._LIST_ENTRY }
%struct._HII_DATABASE_PACKAGE_LIST_INSTANCE = type { %struct.EFI_HII_PACKAGE_LIST_HEADER, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, %struct._LIST_ENTRY, ptr }
%struct.EFI_HII_PACKAGE_LIST_HEADER = type { %struct.GUID, i32 }
%struct._HII_IMAGE_PACKAGE_INSTANCE = type { %struct._EFI_HII_IMAGE_PACKAGE_HDR, i32, i32, ptr, ptr }
%struct._EFI_HII_IMAGE_PACKAGE_HDR = type { %struct.EFI_HII_PACKAGE_HEADER, i32, i32 }
%struct.EFI_HII_PACKAGE_HEADER = type { i32 }
%struct._EFI_IMAGE_INPUT = type { i32, i16, i16, ptr }

@.str = external hidden unnamed_addr constant [147 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [38 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @GetImageIdOrAddress(ptr noundef, ptr noundef) #0

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @Output1bitPixel(ptr noundef, ptr noundef, ptr noundef) #0

declare ptr @AllocateZeroPool(i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Output4bitPixel(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @Output8bitPixel(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @Output24bitPixel(ptr noundef, ptr noundef) #0

declare zeroext i8 @IsHiiHandleValid(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @HiiGetImage(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2, ptr noundef %3) #0 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i16, align 2
  %17 = alloca i8, align 1
  %18 = alloca %struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK, align 1
  %19 = alloca i16, align 2
  %20 = alloca i16, align 2
  %21 = alloca i64, align 8
  %22 = alloca i8, align 1
  %23 = alloca ptr, align 8
  %24 = alloca i8, align 1
  %25 = alloca i16, align 2
  %26 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i16 %2, ptr %8, align 2, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  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 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 7, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %25) #3
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %36, label %29

29:                                               ; preds = %4
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %36, label %32

32:                                               ; preds = %29
  %33 = load i16, ptr %8, align 2, !tbaa !9
  %34 = zext i16 %33 to i32
  %35 = icmp slt i32 %34, 1
  br i1 %35, label %36, label %37

36:                                               ; preds = %32, %29, %4
  store i64 -9223372036854775806, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

37:                                               ; preds = %32
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = call zeroext i8 @IsHiiHandleValid(ptr noundef %38)
  %40 = icmp ne i8 %39, 0
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

42:                                               ; preds = %37
  %43 = call zeroext i8 @DebugAssertEnabled()
  %44 = zext i8 %43 to i32
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %56

46:                                               ; preds = %42
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = ptrtoint ptr %47 to i64
  %49 = sub i64 %48, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_PRIVATE_DATA, ptr null, i32 0, i32 4) to i64)
  %50 = inttoptr i64 %49 to ptr
  %51 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %50, i32 0, i32 0
  %52 = load i64, ptr %51, align 8, !tbaa !11
  %53 = icmp ne i64 %52, 1883531592
  br i1 %53, label %54, label %56

54:                                               ; preds = %46
  call void @DebugAssert(ptr noundef @.str, i64 noundef 840, ptr noundef @.str.8)
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  br label %61

56:                                               ; preds = %46, %42
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = ptrtoint ptr %57 to i64
  %59 = sub i64 %58, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_PRIVATE_DATA, ptr null, i32 0, i32 4) to i64)
  %60 = inttoptr i64 %59 to ptr
  br label %61

61:                                               ; preds = %56, %54
  %62 = phi ptr [ %55, %54 ], [ %60, %56 ]
  store ptr %62, ptr %10, align 8, !tbaa !5
  store ptr null, ptr %13, align 8, !tbaa !5
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %63, i32 0, i32 1
  %65 = getelementptr inbounds %struct._LIST_ENTRY, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !22
  store ptr %66, ptr %11, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %103, %61
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %69, i32 0, i32 1
  %71 = icmp ne ptr %68, %70
  br i1 %71, label %72, label %107

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

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

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

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

91:                                               ; preds = %86, %84
  %92 = phi ptr [ %85, %84 ], [ %90, %86 ]
  store ptr %92, ptr %12, align 8, !tbaa !5
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %93, i32 0, i32 3
  %95 = load ptr, ptr %94, align 8, !tbaa !25
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = icmp eq ptr %95, %96
  br i1 %97, label %98, label %102

98:                                               ; preds = %91
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %99, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !26
  store ptr %101, ptr %13, align 8, !tbaa !5
  br label %107

102:                                              ; preds = %91
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._LIST_ENTRY, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !27
  store ptr %106, ptr %11, align 8, !tbaa !5
  br label %67, !llvm.loop !28

107:                                              ; preds = %98, %67
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = icmp eq ptr %108, null
  br i1 %109, label %110, label %111

110:                                              ; preds = %107
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

111:                                              ; preds = %107
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %112, i32 0, i32 6
  %114 = load ptr, ptr %113, align 8, !tbaa !30
  store ptr %114, ptr %14, align 8, !tbaa !5
  %115 = load ptr, ptr %14, align 8, !tbaa !5
  %116 = icmp eq ptr %115, null
  br i1 %116, label %117, label %118

117:                                              ; preds = %111
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

118:                                              ; preds = %111
  %119 = load i16, ptr %8, align 2, !tbaa !9
  store i16 %119, ptr %16, align 2, !tbaa !9
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._HII_IMAGE_PACKAGE_INSTANCE, ptr %120, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !33
  %123 = call ptr @GetImageIdOrAddress(ptr noundef %122, ptr noundef %16)
  store ptr %123, ptr %15, align 8, !tbaa !5
  %124 = load ptr, ptr %15, align 8, !tbaa !5
  %125 = icmp eq ptr %124, null
  br i1 %125, label %126, label %127

126:                                              ; preds = %118
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

127:                                              ; preds = %118
  store i8 0, ptr %22, align 1, !tbaa !37
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = load i8, ptr %128, align 1, !tbaa !37
  store i8 %129, ptr %17, align 1, !tbaa !37
  %130 = load i8, ptr %17, align 1, !tbaa !37
  %131 = zext i8 %130 to i32
  switch i32 %131, label %295 [
    i32 24, label %132
    i32 17, label %133
    i32 19, label %133
    i32 21, label %133
    i32 16, label %134
    i32 18, label %134
    i32 20, label %134
    i32 23, label %253
    i32 22, label %254
  ]

132:                                              ; preds = %127
  store i64 -9223372036854775805, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

133:                                              ; preds = %127, %127, %127
  store i8 1, ptr %22, align 1, !tbaa !37
  br label %134

134:                                              ; preds = %133, %127, %127, %127
  %135 = load ptr, ptr %15, align 8, !tbaa !5
  %136 = call ptr @CopyMem(ptr noundef %18, ptr noundef %135, i64 noundef 7)
  %137 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK, ptr %18, i32 0, i32 2
  %138 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BASE, ptr %137, i32 0, i32 0
  %139 = load i16, ptr %138, align 1, !tbaa !38
  %140 = zext i16 %139 to i32
  %141 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK, ptr %18, i32 0, i32 2
  %142 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BASE, ptr %141, i32 0, i32 1
  %143 = load i16, ptr %142, align 1, !tbaa !42
  %144 = zext i16 %143 to i32
  %145 = mul nsw i32 %140, %144
  %146 = sext i32 %145 to i64
  %147 = mul i64 4, %146
  store i64 %147, ptr %21, align 8, !tbaa !43
  %148 = load i64, ptr %21, align 8, !tbaa !43
  %149 = call ptr @AllocateZeroPool(i64 noundef %148)
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %150, i32 0, i32 3
  store ptr %149, ptr %151, align 8, !tbaa !44
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %152, i32 0, i32 3
  %154 = load ptr, ptr %153, align 8, !tbaa !44
  %155 = icmp eq ptr %154, null
  br i1 %155, label %156, label %157

156:                                              ; preds = %134
  store i64 -9223372036854775799, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

157:                                              ; preds = %134
  %158 = load i8, ptr %22, align 1, !tbaa !37
  %159 = icmp ne i8 %158, 0
  br i1 %159, label %160, label %163

160:                                              ; preds = %157
  %161 = load ptr, ptr %9, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %161, i32 0, i32 0
  store i32 1, ptr %162, align 8, !tbaa !46
  br label %163

163:                                              ; preds = %160, %157
  %164 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK, ptr %18, i32 0, i32 2
  %165 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BASE, ptr %164, i32 0, i32 0
  %166 = load i16, ptr %165, align 1, !tbaa !38
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %167, i32 0, i32 1
  store i16 %166, ptr %168, align 4, !tbaa !47
  %169 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK, ptr %18, i32 0, i32 2
  %170 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BASE, ptr %169, i32 0, i32 1
  %171 = load i16, ptr %170, align 1, !tbaa !42
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %172, i32 0, i32 2
  store i16 %171, ptr %173, align 2, !tbaa !48
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct._HII_IMAGE_PACKAGE_INSTANCE, ptr %174, i32 0, i32 4
  %176 = load ptr, ptr %175, align 8, !tbaa !49
  %177 = getelementptr inbounds i8, ptr %176, i64 2
  store ptr %177, ptr %23, align 8, !tbaa !5
  store i8 1, ptr %24, align 1, !tbaa !37
  br label %178

178:                                              ; preds = %193, %163
  %179 = load i8, ptr %24, align 1, !tbaa !37
  %180 = zext i8 %179 to i32
  %181 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK, ptr %18, i32 0, i32 1
  %182 = load i8, ptr %181, align 1, !tbaa !50
  %183 = zext i8 %182 to i32
  %184 = icmp slt i32 %180, %183
  br i1 %184, label %185, label %196

185:                                              ; preds = %178
  %186 = load ptr, ptr %23, align 8, !tbaa !5
  %187 = call ptr @CopyMem(ptr noundef %25, ptr noundef %186, i64 noundef 2)
  %188 = load i16, ptr %25, align 2, !tbaa !9
  %189 = zext i16 %188 to i64
  %190 = add i64 %189, 2
  %191 = load ptr, ptr %23, align 8, !tbaa !5
  %192 = getelementptr inbounds i8, ptr %191, i64 %190
  store ptr %192, ptr %23, align 8, !tbaa !5
  br label %193

193:                                              ; preds = %185
  %194 = load i8, ptr %24, align 1, !tbaa !37
  %195 = add i8 %194, 1
  store i8 %195, ptr %24, align 1, !tbaa !37
  br label %178, !llvm.loop !51

196:                                              ; preds = %178
  br label %197

197:                                              ; preds = %196
  %198 = call zeroext i8 @DebugAssertEnabled()
  %199 = icmp ne i8 %198, 0
  br i1 %199, label %200, label %209

200:                                              ; preds = %197
  %201 = load i8, ptr %24, align 1, !tbaa !37
  %202 = zext i8 %201 to i32
  %203 = getelementptr inbounds %struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK, ptr %18, i32 0, i32 1
  %204 = load i8, ptr %203, align 1, !tbaa !50
  %205 = zext i8 %204 to i32
  %206 = icmp eq i32 %202, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %200
  call void @DebugAssert(ptr noundef @.str, i64 noundef 915, ptr noundef @.str.9)
  br label %208

208:                                              ; preds = %207, %200
  br label %209

209:                                              ; preds = %208, %197
  br label %210

210:                                              ; preds = %209
  br label %211

211:                                              ; preds = %210
  %212 = load i8, ptr %17, align 1, !tbaa !37
  %213 = zext i8 %212 to i32
  %214 = icmp eq i32 %213, 16
  br i1 %214, label %219, label %215

215:                                              ; preds = %211
  %216 = load i8, ptr %17, align 1, !tbaa !37
  %217 = zext i8 %216 to i32
  %218 = icmp eq i32 %217, 17
  br i1 %218, label %219, label %227

219:                                              ; preds = %215, %211
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = load ptr, ptr %15, align 8, !tbaa !5
  %222 = ptrtoint ptr %221 to i64
  %223 = add i64 %222, 7
  %224 = sub i64 %223, 1
  %225 = inttoptr i64 %224 to ptr
  %226 = load ptr, ptr %23, align 8, !tbaa !5
  call void @Output1bitPixel(ptr noundef %220, ptr noundef %225, ptr noundef %226)
  br label %252

227:                                              ; preds = %215
  %228 = load i8, ptr %17, align 1, !tbaa !37
  %229 = zext i8 %228 to i32
  %230 = icmp eq i32 %229, 18
  br i1 %230, label %235, label %231

231:                                              ; preds = %227
  %232 = load i8, ptr %17, align 1, !tbaa !37
  %233 = zext i8 %232 to i32
  %234 = icmp eq i32 %233, 19
  br i1 %234, label %235, label %243

235:                                              ; preds = %231, %227
  %236 = load ptr, ptr %9, align 8, !tbaa !5
  %237 = load ptr, ptr %15, align 8, !tbaa !5
  %238 = ptrtoint ptr %237 to i64
  %239 = add i64 %238, 7
  %240 = sub i64 %239, 1
  %241 = inttoptr i64 %240 to ptr
  %242 = load ptr, ptr %23, align 8, !tbaa !5
  call void @Output4bitPixel(ptr noundef %236, ptr noundef %241, ptr noundef %242)
  br label %251

243:                                              ; preds = %231
  %244 = load ptr, ptr %9, align 8, !tbaa !5
  %245 = load ptr, ptr %15, align 8, !tbaa !5
  %246 = ptrtoint ptr %245 to i64
  %247 = add i64 %246, 7
  %248 = sub i64 %247, 1
  %249 = inttoptr i64 %248 to ptr
  %250 = load ptr, ptr %23, align 8, !tbaa !5
  call void @Output8bitPixel(ptr noundef %244, ptr noundef %249, ptr noundef %250)
  br label %251

251:                                              ; preds = %243, %235
  br label %252

252:                                              ; preds = %251, %219
  store i64 0, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

253:                                              ; preds = %127
  store i8 1, ptr %22, align 1, !tbaa !37
  br label %254

254:                                              ; preds = %253, %127
  %255 = load ptr, ptr %15, align 8, !tbaa !5
  %256 = getelementptr inbounds i8, ptr %255, i64 1
  %257 = call ptr @CopyMem(ptr noundef %19, ptr noundef %256, i64 noundef 2)
  %258 = load ptr, ptr %15, align 8, !tbaa !5
  %259 = getelementptr inbounds i8, ptr %258, i64 1
  %260 = getelementptr inbounds i8, ptr %259, i64 2
  %261 = call ptr @CopyMem(ptr noundef %20, ptr noundef %260, i64 noundef 2)
  %262 = load i16, ptr %19, align 2, !tbaa !9
  %263 = zext i16 %262 to i32
  %264 = load i16, ptr %20, align 2, !tbaa !9
  %265 = zext i16 %264 to i32
  %266 = mul nsw i32 %263, %265
  %267 = sext i32 %266 to i64
  %268 = mul i64 4, %267
  store i64 %268, ptr %21, align 8, !tbaa !43
  %269 = load i64, ptr %21, align 8, !tbaa !43
  %270 = call ptr @AllocateZeroPool(i64 noundef %269)
  %271 = load ptr, ptr %9, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %271, i32 0, i32 3
  store ptr %270, ptr %272, align 8, !tbaa !44
  %273 = load ptr, ptr %9, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %273, i32 0, i32 3
  %275 = load ptr, ptr %274, align 8, !tbaa !44
  %276 = icmp eq ptr %275, null
  br i1 %276, label %277, label %278

277:                                              ; preds = %254
  store i64 -9223372036854775799, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

278:                                              ; preds = %254
  %279 = load i8, ptr %22, align 1, !tbaa !37
  %280 = icmp ne i8 %279, 0
  br i1 %280, label %281, label %284

281:                                              ; preds = %278
  %282 = load ptr, ptr %9, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %282, i32 0, i32 0
  store i32 1, ptr %283, align 8, !tbaa !46
  br label %284

284:                                              ; preds = %281, %278
  %285 = load i16, ptr %19, align 2, !tbaa !9
  %286 = load ptr, ptr %9, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %286, i32 0, i32 1
  store i16 %285, ptr %287, align 4, !tbaa !47
  %288 = load i16, ptr %20, align 2, !tbaa !9
  %289 = load ptr, ptr %9, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct._EFI_IMAGE_INPUT, ptr %289, i32 0, i32 2
  store i16 %288, ptr %290, align 2, !tbaa !48
  %291 = load ptr, ptr %9, align 8, !tbaa !5
  %292 = load ptr, ptr %15, align 8, !tbaa !5
  %293 = getelementptr inbounds i8, ptr %292, i64 8
  %294 = getelementptr inbounds i8, ptr %293, i64 -3
  call void @Output24bitPixel(ptr noundef %291, ptr noundef %294)
  store i64 0, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

295:                                              ; preds = %127
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %26, align 4
  br label %296

296:                                              ; preds = %295, %284, %277, %252, %156, %132, %126, %117, %110, %41, %36
  call void @llvm.lifetime.end.p0(i64 2, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 7, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 2, 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 8, 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
  %297 = load i64, ptr %5, align 8
  ret i64 %297
}

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 = !{!"short", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_HII_DATABASE_PRIVATE_DATA", !13, i64 0, !14, i64 8, !14, i64 24, !15, i64 40, !16, i64 72, !17, i64 112, !18, i64 152, !19, i64 240, !14, i64 288, !13, i64 304, !14, i64 312, !13, i64 328, !20, i64 336, !6, i64 352}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"_EFI_HII_FONT_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!"_EFI_HII_IMAGE_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!17 = !{!"_EFI_HII_STRING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!18 = !{!"_EFI_HII_DATABASE_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}
!19 = !{!"_EFI_HII_CONFIG_ROUTING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!20 = !{!"", !21, i64 0, !10, i64 4, !10, i64 6, !7, i64 8}
!21 = !{!"int", !7, i64 0}
!22 = !{!12, !6, i64 8}
!23 = !{!24, !13, i64 0}
!24 = !{!"_HII_DATABASE_RECORD", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32}
!25 = !{!24, !6, i64 24}
!26 = !{!24, !6, i64 8}
!27 = !{!14, !6, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !6, i64 104}
!31 = !{!"_HII_DATABASE_PACKAGE_LIST_INSTANCE", !32, i64 0, !14, i64 24, !14, i64 40, !14, i64 56, !14, i64 72, !14, i64 88, !6, i64 104, !14, i64 112, !6, i64 128}
!32 = !{!"", !20, i64 0, !21, i64 16}
!33 = !{!34, !6, i64 24}
!34 = !{!"_HII_IMAGE_PACKAGE_INSTANCE", !35, i64 0, !21, i64 12, !21, i64 16, !6, i64 24, !6, i64 32}
!35 = !{!"_EFI_HII_IMAGE_PACKAGE_HDR", !36, i64 0, !21, i64 4, !21, i64 8}
!36 = !{!"", !21, i64 0, !21, i64 3}
!37 = !{!7, !7, i64 0}
!38 = !{!39, !10, i64 2}
!39 = !{!"_EFI_HII_IIBT_IMAGE_1BIT_BLOCK", !40, i64 0, !7, i64 1, !41, i64 2}
!40 = !{!"_EFI_HII_IMAGE_BLOCK", !7, i64 0}
!41 = !{!"_EFI_HII_IIBT_IMAGE_1BIT_BASE", !10, i64 0, !10, i64 2, !7, i64 4}
!42 = !{!39, !10, i64 4}
!43 = !{!13, !13, i64 0}
!44 = !{!45, !6, i64 8}
!45 = !{!"_EFI_IMAGE_INPUT", !21, i64 0, !10, i64 4, !10, i64 6, !6, i64 8}
!46 = !{!45, !21, i64 0}
!47 = !{!45, !10, i64 4}
!48 = !{!45, !10, i64 6}
!49 = !{!34, !6, i64 32}
!50 = !{!39, !7, i64 1}
!51 = distinct !{!51, !29}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK = type { %struct._EFI_HII_IMAGE_BLOCK, i8, %struct._EFI_HII_IIBT_IMAGE_1BIT_BASE }
%struct._EFI_HII_IMAGE_BLOCK = type { i8 }
%struct._EFI_HII_IIBT_IMAGE_1BIT_BASE = type <{ i16, i16, [1 x i8] }>

@.str = external hidden unnamed_addr constant [147 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [38 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @GetImageIdOrAddress(ptr noundef, ptr noundef) local_unnamed_addr #0

; 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 @DebugAssertEnabled() local_unnamed_addr #2

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 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

; Function Attrs: nounwind uwtable
declare dso_local void @Output1bitPixel(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Output4bitPixel(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @Output8bitPixel(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @Output24bitPixel(ptr noundef, ptr noundef) local_unnamed_addr #0

declare zeroext i8 @IsHiiHandleValid(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @HiiGetImage(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca i16, align 2
  %6 = alloca %struct._EFI_HII_IIBT_IMAGE_1BIT_BLOCK, align 1
  %7 = alloca i16, align 2
  %8 = alloca i16, align 2
  %9 = alloca i16, align 2
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %9) #3
  %10 = icmp eq ptr %0, null
  %11 = icmp eq ptr %3, null
  %or.cond = or i1 %10, %11
  %12 = icmp eq i16 %2, 0
  %or.cond4 = or i1 %12, %or.cond
  br i1 %or.cond4, label %.thread, label %13

13:                                               ; preds = %4
  %14 = tail call zeroext i8 @IsHiiHandleValid(ptr noundef %1) #3
  %.not = icmp eq i8 %14, 0
  br i1 %.not, label %.thread, label %15

15:                                               ; preds = %13
  %16 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not84 = icmp eq i8 %16, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre103 = add i64 %.pre, -72
  %.pre105 = inttoptr i64 %.pre103 to ptr
  br i1 %.not84, label %._crit_edge102, label %17

17:                                               ; preds = %15
  %18 = load i64, ptr %.pre105, align 8, !tbaa !5
  %.not85 = icmp eq i64 %18, 1883531592
  br i1 %.not85, label %._crit_edge102, label %19

19:                                               ; preds = %17
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 840, ptr noundef nonnull @.str.8) #3
  br label %._crit_edge102

._crit_edge102:                                   ; preds = %15, %17, %19
  %20 = phi ptr [ %0, %19 ], [ %.pre105, %17 ], [ %.pre105, %15 ]
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  br label %22

22:                                               ; preds = %._crit_edge101, %._crit_edge102
  %.076.in = phi ptr [ %21, %._crit_edge102 ], [ %.076, %._crit_edge101 ]
  %.076 = load ptr, ptr %.076.in, align 8, !tbaa !20
  %.not86 = icmp eq ptr %.076, %21
  br i1 %.not86, label %.thread, label %23

23:                                               ; preds = %22
  %24 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not87 = icmp eq i8 %24, 0
  %.pre107 = ptrtoint ptr %.076 to i64
  %.pre109 = add i64 %.pre107, -32
  %.pre111 = inttoptr i64 %.pre109 to ptr
  br i1 %.not87, label %._crit_edge101, label %25

25:                                               ; preds = %23
  %26 = load i64, ptr %.pre111, align 8, !tbaa !21
  %.not88 = icmp eq i64 %26, 1919183208
  br i1 %.not88, label %._crit_edge101, label %27

27:                                               ; preds = %25
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 850, ptr noundef nonnull @.str.8) #3
  br label %._crit_edge101

._crit_edge101:                                   ; preds = %23, %25, %27
  %28 = phi ptr [ %.076, %27 ], [ %.pre111, %25 ], [ %.pre111, %23 ]
  %29 = getelementptr inbounds i8, ptr %28, i64 24
  %30 = load ptr, ptr %29, align 8, !tbaa !23
  %31 = icmp eq ptr %30, %1
  br i1 %31, label %32, label %22, !llvm.loop !24

32:                                               ; preds = %._crit_edge101
  %33 = getelementptr inbounds i8, ptr %28, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !26
  %35 = icmp eq ptr %34, null
  br i1 %35, label %.thread, label %36

36:                                               ; preds = %32
  %37 = getelementptr inbounds i8, ptr %34, i64 104
  %38 = load ptr, ptr %37, align 8, !tbaa !27
  %39 = icmp eq ptr %38, null
  br i1 %39, label %.thread, label %40

40:                                               ; preds = %36
  store i16 %2, ptr %5, align 2, !tbaa !30
  %41 = getelementptr inbounds i8, ptr %38, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !31
  %43 = call ptr @GetImageIdOrAddress(ptr noundef %42, ptr noundef nonnull %5)
  %44 = icmp eq ptr %43, null
  br i1 %44, label %.thread, label %45

45:                                               ; preds = %40
  %46 = load i8, ptr %43, align 1, !tbaa !35
  switch i8 %46, label %115 [
    i8 24, label %.thread
    i8 17, label %47
    i8 19, label %47
    i8 21, label %47
    i8 16, label %48
    i8 18, label %48
    i8 20, label %48
    i8 23, label %92
    i8 22, label %93
  ]

47:                                               ; preds = %45, %45, %45
  br label %48

48:                                               ; preds = %47, %45, %45, %45
  %.not90 = phi i1 [ true, %45 ], [ true, %45 ], [ true, %45 ], [ false, %47 ]
  %49 = call ptr @CopyMem(ptr noundef nonnull %6, ptr noundef nonnull %43, i64 noundef 7) #3
  %50 = getelementptr inbounds i8, ptr %6, i64 2
  %51 = load i16, ptr %50, align 1, !tbaa !36
  %52 = zext i16 %51 to i64
  %53 = getelementptr inbounds i8, ptr %6, i64 4
  %54 = load i16, ptr %53, align 1, !tbaa !40
  %55 = zext i16 %54 to i64
  %56 = shl nuw nsw i64 %52, 2
  %57 = mul nuw nsw i64 %56, %55
  %58 = call ptr @AllocateZeroPool(i64 noundef %57) #3
  %59 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %58, ptr %59, align 8, !tbaa !41
  %60 = icmp eq ptr %58, null
  br i1 %60, label %.thread, label %61

61:                                               ; preds = %48
  br i1 %.not90, label %63, label %62

62:                                               ; preds = %61
  store i32 1, ptr %3, align 8, !tbaa !43
  br label %63

63:                                               ; preds = %62, %61
  %64 = getelementptr inbounds i8, ptr %3, i64 4
  %65 = load <2 x i16>, ptr %50, align 1, !tbaa !30
  store <2 x i16> %65, ptr %64, align 4, !tbaa !30
  %66 = getelementptr inbounds i8, ptr %38, i64 32
  %67 = load ptr, ptr %66, align 8, !tbaa !44
  %68 = getelementptr inbounds i8, ptr %67, i64 2
  %69 = getelementptr inbounds i8, ptr %6, i64 1
  %70 = load i8, ptr %69, align 1, !tbaa !45
  %71 = icmp ugt i8 %70, 1
  br i1 %71, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %63, %.lr.ph
  %.097 = phi i8 [ %77, %.lr.ph ], [ 1, %63 ]
  %.07396 = phi ptr [ %76, %.lr.ph ], [ %68, %63 ]
  %72 = call ptr @CopyMem(ptr noundef nonnull %9, ptr noundef nonnull %.07396, i64 noundef 2) #3
  %73 = load i16, ptr %9, align 2, !tbaa !30
  %74 = zext i16 %73 to i64
  %75 = add nuw nsw i64 %74, 2
  %76 = getelementptr inbounds i8, ptr %.07396, i64 %75
  %77 = add nuw i8 %.097, 1
  %78 = load i8, ptr %69, align 1, !tbaa !45
  %79 = icmp ult i8 %77, %78
  br i1 %79, label %.lr.ph, label %._crit_edge, !llvm.loop !46

._crit_edge:                                      ; preds = %.lr.ph, %63
  %.073.lcssa = phi ptr [ %68, %63 ], [ %76, %.lr.ph ]
  %.0.lcssa = phi i8 [ 1, %63 ], [ %77, %.lr.ph ]
  %80 = call zeroext i8 @DebugAssertEnabled() #3
  %.not91 = icmp eq i8 %80, 0
  %81 = load i8, ptr %69, align 1
  %82 = icmp eq i8 %.0.lcssa, %81
  %or.cond93 = select i1 %.not91, i1 true, i1 %82
  br i1 %or.cond93, label %84, label %83

83:                                               ; preds = %._crit_edge
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 915, ptr noundef nonnull @.str.9) #3
  br label %84

84:                                               ; preds = %83, %._crit_edge
  %85 = and i8 %46, -2
  %86 = ptrtoint ptr %43 to i64
  %87 = add i64 %86, 6
  %88 = inttoptr i64 %87 to ptr
  switch i8 %85, label %91 [
    i8 16, label %89
    i8 18, label %90
  ]

89:                                               ; preds = %84
  call void @Output1bitPixel(ptr noundef %3, ptr noundef %88, ptr noundef nonnull %.073.lcssa)
  br label %.thread

90:                                               ; preds = %84
  call void @Output4bitPixel(ptr noundef %3, ptr noundef %88, ptr noundef nonnull %.073.lcssa)
  br label %.thread

91:                                               ; preds = %84
  call void @Output8bitPixel(ptr noundef %3, ptr noundef %88, ptr noundef nonnull %.073.lcssa)
  br label %.thread

92:                                               ; preds = %45
  br label %93

93:                                               ; preds = %92, %45
  %.not89 = phi i1 [ true, %45 ], [ false, %92 ]
  %94 = getelementptr inbounds i8, ptr %43, i64 1
  %95 = call ptr @CopyMem(ptr noundef nonnull %7, ptr noundef nonnull %94, i64 noundef 2) #3
  %96 = getelementptr inbounds i8, ptr %43, i64 3
  %97 = call ptr @CopyMem(ptr noundef nonnull %8, ptr noundef nonnull %96, i64 noundef 2) #3
  %98 = load i16, ptr %7, align 2, !tbaa !30
  %99 = zext i16 %98 to i64
  %100 = load i16, ptr %8, align 2, !tbaa !30
  %101 = zext i16 %100 to i64
  %102 = shl nuw nsw i64 %99, 2
  %103 = mul nuw nsw i64 %102, %101
  %104 = call ptr @AllocateZeroPool(i64 noundef %103) #3
  %105 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %104, ptr %105, align 8, !tbaa !41
  %106 = icmp eq ptr %104, null
  br i1 %106, label %.thread, label %107

107:                                              ; preds = %93
  br i1 %.not89, label %109, label %108

108:                                              ; preds = %107
  store i32 1, ptr %3, align 8, !tbaa !43
  br label %109

109:                                              ; preds = %108, %107
  %110 = load i16, ptr %7, align 2, !tbaa !30
  %111 = getelementptr inbounds i8, ptr %3, i64 4
  store i16 %110, ptr %111, align 4, !tbaa !47
  %112 = load i16, ptr %8, align 2, !tbaa !30
  %113 = getelementptr inbounds i8, ptr %3, i64 6
  store i16 %112, ptr %113, align 2, !tbaa !48
  %114 = getelementptr inbounds i8, ptr %43, i64 5
  call void @Output24bitPixel(ptr noundef nonnull %3, ptr noundef nonnull %114)
  br label %.thread

115:                                              ; preds = %45
  br label %.thread

.thread:                                          ; preds = %22, %93, %89, %91, %90, %48, %45, %40, %36, %32, %13, %4, %115, %109
  %.075 = phi i64 [ -9223372036854775794, %115 ], [ 0, %109 ], [ -9223372036854775806, %4 ], [ -9223372036854775794, %13 ], [ -9223372036854775794, %32 ], [ -9223372036854775794, %36 ], [ -9223372036854775794, %40 ], [ -9223372036854775805, %45 ], [ -9223372036854775799, %48 ], [ 0, %90 ], [ 0, %91 ], [ 0, %89 ], [ -9223372036854775799, %93 ], [ -9223372036854775794, %22 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #3
  ret i64 %.075
}

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, !7, i64 0}
!6 = !{!"_HII_DATABASE_PRIVATE_DATA", !7, i64 0, !10, i64 8, !10, i64 24, !12, i64 40, !13, i64 72, !14, i64 112, !15, i64 152, !16, i64 240, !10, i64 288, !7, i64 304, !10, i64 312, !7, i64 328, !17, i64 336, !11, i64 352}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_EFI_HII_FONT_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!13 = !{!"_EFI_HII_IMAGE_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!14 = !{!"_EFI_HII_STRING_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!15 = !{!"_EFI_HII_DATABASE_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80}
!16 = !{!"_EFI_HII_CONFIG_ROUTING_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!17 = !{!"", !18, i64 0, !19, i64 4, !19, i64 6, !8, i64 8}
!18 = !{!"int", !8, i64 0}
!19 = !{!"short", !8, i64 0}
!20 = !{!10, !11, i64 0}
!21 = !{!22, !7, i64 0}
!22 = !{!"_HII_DATABASE_RECORD", !7, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !10, i64 32}
!23 = !{!22, !11, i64 24}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!22, !11, i64 8}
!27 = !{!28, !11, i64 104}
!28 = !{!"_HII_DATABASE_PACKAGE_LIST_INSTANCE", !29, i64 0, !10, i64 24, !10, i64 40, !10, i64 56, !10, i64 72, !10, i64 88, !11, i64 104, !10, i64 112, !11, i64 128}
!29 = !{!"", !17, i64 0, !18, i64 16}
!30 = !{!19, !19, i64 0}
!31 = !{!32, !11, i64 24}
!32 = !{!"_HII_IMAGE_PACKAGE_INSTANCE", !33, i64 0, !18, i64 12, !18, i64 16, !11, i64 24, !11, i64 32}
!33 = !{!"_EFI_HII_IMAGE_PACKAGE_HDR", !34, i64 0, !18, i64 4, !18, i64 8}
!34 = !{!"", !18, i64 0, !18, i64 3}
!35 = !{!8, !8, i64 0}
!36 = !{!37, !19, i64 2}
!37 = !{!"_EFI_HII_IIBT_IMAGE_1BIT_BLOCK", !38, i64 0, !8, i64 1, !39, i64 2}
!38 = !{!"_EFI_HII_IMAGE_BLOCK", !8, i64 0}
!39 = !{!"_EFI_HII_IIBT_IMAGE_1BIT_BASE", !19, i64 0, !19, i64 2, !8, i64 4}
!40 = !{!37, !19, i64 4}
!41 = !{!42, !11, i64 8}
!42 = !{!"_EFI_IMAGE_INPUT", !18, i64 0, !19, i64 4, !19, i64 6, !11, i64 8}
!43 = !{!42, !18, i64 0}
!44 = !{!32, !11, i64 32}
!45 = !{!37, !8, i64 1}
!46 = distinct !{!46, !25}
!47 = !{!42, !19, i64 4}
!48 = !{!42, !19, i64 6}


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