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

; 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

declare i64 @AsciiStrSize(ptr noundef) #1

declare zeroext i8 @IsHiiHandleValid(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @HiiGetLanguages(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, 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 i64, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  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
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %25, label %19

19:                                               ; preds = %4
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %25, label %22

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

25:                                               ; preds = %22, %19, %4
  store i64 -9223372036854775806, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %189

26:                                               ; preds = %22
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = icmp ne i64 %28, 0
  br i1 %29, label %30, label %34

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

33:                                               ; preds = %30
  store i64 -9223372036854775806, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %189

34:                                               ; preds = %30, %26
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = call zeroext i8 @IsHiiHandleValid(ptr noundef %35)
  %37 = icmp ne i8 %36, 0
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %189

39:                                               ; preds = %34
  %40 = call zeroext i8 @DebugAssertEnabled()
  %41 = zext i8 %40 to i32
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %53

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

51:                                               ; preds = %43
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1814, ptr noundef @.str.2)
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  br label %58

53:                                               ; preds = %43, %39
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = ptrtoint ptr %54 to i64
  %56 = sub i64 %55, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_PRIVATE_DATA, ptr null, i32 0, i32 5) to i64)
  %57 = inttoptr i64 %56 to ptr
  br label %58

58:                                               ; preds = %53, %51
  %59 = phi ptr [ %52, %51 ], [ %57, %53 ]
  store ptr %59, ptr %11, align 8, !tbaa !5
  store ptr null, ptr %13, align 8, !tbaa !5
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %60, i32 0, i32 1
  %62 = getelementptr inbounds %struct._LIST_ENTRY, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !22
  store ptr %63, ptr %10, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %100, %58
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %66, i32 0, i32 1
  %68 = icmp ne ptr %65, %67
  br i1 %68, label %69, label %104

69:                                               ; preds = %64
  %70 = call zeroext i8 @DebugAssertEnabled()
  %71 = zext i8 %70 to i32
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %83

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

81:                                               ; preds = %73
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1818, ptr noundef @.str.2)
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  br label %88

83:                                               ; preds = %73, %69
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = ptrtoint ptr %84 to i64
  %86 = sub i64 %85, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_RECORD, ptr null, i32 0, i32 4) to i64)
  %87 = inttoptr i64 %86 to ptr
  br label %88

88:                                               ; preds = %83, %81
  %89 = phi ptr [ %82, %81 ], [ %87, %83 ]
  store ptr %89, ptr %12, align 8, !tbaa !5
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %90, i32 0, i32 3
  %92 = load ptr, ptr %91, align 8, !tbaa !25
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = icmp eq ptr %92, %93
  br i1 %94, label %95, label %99

95:                                               ; preds = %88
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %96, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !26
  store ptr %98, ptr %13, align 8, !tbaa !5
  br label %104

99:                                               ; preds = %88
  br label %100

100:                                              ; preds = %99
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._LIST_ENTRY, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !27
  store ptr %103, ptr %10, align 8, !tbaa !5
  br label %64, !llvm.loop !28

104:                                              ; preds = %95, %64
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = icmp eq ptr %105, null
  br i1 %106, label %107, label %108

107:                                              ; preds = %104
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %189

108:                                              ; preds = %104
  store i64 0, ptr %15, align 8, !tbaa !9
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %109, i32 0, i32 4
  %111 = getelementptr inbounds %struct._LIST_ENTRY, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !30
  store ptr %112, ptr %10, align 8, !tbaa !5
  br label %113

113:                                              ; preds = %170, %108
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %115, i32 0, i32 4
  %117 = icmp ne ptr %114, %116
  br i1 %117, label %118, label %174

118:                                              ; preds = %113
  %119 = call zeroext i8 @DebugAssertEnabled()
  %120 = zext i8 %119 to i32
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %132

122:                                              ; preds = %118
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = ptrtoint ptr %123 to i64
  %125 = sub i64 %124, ptrtoint (ptr getelementptr inbounds (%struct._HII_STRING_PACKAGE_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %126 = inttoptr i64 %125 to ptr
  %127 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %126, i32 0, i32 0
  %128 = load i64, ptr %127, align 8, !tbaa !33
  %129 = icmp ne i64 %128, 1886611816
  br i1 %129, label %130, label %132

130:                                              ; preds = %122
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1836, ptr noundef @.str.2)
  %131 = load ptr, ptr %10, align 8, !tbaa !5
  br label %137

132:                                              ; preds = %122, %118
  %133 = load ptr, ptr %10, align 8, !tbaa !5
  %134 = ptrtoint ptr %133 to i64
  %135 = sub i64 %134, ptrtoint (ptr getelementptr inbounds (%struct._HII_STRING_PACKAGE_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %136 = inttoptr i64 %135 to ptr
  br label %137

137:                                              ; preds = %132, %130
  %138 = phi ptr [ %131, %130 ], [ %136, %132 ]
  store ptr %138, ptr %14, align 8, !tbaa !5
  %139 = load ptr, ptr %14, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %139, i32 0, i32 1
  %141 = load ptr, ptr %140, align 8, !tbaa !35
  %142 = getelementptr inbounds %struct._EFI_HII_STRING_PACKAGE_HDR, ptr %141, i32 0, i32 5
  %143 = getelementptr inbounds [1 x i8], ptr %142, i64 0, i64 0
  %144 = call i64 @AsciiStrSize(ptr noundef %143)
  %145 = load i64, ptr %15, align 8, !tbaa !9
  %146 = add i64 %145, %144
  store i64 %146, ptr %15, align 8, !tbaa !9
  %147 = load i64, ptr %15, align 8, !tbaa !9
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = load i64, ptr %148, align 8, !tbaa !9
  %150 = icmp ule i64 %147, %149
  br i1 %150, label %151, label %169

151:                                              ; preds = %137
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = load ptr, ptr %14, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !35
  %156 = getelementptr inbounds %struct._EFI_HII_STRING_PACKAGE_HDR, ptr %155, i32 0, i32 5
  %157 = getelementptr inbounds [1 x i8], ptr %156, i64 0, i64 0
  %158 = call ptr @AsciiStrCpy(ptr noundef %152, ptr noundef %157)
  %159 = load ptr, ptr %14, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %159, i32 0, i32 1
  %161 = load ptr, ptr %160, align 8, !tbaa !35
  %162 = getelementptr inbounds %struct._EFI_HII_STRING_PACKAGE_HDR, ptr %161, i32 0, i32 5
  %163 = getelementptr inbounds [1 x i8], ptr %162, i64 0, i64 0
  %164 = call i64 @AsciiStrSize(ptr noundef %163)
  %165 = load ptr, ptr %8, align 8, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %165, i64 %164
  store ptr %166, ptr %8, align 8, !tbaa !5
  %167 = load ptr, ptr %8, align 8, !tbaa !5
  %168 = getelementptr inbounds i8, ptr %167, i64 -1
  store i8 59, ptr %168, align 1, !tbaa !36
  br label %169

169:                                              ; preds = %151, %137
  br label %170

170:                                              ; preds = %169
  %171 = load ptr, ptr %10, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._LIST_ENTRY, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !27
  store ptr %173, ptr %10, align 8, !tbaa !5
  br label %113, !llvm.loop !37

174:                                              ; preds = %113
  %175 = load i64, ptr %15, align 8, !tbaa !9
  %176 = icmp eq i64 %175, 0
  br i1 %176, label %177, label %178

177:                                              ; preds = %174
  store i64 -9223372036854775794, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %189

178:                                              ; preds = %174
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = load i64, ptr %179, align 8, !tbaa !9
  %181 = load i64, ptr %15, align 8, !tbaa !9
  %182 = icmp ult i64 %180, %181
  br i1 %182, label %183, label %186

183:                                              ; preds = %178
  %184 = load i64, ptr %15, align 8, !tbaa !9
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %184, ptr %185, align 8, !tbaa !9
  store i64 -9223372036854775803, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %189

186:                                              ; preds = %178
  %187 = load ptr, ptr %8, align 8, !tbaa !5
  %188 = getelementptr inbounds i8, ptr %187, i64 -1
  store i8 0, ptr %188, align 1, !tbaa !36
  store i64 0, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %189

189:                                              ; preds = %186, %183, %177, %107, %38, %33, %25
  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
  %190 = load i64, ptr %5, align 8
  ret i64 %190
}

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 = !{!7, !7, i64 0}
!37 = distinct !{!37, !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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @HiiGetLanguages(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = icmp eq ptr %0, null
  %6 = icmp eq ptr %3, null
  %or.cond = or i1 %5, %6
  %7 = icmp eq ptr %1, null
  %or.cond3 = or i1 %7, %or.cond
  br i1 %or.cond3, label %.thread, label %8

8:                                                ; preds = %4
  %9 = load i64, ptr %3, align 8, !tbaa !5
  %10 = icmp ne i64 %9, 0
  %11 = icmp eq ptr %2, null
  %or.cond5 = and i1 %11, %10
  br i1 %or.cond5, label %.thread, label %12

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

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

16:                                               ; preds = %14
  %17 = load i64, ptr %.pre76, align 8, !tbaa !9
  %.not56 = icmp eq i64 %17, 1883531592
  br i1 %.not56, label %._crit_edge73, label %18

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

._crit_edge73:                                    ; preds = %14, %16, %18
  %19 = phi ptr [ %0, %18 ], [ %.pre76, %16 ], [ %.pre76, %14 ]
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  br label %21

21:                                               ; preds = %._crit_edge72, %._crit_edge73
  %.050.in = phi ptr [ %20, %._crit_edge73 ], [ %.050, %._crit_edge72 ]
  %.050 = load ptr, ptr %.050.in, align 8, !tbaa !21
  %.not57 = icmp eq ptr %.050, %20
  br i1 %.not57, label %.thread, label %22

22:                                               ; preds = %21
  %23 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not58 = icmp eq i8 %23, 0
  %.pre78 = ptrtoint ptr %.050 to i64
  %.pre80 = add i64 %.pre78, -32
  %.pre82 = inttoptr i64 %.pre80 to ptr
  br i1 %.not58, label %._crit_edge72, label %24

24:                                               ; preds = %22
  %25 = load i64, ptr %.pre82, align 8, !tbaa !22
  %.not59 = icmp eq i64 %25, 1919183208
  br i1 %.not59, label %._crit_edge72, label %26

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

._crit_edge72:                                    ; preds = %22, %24, %26
  %27 = phi ptr [ %.050, %26 ], [ %.pre82, %24 ], [ %.pre82, %22 ]
  %28 = getelementptr inbounds i8, ptr %27, i64 24
  %29 = load ptr, ptr %28, align 8, !tbaa !24
  %30 = icmp eq ptr %29, %1
  br i1 %30, label %31, label %21, !llvm.loop !25

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

35:                                               ; preds = %31
  %36 = getelementptr inbounds i8, ptr %33, i64 72
  %.15165 = load ptr, ptr %36, align 8, !tbaa !21
  %.not6066 = icmp eq ptr %.15165, %36
  br i1 %.not6066, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %35, %57
  %.15169 = phi ptr [ %.151, %57 ], [ %.15165, %35 ]
  %.068 = phi i64 [ %46, %57 ], [ 0, %35 ]
  %.04967 = phi ptr [ %.1, %57 ], [ %2, %35 ]
  %37 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not61 = icmp eq i8 %37, 0
  %.pre84 = ptrtoint ptr %.15169 to i64
  %.pre86 = add i64 %.pre84, -24
  %.pre88 = inttoptr i64 %.pre86 to ptr
  br i1 %.not61, label %.lr.ph._crit_edge, label %38

38:                                               ; preds = %.lr.ph
  %39 = load i64, ptr %.pre88, align 8, !tbaa !28
  %.not62 = icmp eq i64 %39, 1886611816
  br i1 %.not62, label %.lr.ph._crit_edge, label %40

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

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %38, %40
  %41 = phi ptr [ %.15169, %40 ], [ %.pre88, %38 ], [ %.pre88, %.lr.ph ]
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load ptr, ptr %42, align 8, !tbaa !30
  %44 = getelementptr inbounds i8, ptr %43, i64 46
  %45 = tail call i64 @AsciiStrSize(ptr noundef nonnull %44) #2
  %46 = add i64 %45, %.068
  %47 = load i64, ptr %3, align 8, !tbaa !5
  %.not63 = icmp ugt i64 %46, %47
  br i1 %.not63, label %57, label %48

48:                                               ; preds = %.lr.ph._crit_edge
  %49 = load ptr, ptr %42, align 8, !tbaa !30
  %50 = getelementptr inbounds i8, ptr %49, i64 46
  %51 = tail call ptr @AsciiStrCpy(ptr noundef %.04967, ptr noundef nonnull %50) #2
  %52 = load ptr, ptr %42, align 8, !tbaa !30
  %53 = getelementptr inbounds i8, ptr %52, i64 46
  %54 = tail call i64 @AsciiStrSize(ptr noundef nonnull %53) #2
  %55 = getelementptr inbounds i8, ptr %.04967, i64 %54
  %56 = getelementptr inbounds i8, ptr %55, i64 -1
  store i8 59, ptr %56, align 1, !tbaa !31
  br label %57

57:                                               ; preds = %.lr.ph._crit_edge, %48
  %.1 = phi ptr [ %55, %48 ], [ %.04967, %.lr.ph._crit_edge ]
  %.151 = load ptr, ptr %.15169, align 8, !tbaa !21
  %.not60 = icmp eq ptr %.151, %36
  br i1 %.not60, label %._crit_edge, label %.lr.ph, !llvm.loop !32

._crit_edge:                                      ; preds = %57
  %58 = icmp eq i64 %46, 0
  br i1 %58, label %.thread, label %59

59:                                               ; preds = %._crit_edge
  %60 = load i64, ptr %3, align 8, !tbaa !5
  %61 = icmp ult i64 %60, %46
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  store i64 %46, ptr %3, align 8, !tbaa !5
  br label %.thread

63:                                               ; preds = %59
  %64 = getelementptr inbounds i8, ptr %.1, i64 -1
  store i8 0, ptr %64, align 1, !tbaa !31
  br label %.thread

.thread:                                          ; preds = %21, %35, %._crit_edge, %31, %12, %8, %4, %63, %62
  %.047 = phi i64 [ -9223372036854775803, %62 ], [ 0, %63 ], [ -9223372036854775806, %4 ], [ -9223372036854775806, %8 ], [ -9223372036854775794, %12 ], [ -9223372036854775794, %31 ], [ -9223372036854775794, %._crit_edge ], [ -9223372036854775794, %35 ], [ -9223372036854775794, %21 ]
  ret i64 %.047
}

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 = !{!7, !7, i64 0}
!32 = distinct !{!32, !26}


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