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

; 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._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_STRING_PACKAGE_INSTANCE = type { i64, ptr, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i8, i16 }
%struct._EFI_HII_STRING_PACKAGE_HDR = type <{ %struct.EFI_HII_PACKAGE_HEADER, i32, i32, [16 x i16], i16, [1 x i8] }>
%struct.EFI_HII_PACKAGE_HEADER = type { i32 }

@.str = external hidden unnamed_addr constant [148 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @GetStringWorker(ptr noundef, ptr noundef, i16 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) #2

declare zeroext i8 @IsHiiHandleValid(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @HiiCompareLanguage(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @HiiGetString(ptr noundef %0, ptr noundef %1, ptr noundef %2, i16 noundef zeroext %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #2 {
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i16, align 2
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store i16 %3, ptr %12, align 2, !tbaa !9
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %38, label %25

25:                                               ; preds = %7
  %26 = load ptr, ptr %10, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %38, label %28

28:                                               ; preds = %25
  %29 = load i16, ptr %12, align 2, !tbaa !9
  %30 = zext i16 %29 to i32
  %31 = icmp slt i32 %30, 1
  br i1 %31, label %38, label %32

32:                                               ; preds = %28
  %33 = load ptr, ptr %14, align 8, !tbaa !5
  %34 = icmp eq ptr %33, null
  br i1 %34, label %38, label %35

35:                                               ; preds = %32
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %39

38:                                               ; preds = %35, %32, %28, %25, %7
  store i64 -9223372036854775806, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %222

39:                                               ; preds = %35
  %40 = load ptr, ptr %13, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %47

42:                                               ; preds = %39
  %43 = load ptr, ptr %14, align 8, !tbaa !5
  %44 = load i64, ptr %43, align 8, !tbaa !11
  %45 = icmp ne i64 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %42
  store i64 -9223372036854775806, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %222

47:                                               ; preds = %42, %39
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = call zeroext i8 @IsHiiHandleValid(ptr noundef %48)
  %50 = icmp ne i8 %49, 0
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i64 -9223372036854775794, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %222

52:                                               ; preds = %47
  %53 = call zeroext i8 @DebugAssertEnabled()
  %54 = zext i8 %53 to i32
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %66

56:                                               ; preds = %52
  %57 = load ptr, ptr %9, 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 5) to i64)
  %60 = inttoptr i64 %59 to ptr
  %61 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %60, i32 0, i32 0
  %62 = load i64, ptr %61, align 8, !tbaa !13
  %63 = icmp ne i64 %62, 1883531592
  br i1 %63, label %64, label %66

64:                                               ; preds = %56
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1630, ptr noundef @.str.2)
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  br label %71

66:                                               ; preds = %56, %52
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = ptrtoint ptr %67 to i64
  %69 = sub i64 %68, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_PRIVATE_DATA, ptr null, i32 0, i32 5) to i64)
  %70 = inttoptr i64 %69 to ptr
  br label %71

71:                                               ; preds = %66, %64
  %72 = phi ptr [ %65, %64 ], [ %70, %66 ]
  store ptr %72, ptr %18, align 8, !tbaa !5
  store ptr null, ptr %20, align 8, !tbaa !5
  %73 = load ptr, ptr %18, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %73, i32 0, i32 1
  %75 = getelementptr inbounds %struct._LIST_ENTRY, ptr %74, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !23
  store ptr %76, ptr %17, align 8, !tbaa !5
  br label %77

77:                                               ; preds = %113, %71
  %78 = load ptr, ptr %17, align 8, !tbaa !5
  %79 = load ptr, ptr %18, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %79, i32 0, i32 1
  %81 = icmp ne ptr %78, %80
  br i1 %81, label %82, label %117

82:                                               ; preds = %77
  %83 = call zeroext i8 @DebugAssertEnabled()
  %84 = zext i8 %83 to i32
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %96

86:                                               ; preds = %82
  %87 = load ptr, ptr %17, 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
  %91 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %90, i32 0, i32 0
  %92 = load i64, ptr %91, align 8, !tbaa !24
  %93 = icmp ne i64 %92, 1919183208
  br i1 %93, label %94, label %96

94:                                               ; preds = %86
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1634, ptr noundef @.str.2)
  %95 = load ptr, ptr %17, align 8, !tbaa !5
  br label %101

96:                                               ; preds = %86, %82
  %97 = load ptr, ptr %17, align 8, !tbaa !5
  %98 = ptrtoint ptr %97 to i64
  %99 = sub i64 %98, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_RECORD, ptr null, i32 0, i32 4) to i64)
  %100 = inttoptr i64 %99 to ptr
  br label %101

101:                                              ; preds = %96, %94
  %102 = phi ptr [ %95, %94 ], [ %100, %96 ]
  store ptr %102, ptr %19, align 8, !tbaa !5
  %103 = load ptr, ptr %19, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %103, i32 0, i32 3
  %105 = load ptr, ptr %104, align 8, !tbaa !26
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = icmp eq ptr %105, %106
  br i1 %107, label %108, label %112

108:                                              ; preds = %101
  %109 = load ptr, ptr %19, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %109, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8, !tbaa !27
  store ptr %111, ptr %20, align 8, !tbaa !5
  br label %117

112:                                              ; preds = %101
  br label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %17, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._LIST_ENTRY, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !28
  store ptr %116, ptr %17, align 8, !tbaa !5
  br label %77, !llvm.loop !29

117:                                              ; preds = %108, %77
  %118 = load ptr, ptr %20, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %221

120:                                              ; preds = %117
  %121 = load ptr, ptr %20, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %121, i32 0, i32 4
  %123 = getelementptr inbounds %struct._LIST_ENTRY, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !31
  store ptr %124, ptr %17, align 8, !tbaa !5
  br label %125

125:                                              ; preds = %173, %120
  %126 = load ptr, ptr %17, align 8, !tbaa !5
  %127 = load ptr, ptr %20, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %127, i32 0, i32 4
  %129 = icmp ne ptr %126, %128
  br i1 %129, label %130, label %177

130:                                              ; preds = %125
  %131 = call zeroext i8 @DebugAssertEnabled()
  %132 = zext i8 %131 to i32
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %144

134:                                              ; preds = %130
  %135 = load ptr, ptr %17, align 8, !tbaa !5
  %136 = ptrtoint ptr %135 to i64
  %137 = sub i64 %136, ptrtoint (ptr getelementptr inbounds (%struct._HII_STRING_PACKAGE_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %138 = inttoptr i64 %137 to ptr
  %139 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %138, i32 0, i32 0
  %140 = load i64, ptr %139, align 8, !tbaa !34
  %141 = icmp ne i64 %140, 1886611816
  br i1 %141, label %142, label %144

142:                                              ; preds = %134
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1649, ptr noundef @.str.2)
  %143 = load ptr, ptr %17, align 8, !tbaa !5
  br label %149

144:                                              ; preds = %134, %130
  %145 = load ptr, ptr %17, align 8, !tbaa !5
  %146 = ptrtoint ptr %145 to i64
  %147 = sub i64 %146, ptrtoint (ptr getelementptr inbounds (%struct._HII_STRING_PACKAGE_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %148 = inttoptr i64 %147 to ptr
  br label %149

149:                                              ; preds = %144, %142
  %150 = phi ptr [ %143, %142 ], [ %148, %144 ]
  store ptr %150, ptr %21, align 8, !tbaa !5
  %151 = load ptr, ptr %21, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %151, i32 0, i32 1
  %153 = load ptr, ptr %152, align 8, !tbaa !36
  %154 = getelementptr inbounds %struct._EFI_HII_STRING_PACKAGE_HDR, ptr %153, i32 0, i32 5
  %155 = getelementptr inbounds [1 x i8], ptr %154, i64 0, i64 0
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = call zeroext i8 @HiiCompareLanguage(ptr noundef %155, ptr noundef %156)
  %158 = icmp ne i8 %157, 0
  br i1 %158, label %159, label %172

159:                                              ; preds = %149
  %160 = load ptr, ptr %18, align 8, !tbaa !5
  %161 = load ptr, ptr %21, align 8, !tbaa !5
  %162 = load i16, ptr %12, align 2, !tbaa !9
  %163 = load ptr, ptr %13, align 8, !tbaa !5
  %164 = load ptr, ptr %14, align 8, !tbaa !5
  %165 = load ptr, ptr %15, align 8, !tbaa !5
  %166 = call i64 @GetStringWorker(ptr noundef %160, ptr noundef %161, i16 noundef zeroext %162, ptr noundef %163, ptr noundef %164, ptr noundef %165)
  store i64 %166, ptr %16, align 8, !tbaa !11
  %167 = load i64, ptr %16, align 8, !tbaa !11
  %168 = icmp ne i64 %167, -9223372036854775794
  br i1 %168, label %169, label %171

169:                                              ; preds = %159
  %170 = load i64, ptr %16, align 8, !tbaa !11
  store i64 %170, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %222

171:                                              ; preds = %159
  br label %172

172:                                              ; preds = %171, %149
  br label %173

173:                                              ; preds = %172
  %174 = load ptr, ptr %17, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct._LIST_ENTRY, ptr %174, i32 0, i32 0
  %176 = load ptr, ptr %175, align 8, !tbaa !28
  store ptr %176, ptr %17, align 8, !tbaa !5
  br label %125, !llvm.loop !37

177:                                              ; preds = %125
  %178 = load ptr, ptr %20, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %178, i32 0, i32 4
  %180 = getelementptr inbounds %struct._LIST_ENTRY, ptr %179, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8, !tbaa !31
  store ptr %181, ptr %17, align 8, !tbaa !5
  br label %182

182:                                              ; preds = %216, %177
  %183 = load ptr, ptr %17, align 8, !tbaa !5
  %184 = load ptr, ptr %20, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %184, i32 0, i32 4
  %186 = icmp ne ptr %183, %185
  br i1 %186, label %187, label %220

187:                                              ; preds = %182
  %188 = call zeroext i8 @DebugAssertEnabled()
  %189 = zext i8 %188 to i32
  %190 = icmp ne i32 %189, 0
  br i1 %190, label %191, label %201

191:                                              ; preds = %187
  %192 = load ptr, ptr %17, align 8, !tbaa !5
  %193 = ptrtoint ptr %192 to i64
  %194 = sub i64 %193, ptrtoint (ptr getelementptr inbounds (%struct._HII_STRING_PACKAGE_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %195 = inttoptr i64 %194 to ptr
  %196 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %195, i32 0, i32 0
  %197 = load i64, ptr %196, align 8, !tbaa !34
  %198 = icmp ne i64 %197, 1886611816
  br i1 %198, label %199, label %201

199:                                              ; preds = %191
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1664, ptr noundef @.str.2)
  %200 = load ptr, ptr %17, align 8, !tbaa !5
  br label %206

201:                                              ; preds = %191, %187
  %202 = load ptr, ptr %17, align 8, !tbaa !5
  %203 = ptrtoint ptr %202 to i64
  %204 = sub i64 %203, ptrtoint (ptr getelementptr inbounds (%struct._HII_STRING_PACKAGE_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %205 = inttoptr i64 %204 to ptr
  br label %206

206:                                              ; preds = %201, %199
  %207 = phi ptr [ %200, %199 ], [ %205, %201 ]
  store ptr %207, ptr %21, align 8, !tbaa !5
  %208 = load ptr, ptr %18, align 8, !tbaa !5
  %209 = load ptr, ptr %21, align 8, !tbaa !5
  %210 = load i16, ptr %12, align 2, !tbaa !9
  %211 = call i64 @GetStringWorker(ptr noundef %208, ptr noundef %209, i16 noundef zeroext %210, ptr noundef null, ptr noundef null, ptr noundef null)
  store i64 %211, ptr %16, align 8, !tbaa !11
  %212 = load i64, ptr %16, align 8, !tbaa !11
  %213 = icmp slt i64 %212, 0
  br i1 %213, label %215, label %214

214:                                              ; preds = %206
  store i64 -9223372036854775776, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %222

215:                                              ; preds = %206
  br label %216

216:                                              ; preds = %215
  %217 = load ptr, ptr %17, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._LIST_ENTRY, ptr %217, i32 0, i32 0
  %219 = load ptr, ptr %218, align 8, !tbaa !28
  store ptr %219, ptr %17, align 8, !tbaa !5
  br label %182, !llvm.loop !38

220:                                              ; preds = %182
  br label %221

221:                                              ; preds = %220, %117
  store i64 -9223372036854775794, ptr %8, align 8
  store i32 1, ptr %22, align 4
  br label %222

222:                                              ; preds = %221, %214, %169, %51, %46, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  %223 = load i64, ptr %8, align 8
  ret i64 %223
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_HII_DATABASE_PRIVATE_DATA", !12, i64 0, !15, i64 8, !15, i64 24, !16, i64 40, !17, i64 72, !18, i64 112, !19, i64 152, !20, i64 240, !15, i64 288, !12, i64 304, !15, i64 312, !12, i64 328, !21, i64 336, !6, i64 352}
!15 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!16 = !{!"_EFI_HII_FONT_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!"_EFI_HII_IMAGE_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!18 = !{!"_EFI_HII_STRING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!19 = !{!"_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}
!20 = !{!"_EFI_HII_CONFIG_ROUTING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!21 = !{!"", !22, i64 0, !10, i64 4, !10, i64 6, !7, i64 8}
!22 = !{!"int", !7, i64 0}
!23 = !{!14, !6, i64 8}
!24 = !{!25, !12, i64 0}
!25 = !{!"_HII_DATABASE_RECORD", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !15, i64 32}
!26 = !{!25, !6, i64 24}
!27 = !{!25, !6, i64 8}
!28 = !{!15, !6, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !6, i64 72}
!32 = !{!"_HII_DATABASE_PACKAGE_LIST_INSTANCE", !33, i64 0, !15, i64 24, !15, i64 40, !15, i64 56, !15, i64 72, !15, i64 88, !6, i64 104, !15, i64 112, !6, i64 128}
!33 = !{!"", !21, i64 0, !22, i64 16}
!34 = !{!35, !12, i64 0}
!35 = !{!"_HII_STRING_PACKAGE_INSTANCE", !12, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !15, i64 40, !7, i64 56, !10, i64 58}
!36 = !{!35, !6, i64 8}
!37 = distinct !{!37, !30}
!38 = distinct !{!38, !30}


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

@.str = external hidden unnamed_addr constant [148 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @HiiCompareLanguage(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @HiiGetString(ptr noundef %0, ptr noundef %1, ptr noundef %2, i16 noundef zeroext %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #1 {
  %8 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %9 = insertelement <4 x ptr> %8, ptr %1, i64 1
  %10 = insertelement <4 x ptr> %9, ptr %5, i64 2
  %11 = insertelement <4 x ptr> %10, ptr %2, i64 3
  %12 = icmp eq <4 x ptr> %11, zeroinitializer
  %13 = icmp eq i16 %3, 0
  %14 = bitcast <4 x i1> %12 to i4
  %15 = icmp ne i4 %14, 0
  %op.rdx = or i1 %15, %13
  br i1 %op.rdx, label %.thread, label %16

16:                                               ; preds = %7
  %17 = icmp eq ptr %4, null
  br i1 %17, label %18, label %20

18:                                               ; preds = %16
  %19 = load i64, ptr %5, align 8, !tbaa !5
  %.not = icmp eq i64 %19, 0
  br i1 %.not, label %20, label %.thread

20:                                               ; preds = %18, %16
  %21 = tail call zeroext i8 @IsHiiHandleValid(ptr noundef nonnull %2) #2
  %.not65 = icmp eq i8 %21, 0
  br i1 %.not65, label %.thread, label %22

22:                                               ; preds = %20
  %23 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not66 = icmp eq i8 %23, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre93 = add i64 %.pre, -112
  %.pre95 = inttoptr i64 %.pre93 to ptr
  br i1 %.not66, label %._crit_edge92, label %24

24:                                               ; preds = %22
  %25 = load i64, ptr %.pre95, align 8, !tbaa !9
  %.not67 = icmp eq i64 %25, 1883531592
  br i1 %.not67, label %._crit_edge92, label %26

26:                                               ; preds = %24
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1630, ptr noundef nonnull @.str.2) #2
  br label %._crit_edge92

._crit_edge92:                                    ; preds = %22, %24, %26
  %27 = phi ptr [ %0, %26 ], [ %.pre95, %24 ], [ %.pre95, %22 ]
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  br label %29

29:                                               ; preds = %._crit_edge91, %._crit_edge92
  %.059.in = phi ptr [ %28, %._crit_edge92 ], [ %.059, %._crit_edge91 ]
  %.059 = load ptr, ptr %.059.in, align 8, !tbaa !21
  %.not68 = icmp eq ptr %.059, %28
  br i1 %.not68, label %.thread, label %30

30:                                               ; preds = %29
  %31 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not69 = icmp eq i8 %31, 0
  %.pre97 = ptrtoint ptr %.059 to i64
  %.pre99 = add i64 %.pre97, -32
  %.pre101 = inttoptr i64 %.pre99 to ptr
  br i1 %.not69, label %._crit_edge91, label %32

32:                                               ; preds = %30
  %33 = load i64, ptr %.pre101, align 8, !tbaa !22
  %.not70 = icmp eq i64 %33, 1919183208
  br i1 %.not70, label %._crit_edge91, label %34

34:                                               ; preds = %32
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1634, ptr noundef nonnull @.str.2) #2
  br label %._crit_edge91

._crit_edge91:                                    ; preds = %30, %32, %34
  %35 = phi ptr [ %.059, %34 ], [ %.pre101, %32 ], [ %.pre101, %30 ]
  %36 = getelementptr inbounds i8, ptr %35, i64 24
  %37 = load ptr, ptr %36, align 8, !tbaa !24
  %38 = icmp eq ptr %37, %2
  br i1 %38, label %39, label %29, !llvm.loop !25

39:                                               ; preds = %._crit_edge91
  %40 = getelementptr inbounds i8, ptr %35, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !27
  %.not71 = icmp eq ptr %41, null
  br i1 %.not71, label %.thread, label %42

42:                                               ; preds = %39
  %43 = getelementptr inbounds i8, ptr %41, i64 72
  %.185 = load ptr, ptr %43, align 8, !tbaa !21
  %.not7286 = icmp eq ptr %.185, %43
  br i1 %.not7286, label %.preheader.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %42, %55
  %.187 = phi ptr [ %.1, %55 ], [ %.185, %42 ]
  %44 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not76 = icmp eq i8 %44, 0
  %.pre109 = ptrtoint ptr %.187 to i64
  %.pre111 = add i64 %.pre109, -24
  %.pre113 = inttoptr i64 %.pre111 to ptr
  br i1 %.not76, label %.lr.ph._crit_edge, label %45

45:                                               ; preds = %.lr.ph
  %46 = load i64, ptr %.pre113, align 8, !tbaa !28
  %.not77 = icmp eq i64 %46, 1886611816
  br i1 %.not77, label %.lr.ph._crit_edge, label %47

47:                                               ; preds = %45
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1649, ptr noundef nonnull @.str.2) #2
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %45, %47
  %48 = phi ptr [ %.187, %47 ], [ %.pre113, %45 ], [ %.pre113, %.lr.ph ]
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !30
  %51 = getelementptr inbounds i8, ptr %50, i64 46
  %52 = tail call zeroext i8 @HiiCompareLanguage(ptr noundef nonnull %51, ptr noundef %1)
  %.not78 = icmp eq i8 %52, 0
  br i1 %.not78, label %55, label %53

53:                                               ; preds = %.lr.ph._crit_edge
  %54 = tail call i64 @GetStringWorker(ptr noundef %27, ptr noundef nonnull %48, i16 noundef zeroext %3, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  %.not79 = icmp eq i64 %54, -9223372036854775794
  br i1 %.not79, label %55, label %.thread

55:                                               ; preds = %.lr.ph._crit_edge, %53
  %.1 = load ptr, ptr %.187, align 8, !tbaa !21
  %.not72 = icmp eq ptr %.1, %43
  br i1 %.not72, label %.preheader.preheader, label %.lr.ph, !llvm.loop !31

.preheader.preheader:                             ; preds = %55, %42
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %.2.in = phi ptr [ %.2, %._crit_edge ], [ %43, %.preheader.preheader ]
  %.2 = load ptr, ptr %.2.in, align 8, !tbaa !21
  %.not73 = icmp eq ptr %.2, %43
  br i1 %.not73, label %.thread, label %56

56:                                               ; preds = %.preheader
  %57 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not74 = icmp eq i8 %57, 0
  %.pre103 = ptrtoint ptr %.2 to i64
  %.pre105 = add i64 %.pre103, -24
  %.pre107 = inttoptr i64 %.pre105 to ptr
  br i1 %.not74, label %._crit_edge, label %58

58:                                               ; preds = %56
  %59 = load i64, ptr %.pre107, align 8, !tbaa !28
  %.not75 = icmp eq i64 %59, 1886611816
  br i1 %.not75, label %._crit_edge, label %60

60:                                               ; preds = %58
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1664, ptr noundef nonnull @.str.2) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %56, %58, %60
  %61 = phi ptr [ %.2, %60 ], [ %.pre107, %58 ], [ %.pre107, %56 ]
  %62 = tail call i64 @GetStringWorker(ptr noundef %27, ptr noundef %61, i16 noundef zeroext %3, ptr noundef null, ptr noundef null, ptr noundef null)
  %63 = icmp slt i64 %62, 0
  br i1 %63, label %.preheader, label %.thread, !llvm.loop !32

.thread:                                          ; preds = %29, %53, %.preheader, %._crit_edge, %39, %20, %18, %7
  %.058 = phi i64 [ -9223372036854775806, %7 ], [ -9223372036854775806, %18 ], [ -9223372036854775794, %20 ], [ -9223372036854775794, %39 ], [ -9223372036854775794, %.preheader ], [ -9223372036854775776, %._crit_edge ], [ %54, %53 ], [ -9223372036854775794, %29 ]
  ret i64 %.058
}

attributes #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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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, !6, i64 0}
!10 = !{!"_HII_DATABASE_PRIVATE_DATA", !6, i64 0, !11, i64 8, !11, i64 24, !13, i64 40, !14, i64 72, !15, i64 112, !16, i64 152, !17, i64 240, !11, i64 288, !6, i64 304, !11, i64 312, !6, i64 328, !18, i64 336, !12, i64 352}
!11 = !{!"_LIST_ENTRY", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_EFI_HII_FONT_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!14 = !{!"_EFI_HII_IMAGE_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!15 = !{!"_EFI_HII_STRING_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!16 = !{!"_EFI_HII_DATABASE_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80}
!17 = !{!"_EFI_HII_CONFIG_ROUTING_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!18 = !{!"", !19, i64 0, !20, i64 4, !20, i64 6, !7, i64 8}
!19 = !{!"int", !7, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = !{!11, !12, i64 0}
!22 = !{!23, !6, i64 0}
!23 = !{!"_HII_DATABASE_RECORD", !6, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !11, i64 32}
!24 = !{!23, !12, i64 24}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!23, !12, i64 8}
!28 = !{!29, !6, i64 0}
!29 = !{!"_HII_STRING_PACKAGE_INSTANCE", !6, i64 0, !12, i64 8, !12, i64 16, !11, i64 24, !11, i64 40, !7, i64 56, !20, i64 58}
!30 = !{!29, !12, i64 8}
!31 = distinct !{!31, !26}
!32 = distinct !{!32, !26}


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