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

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

@gMnpDriverBinding = external dso_local global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@.str = external hidden unnamed_addr constant [151 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4
@.str.5 = external hidden unnamed_addr constant [78 x i8], align 1
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4
@.str.6 = external hidden unnamed_addr constant [71 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() #1

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

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

declare ptr @AllocateZeroPool(i64 noundef) #1

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

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

declare void @FreePool(ptr noundef) #1

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

14:                                               ; preds = %2
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

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

18:                                               ; preds = %14
  %19 = call zeroext i8 @DebugAssertEnabled()
  %20 = zext i8 %19 to i32
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %32

22:                                               ; preds = %18
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = ptrtoint ptr %23 to i64
  %25 = sub i64 %24, ptrtoint (ptr getelementptr inbounds (%struct.MNP_SERVICE_DATA, ptr null, i32 0, i32 4) to i64)
  %26 = inttoptr i64 %25 to ptr
  %27 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !9
  %29 = icmp ne i32 %28, 1399877197
  br i1 %29, label %30, label %32

30:                                               ; preds = %22
  call void @DebugAssert(ptr noundef @.str, i64 noundef 453, ptr noundef @.str.1)
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  br label %37

32:                                               ; preds = %22, %18
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = ptrtoint ptr %33 to i64
  %35 = sub i64 %34, ptrtoint (ptr getelementptr inbounds (%struct.MNP_SERVICE_DATA, ptr null, i32 0, i32 4) to i64)
  %36 = inttoptr i64 %35 to ptr
  br label %37

37:                                               ; preds = %32, %30
  %38 = phi ptr [ %31, %30 ], [ %36, %32 ]
  store ptr %38, ptr %7, align 8, !tbaa !5
  %39 = call ptr @AllocateZeroPool(i64 noundef 232)
  store ptr %39, ptr %8, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %57

42:                                               ; preds = %37
  br label %43

43:                                               ; preds = %42
  %44 = call zeroext i8 @DebugPrintEnabled()
  %45 = icmp ne i8 %44, 0
  br i1 %45, label %46, label %54

46:                                               ; preds = %43
  br label %47

47:                                               ; preds = %46
  %48 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %49 = icmp ne i8 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.5)
  br label %51

51:                                               ; preds = %50, %47
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53, %43
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %144

57:                                               ; preds = %37
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  call void @MnpInitializeInstanceData(ptr noundef %58, ptr noundef %59)
  %60 = load ptr, ptr @gBS, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %60, i32 0, i32 39
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %64, i32 0, i32 4
  %66 = call i64 (ptr, ...) %62(ptr noundef %63, ptr noundef @gEfiManagedNetworkProtocolGuid, ptr noundef %65, ptr noundef null)
  store i64 %66, ptr %6, align 8, !tbaa !19
  %67 = load i64, ptr %6, align 8, !tbaa !19
  %68 = icmp slt i64 %67, 0
  br i1 %68, label %69, label %85

69:                                               ; preds = %57
  br label %70

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

73:                                               ; preds = %70
  br label %74

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

77:                                               ; preds = %74
  %78 = load i64, ptr %6, align 8, !tbaa !19
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.6, i64 noundef %78)
  br label %79

79:                                               ; preds = %77, %74
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  br label %82

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

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  br label %122

85:                                               ; preds = %57
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %88, i32 0, i32 2
  store ptr %87, ptr %89, align 8, !tbaa !20
  %90 = load ptr, ptr @gBS, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %90, i32 0, i32 33
  %92 = load ptr, ptr %91, align 8, !tbaa !25
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %93, i32 0, i32 3
  %95 = load ptr, ptr %94, align 8, !tbaa !26
  %96 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gMnpDriverBinding, i32 0, i32 5), align 8, !tbaa !27
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !20
  %100 = call i64 %92(ptr noundef %95, ptr noundef @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef %9, ptr noundef %96, ptr noundef %99, i32 noundef 8)
  store i64 %100, ptr %6, align 8, !tbaa !19
  %101 = load i64, ptr %6, align 8, !tbaa !19
  %102 = icmp slt i64 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %85
  br label %122

104:                                              ; preds = %85
  %105 = load ptr, ptr @gBS, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !29
  %108 = call i64 %107(i64 noundef 8)
  store i64 %108, ptr %10, align 8, !tbaa !19
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %109, i32 0, i32 6
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %111, i32 0, i32 3
  %113 = call ptr @InsertTailList(ptr noundef %110, ptr noundef %112)
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.MNP_SERVICE_DATA, ptr %114, i32 0, i32 7
  %116 = load i64, ptr %115, align 8, !tbaa !30
  %117 = add i64 %116, 1
  store i64 %117, ptr %115, align 8, !tbaa !30
  %118 = load ptr, ptr @gBS, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %118, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !31
  %121 = load i64, ptr %10, align 8, !tbaa !19
  call void %120(i64 noundef %121)
  br label %122

122:                                              ; preds = %104, %103, %84
  %123 = load i64, ptr %6, align 8, !tbaa !19
  %124 = icmp slt i64 %123, 0
  br i1 %124, label %125, label %142

125:                                              ; preds = %122
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %126, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !20
  %129 = icmp ne ptr %128, null
  br i1 %129, label %130, label %140

130:                                              ; preds = %125
  %131 = load ptr, ptr @gBS, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %131, i32 0, i32 40
  %133 = load ptr, ptr %132, align 8, !tbaa !32
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %134, i32 0, i32 2
  %136 = load ptr, ptr %135, align 8, !tbaa !20
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.MNP_INSTANCE_DATA, ptr %137, i32 0, i32 4
  %139 = call i64 (ptr, ...) %133(ptr noundef %136, ptr noundef @gEfiManagedNetworkProtocolGuid, ptr noundef %138, ptr noundef null)
  br label %140

140:                                              ; preds = %130, %125
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  call void @FreePool(ptr noundef %141)
  br label %142

142:                                              ; preds = %140, %122
  %143 = load i64, ptr %6, align 8, !tbaa !19
  store i64 %143, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %144

144:                                              ; preds = %142, %56, %17
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %145 = load i64, ptr %3, align 8
  ret i64 %145
}

declare void @MnpInitializeInstanceData(ptr noundef, ptr noundef) #1

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

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, !11, i64 0}
!10 = !{!"", !11, i64 0, !12, i64 8, !6, i64 24, !6, i64 32, !13, i64 40, !6, i64 56, !12, i64 64, !14, i64 80, !11, i64 88, !15, i64 92, !7, i64 94}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!17, !6, i64 328}
!17 = !{!"", !18, 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}
!18 = !{!"", !14, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!19 = !{!14, !14, i64 0}
!20 = !{!21, !6, i64 16}
!21 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !22, i64 40, !7, i64 104, !7, i64 105, !12, i64 112, !23, i64 128, !12, i64 168, !12, i64 184, !14, i64 200, !24, i64 208, !7, i64 228}
!22 = !{!"_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}
!23 = !{!"", !12, i64 0, !12, i64 16, !14, i64 32}
!24 = !{!"", !11, i64 0, !11, i64 4, !15, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!25 = !{!17, !6, i64 280}
!26 = !{!10, !6, i64 32}
!27 = !{!28, !6, i64 40}
!28 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40}
!29 = !{!17, !6, i64 24}
!30 = !{!10, !14, i64 80}
!31 = !{!17, !6, i64 32}
!32 = !{!17, !6, i64 336}


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

@gMnpDriverBinding = external dso_local local_unnamed_addr global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@.str = external hidden unnamed_addr constant [151 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiManagedNetworkServiceBindingProtocolGuid = external global %struct.GUID, align 4
@.str.5 = external hidden unnamed_addr constant [78 x i8], align 1
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4
@.str.6 = external hidden unnamed_addr constant [71 x i8], align 1

; 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 @DebugAssertEnabled() local_unnamed_addr #1

declare void @DebugAssert(ptr noundef, 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 @AllocateZeroPool(i64 noundef) local_unnamed_addr #1

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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @MnpServiceBindingCreateChild(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %4 = icmp eq ptr %0, null
  %5 = icmp eq ptr %1, null
  %or.cond = or i1 %4, %5
  br i1 %or.cond, label %65, label %6

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

8:                                                ; preds = %6
  %9 = load i32, ptr %.pre45, align 8, !tbaa !5
  %.not35 = icmp eq i32 %9, 1399877197
  br i1 %.not35, label %._crit_edge, label %10

10:                                               ; preds = %8
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 453, ptr noundef nonnull @.str.1) #3
  br label %._crit_edge

._crit_edge:                                      ; preds = %6, %8, %10
  %11 = phi ptr [ %0, %10 ], [ %.pre45, %8 ], [ %.pre45, %6 ]
  %12 = tail call ptr @AllocateZeroPool(i64 noundef 232) #3
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %19

14:                                               ; preds = %._crit_edge
  %15 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not39 = icmp eq i8 %15, 0
  br i1 %.not39, label %65, label %16

16:                                               ; preds = %14
  %17 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not40 = icmp eq i8 %17, 0
  br i1 %.not40, label %65, label %18

18:                                               ; preds = %16
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.5) #3
  br label %65

19:                                               ; preds = %._crit_edge
  tail call void @MnpInitializeInstanceData(ptr noundef %11, ptr noundef nonnull %12) #3
  %20 = load ptr, ptr @gBS, align 8, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %20, i64 328
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %23 = getelementptr inbounds i8, ptr %12, i64 40
  %24 = tail call i64 (ptr, ...) %22(ptr noundef nonnull %1, ptr noundef nonnull @gEfiManagedNetworkProtocolGuid, ptr noundef nonnull %23, ptr noundef null) #3
  %25 = icmp slt i64 %24, 0
  br i1 %25, label %26, label %31

26:                                               ; preds = %19
  %27 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not36 = icmp eq i8 %27, 0
  br i1 %.not36, label %56, label %28

28:                                               ; preds = %26
  %29 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not37 = icmp eq i8 %29, 0
  br i1 %.not37, label %56, label %30

30:                                               ; preds = %28
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.6, i64 noundef %24) #3
  br label %56

31:                                               ; preds = %19
  %32 = load ptr, ptr %1, align 8, !tbaa !15
  %33 = getelementptr inbounds i8, ptr %12, i64 16
  store ptr %32, ptr %33, align 8, !tbaa !19
  %34 = load ptr, ptr @gBS, align 8, !tbaa !15
  %35 = getelementptr inbounds i8, ptr %34, i64 280
  %36 = load ptr, ptr %35, align 8, !tbaa !24
  %37 = getelementptr inbounds i8, ptr %11, i64 32
  %38 = load ptr, ptr %37, align 8, !tbaa !25
  %39 = load ptr, ptr getelementptr inbounds (i8, ptr @gMnpDriverBinding, i64 40), align 8, !tbaa !26
  %40 = call i64 %36(ptr noundef %38, ptr noundef nonnull @gEfiManagedNetworkServiceBindingProtocolGuid, ptr noundef nonnull %3, ptr noundef %39, ptr noundef %32, i32 noundef 8) #3
  %41 = icmp slt i64 %40, 0
  br i1 %41, label %56, label %42

42:                                               ; preds = %31
  %43 = load ptr, ptr @gBS, align 8, !tbaa !15
  %44 = getelementptr inbounds i8, ptr %43, i64 24
  %45 = load ptr, ptr %44, align 8, !tbaa !28
  %46 = call i64 %45(i64 noundef 8) #3
  %47 = getelementptr inbounds i8, ptr %11, i64 64
  %48 = getelementptr inbounds i8, ptr %12, i64 24
  %49 = call ptr @InsertTailList(ptr noundef nonnull %47, ptr noundef nonnull %48) #3
  %50 = getelementptr inbounds i8, ptr %11, i64 80
  %51 = load i64, ptr %50, align 8, !tbaa !29
  %52 = add i64 %51, 1
  store i64 %52, ptr %50, align 8, !tbaa !29
  %53 = load ptr, ptr @gBS, align 8, !tbaa !15
  %54 = getelementptr inbounds i8, ptr %53, i64 32
  %55 = load ptr, ptr %54, align 8, !tbaa !30
  call void %55(i64 noundef %46) #3
  br label %65

56:                                               ; preds = %30, %28, %26, %31
  %.028.ph = phi i64 [ %40, %31 ], [ %24, %26 ], [ %24, %28 ], [ %24, %30 ]
  %57 = getelementptr inbounds i8, ptr %12, i64 16
  %58 = load ptr, ptr %57, align 8, !tbaa !19
  %.not38 = icmp eq ptr %58, null
  br i1 %.not38, label %64, label %59

59:                                               ; preds = %56
  %60 = load ptr, ptr @gBS, align 8, !tbaa !15
  %61 = getelementptr inbounds i8, ptr %60, i64 336
  %62 = load ptr, ptr %61, align 8, !tbaa !31
  %63 = call i64 (ptr, ...) %62(ptr noundef nonnull %58, ptr noundef nonnull @gEfiManagedNetworkProtocolGuid, ptr noundef nonnull %23, ptr noundef null) #3
  br label %64

64:                                               ; preds = %59, %56
  call void @FreePool(ptr noundef nonnull %12) #3
  br label %65

65:                                               ; preds = %42, %64, %14, %18, %16, %2
  %.0 = phi i64 [ -9223372036854775806, %2 ], [ -9223372036854775799, %16 ], [ -9223372036854775799, %18 ], [ -9223372036854775799, %14 ], [ %.028.ph, %64 ], [ %40, %42 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i64 %.0
}

declare void @MnpInitializeInstanceData(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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 = !{!11, !11, i64 0}
!16 = !{!17, !11, i64 328}
!17 = !{!"", !18, 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}
!18 = !{!"", !13, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!19 = !{!20, !11, i64 16}
!20 = !{!"", !7, i64 0, !11, i64 8, !11, i64 16, !10, i64 24, !21, i64 40, !8, i64 104, !8, i64 105, !10, i64 112, !22, i64 128, !10, i64 168, !10, i64 184, !13, i64 200, !23, i64 208, !8, i64 228}
!21 = !{!"_EFI_MANAGED_NETWORK_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!22 = !{!"", !10, i64 0, !10, i64 16, !13, i64 32}
!23 = !{!"", !7, i64 0, !7, i64 4, !14, i64 8, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16}
!24 = !{!17, !11, i64 280}
!25 = !{!6, !11, i64 32}
!26 = !{!27, !11, i64 40}
!27 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !11, i64 40}
!28 = !{!17, !11, i64 24}
!29 = !{!6, !13, i64 80}
!30 = !{!17, !11, i64 32}
!31 = !{!17, !11, i64 336}


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