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

; 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
@.str.15 = external hidden unnamed_addr constant [2 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

declare i64 @AsciiStrSize(ptr noundef) #1

declare zeroext i8 @IsHiiHandleValid(ptr noundef) #1

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

declare ptr @AsciiStrCpy(ptr noundef, ptr noundef) #1

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

23:                                               ; preds = %5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %32, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %32, label %29

29:                                               ; preds = %26
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %29, %26, %23, %5
  store i64 -9223372036854775806, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %188

33:                                               ; preds = %29
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %41

36:                                               ; preds = %33
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = load i64, ptr %37, align 8, !tbaa !9
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %36
  store i64 -9223372036854775806, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %188

41:                                               ; preds = %36, %33
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = call zeroext i8 @IsHiiHandleValid(ptr noundef %42)
  %44 = icmp ne i8 %43, 0
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i64 -9223372036854775794, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %188

46:                                               ; preds = %41
  %47 = call zeroext i8 @DebugAssertEnabled()
  %48 = zext i8 %47 to i32
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %60

50:                                               ; preds = %46
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = ptrtoint ptr %51 to i64
  %53 = sub i64 %52, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_PRIVATE_DATA, ptr null, i32 0, i32 5) to i64)
  %54 = inttoptr i64 %53 to ptr
  %55 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %54, i32 0, i32 0
  %56 = load i64, ptr %55, align 8, !tbaa !11
  %57 = icmp ne i64 %56, 1883531592
  br i1 %57, label %58, label %60

58:                                               ; preds = %50
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1920, ptr noundef @.str.2)
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  br label %65

60:                                               ; preds = %50, %46
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = ptrtoint ptr %61 to i64
  %63 = sub i64 %62, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_PRIVATE_DATA, ptr null, i32 0, i32 5) to i64)
  %64 = inttoptr i64 %63 to ptr
  br label %65

65:                                               ; preds = %60, %58
  %66 = phi ptr [ %59, %58 ], [ %64, %60 ]
  store ptr %66, ptr %14, align 8, !tbaa !5
  store ptr null, ptr %16, align 8, !tbaa !5
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds %struct._LIST_ENTRY, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !22
  store ptr %70, ptr %12, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %107, %65
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %73, i32 0, i32 1
  %75 = icmp ne ptr %72, %74
  br i1 %75, label %76, label %111

76:                                               ; preds = %71
  %77 = call zeroext i8 @DebugAssertEnabled()
  %78 = zext i8 %77 to i32
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %90

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

88:                                               ; preds = %80
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1924, ptr noundef @.str.2)
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  br label %95

90:                                               ; preds = %80, %76
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = ptrtoint ptr %91 to i64
  %93 = sub i64 %92, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_RECORD, ptr null, i32 0, i32 4) to i64)
  %94 = inttoptr i64 %93 to ptr
  br label %95

95:                                               ; preds = %90, %88
  %96 = phi ptr [ %89, %88 ], [ %94, %90 ]
  store ptr %96, ptr %15, align 8, !tbaa !5
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %97, i32 0, i32 3
  %99 = load ptr, ptr %98, align 8, !tbaa !25
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = icmp eq ptr %99, %100
  br i1 %101, label %102, label %106

102:                                              ; preds = %95
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !26
  store ptr %105, ptr %16, align 8, !tbaa !5
  br label %111

106:                                              ; preds = %95
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._LIST_ENTRY, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !27
  store ptr %110, ptr %12, align 8, !tbaa !5
  br label %71, !llvm.loop !28

111:                                              ; preds = %102, %71
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  %113 = icmp eq ptr %112, null
  br i1 %113, label %114, label %115

114:                                              ; preds = %111
  store i64 -9223372036854775794, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %188

115:                                              ; preds = %111
  store ptr null, ptr %18, align 8, !tbaa !5
  store i64 0, ptr %19, align 8, !tbaa !9
  %116 = load ptr, ptr %16, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %116, i32 0, i32 4
  %118 = getelementptr inbounds %struct._LIST_ENTRY, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !30
  store ptr %119, ptr %13, align 8, !tbaa !5
  br label %120

120:                                              ; preds = %183, %115
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %122, i32 0, i32 4
  %124 = icmp ne ptr %121, %123
  br i1 %124, label %125, label %187

125:                                              ; preds = %120
  %126 = call zeroext i8 @DebugAssertEnabled()
  %127 = zext i8 %126 to i32
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %139

129:                                              ; preds = %125
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  %131 = ptrtoint ptr %130 to i64
  %132 = sub i64 %131, ptrtoint (ptr getelementptr inbounds (%struct._HII_STRING_PACKAGE_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %133 = inttoptr i64 %132 to ptr
  %134 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %133, i32 0, i32 0
  %135 = load i64, ptr %134, align 8, !tbaa !33
  %136 = icmp ne i64 %135, 1886611816
  br i1 %136, label %137, label %139

137:                                              ; preds = %129
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1940, ptr noundef @.str.2)
  %138 = load ptr, ptr %13, align 8, !tbaa !5
  br label %144

139:                                              ; preds = %129, %125
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = ptrtoint ptr %140 to i64
  %142 = sub i64 %141, ptrtoint (ptr getelementptr inbounds (%struct._HII_STRING_PACKAGE_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %143 = inttoptr i64 %142 to ptr
  br label %144

144:                                              ; preds = %139, %137
  %145 = phi ptr [ %138, %137 ], [ %143, %139 ]
  store ptr %145, ptr %17, align 8, !tbaa !5
  %146 = load ptr, ptr %17, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %146, i32 0, i32 1
  %148 = load ptr, ptr %147, align 8, !tbaa !35
  %149 = getelementptr inbounds %struct._EFI_HII_STRING_PACKAGE_HDR, ptr %148, i32 0, i32 5
  %150 = getelementptr inbounds [1 x i8], ptr %149, i64 0, i64 0
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = call zeroext i8 @HiiCompareLanguage(ptr noundef %150, ptr noundef %151)
  %153 = icmp ne i8 %152, 0
  br i1 %153, label %154, label %182

154:                                              ; preds = %144
  %155 = load ptr, ptr %17, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %155, i32 0, i32 1
  %157 = load ptr, ptr %156, align 8, !tbaa !35
  %158 = getelementptr inbounds %struct._EFI_HII_STRING_PACKAGE_HDR, ptr %157, i32 0, i32 5
  %159 = getelementptr inbounds [1 x i8], ptr %158, i64 0, i64 0
  store ptr %159, ptr %18, align 8, !tbaa !5
  %160 = load ptr, ptr %18, align 8, !tbaa !5
  %161 = call ptr @AsciiStrStr(ptr noundef %160, ptr noundef @.str.15)
  store ptr %161, ptr %18, align 8, !tbaa !5
  %162 = load ptr, ptr %18, align 8, !tbaa !5
  %163 = icmp eq ptr %162, null
  br i1 %163, label %164, label %165

164:                                              ; preds = %154
  br label %187

165:                                              ; preds = %154
  %166 = load ptr, ptr %18, align 8, !tbaa !5
  %167 = getelementptr inbounds i8, ptr %166, i32 1
  store ptr %167, ptr %18, align 8, !tbaa !5
  %168 = load ptr, ptr %18, align 8, !tbaa !5
  %169 = call i64 @AsciiStrSize(ptr noundef %168)
  store i64 %169, ptr %19, align 8, !tbaa !9
  %170 = load i64, ptr %19, align 8, !tbaa !9
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  %172 = load i64, ptr %171, align 8, !tbaa !9
  %173 = icmp ule i64 %170, %172
  br i1 %173, label %174, label %178

174:                                              ; preds = %165
  %175 = load ptr, ptr %10, align 8, !tbaa !5
  %176 = load ptr, ptr %18, align 8, !tbaa !5
  %177 = call ptr @AsciiStrCpy(ptr noundef %175, ptr noundef %176)
  br label %181

178:                                              ; preds = %165
  %179 = load i64, ptr %19, align 8, !tbaa !9
  %180 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 %179, ptr %180, align 8, !tbaa !9
  store i64 -9223372036854775803, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %188

181:                                              ; preds = %174
  store i64 0, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %188

182:                                              ; preds = %144
  br label %183

183:                                              ; preds = %182
  %184 = load ptr, ptr %13, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._LIST_ENTRY, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !27
  store ptr %186, ptr %13, align 8, !tbaa !5
  br label %120, !llvm.loop !36

187:                                              ; preds = %164, %120
  store i64 -9223372036854775776, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %188

188:                                              ; preds = %187, %181, %178, %114, %45, %40, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 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
  %189 = load i64, ptr %6, align 8
  ret i64 %189
}

declare ptr @AsciiStrStr(ptr noundef, ptr noundef) #1

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

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

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

@.str = external hidden unnamed_addr constant [148 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [2 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

declare i64 @AsciiStrSize(ptr noundef) local_unnamed_addr #0

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

declare ptr @AsciiStrCpy(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @HiiGetSecondaryLanguages(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %7 = insertelement <4 x ptr> %6, ptr %1, i64 1
  %8 = insertelement <4 x ptr> %7, ptr %2, i64 2
  %9 = insertelement <4 x ptr> %8, ptr %4, i64 3
  %10 = icmp eq <4 x ptr> %9, zeroinitializer
  %11 = bitcast <4 x i1> %10 to i4
  %.not95 = icmp eq i4 %11, 0
  br i1 %.not95, label %12, label %.thread

12:                                               ; preds = %5
  %13 = icmp eq ptr %3, null
  br i1 %13, label %14, label %16

14:                                               ; preds = %12
  %15 = load i64, ptr %4, align 8, !tbaa !5
  %.not = icmp eq i64 %15, 0
  br i1 %.not, label %16, label %.thread

16:                                               ; preds = %14, %12
  %17 = tail call zeroext i8 @IsHiiHandleValid(ptr noundef nonnull %1) #2
  %.not55 = icmp eq i8 %17, 0
  br i1 %.not55, label %.thread, label %18

18:                                               ; preds = %16
  %19 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not56 = icmp eq i8 %19, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre74 = add i64 %.pre, -112
  %.pre76 = inttoptr i64 %.pre74 to ptr
  br i1 %.not56, label %._crit_edge73, label %20

20:                                               ; preds = %18
  %21 = load i64, ptr %.pre76, align 8, !tbaa !9
  %.not57 = icmp eq i64 %21, 1883531592
  br i1 %.not57, label %._crit_edge73, label %22

22:                                               ; preds = %20
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1920, ptr noundef nonnull @.str.2) #2
  br label %._crit_edge73

._crit_edge73:                                    ; preds = %18, %20, %22
  %23 = phi ptr [ %0, %22 ], [ %.pre76, %20 ], [ %.pre76, %18 ]
  %24 = getelementptr inbounds i8, ptr %23, i64 8
  br label %25

25:                                               ; preds = %._crit_edge72, %._crit_edge73
  %.047.in = phi ptr [ %24, %._crit_edge73 ], [ %.047, %._crit_edge72 ]
  %.047 = load ptr, ptr %.047.in, align 8, !tbaa !21
  %.not58 = icmp eq ptr %.047, %24
  br i1 %.not58, label %.thread, label %26

26:                                               ; preds = %25
  %27 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not59 = icmp eq i8 %27, 0
  %.pre78 = ptrtoint ptr %.047 to i64
  %.pre80 = add i64 %.pre78, -32
  %.pre82 = inttoptr i64 %.pre80 to ptr
  br i1 %.not59, label %._crit_edge72, label %28

28:                                               ; preds = %26
  %29 = load i64, ptr %.pre82, align 8, !tbaa !22
  %.not60 = icmp eq i64 %29, 1919183208
  br i1 %.not60, label %._crit_edge72, label %30

30:                                               ; preds = %28
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1924, ptr noundef nonnull @.str.2) #2
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %26, %28, %30
  %31 = phi ptr [ %.047, %30 ], [ %.pre82, %28 ], [ %.pre82, %26 ]
  %32 = getelementptr inbounds i8, ptr %31, i64 24
  %33 = load ptr, ptr %32, align 8, !tbaa !24
  %34 = icmp eq ptr %33, %1
  br i1 %34, label %35, label %25, !llvm.loop !25

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

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %37, i64 72
  br label %41

41:                                               ; preds = %._crit_edge, %39
  %.048.in = phi ptr [ %40, %39 ], [ %.048, %._crit_edge ]
  %.048 = load ptr, ptr %.048.in, align 8, !tbaa !21
  %.not61 = icmp eq ptr %.048, %40
  br i1 %.not61, label %.thread, label %42

42:                                               ; preds = %41
  %43 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not62 = icmp eq i8 %43, 0
  %.pre84 = ptrtoint ptr %.048 to i64
  %.pre86 = add i64 %.pre84, -24
  %.pre88 = inttoptr i64 %.pre86 to ptr
  br i1 %.not62, label %._crit_edge, label %44

44:                                               ; preds = %42
  %45 = load i64, ptr %.pre88, align 8, !tbaa !28
  %.not63 = icmp eq i64 %45, 1886611816
  br i1 %.not63, label %._crit_edge, label %46

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

._crit_edge:                                      ; preds = %42, %44, %46
  %47 = phi ptr [ %.048, %46 ], [ %.pre88, %44 ], [ %.pre88, %42 ]
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !30
  %50 = getelementptr inbounds i8, ptr %49, i64 46
  %51 = tail call zeroext i8 @HiiCompareLanguage(ptr noundef nonnull %50, ptr noundef %2)
  %.not64 = icmp eq i8 %51, 0
  br i1 %.not64, label %41, label %52, !llvm.loop !31

52:                                               ; preds = %._crit_edge
  %53 = getelementptr inbounds i8, ptr %47, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !30
  %55 = getelementptr inbounds i8, ptr %54, i64 46
  %56 = tail call ptr @AsciiStrStr(ptr noundef nonnull %55, ptr noundef nonnull @.str.15) #2
  %57 = icmp eq ptr %56, null
  br i1 %57, label %.thread, label %58

58:                                               ; preds = %52
  %59 = getelementptr inbounds i8, ptr %56, i64 1
  %60 = tail call i64 @AsciiStrSize(ptr noundef nonnull %59) #2
  %61 = load i64, ptr %4, align 8, !tbaa !5
  %.not65 = icmp ugt i64 %60, %61
  br i1 %.not65, label %64, label %62

62:                                               ; preds = %58
  %63 = tail call ptr @AsciiStrCpy(ptr noundef %3, ptr noundef nonnull %59) #2
  br label %.thread

64:                                               ; preds = %58
  store i64 %60, ptr %4, align 8, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %25, %41, %52, %35, %16, %14, %5, %62, %64
  %.0 = phi i64 [ 0, %62 ], [ -9223372036854775803, %64 ], [ -9223372036854775806, %5 ], [ -9223372036854775806, %14 ], [ -9223372036854775794, %16 ], [ -9223372036854775794, %35 ], [ -9223372036854775776, %52 ], [ -9223372036854775776, %41 ], [ -9223372036854775794, %25 ]
  ret i64 %.0
}

declare ptr @AsciiStrStr(ptr noundef, ptr noundef) local_unnamed_addr #0

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}


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