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

; 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._EFI_COMPONENT_NAME_PROTOCOL = type { ptr, ptr, ptr }
%struct._EFI_COMPONENT_NAME2_PROTOCOL = type { ptr, ptr, ptr }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.MNP_INSTANCE_DATA = type { i32, ptr, ptr, %struct._LIST_ENTRY, %struct._EFI_MANAGED_NETWORK_PROTOCOL, i8, i8, %struct._LIST_ENTRY, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, i8 }
%struct._EFI_MANAGED_NETWORK_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.MNP_SERVICE_DATA = type { i32, %struct._LIST_ENTRY, ptr, ptr, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, %struct._LIST_ENTRY, i64, i32, i16, i8 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@gMnpComponentName = external dso_local global %struct._EFI_COMPONENT_NAME_PROTOCOL, align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@gMnpComponentName2 = external dso_local global %struct._EFI_COMPONENT_NAME2_PROTOCOL, align 8
@gMnpControllerNameTable = external dso_local global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [155 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i32], align 4
@.str.7 = external hidden unnamed_addr constant [6 x i32], align 4
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [32 x i32], align 4
@.str.10 = external hidden unnamed_addr constant [18 x i32], align 4

; Function Attrs: nounwind uwtable
define dso_local i64 @UpdateName(ptr noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [80 x i16], align 16
  %7 = alloca %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, align 4
  %8 = alloca %struct.EFI_SIMPLE_NETWORK_MODE, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 160, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 20, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 656, 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
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %1
  store i64 -9223372036854775806, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %132

15:                                               ; preds = %1
  %16 = call zeroext i8 @DebugAssertEnabled()
  %17 = zext i8 %16 to i32
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %19, label %29

19:                                               ; preds = %15
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = ptrtoint ptr %20 to i64
  %22 = sub i64 %21, ptrtoint (ptr getelementptr inbounds (%struct.MNP_INSTANCE_DATA, ptr null, i32 0, i32 4) to i64)
  %23 = inttoptr i64 %22 to ptr
  %24 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !9
  %26 = icmp ne i32 %25, 1232105037
  br i1 %26, label %27, label %29

27:                                               ; preds = %19
  call void @DebugAssert(ptr noundef @.str.4, i64 noundef 132, ptr noundef @.str.5)
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  br label %34

29:                                               ; preds = %19, %15
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = ptrtoint ptr %30 to i64
  %32 = sub i64 %31, ptrtoint (ptr getelementptr inbounds (%struct.MNP_INSTANCE_DATA, ptr null, i32 0, i32 4) to i64)
  %33 = inttoptr i64 %32 to ptr
  br label %34

34:                                               ; preds = %29, %27
  %35 = phi ptr [ %28, %27 ], [ %33, %29 ]
  store ptr %35, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._EFI_MANAGED_NETWORK_PROTOCOL, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !18
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = call i64 %38(ptr noundef %39, ptr noundef %7, ptr noundef %8)
  store i64 %40, ptr %4, align 8, !tbaa !19
  %41 = load i64, ptr %4, align 8, !tbaa !19
  %42 = icmp slt i64 %41, 0
  br i1 %42, label %105, label %43

43:                                               ; preds = %34
  store i64 0, ptr %9, align 8, !tbaa !19
  %44 = getelementptr inbounds [80 x i16], ptr %6, i64 0, i64 0
  %45 = call i64 (ptr, i64, ptr, ...) @UnicodeSPrint(ptr noundef %44, i64 noundef 160, ptr noundef @.str.6)
  %46 = load i64, ptr %9, align 8, !tbaa !19
  %47 = add i64 %46, %45
  store i64 %47, ptr %9, align 8, !tbaa !19
  store i64 0, ptr %10, align 8, !tbaa !19
  br label %48

48:                                               ; preds = %70, %43
  %49 = load i64, ptr %10, align 8, !tbaa !19
  %50 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %8, i32 0, i32 1
  %51 = load i32, ptr %50, align 4, !tbaa !20
  %52 = zext i32 %51 to i64
  %53 = icmp ult i64 %49, %52
  br i1 %53, label %54, label %73

54:                                               ; preds = %48
  %55 = getelementptr inbounds [80 x i16], ptr %6, i64 0, i64 0
  %56 = load i64, ptr %9, align 8, !tbaa !19
  %57 = getelementptr inbounds i16, ptr %55, i64 %56
  %58 = load i64, ptr %9, align 8, !tbaa !19
  %59 = mul i64 %58, 2
  %60 = sub i64 160, %59
  %61 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %8, i32 0, i32 11
  %62 = getelementptr inbounds %struct.EFI_MAC_ADDRESS, ptr %61, i32 0, i32 0
  %63 = load i64, ptr %10, align 8, !tbaa !19
  %64 = getelementptr inbounds [32 x i8], ptr %62, i64 0, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !23
  %66 = zext i8 %65 to i32
  %67 = call i64 (ptr, i64, ptr, ...) @UnicodeSPrint(ptr noundef %57, i64 noundef %60, ptr noundef @.str.7, i32 noundef %66)
  %68 = load i64, ptr %9, align 8, !tbaa !19
  %69 = add i64 %68, %67
  store i64 %69, ptr %9, align 8, !tbaa !19
  br label %70

70:                                               ; preds = %54
  %71 = load i64, ptr %10, align 8, !tbaa !19
  %72 = add i64 %71, 1
  store i64 %72, ptr %10, align 8, !tbaa !19
  br label %48, !llvm.loop !24

73:                                               ; preds = %48
  br label %74

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

77:                                               ; preds = %74
  %78 = load i64, ptr %9, align 8, !tbaa !19
  %79 = icmp ugt i64 %78, 0
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  call void @DebugAssert(ptr noundef @.str.4, i64 noundef 156, ptr noundef @.str.8)
  br label %81

81:                                               ; preds = %80, %77
  br label %82

82:                                               ; preds = %81, %74
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  %85 = load i64, ptr %9, align 8, !tbaa !19
  %86 = add i64 %85, -1
  store i64 %86, ptr %9, align 8, !tbaa !19
  %87 = getelementptr inbounds [80 x i16], ptr %6, i64 0, i64 0
  %88 = load i64, ptr %9, align 8, !tbaa !19
  %89 = getelementptr inbounds i16, ptr %87, i64 %88
  %90 = load i64, ptr %9, align 8, !tbaa !19
  %91 = mul i64 %90, 2
  %92 = sub i64 160, %91
  %93 = getelementptr inbounds %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, ptr %7, i32 0, i32 2
  %94 = load i16, ptr %93, align 4, !tbaa !26
  %95 = zext i16 %94 to i32
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %96, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !27
  %99 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %98, i32 0, i32 9
  %100 = load i16, ptr %99, align 4, !tbaa !28
  %101 = zext i16 %100 to i32
  %102 = call i64 (ptr, i64, ptr, ...) @UnicodeSPrint(ptr noundef %89, i64 noundef %92, ptr noundef @.str.9, i32 noundef %95, i32 noundef %101)
  %103 = load i64, ptr %9, align 8, !tbaa !19
  %104 = add i64 %103, %102
  store i64 %104, ptr %9, align 8, !tbaa !19
  br label %114

105:                                              ; preds = %34
  %106 = load i64, ptr %4, align 8, !tbaa !19
  %107 = icmp eq i64 %106, -9223372036854775789
  br i1 %107, label %108, label %111

108:                                              ; preds = %105
  %109 = getelementptr inbounds [80 x i16], ptr %6, i64 0, i64 0
  %110 = call i64 (ptr, i64, ptr, ...) @UnicodeSPrint(ptr noundef %109, i64 noundef 160, ptr noundef @.str.10)
  br label %113

111:                                              ; preds = %105
  %112 = load i64, ptr %4, align 8, !tbaa !19
  store i64 %112, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %132

113:                                              ; preds = %108
  br label %114

114:                                              ; preds = %113, %84
  %115 = load ptr, ptr @gMnpControllerNameTable, align 8, !tbaa !5
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %120

117:                                              ; preds = %114
  %118 = load ptr, ptr @gMnpControllerNameTable, align 8, !tbaa !5
  %119 = call i64 @FreeUnicodeStringTable(ptr noundef %118)
  store ptr null, ptr @gMnpControllerNameTable, align 8, !tbaa !5
  br label %120

120:                                              ; preds = %117, %114
  %121 = load ptr, ptr getelementptr inbounds (%struct._EFI_COMPONENT_NAME_PROTOCOL, ptr @gMnpComponentName, i32 0, i32 2), align 8, !tbaa !31
  %122 = getelementptr inbounds [80 x i16], ptr %6, i64 0, i64 0
  %123 = call i64 @AddUnicodeString2(ptr noundef @.str, ptr noundef %121, ptr noundef @gMnpControllerNameTable, ptr noundef %122, i8 noundef zeroext 1)
  store i64 %123, ptr %4, align 8, !tbaa !19
  %124 = load i64, ptr %4, align 8, !tbaa !19
  %125 = icmp slt i64 %124, 0
  br i1 %125, label %126, label %128

126:                                              ; preds = %120
  %127 = load i64, ptr %4, align 8, !tbaa !19
  store i64 %127, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %132

128:                                              ; preds = %120
  %129 = load ptr, ptr getelementptr inbounds (%struct._EFI_COMPONENT_NAME2_PROTOCOL, ptr @gMnpComponentName2, i32 0, i32 2), align 8, !tbaa !33
  %130 = getelementptr inbounds [80 x i16], ptr %6, i64 0, i64 0
  %131 = call i64 @AddUnicodeString2(ptr noundef @.str.1, ptr noundef %129, ptr noundef @gMnpControllerNameTable, ptr noundef %130, i8 noundef zeroext 0)
  store i64 %131, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %132

132:                                              ; preds = %128, %126, %111, %14
  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 656, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 160, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %133 = load i64, ptr %2, align 8
  ret i64 %133
}

; 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 @UnicodeSPrint(ptr noundef, i64 noundef, ptr noundef, ...) #2

declare i64 @FreeUnicodeStringTable(ptr noundef) #2

declare i64 @AddUnicodeString2(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext) #2

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

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 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !7, i64 104, !7, i64 105, !12, i64 112, !14, i64 128, !12, i64 168, !12, i64 184, !15, i64 200, !16, i64 208, !7, i64 228}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_MANAGED_NETWORK_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}
!14 = !{!"", !12, i64 0, !12, i64 16, !15, i64 32}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"", !11, i64 0, !11, i64 4, !17, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!17 = !{!"short", !7, i64 0}
!18 = !{!13, !6, i64 0}
!19 = !{!15, !15, i64 0}
!20 = !{!21, !11, i64 4}
!21 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !7, i64 40, !22, i64 552, !22, i64 584, !22, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!22 = !{!"", !7, i64 0}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!16, !17, i64 8}
!27 = !{!10, !6, i64 8}
!28 = !{!29, !17, i64 92}
!29 = !{!"", !11, i64 0, !12, i64 8, !6, i64 24, !6, i64 32, !30, i64 40, !6, i64 56, !12, i64 64, !15, i64 80, !11, i64 88, !17, i64 92, !7, i64 94}
!30 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!31 = !{!32, !6, i64 16}
!32 = !{!"_EFI_COMPONENT_NAME_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!34, !6, i64 16}
!34 = !{!"_EFI_COMPONENT_NAME2_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}


; 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._EFI_COMPONENT_NAME_PROTOCOL = type { ptr, ptr, ptr }
%struct._EFI_COMPONENT_NAME2_PROTOCOL = type { ptr, ptr, ptr }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@gMnpComponentName = external dso_local local_unnamed_addr global %struct._EFI_COMPONENT_NAME_PROTOCOL, align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@gMnpComponentName2 = external dso_local local_unnamed_addr global %struct._EFI_COMPONENT_NAME2_PROTOCOL, align 8
@gMnpControllerNameTable = external dso_local global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [155 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i32], align 4
@.str.7 = external hidden unnamed_addr constant [6 x i32], align 4
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [32 x i32], align 4
@.str.10 = external hidden unnamed_addr constant [18 x i32], align 4

; Function Attrs: nounwind uwtable
define dso_local i64 @UpdateName(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [80 x i16], align 16
  %3 = alloca %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, align 4
  %4 = alloca %struct.EFI_SIMPLE_NETWORK_MODE, align 4
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 656, ptr nonnull %4) #3
  %5 = icmp eq ptr %0, null
  br i1 %5, label %66, label %6

6:                                                ; preds = %1
  %7 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %7, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre37 = add i64 %.pre, -40
  %.pre39 = inttoptr i64 %.pre37 to ptr
  br i1 %.not, label %._crit_edge36, label %8

8:                                                ; preds = %6
  %9 = load i32, ptr %.pre39, align 8, !tbaa !5
  %.not31 = icmp eq i32 %9, 1232105037
  br i1 %.not31, label %._crit_edge36, label %10

10:                                               ; preds = %8
  tail call void @DebugAssert(ptr noundef nonnull @.str.4, i64 noundef 132, ptr noundef nonnull @.str.5) #3
  br label %._crit_edge36

._crit_edge36:                                    ; preds = %6, %8, %10
  %11 = phi ptr [ %0, %10 ], [ %.pre39, %8 ], [ %.pre39, %6 ]
  %12 = load ptr, ptr %0, align 8, !tbaa !17
  %13 = call i64 %12(ptr noundef nonnull %0, ptr noundef nonnull %3, ptr noundef nonnull %4) #3
  %14 = icmp slt i64 %13, 0
  br i1 %14, label %51, label %15

15:                                               ; preds = %._crit_edge36
  %16 = call i64 (ptr, i64, ptr, ...) @UnicodeSPrint(ptr noundef nonnull %2, i64 noundef 160, ptr noundef nonnull @.str.6) #3
  %17 = getelementptr inbounds i8, ptr %4, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !18
  %.not35 = icmp eq i32 %18, 0
  br i1 %.not35, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %15
  %19 = getelementptr inbounds i8, ptr %4, i64 552
  br label %20

20:                                               ; preds = %.lr.ph, %20
  %.034 = phi i64 [ 0, %.lr.ph ], [ %29, %20 ]
  %.02533 = phi i64 [ %16, %.lr.ph ], [ %28, %20 ]
  %21 = getelementptr inbounds i16, ptr %2, i64 %.02533
  %22 = shl i64 %.02533, 1
  %23 = sub i64 160, %22
  %24 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 %.034
  %25 = load i8, ptr %24, align 1, !tbaa !21
  %26 = zext i8 %25 to i32
  %27 = call i64 (ptr, i64, ptr, ...) @UnicodeSPrint(ptr noundef nonnull %21, i64 noundef %23, ptr noundef nonnull @.str.7, i32 noundef %26) #3
  %28 = add i64 %27, %.02533
  %29 = add nuw nsw i64 %.034, 1
  %30 = load i32, ptr %17, align 4, !tbaa !18
  %31 = zext i32 %30 to i64
  %32 = icmp ult i64 %29, %31
  br i1 %32, label %20, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %20, %15
  %.025.lcssa = phi i64 [ %16, %15 ], [ %28, %20 ]
  %33 = call zeroext i8 @DebugAssertEnabled() #3
  %34 = icmp eq i8 %33, 0
  %35 = icmp ne i64 %.025.lcssa, 0
  %or.cond = select i1 %34, i1 true, i1 %35
  br i1 %or.cond, label %37, label %36

36:                                               ; preds = %._crit_edge
  call void @DebugAssert(ptr noundef nonnull @.str.4, i64 noundef 156, ptr noundef nonnull @.str.8) #3
  br label %37

37:                                               ; preds = %36, %._crit_edge
  %38 = add i64 %.025.lcssa, -1
  %39 = getelementptr inbounds i16, ptr %2, i64 %38
  %40 = shl i64 %38, 1
  %41 = sub i64 160, %40
  %42 = getelementptr inbounds i8, ptr %3, i64 8
  %43 = load i16, ptr %42, align 4, !tbaa !24
  %44 = zext i16 %43 to i32
  %45 = getelementptr inbounds i8, ptr %11, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !25
  %47 = getelementptr inbounds i8, ptr %46, i64 92
  %48 = load i16, ptr %47, align 4, !tbaa !26
  %49 = zext i16 %48 to i32
  %50 = call i64 (ptr, i64, ptr, ...) @UnicodeSPrint(ptr noundef nonnull %39, i64 noundef %41, ptr noundef nonnull @.str.9, i32 noundef %44, i32 noundef %49) #3
  br label %55

51:                                               ; preds = %._crit_edge36
  %52 = icmp eq i64 %13, -9223372036854775789
  br i1 %52, label %53, label %66

53:                                               ; preds = %51
  %54 = call i64 (ptr, i64, ptr, ...) @UnicodeSPrint(ptr noundef nonnull %2, i64 noundef 160, ptr noundef nonnull @.str.10) #3
  br label %55

55:                                               ; preds = %53, %37
  %56 = load ptr, ptr @gMnpControllerNameTable, align 8, !tbaa !29
  %.not32 = icmp eq ptr %56, null
  br i1 %.not32, label %59, label %57

57:                                               ; preds = %55
  %58 = call i64 @FreeUnicodeStringTable(ptr noundef nonnull %56) #3
  store ptr null, ptr @gMnpControllerNameTable, align 8, !tbaa !29
  br label %59

59:                                               ; preds = %57, %55
  %60 = load ptr, ptr getelementptr inbounds (i8, ptr @gMnpComponentName, i64 16), align 8, !tbaa !30
  %61 = call i64 @AddUnicodeString2(ptr noundef nonnull @.str, ptr noundef %60, ptr noundef nonnull @gMnpControllerNameTable, ptr noundef nonnull %2, i8 noundef zeroext 1) #3
  %62 = icmp slt i64 %61, 0
  br i1 %62, label %66, label %63

63:                                               ; preds = %59
  %64 = load ptr, ptr getelementptr inbounds (i8, ptr @gMnpComponentName2, i64 16), align 8, !tbaa !32
  %65 = call i64 @AddUnicodeString2(ptr noundef nonnull @.str.1, ptr noundef %64, ptr noundef nonnull @gMnpControllerNameTable, ptr noundef nonnull %2, i8 noundef zeroext 0) #3
  br label %66

66:                                               ; preds = %59, %51, %1, %63
  %.026 = phi i64 [ %65, %63 ], [ -9223372036854775806, %1 ], [ %13, %51 ], [ %61, %59 ]
  call void @llvm.lifetime.end.p0(i64 656, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %2) #3
  ret i64 %.026
}

; 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 @UnicodeSPrint(ptr noundef, i64 noundef, ptr noundef, ...) local_unnamed_addr #2

declare i64 @FreeUnicodeStringTable(ptr noundef) local_unnamed_addr #2

declare i64 @AddUnicodeString2(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext) 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

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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 40, !8, i64 104, !8, i64 105, !11, i64 112, !13, i64 128, !11, i64 168, !11, i64 184, !14, i64 200, !15, i64 208, !8, i64 228}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!12 = !{!"_EFI_MANAGED_NETWORK_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!13 = !{!"", !11, i64 0, !11, i64 16, !14, i64 32}
!14 = !{!"long long", !8, i64 0}
!15 = !{!"", !7, i64 0, !7, i64 4, !16, i64 8, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16}
!16 = !{!"short", !8, i64 0}
!17 = !{!12, !10, i64 0}
!18 = !{!19, !7, i64 4}
!19 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !20, i64 552, !20, i64 584, !20, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!20 = !{!"", !8, i64 0}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!15, !16, i64 8}
!25 = !{!6, !10, i64 8}
!26 = !{!27, !16, i64 92}
!27 = !{!"", !7, i64 0, !11, i64 8, !10, i64 24, !10, i64 32, !28, i64 40, !10, i64 56, !11, i64 64, !14, i64 80, !7, i64 88, !16, i64 92, !8, i64 94}
!28 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!29 = !{!10, !10, i64 0}
!30 = !{!31, !10, i64 16}
!31 = !{!"_EFI_COMPONENT_NAME_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16}
!32 = !{!33, !10, i64 16}
!33 = !{!"_EFI_COMPONENT_NAME2_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16}


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