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

; 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 @SetStringWorker(ptr noundef, ptr noundef, i16 noundef zeroext, 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 @HiiSetString(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i16, align 2
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i16 %2, ptr %10, align 2, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %37, label %24

24:                                               ; preds = %6
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %37, label %27

27:                                               ; preds = %24
  %28 = load i16, ptr %10, align 2, !tbaa !9
  %29 = zext i16 %28 to i32
  %30 = icmp slt i32 %29, 1
  br i1 %30, label %37, label %31

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

34:                                               ; preds = %31
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %38

37:                                               ; preds = %34, %31, %27, %24, %6
  store i64 -9223372036854775806, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %188

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

42:                                               ; preds = %38
  store i64 -9223372036854775794, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %188

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

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

55:                                               ; preds = %47
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1727, ptr noundef @.str.2)
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  br label %62

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

62:                                               ; preds = %57, %55
  %63 = phi ptr [ %56, %55 ], [ %61, %57 ]
  store ptr %63, ptr %16, align 8, !tbaa !5
  store ptr null, ptr %18, align 8, !tbaa !5
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %64, i32 0, i32 1
  %66 = getelementptr inbounds %struct._LIST_ENTRY, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !22
  store ptr %67, ptr %15, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %104, %62
  %69 = load ptr, ptr %15, align 8, !tbaa !5
  %70 = load ptr, ptr %16, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %70, i32 0, i32 1
  %72 = icmp ne ptr %69, %71
  br i1 %72, label %73, label %108

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

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

85:                                               ; preds = %77
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1731, ptr noundef @.str.2)
  %86 = load ptr, ptr %15, align 8, !tbaa !5
  br label %92

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

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

99:                                               ; preds = %92
  %100 = load ptr, ptr %17, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !26
  store ptr %102, ptr %18, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %99, %92
  br label %104

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

108:                                              ; preds = %68
  %109 = load ptr, ptr %18, align 8, !tbaa !5
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %187

111:                                              ; preds = %108
  %112 = load ptr, ptr %18, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %112, i32 0, i32 4
  %114 = getelementptr inbounds %struct._LIST_ENTRY, ptr %113, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !30
  store ptr %115, ptr %15, align 8, !tbaa !5
  br label %116

116:                                              ; preds = %182, %111
  %117 = load ptr, ptr %15, align 8, !tbaa !5
  %118 = load ptr, ptr %18, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %118, i32 0, i32 4
  %120 = icmp ne ptr %117, %119
  br i1 %120, label %121, label %186

121:                                              ; preds = %116
  %122 = call zeroext i8 @DebugAssertEnabled()
  %123 = zext i8 %122 to i32
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %135

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

133:                                              ; preds = %125
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1742, ptr noundef @.str.2)
  %134 = load ptr, ptr %15, align 8, !tbaa !5
  br label %140

135:                                              ; preds = %125, %121
  %136 = load ptr, ptr %15, align 8, !tbaa !5
  %137 = ptrtoint ptr %136 to i64
  %138 = sub i64 %137, ptrtoint (ptr getelementptr inbounds (%struct._HII_STRING_PACKAGE_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %139 = inttoptr i64 %138 to ptr
  br label %140

140:                                              ; preds = %135, %133
  %141 = phi ptr [ %134, %133 ], [ %139, %135 ]
  store ptr %141, ptr %19, align 8, !tbaa !5
  %142 = load ptr, ptr %19, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !35
  %145 = getelementptr inbounds %struct._EFI_HII_STRING_PACKAGE_HDR, ptr %144, i32 0, i32 5
  %146 = getelementptr inbounds [1 x i8], ptr %145, i64 0, i64 0
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = call zeroext i8 @HiiCompareLanguage(ptr noundef %146, ptr noundef %147)
  %149 = icmp ne i8 %148, 0
  br i1 %149, label %150, label %181

150:                                              ; preds = %140
  %151 = load ptr, ptr %19, 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 !35
  %154 = getelementptr inbounds %struct._EFI_HII_STRING_PACKAGE_HDR, ptr %153, i32 0, i32 0
  %155 = load i32, ptr %154, align 1
  %156 = and i32 %155, 16777215
  store i32 %156, ptr %20, align 4, !tbaa !36
  %157 = load ptr, ptr %16, align 8, !tbaa !5
  %158 = load ptr, ptr %19, align 8, !tbaa !5
  %159 = load i16, ptr %10, align 2, !tbaa !9
  %160 = load ptr, ptr %12, align 8, !tbaa !5
  %161 = load ptr, ptr %13, align 8, !tbaa !5
  %162 = call i64 @SetStringWorker(ptr noundef %157, ptr noundef %158, i16 noundef zeroext %159, ptr noundef %160, ptr noundef %161)
  store i64 %162, ptr %14, align 8, !tbaa !37
  %163 = load i64, ptr %14, align 8, !tbaa !37
  %164 = icmp slt i64 %163, 0
  br i1 %164, label %165, label %167

165:                                              ; preds = %150
  %166 = load i64, ptr %14, align 8, !tbaa !37
  store i64 %166, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %188

167:                                              ; preds = %150
  %168 = load ptr, ptr %19, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct._HII_STRING_PACKAGE_INSTANCE, ptr %168, i32 0, i32 1
  %170 = load ptr, ptr %169, align 8, !tbaa !35
  %171 = getelementptr inbounds %struct._EFI_HII_STRING_PACKAGE_HDR, ptr %170, i32 0, i32 0
  %172 = load i32, ptr %171, align 1
  %173 = and i32 %172, 16777215
  %174 = load i32, ptr %20, align 4, !tbaa !36
  %175 = sub i32 %173, %174
  %176 = load ptr, ptr %18, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %176, i32 0, i32 0
  %178 = getelementptr inbounds %struct.EFI_HII_PACKAGE_LIST_HEADER, ptr %177, i32 0, i32 1
  %179 = load i32, ptr %178, align 8, !tbaa !38
  %180 = add i32 %179, %175
  store i32 %180, ptr %178, align 8, !tbaa !38
  store i64 0, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %188

181:                                              ; preds = %140
  br label %182

182:                                              ; preds = %181
  %183 = load ptr, ptr %15, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._LIST_ENTRY, ptr %183, i32 0, i32 0
  %185 = load ptr, ptr %184, align 8, !tbaa !27
  store ptr %185, ptr %15, align 8, !tbaa !5
  br label %116, !llvm.loop !39

186:                                              ; preds = %116
  br label %187

187:                                              ; preds = %186, %108
  store i64 -9223372036854775794, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %188

188:                                              ; preds = %187, %167, %165, %42, %37
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %189 = load i64, ptr %7, align 8
  ret i64 %189
}

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, !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 72}
!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, !13, i64 0}
!34 = !{!"_HII_STRING_PACKAGE_INSTANCE", !13, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !14, i64 40, !7, i64 56, !10, i64 58}
!35 = !{!34, !6, i64 8}
!36 = !{!21, !21, i64 0}
!37 = !{!13, !13, i64 0}
!38 = !{!31, !21, i64 16}
!39 = distinct !{!39, !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

; Function Attrs: nounwind uwtable
declare dso_local i64 @SetStringWorker(ptr noundef, ptr noundef, i16 noundef zeroext, 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 range(i64 -9223372036854775808, 1) i64 @HiiSetString(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  %7 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %8 = insertelement <4 x ptr> %7, ptr %3, i64 1
  %9 = insertelement <4 x ptr> %8, ptr %4, i64 2
  %10 = insertelement <4 x ptr> %9, ptr %1, i64 3
  %11 = icmp eq <4 x ptr> %10, zeroinitializer
  %12 = icmp eq i16 %2, 0
  %13 = bitcast <4 x i1> %11 to i4
  %14 = icmp ne i4 %13, 0
  %op.rdx = or i1 %14, %12
  br i1 %op.rdx, label %.loopexit, label %15

15:                                               ; preds = %6
  %16 = tail call zeroext i8 @IsHiiHandleValid(ptr noundef nonnull %1) #2
  %.not = icmp eq i8 %16, 0
  br i1 %.not, label %.loopexit, label %17

17:                                               ; preds = %15
  %18 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not55 = icmp eq i8 %18, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre73 = add i64 %.pre, -112
  %.pre75 = inttoptr i64 %.pre73 to ptr
  br i1 %.not55, label %._crit_edge72, label %19

19:                                               ; preds = %17
  %20 = load i64, ptr %.pre75, align 8, !tbaa !5
  %.not56 = icmp eq i64 %20, 1883531592
  br i1 %.not56, label %._crit_edge72, label %21

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

._crit_edge72:                                    ; preds = %17, %19, %21
  %22 = phi ptr [ %0, %21 ], [ %.pre75, %19 ], [ %.pre75, %17 ]
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %.04866 = load ptr, ptr %23, align 8, !tbaa !20
  %.not5767 = icmp eq ptr %.04866, %23
  br i1 %.not5767, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %._crit_edge72, %35
  %.04869 = phi ptr [ %.048, %35 ], [ %.04866, %._crit_edge72 ]
  %.04968 = phi ptr [ %.150, %35 ], [ null, %._crit_edge72 ]
  %24 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not63 = icmp eq i8 %24, 0
  %.pre83 = ptrtoint ptr %.04869 to i64
  %.pre85 = add i64 %.pre83, -32
  %.pre87 = inttoptr i64 %.pre85 to ptr
  br i1 %.not63, label %.lr.ph._crit_edge, label %25

25:                                               ; preds = %.lr.ph
  %26 = load i64, ptr %.pre87, align 8, !tbaa !21
  %.not64 = icmp eq i64 %26, 1919183208
  br i1 %.not64, label %.lr.ph._crit_edge, label %27

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

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %25, %27
  %28 = phi ptr [ %.04869, %27 ], [ %.pre87, %25 ], [ %.pre87, %.lr.ph ]
  %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 %35

32:                                               ; preds = %.lr.ph._crit_edge
  %33 = getelementptr inbounds i8, ptr %28, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !24
  br label %35

35:                                               ; preds = %.lr.ph._crit_edge, %32
  %.150 = phi ptr [ %34, %32 ], [ %.04968, %.lr.ph._crit_edge ]
  %.048 = load ptr, ptr %.04869, align 8, !tbaa !20
  %.not57 = icmp eq ptr %.048, %23
  br i1 %.not57, label %._crit_edge, label %.lr.ph, !llvm.loop !25

._crit_edge:                                      ; preds = %35
  %.not58 = icmp eq ptr %.150, null
  br i1 %.not58, label %.loopexit, label %36

36:                                               ; preds = %._crit_edge
  %37 = getelementptr inbounds i8, ptr %.150, i64 72
  br label %38

38:                                               ; preds = %._crit_edge71, %36
  %.1.in = phi ptr [ %37, %36 ], [ %.1, %._crit_edge71 ]
  %.1 = load ptr, ptr %.1.in, align 8, !tbaa !20
  %.not59 = icmp eq ptr %.1, %37
  br i1 %.not59, label %.loopexit, label %39

39:                                               ; preds = %38
  %40 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not60 = icmp eq i8 %40, 0
  %.pre77 = ptrtoint ptr %.1 to i64
  %.pre79 = add i64 %.pre77, -24
  %.pre81 = inttoptr i64 %.pre79 to ptr
  br i1 %.not60, label %._crit_edge71, label %41

41:                                               ; preds = %39
  %42 = load i64, ptr %.pre81, align 8, !tbaa !27
  %.not61 = icmp eq i64 %42, 1886611816
  br i1 %.not61, label %._crit_edge71, label %43

43:                                               ; preds = %41
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1742, ptr noundef nonnull @.str.2) #2
  br label %._crit_edge71

._crit_edge71:                                    ; preds = %39, %41, %43
  %44 = phi ptr [ %.1, %43 ], [ %.pre81, %41 ], [ %.pre81, %39 ]
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !29
  %47 = getelementptr inbounds i8, ptr %46, i64 46
  %48 = tail call zeroext i8 @HiiCompareLanguage(ptr noundef nonnull %47, ptr noundef %3)
  %.not62 = icmp eq i8 %48, 0
  br i1 %.not62, label %38, label %49, !llvm.loop !30

49:                                               ; preds = %._crit_edge71
  %50 = getelementptr inbounds i8, ptr %44, i64 8
  %51 = load ptr, ptr %50, align 8, !tbaa !29
  %52 = load i32, ptr %51, align 1
  %53 = tail call i64 @SetStringWorker(ptr noundef %22, ptr noundef nonnull %44, i16 noundef zeroext %2, ptr noundef %4, ptr noundef %5)
  %54 = icmp slt i64 %53, 0
  br i1 %54, label %.loopexit, label %55

55:                                               ; preds = %49
  %56 = and i32 %52, 16777215
  %57 = load ptr, ptr %50, align 8, !tbaa !29
  %58 = load i32, ptr %57, align 1
  %59 = and i32 %58, 16777215
  %60 = sub nsw i32 %59, %56
  %61 = getelementptr inbounds i8, ptr %.150, i64 16
  %62 = load i32, ptr %61, align 8, !tbaa !31
  %63 = add i32 %60, %62
  store i32 %63, ptr %61, align 8, !tbaa !31
  br label %.loopexit

.loopexit:                                        ; preds = %38, %._crit_edge72, %._crit_edge, %49, %15, %6, %55
  %.0 = phi i64 [ 0, %55 ], [ -9223372036854775806, %6 ], [ -9223372036854775794, %15 ], [ %53, %49 ], [ -9223372036854775794, %._crit_edge ], [ -9223372036854775794, %._crit_edge72 ], [ -9223372036854775794, %38 ]
  ret i64 %.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, !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 = !{!22, !11, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !7, i64 0}
!28 = !{!"_HII_STRING_PACKAGE_INSTANCE", !7, i64 0, !11, i64 8, !11, i64 16, !10, i64 24, !10, i64 40, !8, i64 56, !19, i64 58}
!29 = !{!28, !11, i64 8}
!30 = distinct !{!30, !26}
!31 = !{!32, !18, i64 16}
!32 = !{!"_HII_DATABASE_PACKAGE_LIST_INSTANCE", !33, 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}
!33 = !{!"", !17, i64 0, !18, i64 16}


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