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

; 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.GUID = type { i32, i16, i16, [8 x i8] }
%struct._HII_DATABASE_PRIVATE_DATA = type { i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._EFI_HII_FONT_PROTOCOL, %struct._EFI_HII_IMAGE_PROTOCOL, %struct._EFI_HII_STRING_PROTOCOL, %struct._EFI_HII_DATABASE_PROTOCOL, %struct._EFI_HII_CONFIG_ROUTING_PROTOCOL, %struct._LIST_ENTRY, i64, %struct._LIST_ENTRY, i64, %struct.GUID, ptr }
%struct._EFI_HII_FONT_PROTOCOL = type { ptr, ptr, ptr, ptr }
%struct._EFI_HII_IMAGE_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr }
%struct._EFI_HII_STRING_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr }
%struct._EFI_HII_DATABASE_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_HII_CONFIG_ROUTING_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct._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.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct._EFI_HII_CONFIG_ACCESS_PROTOCOL = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [155 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i32], align 4
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@gEfiDevicePathProtocolGuid = external global %struct.GUID, align 4
@.str.37 = external hidden unnamed_addr constant [31 x i8], align 1
@gEfiHiiConfigAccessProtocolGuid = external global %struct.GUID, align 4
@.str.38 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @CalculateConfigStringLen(ptr noundef) #0

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

declare i64 @StrLen(ptr noundef) #2

declare ptr @StrStr(ptr noundef, ptr noundef) #2

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

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

declare void @FreePool(ptr noundef) #2

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

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

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

declare i64 @GetDevicePathSize(ptr noundef) #2

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

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

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #2

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

28:                                               ; preds = %3
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %28, %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %288

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

35:                                               ; preds = %32
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr null, ptr %36, align 8, !tbaa !5
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %288

37:                                               ; preds = %32
  %38 = call zeroext i8 @DebugAssertEnabled()
  %39 = zext i8 %38 to i32
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %51

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

49:                                               ; preds = %41
  call void @DebugAssert(ptr noundef @.str, i64 noundef 4219, ptr noundef @.str.36)
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  br label %56

51:                                               ; preds = %41, %37
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = ptrtoint ptr %52 to i64
  %54 = sub i64 %53, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_PRIVATE_DATA, ptr null, i32 0, i32 7) to i64)
  %55 = inttoptr i64 %54 to ptr
  br label %56

56:                                               ; preds = %51, %49
  %57 = phi ptr [ %50, %49 ], [ %55, %51 ]
  store ptr %57, ptr %8, align 8, !tbaa !5
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %58, ptr %9, align 8, !tbaa !5
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %59, ptr %60, align 8, !tbaa !5
  store ptr null, ptr %16, align 8, !tbaa !5
  store ptr null, ptr %21, align 8, !tbaa !5
  store ptr null, ptr %22, align 8, !tbaa !5
  store i8 0, ptr %23, align 1, !tbaa !21
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = call i64 @StrLen(ptr noundef @.str.2)
  %63 = call i64 @StrnCmp(ptr noundef %61, ptr noundef @.str.2, i64 noundef %62)
  %64 = icmp ne i64 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %56
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %288

66:                                               ; preds = %56
  br label %67

67:                                               ; preds = %284, %66
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = load i16, ptr %68, align 2, !tbaa !22
  %70 = zext i16 %69 to i32
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %77

72:                                               ; preds = %67
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = call i64 @StrLen(ptr noundef @.str.2)
  %75 = call i64 @StrnCmp(ptr noundef %73, ptr noundef @.str.2, i64 noundef %74)
  %76 = icmp eq i64 %75, 0
  br label %77

77:                                               ; preds = %72, %67
  %78 = phi i1 [ false, %67 ], [ %76, %72 ]
  br i1 %78, label %79, label %287

79:                                               ; preds = %77
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = icmp eq ptr %80, %81
  br i1 %82, label %83, label %86

83:                                               ; preds = %79
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %84, ptr %85, align 8, !tbaa !5
  br label %90

86:                                               ; preds = %79
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds i16, ptr %87, i64 -1
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %88, ptr %89, align 8, !tbaa !5
  br label %90

90:                                               ; preds = %86, %83
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = call i64 @CalculateConfigStringLen(ptr noundef %91)
  store i64 %92, ptr %11, align 8, !tbaa !23
  %93 = load i64, ptr %11, align 8, !tbaa !23
  %94 = add i64 %93, 1
  %95 = mul i64 %94, 2
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = call ptr @AllocateCopyPool(i64 noundef %95, ptr noundef %96)
  store ptr %97, ptr %10, align 8, !tbaa !5
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = icmp eq ptr %98, null
  br i1 %99, label %100, label %101

100:                                              ; preds = %90
  store i64 -9223372036854775799, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %288

101:                                              ; preds = %90
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = load i64, ptr %11, align 8, !tbaa !23
  %104 = getelementptr inbounds i16, ptr %102, i64 %103
  store i16 0, ptr %104, align 2, !tbaa !22
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = call i64 @GetDevicePath(ptr noundef %105, ptr noundef %13)
  store i64 %106, ptr %12, align 8, !tbaa !23
  %107 = load i64, ptr %12, align 8, !tbaa !23
  %108 = icmp slt i64 %107, 0
  br i1 %108, label %109, label %112

109:                                              ; preds = %101
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  call void @FreePool(ptr noundef %110)
  %111 = load i64, ptr %12, align 8, !tbaa !23
  store i64 %111, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %288

112:                                              ; preds = %101
  store ptr null, ptr %19, align 8, !tbaa !5
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %113, i32 0, i32 1
  %115 = getelementptr inbounds %struct._LIST_ENTRY, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !24
  store ptr %116, ptr %15, align 8, !tbaa !5
  br label %117

117:                                              ; preds = %171, %112
  %118 = load ptr, ptr %15, align 8, !tbaa !5
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._HII_DATABASE_PRIVATE_DATA, ptr %119, i32 0, i32 1
  %121 = icmp ne ptr %118, %120
  br i1 %121, label %122, label %175

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

126:                                              ; preds = %122
  %127 = load ptr, ptr %15, align 8, !tbaa !5
  %128 = ptrtoint ptr %127 to i64
  %129 = sub i64 %128, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_RECORD, ptr null, i32 0, i32 4) to i64)
  %130 = inttoptr i64 %129 to ptr
  %131 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %130, i32 0, i32 0
  %132 = load i64, ptr %131, align 8, !tbaa !25
  %133 = icmp ne i64 %132, 1919183208
  br i1 %133, label %134, label %136

134:                                              ; preds = %126
  call void @DebugAssert(ptr noundef @.str, i64 noundef 4276, ptr noundef @.str.36)
  %135 = load ptr, ptr %15, align 8, !tbaa !5
  br label %141

136:                                              ; preds = %126, %122
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  %138 = ptrtoint ptr %137 to i64
  %139 = sub i64 %138, ptrtoint (ptr getelementptr inbounds (%struct._HII_DATABASE_RECORD, ptr null, i32 0, i32 4) to i64)
  %140 = inttoptr i64 %139 to ptr
  br label %141

141:                                              ; preds = %136, %134
  %142 = phi ptr [ %135, %134 ], [ %140, %136 ]
  store ptr %142, ptr %16, align 8, !tbaa !5
  %143 = load ptr, ptr %16, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %143, i32 0, i32 1
  %145 = load ptr, ptr %144, align 8, !tbaa !27
  %146 = getelementptr inbounds %struct._HII_DATABASE_PACKAGE_LIST_INSTANCE, ptr %145, i32 0, i32 8
  %147 = load ptr, ptr %146, align 8, !tbaa !28
  store ptr %147, ptr %17, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %170

149:                                              ; preds = %141
  %150 = load ptr, ptr %17, align 8, !tbaa !5
  %151 = getelementptr inbounds i8, ptr %150, i64 4
  store ptr %151, ptr %18, align 8, !tbaa !5
  %152 = load ptr, ptr %18, align 8, !tbaa !5
  %153 = call i64 @GetDevicePathSize(ptr noundef %152)
  store i64 %153, ptr %24, align 8, !tbaa !23
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  %156 = load i64, ptr %24, align 8, !tbaa !23
  %157 = call i64 @CompareMem(ptr noundef %154, ptr noundef %155, i64 noundef %156)
  %158 = icmp eq i64 %157, 0
  br i1 %158, label %159, label %169

159:                                              ; preds = %149
  %160 = load ptr, ptr %16, align 8, !tbaa !5
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  %162 = call zeroext i8 @IsThisPackageList(ptr noundef %160, ptr noundef %161)
  %163 = zext i8 %162 to i32
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %169

165:                                              ; preds = %159
  %166 = load ptr, ptr %16, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct._HII_DATABASE_RECORD, ptr %166, i32 0, i32 2
  %168 = load ptr, ptr %167, align 8, !tbaa !31
  store ptr %168, ptr %19, align 8, !tbaa !5
  br label %175

169:                                              ; preds = %159, %149
  br label %170

170:                                              ; preds = %169, %141
  br label %171

171:                                              ; preds = %170
  %172 = load ptr, ptr %15, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct._LIST_ENTRY, ptr %172, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !32
  store ptr %174, ptr %15, align 8, !tbaa !5
  br label %117, !llvm.loop !33

175:                                              ; preds = %165, %117
  %176 = load ptr, ptr %19, align 8, !tbaa !5
  %177 = icmp eq ptr %176, null
  br i1 %177, label %178, label %195

178:                                              ; preds = %175
  %179 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %179, ptr %14, align 8, !tbaa !5
  %180 = load ptr, ptr @gBS, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %180, i32 0, i32 21
  %182 = load ptr, ptr %181, align 8, !tbaa !35
  %183 = call i64 %182(ptr noundef @gEfiDevicePathProtocolGuid, ptr noundef %14, ptr noundef %19)
  store i64 %183, ptr %12, align 8, !tbaa !23
  %184 = load i64, ptr %12, align 8, !tbaa !23
  %185 = icmp slt i64 %184, 0
  br i1 %185, label %189, label %186

186:                                              ; preds = %178
  %187 = load ptr, ptr %19, align 8, !tbaa !5
  %188 = icmp eq ptr %187, null
  br i1 %188, label %189, label %194

189:                                              ; preds = %186, %178
  %190 = load ptr, ptr %13, align 8, !tbaa !5
  call void @FreePool(ptr noundef %190)
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %191, ptr %192, align 8, !tbaa !5
  %193 = load ptr, ptr %10, align 8, !tbaa !5
  call void @FreePool(ptr noundef %193)
  store i64 -9223372036854775794, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %288

194:                                              ; preds = %186
  br label %195

195:                                              ; preds = %194, %175
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  call void @FreePool(ptr noundef %196)
  %197 = load ptr, ptr %16, align 8, !tbaa !5
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  %199 = call i64 @GetVarStoreType(ptr noundef %197, ptr noundef %198, ptr noundef %23, ptr noundef %22)
  store i64 %199, ptr %12, align 8, !tbaa !23
  %200 = load i64, ptr %12, align 8, !tbaa !23
  %201 = icmp slt i64 %200, 0
  br i1 %201, label %202, label %204

202:                                              ; preds = %195
  %203 = load i64, ptr %12, align 8, !tbaa !23
  store i64 %203, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %288

204:                                              ; preds = %195
  %205 = load i8, ptr %23, align 1, !tbaa !21
  %206 = icmp ne i8 %205, 0
  br i1 %206, label %207, label %213

207:                                              ; preds = %204
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = load ptr, ptr %22, align 8, !tbaa !5
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = call i64 @RouteConfigRespForEfiVarStore(ptr noundef %208, ptr noundef %209, ptr noundef %210, ptr noundef %21)
  store i64 %211, ptr %12, align 8, !tbaa !23
  %212 = load ptr, ptr %22, align 8, !tbaa !5
  call void @FreePool(ptr noundef %212)
  br label %251

213:                                              ; preds = %204
  %214 = load ptr, ptr @gBS, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %214, i32 0, i32 17
  %216 = load ptr, ptr %215, align 8, !tbaa !38
  %217 = load ptr, ptr %19, align 8, !tbaa !5
  %218 = call i64 %216(ptr noundef %217, ptr noundef @gEfiHiiConfigAccessProtocolGuid, ptr noundef %20)
  store i64 %218, ptr %12, align 8, !tbaa !23
  br label %219

219:                                              ; preds = %213
  %220 = call zeroext i8 @DebugAssertEnabled()
  %221 = icmp ne i8 %220, 0
  br i1 %221, label %222, label %242

222:                                              ; preds = %219
  %223 = load i64, ptr %12, align 8, !tbaa !23
  %224 = icmp slt i64 %223, 0
  br i1 %224, label %225, label %241

225:                                              ; preds = %222
  br label %226

226:                                              ; preds = %225
  %227 = call zeroext i8 @DebugPrintEnabled()
  %228 = icmp ne i8 %227, 0
  br i1 %228, label %229, label %238

229:                                              ; preds = %226
  br label %230

230:                                              ; preds = %229
  %231 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %232 = icmp ne i8 %231, 0
  br i1 %232, label %233, label %235

233:                                              ; preds = %230
  %234 = load i64, ptr %12, align 8, !tbaa !23
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.38, i64 noundef %234)
  br label %235

235:                                              ; preds = %233, %230
  br label %236

236:                                              ; preds = %235
  br label %237

237:                                              ; preds = %236
  br label %238

238:                                              ; preds = %237, %226
  br label %239

239:                                              ; preds = %238
  br label %240

240:                                              ; preds = %239
  call void @DebugAssert(ptr noundef @.str, i64 noundef 4335, ptr noundef @.str.39)
  br label %241

241:                                              ; preds = %240, %222
  br label %242

242:                                              ; preds = %241, %219
  br label %243

243:                                              ; preds = %242
  br label %244

244:                                              ; preds = %243
  %245 = load ptr, ptr %20, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct._EFI_HII_CONFIG_ACCESS_PROTOCOL, ptr %245, i32 0, i32 1
  %247 = load ptr, ptr %246, align 8, !tbaa !39
  %248 = load ptr, ptr %20, align 8, !tbaa !5
  %249 = load ptr, ptr %10, align 8, !tbaa !5
  %250 = call i64 %247(ptr noundef %248, ptr noundef %249, ptr noundef %21)
  store i64 %250, ptr %12, align 8, !tbaa !23
  br label %251

251:                                              ; preds = %244, %207
  %252 = load i64, ptr %12, align 8, !tbaa !23
  %253 = icmp slt i64 %252, 0
  br i1 %253, label %254, label %272

254:                                              ; preds = %251
  br label %255

255:                                              ; preds = %254
  %256 = call zeroext i8 @DebugAssertEnabled()
  %257 = icmp ne i8 %256, 0
  br i1 %257, label %258, label %263

258:                                              ; preds = %255
  %259 = load ptr, ptr %21, align 8, !tbaa !5
  %260 = icmp ne ptr %259, null
  br i1 %260, label %262, label %261

261:                                              ; preds = %258
  call void @DebugAssert(ptr noundef @.str, i64 noundef 4344, ptr noundef @.str.37)
  br label %262

262:                                              ; preds = %261, %258
  br label %263

263:                                              ; preds = %262, %255
  br label %264

264:                                              ; preds = %263
  br label %265

265:                                              ; preds = %264
  %266 = load ptr, ptr %9, align 8, !tbaa !5
  %267 = load ptr, ptr %21, align 8, !tbaa !5
  %268 = call ptr @StrStr(ptr noundef %266, ptr noundef %267)
  %269 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %268, ptr %269, align 8, !tbaa !5
  %270 = load ptr, ptr %10, align 8, !tbaa !5
  call void @FreePool(ptr noundef %270)
  %271 = load i64, ptr %12, align 8, !tbaa !23
  store i64 %271, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %288

272:                                              ; preds = %251
  %273 = load ptr, ptr %10, align 8, !tbaa !5
  call void @FreePool(ptr noundef %273)
  store ptr null, ptr %10, align 8, !tbaa !5
  %274 = load i64, ptr %11, align 8, !tbaa !23
  %275 = load ptr, ptr %9, align 8, !tbaa !5
  %276 = getelementptr inbounds i16, ptr %275, i64 %274
  store ptr %276, ptr %9, align 8, !tbaa !5
  %277 = load ptr, ptr %9, align 8, !tbaa !5
  %278 = load i16, ptr %277, align 2, !tbaa !22
  %279 = zext i16 %278 to i32
  %280 = icmp eq i32 %279, 0
  br i1 %280, label %281, label %284

281:                                              ; preds = %272
  %282 = load ptr, ptr %9, align 8, !tbaa !5
  %283 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %282, ptr %283, align 8, !tbaa !5
  br label %287

284:                                              ; preds = %272
  %285 = load ptr, ptr %9, align 8, !tbaa !5
  %286 = getelementptr inbounds i16, ptr %285, i32 1
  store ptr %286, ptr %9, align 8, !tbaa !5
  br label %67, !llvm.loop !41

287:                                              ; preds = %281, %77
  store i64 0, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %288

288:                                              ; preds = %287, %265, %202, %189, %109, %100, %65, %35, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  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
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %289 = load i64, ptr %4, align 8
  ret i64 %289
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_HII_DATABASE_PRIVATE_DATA", !11, i64 0, !12, i64 8, !12, i64 24, !13, i64 40, !14, i64 72, !15, i64 112, !16, i64 152, !17, i64 240, !12, i64 288, !11, i64 304, !12, i64 312, !11, i64 328, !18, i64 336, !6, i64 352}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_HII_FONT_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!"_EFI_HII_IMAGE_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!15 = !{!"_EFI_HII_STRING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!16 = !{!"_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}
!17 = !{!"_EFI_HII_CONFIG_ROUTING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, 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 = !{!7, !7, i64 0}
!22 = !{!20, !20, i64 0}
!23 = !{!11, !11, i64 0}
!24 = !{!10, !6, i64 8}
!25 = !{!26, !11, i64 0}
!26 = !{!"_HII_DATABASE_RECORD", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32}
!27 = !{!26, !6, i64 8}
!28 = !{!29, !6, i64 128}
!29 = !{!"_HII_DATABASE_PACKAGE_LIST_INSTANCE", !30, i64 0, !12, i64 24, !12, i64 40, !12, i64 56, !12, i64 72, !12, i64 88, !6, i64 104, !12, i64 112, !6, i64 128}
!30 = !{!"", !18, i64 0, !19, i64 16}
!31 = !{!26, !6, i64 16}
!32 = !{!12, !6, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!36, !6, i64 184}
!36 = !{!"", !37, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!37 = !{!"", !11, i64 0, !19, i64 8, !19, i64 12, !19, i64 16, !19, i64 20}
!38 = !{!36, !6, i64 152}
!39 = !{!40, !6, i64 8}
!40 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!41 = distinct !{!41, !34}


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

%struct.GUID = type { i32, i16, i16, [8 x i8] }

@.str = external hidden unnamed_addr constant [155 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i32], align 4
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiDevicePathProtocolGuid = external global %struct.GUID, align 4
@.str.37 = external hidden unnamed_addr constant [31 x i8], align 1
@gEfiHiiConfigAccessProtocolGuid = external global %struct.GUID, align 4
@.str.38 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [20 x i8], align 1

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

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

declare i64 @StrnCmp(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i64 @StrLen(ptr noundef) local_unnamed_addr #2

declare ptr @StrStr(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare void @FreePool(ptr noundef) local_unnamed_addr #2

declare ptr @AllocateCopyPool(i64 noundef, ptr noundef) local_unnamed_addr #2

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

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

declare i64 @GetDevicePathSize(ptr noundef) local_unnamed_addr #2

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

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @HiiConfigRoutingRouteConfig(ptr noundef %0, ptr noundef %1, ptr noundef writeonly %2) local_unnamed_addr #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #3
  %11 = icmp eq ptr %0, null
  %12 = icmp eq ptr %2, null
  %or.cond = or i1 %11, %12
  br i1 %or.cond, label %.critedge, label %13

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

15:                                               ; preds = %13
  store ptr null, ptr %2, align 8, !tbaa !5
  br label %.critedge

16:                                               ; preds = %13
  %17 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %17, 0
  %.pre144 = ptrtoint ptr %0 to i64
  %.pre145 = add i64 %.pre144, -240
  %.pre147 = inttoptr i64 %.pre145 to ptr
  br i1 %.not, label %._crit_edge, label %18

18:                                               ; preds = %16
  %19 = load i64, ptr %.pre147, align 8, !tbaa !9
  %.not88 = icmp eq i64 %19, 1883531592
  br i1 %.not88, label %._crit_edge, label %20

20:                                               ; preds = %18
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 4219, ptr noundef nonnull @.str.36) #3
  br label %._crit_edge

._crit_edge:                                      ; preds = %16, %18, %20
  %21 = phi ptr [ %0, %20 ], [ %.pre147, %18 ], [ %.pre147, %16 ]
  store ptr %1, ptr %2, align 8, !tbaa !5
  store ptr null, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %9, align 8, !tbaa !5
  store i8 0, ptr %10, align 1, !tbaa !21
  %22 = tail call i64 @StrLen(ptr noundef nonnull @.str.2) #3
  %23 = tail call i64 @StrnCmp(ptr noundef nonnull %1, ptr noundef nonnull @.str.2, i64 noundef %22) #3
  %.not89 = icmp eq i64 %23, 0
  br i1 %.not89, label %.preheader, label %.critedge

.preheader:                                       ; preds = %._crit_edge
  %24 = load i16, ptr %1, align 2, !tbaa !22
  %.not90117 = icmp eq i16 %24, 0
  br i1 %.not90117, label %.critedge, label %.lr.ph120

.lr.ph120:                                        ; preds = %.preheader
  %25 = getelementptr inbounds i8, ptr %21, i64 8
  br label %26

26:                                               ; preds = %.lr.ph120, %122
  %.076119 = phi ptr [ %1, %.lr.ph120 ], [ %123, %122 ]
  %.077118 = phi ptr [ null, %.lr.ph120 ], [ %.2156, %122 ]
  %27 = call i64 @StrLen(ptr noundef nonnull @.str.2) #3
  %28 = call i64 @StrnCmp(ptr noundef nonnull %.076119, ptr noundef nonnull @.str.2, i64 noundef %27) #3
  %29 = icmp eq i64 %28, 0
  br i1 %29, label %30, label %.critedge

30:                                               ; preds = %26
  %31 = icmp eq ptr %.076119, %1
  %storemerge.idx = select i1 %31, i64 0, i64 -2
  %storemerge = getelementptr inbounds i8, ptr %.076119, i64 %storemerge.idx
  store ptr %storemerge, ptr %2, align 8, !tbaa !5
  %32 = call i64 @CalculateConfigStringLen(ptr noundef nonnull %.076119)
  %33 = shl i64 %32, 1
  %34 = add i64 %33, 2
  %35 = call ptr @AllocateCopyPool(i64 noundef %34, ptr noundef nonnull %.076119) #3
  %36 = icmp eq ptr %35, null
  br i1 %36, label %.critedge, label %37

37:                                               ; preds = %30
  %38 = getelementptr inbounds i16, ptr %35, i64 %32
  store i16 0, ptr %38, align 2, !tbaa !22
  %39 = call i64 @GetDevicePath(ptr noundef nonnull %35, ptr noundef nonnull %4)
  %40 = icmp slt i64 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  call void @FreePool(ptr noundef nonnull %35) #3
  br label %.critedge

42:                                               ; preds = %37
  store ptr null, ptr %6, align 8, !tbaa !5
  %.078114 = load ptr, ptr %25, align 8, !tbaa !23
  %.not91115 = icmp eq ptr %.078114, %25
  br i1 %.not91115, label %thread-pre-split.thread, label %.lr.ph

.lr.ph:                                           ; preds = %42, %63
  %.078116 = phi ptr [ %.078, %63 ], [ %.078114, %42 ]
  %43 = call zeroext i8 @DebugAssertEnabled() #3
  %.not92 = icmp eq i8 %43, 0
  %.pre149 = ptrtoint ptr %.078116 to i64
  %.pre151 = add i64 %.pre149, -32
  %.pre153 = inttoptr i64 %.pre151 to ptr
  br i1 %.not92, label %.lr.ph._crit_edge, label %44

44:                                               ; preds = %.lr.ph
  %45 = load i64, ptr %.pre153, align 8, !tbaa !24
  %.not93 = icmp eq i64 %45, 1919183208
  br i1 %.not93, label %.lr.ph._crit_edge, label %46

46:                                               ; preds = %44
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 4276, ptr noundef nonnull @.str.36) #3
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %44, %46
  %47 = phi ptr [ %.078116, %46 ], [ %.pre153, %44 ], [ %.pre153, %.lr.ph ]
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !26
  %50 = getelementptr inbounds i8, ptr %49, i64 128
  %51 = load ptr, ptr %50, align 8, !tbaa !27
  %.not94 = icmp eq ptr %51, null
  br i1 %.not94, label %63, label %52

52:                                               ; preds = %.lr.ph._crit_edge
  %53 = getelementptr inbounds i8, ptr %51, i64 4
  %54 = call i64 @GetDevicePathSize(ptr noundef nonnull %53) #3
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = call i64 @CompareMem(ptr noundef %55, ptr noundef nonnull %53, i64 noundef %54) #3
  %57 = icmp eq i64 %56, 0
  br i1 %57, label %58, label %63

58:                                               ; preds = %52
  %59 = call zeroext i8 @IsThisPackageList(ptr noundef nonnull %47, ptr noundef nonnull %35)
  %.not95 = icmp eq i8 %59, 0
  br i1 %.not95, label %63, label %60

60:                                               ; preds = %58
  %61 = getelementptr inbounds i8, ptr %47, i64 16
  %62 = load ptr, ptr %61, align 8, !tbaa !30
  store ptr %62, ptr %6, align 8, !tbaa !5
  br label %thread-pre-split

63:                                               ; preds = %.lr.ph._crit_edge, %58, %52
  %.078 = load ptr, ptr %.078116, align 8, !tbaa !23
  %.not91 = icmp eq ptr %.078, %25
  br i1 %.not91, label %thread-pre-split.loopexit, label %.lr.ph, !llvm.loop !31

thread-pre-split.loopexit:                        ; preds = %63
  %.pr.pre = load ptr, ptr %6, align 8, !tbaa !5
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %thread-pre-split.loopexit, %60
  %64 = phi ptr [ %62, %60 ], [ %.pr.pre, %thread-pre-split.loopexit ]
  %65 = icmp eq ptr %64, null
  br i1 %65, label %thread-pre-split.thread, label %76

thread-pre-split.thread:                          ; preds = %42, %thread-pre-split
  %.2157 = phi ptr [ %47, %thread-pre-split ], [ %.077118, %42 ]
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %66, ptr %5, align 8, !tbaa !5
  %67 = load ptr, ptr @gBS, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 184
  %69 = load ptr, ptr %68, align 8, !tbaa !33
  %70 = call i64 %69(ptr noundef nonnull @gEfiDevicePathProtocolGuid, ptr noundef nonnull %5, ptr noundef nonnull %6) #3
  %71 = icmp slt i64 %70, 0
  %72 = load ptr, ptr %6, align 8
  %73 = icmp eq ptr %72, null
  %or.cond3 = select i1 %71, i1 true, i1 %73
  br i1 %or.cond3, label %74, label %76

74:                                               ; preds = %thread-pre-split.thread
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  call void @FreePool(ptr noundef %75) #3
  store ptr %.076119, ptr %2, align 8, !tbaa !5
  call void @FreePool(ptr noundef nonnull %35) #3
  br label %.critedge

76:                                               ; preds = %thread-pre-split.thread, %thread-pre-split
  %.2156 = phi ptr [ %.2157, %thread-pre-split.thread ], [ %47, %thread-pre-split ]
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  call void @FreePool(ptr noundef %77) #3
  %78 = call i64 @GetVarStoreType(ptr noundef %.2156, ptr noundef nonnull %35, ptr noundef nonnull %10, ptr noundef nonnull %9)
  %79 = icmp slt i64 %78, 0
  br i1 %79, label %.critedge, label %80

80:                                               ; preds = %76
  %81 = load i8, ptr %10, align 1, !tbaa !21
  %.not96 = icmp eq i8 %81, 0
  br i1 %.not96, label %86, label %82

82:                                               ; preds = %80
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = call i64 @RouteConfigRespForEfiVarStore(ptr noundef %0, ptr noundef %83, ptr noundef nonnull %35, ptr noundef nonnull %8)
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  call void @FreePool(ptr noundef %85) #3
  br label %106

86:                                               ; preds = %80
  %87 = load ptr, ptr @gBS, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 152
  %89 = load ptr, ptr %88, align 8, !tbaa !36
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = call i64 %89(ptr noundef %90, ptr noundef nonnull @gEfiHiiConfigAccessProtocolGuid, ptr noundef nonnull %7) #3
  %92 = call zeroext i8 @DebugAssertEnabled() #3
  %93 = icmp ne i8 %92, 0
  %94 = icmp slt i64 %91, 0
  %or.cond5 = select i1 %93, i1 %94, i1 false
  br i1 %or.cond5, label %95, label %101

95:                                               ; preds = %86
  %96 = call zeroext i8 @DebugPrintEnabled() #3
  %.not97 = icmp eq i8 %96, 0
  br i1 %.not97, label %100, label %97

97:                                               ; preds = %95
  %98 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not98 = icmp eq i8 %98, 0
  br i1 %.not98, label %100, label %99

99:                                               ; preds = %97
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.38, i64 noundef %91) #3
  br label %100

100:                                              ; preds = %97, %99, %95
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 4335, ptr noundef nonnull @.str.39) #3
  br label %101

101:                                              ; preds = %100, %86
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %102, i64 8
  %104 = load ptr, ptr %103, align 8, !tbaa !37
  %105 = call i64 %104(ptr noundef %102, ptr noundef nonnull %35, ptr noundef nonnull %8) #3
  br label %106

106:                                              ; preds = %101, %82
  %.079 = phi i64 [ %84, %82 ], [ %105, %101 ]
  %107 = icmp slt i64 %.079, 0
  br i1 %107, label %108, label %117

108:                                              ; preds = %106
  %109 = call zeroext i8 @DebugAssertEnabled() #3
  %110 = icmp eq i8 %109, 0
  %111 = load ptr, ptr %8, align 8
  %112 = icmp ne ptr %111, null
  %or.cond7 = select i1 %110, i1 true, i1 %112
  br i1 %or.cond7, label %114, label %113

113:                                              ; preds = %108
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 4344, ptr noundef nonnull @.str.37) #3
  %.pre = load ptr, ptr %8, align 8, !tbaa !5
  br label %114

114:                                              ; preds = %113, %108
  %115 = phi ptr [ %.pre, %113 ], [ %111, %108 ]
  %116 = call ptr @StrStr(ptr noundef nonnull %.076119, ptr noundef %115) #3
  store ptr %116, ptr %2, align 8, !tbaa !5
  call void @FreePool(ptr noundef nonnull %35) #3
  br label %.critedge

117:                                              ; preds = %106
  call void @FreePool(ptr noundef nonnull %35) #3
  %118 = getelementptr inbounds i16, ptr %.076119, i64 %32
  %119 = load i16, ptr %118, align 2, !tbaa !22
  %120 = icmp eq i16 %119, 0
  br i1 %120, label %121, label %122

121:                                              ; preds = %117
  store ptr %118, ptr %2, align 8, !tbaa !5
  br label %.critedge

122:                                              ; preds = %117
  %123 = getelementptr inbounds i8, ptr %118, i64 2
  %124 = load i16, ptr %123, align 2, !tbaa !22
  %.not90 = icmp eq i16 %124, 0
  br i1 %.not90, label %.critedge, label %26, !llvm.loop !39

.critedge:                                        ; preds = %30, %76, %122, %26, %.preheader, %121, %._crit_edge, %3, %114, %74, %41, %15
  %.0 = phi i64 [ -9223372036854775806, %15 ], [ %39, %41 ], [ -9223372036854775794, %74 ], [ %.079, %114 ], [ -9223372036854775806, %3 ], [ -9223372036854775806, %._crit_edge ], [ 0, %121 ], [ 0, %.preheader ], [ -9223372036854775799, %30 ], [ %78, %76 ], [ 0, %122 ], [ 0, %26 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i64 %.0
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_HII_DATABASE_PRIVATE_DATA", !11, i64 0, !12, i64 8, !12, i64 24, !13, i64 40, !14, i64 72, !15, i64 112, !16, i64 152, !17, i64 240, !12, i64 288, !11, i64 304, !12, i64 312, !11, i64 328, !18, i64 336, !6, i64 352}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_HII_FONT_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!"_EFI_HII_IMAGE_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!15 = !{!"_EFI_HII_STRING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!16 = !{!"_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}
!17 = !{!"_EFI_HII_CONFIG_ROUTING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, 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 = !{!7, !7, i64 0}
!22 = !{!20, !20, i64 0}
!23 = !{!12, !6, i64 0}
!24 = !{!25, !11, i64 0}
!25 = !{!"_HII_DATABASE_RECORD", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32}
!26 = !{!25, !6, i64 8}
!27 = !{!28, !6, i64 128}
!28 = !{!"_HII_DATABASE_PACKAGE_LIST_INSTANCE", !29, i64 0, !12, i64 24, !12, i64 40, !12, i64 56, !12, i64 72, !12, i64 88, !6, i64 104, !12, i64 112, !6, i64 128}
!29 = !{!"", !18, i64 0, !19, i64 16}
!30 = !{!25, !6, i64 16}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!34, !6, i64 184}
!34 = !{!"", !35, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!35 = !{!"", !11, i64 0, !19, i64 8, !19, i64 12, !19, i64 16, !19, i64 20}
!36 = !{!34, !6, i64 152}
!37 = !{!38, !6, i64 8}
!38 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = distinct !{!39, !32}


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