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

; 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_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.GUID = type { i32, i16, i16, [8 x i8] }
%struct.MNP_DEVICE_DATA = type { i32, ptr, ptr, %struct._EFI_VLAN_CONFIG_PROTOCOL, i64, ptr, ptr, %struct._LIST_ENTRY, i64, %struct._LIST_ENTRY, i32, ptr, %struct.NET_BUF_QUEUE, i64, ptr, i8, ptr, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr }
%struct._EFI_VLAN_CONFIG_PROTOCOL = type { ptr, ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.NET_BUF_QUEUE = type { i32, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i32 }
%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_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, 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 }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%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] }

@mMnpServiceBindingProtocol = external dso_local global %struct._EFI_SERVICE_BINDING_PROTOCOL, align 8
@gBS = external global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [53 x i8], align 1
@gEfiVlanConfigProtocolGuid = external global %struct.GUID, align 4
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4

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

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

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

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #1

declare ptr @InitializeListHead(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @MnpCreateServiceData(ptr noundef %0, i16 noundef zeroext %1, i8 noundef zeroext %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i16, align 2
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i16 %1, ptr %6, align 2, !tbaa !9
  store i8 %2, ptr %7, align 1, !tbaa !11
  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
  %14 = call ptr @AllocateZeroPool(i64 noundef 96)
  store ptr %14, ptr %9, align 8, !tbaa !5
  %15 = load ptr, ptr %9, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %32

17:                                               ; preds = %3
  br label %18

18:                                               ; preds = %17
  %19 = call zeroext i8 @DebugPrintEnabled()
  %20 = icmp ne i8 %19, 0
  br i1 %20, label %21, label %29

21:                                               ; preds = %18
  br label %22

22:                                               ; preds = %21
  %23 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %24 = icmp ne i8 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.14)
  br label %26

26:                                               ; preds = %25, %22
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28, %18
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %140

32:                                               ; preds = %3
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %33, i32 0, i32 7
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %35, i32 0, i32 1
  %37 = call ptr @InsertTailList(ptr noundef %34, ptr noundef %36)
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %38, i32 0, i32 0
  store i32 1399877197, ptr %39, align 8, !tbaa !12
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %41, i32 0, i32 2
  store ptr %40, ptr %42, align 8, !tbaa !18
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %43, i32 0, i32 4
  %45 = call ptr @CopyMem(ptr noundef %44, ptr noundef @mMnpServiceBindingProtocol, i64 noundef 16)
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %46, i32 0, i32 6
  %48 = call ptr @InitializeListHead(ptr noundef %47)
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %49, i32 0, i32 6
  %51 = load ptr, ptr %50, align 8, !tbaa !19
  %52 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %51, i32 0, i32 15
  %53 = load ptr, ptr %52, align 8, !tbaa !23
  store ptr %53, ptr %11, align 8, !tbaa !5
  %54 = load i16, ptr %6, align 2, !tbaa !9
  %55 = zext i16 %54 to i32
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %107

57:                                               ; preds = %32
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !25
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !26
  %64 = load i16, ptr %6, align 2, !tbaa !9
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %65, i32 0, i32 5
  %67 = call ptr @MnpCreateVlanChild(ptr noundef %60, ptr noundef %63, i16 noundef zeroext %64, ptr noundef %66)
  store ptr %67, ptr %8, align 8, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = icmp eq ptr %68, null
  br i1 %69, label %70, label %85

70:                                               ; preds = %57
  br label %71

71:                                               ; preds = %70
  %72 = call zeroext i8 @DebugPrintEnabled()
  %73 = icmp ne i8 %72, 0
  br i1 %73, label %74, label %82

74:                                               ; preds = %71
  br label %75

75:                                               ; preds = %74
  %76 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.15)
  br label %79

79:                                               ; preds = %78, %75
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  br label %82

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

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %140

85:                                               ; preds = %57
  %86 = load ptr, ptr @gBS, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %86, i32 0, i32 33
  %88 = load ptr, ptr %87, align 8, !tbaa !27
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %89, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !26
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !25
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = call i64 %88(ptr noundef %91, ptr noundef @gEfiVlanConfigProtocolGuid, ptr noundef %12, ptr noundef %94, ptr noundef %95, i32 noundef 8)
  store i64 %96, ptr %10, align 8, !tbaa !30
  %97 = load i64, ptr %10, align 8, !tbaa !30
  %98 = icmp slt i64 %97, 0
  br i1 %98, label %99, label %100

99:                                               ; preds = %85
  br label %132

100:                                              ; preds = %85
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %101, i32 0, i32 3
  %103 = load i32, ptr %102, align 4, !tbaa !31
  %104 = sub i32 %103, 4
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %105, i32 0, i32 8
  store i32 %104, ptr %106, align 8, !tbaa !34
  br label %116

107:                                              ; preds = %32
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.MNP_DEVICE_DATA, ptr %108, i32 0, i32 1
  %110 = load ptr, ptr %109, align 8, !tbaa !26
  store ptr %110, ptr %8, align 8, !tbaa !5
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %111, i32 0, i32 3
  %113 = load i32, ptr %112, align 4, !tbaa !31
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %114, i32 0, i32 8
  store i32 %113, ptr %115, align 8, !tbaa !34
  br label %116

116:                                              ; preds = %107, %100
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %118, i32 0, i32 3
  store ptr %117, ptr %119, align 8, !tbaa !35
  %120 = load i16, ptr %6, align 2, !tbaa !9
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %121, i32 0, i32 9
  store i16 %120, ptr %122, align 4, !tbaa !36
  %123 = load i8, ptr %7, align 1, !tbaa !11
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %124, i32 0, i32 10
  store i8 %123, ptr %125, align 2, !tbaa !37
  %126 = load ptr, ptr @gBS, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %126, i32 0, i32 39
  %128 = load ptr, ptr %127, align 8, !tbaa !38
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %129, i32 0, i32 4
  %131 = call i64 (ptr, ...) %128(ptr noundef %8, ptr noundef @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef %130, ptr noundef null)
  store i64 %131, ptr %10, align 8, !tbaa !30
  br label %132

132:                                              ; preds = %116, %99
  %133 = load i64, ptr %10, align 8, !tbaa !30
  %134 = icmp slt i64 %133, 0
  br i1 %134, label %135, label %138

135:                                              ; preds = %132
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = call i64 @MnpDestroyServiceData(ptr noundef %136)
  store ptr null, ptr %9, align 8, !tbaa !5
  br label %138

138:                                              ; preds = %135, %132
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %139, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %140

140:                                              ; preds = %138, %84, %31
  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
  %141 = load ptr, ptr %4, align 8
  ret ptr %141
}

declare ptr @AllocateZeroPool(i64 noundef) #1

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

declare ptr @MnpCreateVlanChild(ptr noundef, ptr noundef, i16 noundef zeroext, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @MnpDestroyServiceData(ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"", !14, i64 0, !15, i64 8, !6, i64 24, !6, i64 32, !16, i64 40, !6, i64 56, !15, i64 64, !17, i64 80, !14, i64 88, !10, i64 92, !7, i64 94}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!16 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!17 = !{!"long long", !7, i64 0}
!18 = !{!13, !6, i64 24}
!19 = !{!20, !6, i64 64}
!20 = !{!"", !14, i64 0, !6, i64 8, !6, i64 16, !21, i64 24, !17, i64 48, !6, i64 56, !6, i64 64, !15, i64 72, !17, i64 88, !15, i64 96, !14, i64 112, !6, i64 120, !22, i64 128, !17, i64 184, !6, i64 192, !7, i64 200, !6, i64 208, !6, i64 216, !14, i64 224, !14, i64 228, !14, i64 232, !14, i64 236, !14, i64 240, !14, i64 244, !6, i64 248, !6, i64 256}
!21 = !{!"_EFI_VLAN_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"", !14, i64 0, !17, i64 8, !15, i64 16, !15, i64 32, !14, i64 48, !14, i64 52}
!23 = !{!24, !6, i64 120}
!24 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !17, 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, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!25 = !{!20, !6, i64 16}
!26 = !{!20, !6, i64 8}
!27 = !{!28, !6, i64 280}
!28 = !{!"", !29, 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}
!29 = !{!"", !17, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!30 = !{!17, !17, i64 0}
!31 = !{!32, !14, i64 12}
!32 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !7, i64 40, !33, i64 552, !33, i64 584, !33, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!33 = !{!"", !7, i64 0}
!34 = !{!13, !14, i64 88}
!35 = !{!13, !6, i64 32}
!36 = !{!13, !10, i64 92}
!37 = !{!13, !7, i64 94}
!38 = !{!28, !6, i64 328}


; 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_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.GUID = type { i32, i16, i16, [8 x i8] }

@mMnpServiceBindingProtocol = external dso_local global %struct._EFI_SERVICE_BINDING_PROTOCOL, align 8
@gBS = external local_unnamed_addr global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [53 x i8], align 1
@gEfiVlanConfigProtocolGuid = external global %struct.GUID, align 4
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4

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

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #1

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

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

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare ptr @InitializeListHead(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @MnpCreateServiceData(ptr noundef %0, i16 noundef zeroext %1, i8 noundef zeroext %2) local_unnamed_addr #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %6 = tail call ptr @AllocateZeroPool(i64 noundef 96) #3
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %13

8:                                                ; preds = %3
  %9 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not38 = icmp eq i8 %9, 0
  br i1 %.not38, label %68, label %10

10:                                               ; preds = %8
  %11 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not39 = icmp eq i8 %11, 0
  br i1 %.not39, label %68, label %12

12:                                               ; preds = %10
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.14) #3
  br label %68

13:                                               ; preds = %3
  %14 = getelementptr inbounds i8, ptr %0, i64 72
  %15 = getelementptr inbounds i8, ptr %6, i64 8
  %16 = tail call ptr @InsertTailList(ptr noundef nonnull %14, ptr noundef nonnull %15) #3
  store i32 1399877197, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %0, ptr %17, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %6, i64 40
  %19 = tail call ptr @CopyMem(ptr noundef nonnull %18, ptr noundef nonnull @mMnpServiceBindingProtocol, i64 noundef 16) #3
  %20 = getelementptr inbounds i8, ptr %6, i64 64
  %21 = tail call ptr @InitializeListHead(ptr noundef nonnull %20) #3
  %22 = getelementptr inbounds i8, ptr %0, i64 64
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  %24 = getelementptr inbounds i8, ptr %23, i64 120
  %25 = load ptr, ptr %24, align 8, !tbaa !20
  %.not = icmp eq i16 %1, 0
  br i1 %.not, label %51, label %26

26:                                               ; preds = %13
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !22
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !23
  %31 = getelementptr inbounds i8, ptr %6, i64 56
  %32 = tail call ptr @MnpCreateVlanChild(ptr noundef %28, ptr noundef %30, i16 noundef zeroext %1, ptr noundef nonnull %31) #3
  store ptr %32, ptr %4, align 8, !tbaa !24
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %39

34:                                               ; preds = %26
  %35 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not36 = icmp eq i8 %35, 0
  br i1 %.not36, label %68, label %36

36:                                               ; preds = %34
  %37 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not37 = icmp eq i8 %37, 0
  br i1 %.not37, label %68, label %38

38:                                               ; preds = %36
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.15) #3
  br label %68

39:                                               ; preds = %26
  %40 = load ptr, ptr @gBS, align 8, !tbaa !24
  %41 = getelementptr inbounds i8, ptr %40, i64 280
  %42 = load ptr, ptr %41, align 8, !tbaa !25
  %43 = load ptr, ptr %29, align 8, !tbaa !23
  %44 = load ptr, ptr %27, align 8, !tbaa !22
  %45 = call i64 %42(ptr noundef %43, ptr noundef nonnull @gEfiVlanConfigProtocolGuid, ptr noundef nonnull %5, ptr noundef %44, ptr noundef nonnull %32, i32 noundef 8) #3
  %46 = icmp slt i64 %45, 0
  br i1 %46, label %.critedge, label %47

47:                                               ; preds = %39
  %48 = getelementptr inbounds i8, ptr %25, i64 12
  %49 = load i32, ptr %48, align 4, !tbaa !28
  %50 = add i32 %49, -4
  br label %56

51:                                               ; preds = %13
  %52 = getelementptr inbounds i8, ptr %0, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !23
  store ptr %53, ptr %4, align 8, !tbaa !24
  %54 = getelementptr inbounds i8, ptr %25, i64 12
  %55 = load i32, ptr %54, align 4, !tbaa !28
  br label %56

56:                                               ; preds = %51, %47
  %.sink = phi i32 [ %55, %51 ], [ %50, %47 ]
  %57 = phi ptr [ %53, %51 ], [ %32, %47 ]
  %58 = getelementptr inbounds i8, ptr %6, i64 88
  store i32 %.sink, ptr %58, align 8, !tbaa !31
  %59 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr %57, ptr %59, align 8, !tbaa !32
  %60 = getelementptr inbounds i8, ptr %6, i64 92
  store i16 %1, ptr %60, align 4, !tbaa !33
  %61 = getelementptr inbounds i8, ptr %6, i64 94
  store i8 %2, ptr %61, align 2, !tbaa !34
  %62 = load ptr, ptr @gBS, align 8, !tbaa !24
  %63 = getelementptr inbounds i8, ptr %62, i64 328
  %64 = load ptr, ptr %63, align 8, !tbaa !35
  %65 = call i64 (ptr, ...) %64(ptr noundef nonnull %4, ptr noundef nonnull @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef nonnull %18, ptr noundef null) #3
  %66 = icmp slt i64 %65, 0
  br i1 %66, label %.critedge, label %68

.critedge:                                        ; preds = %39, %56
  %67 = call i64 @MnpDestroyServiceData(ptr noundef nonnull %6)
  br label %68

68:                                               ; preds = %56, %.critedge, %34, %38, %36, %8, %12, %10
  %.0 = phi ptr [ null, %10 ], [ null, %12 ], [ null, %8 ], [ null, %36 ], [ null, %38 ], [ null, %34 ], [ null, %.critedge ], [ %6, %56 ]
  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 ptr %.0
}

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #1

declare ptr @InsertTailList(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @MnpCreateVlanChild(ptr noundef, ptr noundef, i16 noundef zeroext, ptr noundef) local_unnamed_addr #1

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 24, !11, i64 32, !12, i64 40, !11, i64 56, !10, i64 64, !13, i64 80, !7, i64 88, !14, i64 92, !8, i64 94}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !11, i64 0, !11, i64 8}
!13 = !{!"long long", !8, i64 0}
!14 = !{!"short", !8, i64 0}
!15 = !{!6, !11, i64 24}
!16 = !{!17, !11, i64 64}
!17 = !{!"", !7, i64 0, !11, i64 8, !11, i64 16, !18, i64 24, !13, i64 48, !11, i64 56, !11, i64 64, !10, i64 72, !13, i64 88, !10, i64 96, !7, i64 112, !11, i64 120, !19, i64 128, !13, i64 184, !11, i64 192, !8, i64 200, !11, i64 208, !11, i64 216, !7, i64 224, !7, i64 228, !7, i64 232, !7, i64 236, !7, i64 240, !7, i64 244, !11, i64 248, !11, i64 256}
!18 = !{!"_EFI_VLAN_CONFIG_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16}
!19 = !{!"", !7, i64 0, !13, i64 8, !10, i64 16, !10, i64 32, !7, i64 48, !7, i64 52}
!20 = !{!21, !11, i64 120}
!21 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !13, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120}
!22 = !{!17, !11, i64 16}
!23 = !{!17, !11, i64 8}
!24 = !{!11, !11, i64 0}
!25 = !{!26, !11, i64 280}
!26 = !{!"", !27, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !11, i64 296, !11, i64 304, !11, i64 312, !11, i64 320, !11, i64 328, !11, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368}
!27 = !{!"", !13, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!28 = !{!29, !7, i64 12}
!29 = !{!"", !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, !30, i64 552, !30, i64 584, !30, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!30 = !{!"", !8, i64 0}
!31 = !{!6, !7, i64 88}
!32 = !{!6, !11, i64 32}
!33 = !{!6, !14, i64 92}
!34 = !{!6, !8, i64 94}
!35 = !{!26, !11, i64 328}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass