; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/OptionRomPkg (InstallConfigTable)

; 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.s_pxe_sw_undi = type { i32, i8, i8, i8, i8, i8, i8, i8, i8, i32, i64, [3 x i8], i8, [1 x i32] }
%struct.undiconfig_table = type { i32, i32, ptr, [1 x %struct.anon] }
%struct.anon = type { ptr, ptr }
%struct.UNDI32_DEV = type { i64, %struct._EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL, ptr, ptr, ptr, %struct.s_data_instance }
%struct._EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL = type { i64, i64, i64, i32, [4 x i8], i8, i8, i8, i8, i16 }
%struct.s_data_instance = type { i16, i16, i8, i8, i16, i16, i16, i16, i16, [32 x i8], [32 x i8], [32 x i8], [64 x i32], [128 x i32], i32, i32, i16, i16, i8, i8, i8, i8, i16, i16, i16, i16, i32, i32, i16, i16, [2 x i16], i8, i8, i16, i32, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, [64 x i64], i16, i16, i16, i16, i8, i8, i8, i8, i8, [3 x i8], %struct.mc, i64, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.mc = type { [3 x i16], i16, [8 x [32 x i8]] }
%struct.EFI_SYSTEM_TABLE = type { %struct.EFI_TABLE_HEADER, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct.EFI_CONFIGURATION_TABLE = type { %struct.GUID, ptr }
%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 }

@pxe_31 = external dso_local global ptr, align 8
@UndiDataPointer = external dso_local global ptr, align 8
@UNDI32DeviceList = external dso_local global [16 x ptr], align 16
@gBS = external global ptr, align 8
@gEfiNetworkInterfaceIdentifierProtocolGuid_31 = external global %struct.GUID, align 4
@gST = external global ptr, align 8

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

; 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
define dso_local i64 @InstallConfigTable() #1 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i16, align 2
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %8 = load ptr, ptr @pxe_31, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %0
  store i64 0, ptr %1, align 8
  store i32 1, ptr %7, align 4
  br label %131

11:                                               ; preds = %0
  %12 = load ptr, ptr @UndiDataPointer, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %11
  store i64 0, ptr %1, align 8
  store i32 1, ptr %7, align 4
  br label %131

15:                                               ; preds = %11
  %16 = load ptr, ptr @UndiDataPointer, align 8, !tbaa !5
  store ptr %16, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr @pxe_31, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.s_pxe_sw_undi, ptr %17, i32 0, i32 4
  %19 = load i8, ptr %18, align 1, !tbaa !9
  %20 = zext i8 %19 to i32
  %21 = load ptr, ptr @pxe_31, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.s_pxe_sw_undi, ptr %21, i32 0, i32 7
  %23 = load i8, ptr %22, align 1, !tbaa !13
  %24 = zext i8 %23 to i32
  %25 = shl i32 %24, 8
  %26 = or i32 %20, %25
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.undiconfig_table, ptr %27, i32 0, i32 0
  store i32 %26, ptr %28, align 8, !tbaa !14
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.undiconfig_table, ptr %29, i32 0, i32 2
  store ptr null, ptr %30, align 8, !tbaa !16
  store i16 0, ptr %5, align 2, !tbaa !17
  br label %31

31:                                               ; preds = %69, %15
  %32 = load i16, ptr %5, align 2, !tbaa !17
  %33 = zext i16 %32 to i32
  %34 = load ptr, ptr @pxe_31, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.s_pxe_sw_undi, ptr %34, i32 0, i32 4
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = zext i8 %36 to i32
  %38 = load ptr, ptr @pxe_31, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.s_pxe_sw_undi, ptr %38, i32 0, i32 7
  %40 = load i8, ptr %39, align 1, !tbaa !13
  %41 = zext i8 %40 to i32
  %42 = shl i32 %41, 8
  %43 = or i32 %37, %42
  %44 = icmp slt i32 %33, %43
  br i1 %44, label %45, label %72

45:                                               ; preds = %31
  %46 = load i16, ptr %5, align 2, !tbaa !17
  %47 = zext i16 %46 to i64
  %48 = getelementptr inbounds [16 x ptr], ptr @UNDI32DeviceList, i64 0, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.UNDI32_DEV, ptr %49, i32 0, i32 1
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.undiconfig_table, ptr %51, i32 0, i32 3
  %53 = load i16, ptr %5, align 2, !tbaa !17
  %54 = zext i16 %53 to i64
  %55 = getelementptr inbounds [1 x %struct.anon], ptr %52, i64 0, i64 %54
  %56 = getelementptr inbounds %struct.anon, ptr %55, i32 0, i32 0
  store ptr %50, ptr %56, align 8, !tbaa !19
  %57 = load i16, ptr %5, align 2, !tbaa !17
  %58 = zext i16 %57 to i64
  %59 = getelementptr inbounds [16 x ptr], ptr @UNDI32DeviceList, i64 0, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.UNDI32_DEV, ptr %60, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.undiconfig_table, ptr %63, i32 0, i32 3
  %65 = load i16, ptr %5, align 2, !tbaa !17
  %66 = zext i16 %65 to i64
  %67 = getelementptr inbounds [1 x %struct.anon], ptr %64, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.anon, ptr %67, i32 0, i32 1
  store ptr %62, ptr %68, align 8, !tbaa !26
  br label %69

69:                                               ; preds = %45
  %70 = load i16, ptr %5, align 2, !tbaa !17
  %71 = add i16 %70, 1
  store i16 %71, ptr %5, align 2, !tbaa !17
  br label %31, !llvm.loop !27

72:                                               ; preds = %31
  %73 = load ptr, ptr @gST, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %73, i32 0, i32 12
  %75 = load ptr, ptr %74, align 8, !tbaa !29
  store ptr %75, ptr %3, align 8, !tbaa !5
  store i16 0, ptr %5, align 2, !tbaa !17
  br label %76

76:                                               ; preds = %94, %72
  %77 = load i16, ptr %5, align 2, !tbaa !17
  %78 = zext i16 %77 to i64
  %79 = load ptr, ptr @gST, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %79, i32 0, i32 11
  %81 = load i64, ptr %80, align 8, !tbaa !32
  %82 = icmp ult i64 %78, %81
  br i1 %82, label %83, label %97

83:                                               ; preds = %76
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.EFI_CONFIGURATION_TABLE, ptr %84, i32 0, i32 0
  %86 = call zeroext i8 @CompareGuid(ptr noundef %85, ptr noundef @gEfiNetworkInterfaceIdentifierProtocolGuid_31)
  %87 = zext i8 %86 to i64
  store i64 %87, ptr %2, align 8, !tbaa !33
  %88 = load i64, ptr %2, align 8, !tbaa !33
  %89 = icmp ne i64 %88, 0
  br i1 %89, label %90, label %91

90:                                               ; preds = %83
  br label %97

91:                                               ; preds = %83
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.EFI_CONFIGURATION_TABLE, ptr %92, i32 1
  store ptr %93, ptr %3, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %91
  %95 = load i16, ptr %5, align 2, !tbaa !17
  %96 = add i16 %95, 1
  store i16 %96, ptr %5, align 2, !tbaa !17
  br label %76, !llvm.loop !34

97:                                               ; preds = %90, %76
  %98 = load i16, ptr %5, align 2, !tbaa !17
  %99 = zext i16 %98 to i64
  %100 = load ptr, ptr @gST, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.EFI_SYSTEM_TABLE, ptr %100, i32 0, i32 11
  %102 = load i64, ptr %101, align 8, !tbaa !32
  %103 = icmp ult i64 %99, %102
  br i1 %103, label %104, label %124

104:                                              ; preds = %97
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_CONFIGURATION_TABLE, ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !35
  store ptr %107, ptr %4, align 8, !tbaa !5
  br label %108

108:                                              ; preds = %113, %104
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.undiconfig_table, ptr %109, i32 0, i32 2
  %111 = load ptr, ptr %110, align 8, !tbaa !16
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %117

113:                                              ; preds = %108
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.undiconfig_table, ptr %114, i32 0, i32 2
  %116 = load ptr, ptr %115, align 8, !tbaa !16
  store ptr %116, ptr %4, align 8, !tbaa !5
  br label %108, !llvm.loop !38

117:                                              ; preds = %108
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.undiconfig_table, ptr %119, i32 0, i32 2
  store ptr %118, ptr %120, align 8, !tbaa !16
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_CONFIGURATION_TABLE, ptr %121, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !35
  store ptr %123, ptr %6, align 8, !tbaa !5
  br label %124

124:                                              ; preds = %117, %97
  %125 = load ptr, ptr @gBS, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %125, i32 0, i32 22
  %127 = load ptr, ptr %126, align 8, !tbaa !39
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = call i64 %127(ptr noundef @gEfiNetworkInterfaceIdentifierProtocolGuid_31, ptr noundef %128)
  store i64 %129, ptr %2, align 8, !tbaa !33
  %130 = load i64, ptr %2, align 8, !tbaa !33
  store i64 %130, ptr %1, align 8
  store i32 1, ptr %7, align 4
  br label %131

131:                                              ; preds = %124, %14, %10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  %132 = load i64, ptr %1, align 8
  ret i64 %132
}

declare zeroext i8 @CompareGuid(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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, !7, i64 7}
!10 = !{!"s_pxe_sw_undi", !11, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !11, i64 12, !12, i64 16, !7, i64 24, !7, i64 27, !7, i64 28}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!10, !7, i64 10}
!14 = !{!15, !11, i64 0}
!15 = !{!"undiconfig_table", !11, i64 0, !11, i64 4, !6, i64 8, !7, i64 16}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !18, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!20, !6, i64 0}
!20 = !{!"", !6, i64 0, !6, i64 8}
!21 = !{!22, !6, i64 64}
!22 = !{!"", !12, i64 0, !23, i64 8, !6, i64 48, !6, i64 56, !6, i64 64, !24, i64 72}
!23 = !{!"_EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !11, i64 24, !7, i64 28, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !18, i64 36}
!24 = !{!"s_data_instance", !18, i64 0, !18, i64 2, !7, i64 4, !7, i64 5, !18, i64 6, !18, i64 8, !18, i64 10, !18, i64 12, !18, i64 14, !7, i64 16, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 368, !11, i64 880, !11, i64 884, !18, i64 888, !18, i64 890, !7, i64 892, !7, i64 893, !7, i64 894, !7, i64 895, !18, i64 896, !18, i64 898, !18, i64 900, !18, i64 902, !11, i64 904, !11, i64 908, !18, i64 912, !18, i64 914, !7, i64 916, !7, i64 920, !7, i64 921, !18, i64 922, !11, i64 924, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !12, i64 976, !12, i64 984, !12, i64 992, !12, i64 1000, !12, i64 1008, !7, i64 1016, !18, i64 1528, !18, i64 1530, !18, i64 1532, !18, i64 1534, !7, i64 1536, !7, i64 1537, !7, i64 1538, !7, i64 1539, !7, i64 1540, !7, i64 1541, !25, i64 1544, !12, i64 1808, !6, i64 1816, !12, i64 1824, !6, i64 1832, !6, i64 1840, !6, i64 1848, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888, !6, i64 1896, !6, i64 1904, !6, i64 1912}
!25 = !{!"mc", !7, i64 0, !18, i64 6, !7, i64 8}
!26 = !{!20, !6, i64 8}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!30, !6, i64 112}
!30 = !{!"", !31, i64 0, !6, i64 24, !11, 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, !12, i64 104, !6, i64 112}
!31 = !{!"", !12, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!32 = !{!30, !12, i64 104}
!33 = !{!12, !12, i64 0}
!34 = distinct !{!34, !28}
!35 = !{!36, !6, i64 16}
!36 = !{!"", !37, i64 0, !6, i64 16}
!37 = !{!"", !11, i64 0, !18, i64 4, !18, i64 6, !7, i64 8}
!38 = distinct !{!38, !28}
!39 = !{!40, !6, i64 192}
!40 = !{!"", !31, 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}


; 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] }
%struct.anon = type { ptr, ptr }

@pxe_31 = external dso_local local_unnamed_addr global ptr, align 8
@UndiDataPointer = external dso_local local_unnamed_addr global ptr, align 8
@UNDI32DeviceList = external dso_local local_unnamed_addr global [16 x ptr], align 16
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiNetworkInterfaceIdentifierProtocolGuid_31 = external global %struct.GUID, align 4
@gST = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i64 @InstallConfigTable() local_unnamed_addr #0 {
  %1 = load ptr, ptr @pxe_31, align 8, !tbaa !5
  %2 = icmp eq ptr %1, null
  br i1 %2, label %66, label %3

3:                                                ; preds = %0
  %4 = load ptr, ptr @UndiDataPointer, align 8, !tbaa !5
  %5 = icmp eq ptr %4, null
  br i1 %5, label %66, label %6

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %1, i64 7
  %8 = load i8, ptr %7, align 1, !tbaa !9
  %9 = zext i8 %8 to i32
  %10 = getelementptr inbounds i8, ptr %1, i64 10
  %11 = load i8, ptr %10, align 1, !tbaa !13
  %12 = zext i8 %11 to i32
  %13 = shl nuw nsw i32 %12, 8
  %14 = or disjoint i32 %13, %9
  store i32 %14, ptr %4, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr null, ptr %15, align 8, !tbaa !16
  %.not43 = icmp eq i32 %14, 0
  br i1 %.not43, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %6
  %16 = getelementptr inbounds i8, ptr %4, i64 16
  br label %17

17:                                               ; preds = %.lr.ph, %17
  %.02433 = phi i16 [ 0, %.lr.ph ], [ %27, %17 ]
  %18 = zext i16 %.02433 to i64
  %19 = getelementptr inbounds [16 x ptr], ptr @UNDI32DeviceList, i64 0, i64 %18
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = getelementptr inbounds [1 x %struct.anon], ptr %16, i64 0, i64 %18
  store ptr %21, ptr %22, align 8, !tbaa !17
  %23 = load ptr, ptr %19, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 64
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  %26 = getelementptr inbounds i8, ptr %22, i64 8
  store ptr %25, ptr %26, align 8, !tbaa !25
  %27 = add nuw i16 %.02433, 1
  %28 = zext i16 %27 to i32
  %29 = load ptr, ptr @pxe_31, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 7
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = zext i8 %31 to i32
  %33 = getelementptr inbounds i8, ptr %29, i64 10
  %34 = load i8, ptr %33, align 1, !tbaa !13
  %35 = zext i8 %34 to i32
  %36 = shl nuw nsw i32 %35, 8
  %37 = or disjoint i32 %36, %32
  %38 = icmp ugt i32 %37, %28
  br i1 %38, label %17, label %._crit_edge, !llvm.loop !26

._crit_edge:                                      ; preds = %17, %6
  %39 = load ptr, ptr @gST, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 104
  %41 = load i64, ptr %40, align 8, !tbaa !28
  %.not44 = icmp eq i64 %41, 0
  br i1 %.not44, label %._crit_edge38.thread, label %.lr.ph37.preheader

.lr.ph37.preheader:                               ; preds = %._crit_edge
  %42 = getelementptr inbounds i8, ptr %39, i64 112
  %43 = load ptr, ptr %42, align 8, !tbaa !31
  %44 = tail call zeroext i8 @CompareGuid(ptr noundef %43, ptr noundef nonnull @gEfiNetworkInterfaceIdentifierProtocolGuid_31) #2
  %.not62 = icmp eq i8 %44, 0
  %.pre.pre63 = load ptr, ptr @gST, align 8, !tbaa !5
  br i1 %.not62, label %.lr.ph67, label %.lr.ph37.._crit_edge38.loopexit_crit_edge

.lr.ph37:                                         ; preds = %.lr.ph67
  %45 = tail call zeroext i8 @CompareGuid(ptr noundef nonnull %46, ptr noundef nonnull @gEfiNetworkInterfaceIdentifierProtocolGuid_31) #2
  %.not = icmp eq i8 %45, 0
  %.pre.pre = load ptr, ptr @gST, align 8, !tbaa !5
  br i1 %.not, label %.lr.ph67, label %.lr.ph37.._crit_edge38.loopexit_crit_edge, !llvm.loop !32

.lr.ph37.._crit_edge38.loopexit_crit_edge:        ; preds = %.lr.ph37, %.lr.ph37.preheader
  %.lcssa = phi i64 [ 0, %.lr.ph37.preheader ], [ %48, %.lr.ph37 ]
  %.02634.lcssa = phi ptr [ %43, %.lr.ph37.preheader ], [ %46, %.lr.ph37 ]
  %.pre.pre.lcssa = phi ptr [ %.pre.pre63, %.lr.ph37.preheader ], [ %.pre.pre, %.lr.ph37 ]
  %.phi.trans.insert.phi.trans.insert = getelementptr inbounds i8, ptr %.pre.pre.lcssa, i64 104
  %.pre45.pre = load i64, ptr %.phi.trans.insert.phi.trans.insert, align 8, !tbaa !28
  br label %._crit_edge38

.lr.ph67:                                         ; preds = %.lr.ph37.preheader, %.lr.ph37
  %.pre.pre66 = phi ptr [ %.pre.pre, %.lr.ph37 ], [ %.pre.pre63, %.lr.ph37.preheader ]
  %.0263465 = phi ptr [ %46, %.lr.ph37 ], [ %43, %.lr.ph37.preheader ]
  %.13564 = phi i16 [ %47, %.lr.ph37 ], [ 0, %.lr.ph37.preheader ]
  %46 = getelementptr inbounds i8, ptr %.0263465, i64 24
  %47 = add i16 %.13564, 1
  %48 = zext i16 %47 to i64
  %49 = getelementptr inbounds i8, ptr %.pre.pre66, i64 104
  %50 = load i64, ptr %49, align 8, !tbaa !28
  %51 = icmp ugt i64 %50, %48
  br i1 %51, label %.lr.ph37, label %._crit_edge38, !llvm.loop !32

._crit_edge38:                                    ; preds = %.lr.ph67, %.lr.ph37.._crit_edge38.loopexit_crit_edge
  %52 = phi i64 [ %.pre45.pre, %.lr.ph37.._crit_edge38.loopexit_crit_edge ], [ %50, %.lr.ph67 ]
  %.026.lcssa = phi ptr [ %.02634.lcssa, %.lr.ph37.._crit_edge38.loopexit_crit_edge ], [ %46, %.lr.ph67 ]
  %.lcssa32 = phi i64 [ %.lcssa, %.lr.ph37.._crit_edge38.loopexit_crit_edge ], [ %48, %.lr.ph67 ]
  %53 = icmp ugt i64 %52, %.lcssa32
  br i1 %53, label %54, label %._crit_edge38.thread

54:                                               ; preds = %._crit_edge38
  %55 = getelementptr inbounds i8, ptr %.026.lcssa, i64 16
  %56 = load ptr, ptr %55, align 8, !tbaa !33
  br label %57

57:                                               ; preds = %57, %54
  %.025 = phi ptr [ %56, %54 ], [ %59, %57 ]
  %58 = getelementptr inbounds i8, ptr %.025, i64 8
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %.not31 = icmp eq ptr %59, null
  br i1 %.not31, label %60, label %57, !llvm.loop !36

60:                                               ; preds = %57
  %61 = getelementptr inbounds i8, ptr %.025, i64 8
  store ptr %4, ptr %61, align 8, !tbaa !16
  br label %._crit_edge38.thread

._crit_edge38.thread:                             ; preds = %._crit_edge, %60, %._crit_edge38
  %.0 = phi ptr [ %56, %60 ], [ %4, %._crit_edge38 ], [ %4, %._crit_edge ]
  %62 = load ptr, ptr @gBS, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 192
  %64 = load ptr, ptr %63, align 8, !tbaa !37
  %65 = tail call i64 %64(ptr noundef nonnull @gEfiNetworkInterfaceIdentifierProtocolGuid_31, ptr noundef %.0) #2
  br label %66

66:                                               ; preds = %3, %0, %._crit_edge38.thread
  %.027 = phi i64 [ %65, %._crit_edge38.thread ], [ 0, %0 ], [ 0, %3 ]
  ret i64 %.027
}

declare zeroext i8 @CompareGuid(ptr noundef, ptr noundef) local_unnamed_addr #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !7, i64 7}
!10 = !{!"s_pxe_sw_undi", !11, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !11, i64 12, !12, i64 16, !7, i64 24, !7, i64 27, !7, i64 28}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!10, !7, i64 10}
!14 = !{!15, !11, i64 0}
!15 = !{!"undiconfig_table", !11, i64 0, !11, i64 4, !6, i64 8, !7, i64 16}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !6, i64 0}
!18 = !{!"", !6, i64 0, !6, i64 8}
!19 = !{!20, !6, i64 64}
!20 = !{!"", !12, i64 0, !21, i64 8, !6, i64 48, !6, i64 56, !6, i64 64, !23, i64 72}
!21 = !{!"_EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL", !12, i64 0, !12, i64 8, !12, i64 16, !11, i64 24, !7, i64 28, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !22, i64 36}
!22 = !{!"short", !7, i64 0}
!23 = !{!"s_data_instance", !22, i64 0, !22, i64 2, !7, i64 4, !7, i64 5, !22, i64 6, !22, i64 8, !22, i64 10, !22, i64 12, !22, i64 14, !7, i64 16, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 368, !11, i64 880, !11, i64 884, !22, i64 888, !22, i64 890, !7, i64 892, !7, i64 893, !7, i64 894, !7, i64 895, !22, i64 896, !22, i64 898, !22, i64 900, !22, i64 902, !11, i64 904, !11, i64 908, !22, i64 912, !22, i64 914, !7, i64 916, !7, i64 920, !7, i64 921, !22, i64 922, !11, i64 924, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !12, i64 976, !12, i64 984, !12, i64 992, !12, i64 1000, !12, i64 1008, !7, i64 1016, !22, i64 1528, !22, i64 1530, !22, i64 1532, !22, i64 1534, !7, i64 1536, !7, i64 1537, !7, i64 1538, !7, i64 1539, !7, i64 1540, !7, i64 1541, !24, i64 1544, !12, i64 1808, !6, i64 1816, !12, i64 1824, !6, i64 1832, !6, i64 1840, !6, i64 1848, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888, !6, i64 1896, !6, i64 1904, !6, i64 1912}
!24 = !{!"mc", !7, i64 0, !22, i64 6, !7, i64 8}
!25 = !{!18, !6, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!29, !12, i64 104}
!29 = !{!"", !30, i64 0, !6, i64 24, !11, 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, !12, i64 104, !6, i64 112}
!30 = !{!"", !12, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!31 = !{!29, !6, i64 112}
!32 = distinct !{!32, !27}
!33 = !{!34, !6, i64 16}
!34 = !{!"", !35, i64 0, !6, i64 16}
!35 = !{!"", !11, i64 0, !22, i64 4, !22, i64 6, !7, i64 8}
!36 = distinct !{!36, !27}
!37 = !{!38, !6, i64 192}
!38 = !{!"", !30, 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}


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