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

; 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._ARP_SERVICE_DATA = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, %struct.EFI_SIMPLE_NETWORK_MODE, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%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._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.ARP_INSTANCE_DATA = type { i32, ptr, ptr, %struct._EFI_ARP_PROTOCOL, %struct._LIST_ENTRY, %struct.EFI_ARP_CONFIG_DATA, i8, i8 }
%struct._EFI_ARP_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_ARP_CONFIG_DATA = type { i16, i8, ptr, i32, i32, i32 }

@gArpDriverBinding = external dso_local global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@.str = external hidden unnamed_addr constant [151 x i8], align 1
@gBS = external global ptr, align 8
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [59 x i8], align 1
@gEfiArpProtocolGuid = external global %struct.GUID, align 4
@.str.9 = external hidden unnamed_addr constant [54 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: nounwind uwtable
define dso_local i64 @ArpServiceBindingCreateChild(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 %151

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._ARP_SERVICE_DATA, ptr null, i32 0, i32 1) to i64)
  %26 = inttoptr i64 %25 to ptr
  %27 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !9
  %29 = icmp ne i32 %28, 1397772865
  br i1 %29, label %30, label %32

30:                                               ; preds = %22
  call void @DebugAssert(ptr noundef @.str, i64 noundef 580, ptr noundef @.str.3)
  %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._ARP_SERVICE_DATA, ptr null, i32 0, i32 1) 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 136)
  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.8)
  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 %151

57:                                               ; preds = %37
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ArpInitInstance(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 !20
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %64, i32 0, i32 3
  %66 = call i64 (ptr, ...) %62(ptr noundef %63, ptr noundef @gEfiArpProtocolGuid, ptr noundef %65, ptr noundef null)
  store i64 %66, ptr %6, align 8, !tbaa !23
  %67 = load i64, ptr %6, align 8, !tbaa !23
  %68 = icmp slt i64 %67, 0
  br i1 %68, label %69, label %87

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 !23
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.9, 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
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  call void @FreePool(ptr noundef %85)
  %86 = load i64, ptr %6, align 8, !tbaa !23
  store i64 %86, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %151

87:                                               ; preds = %57
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %90, i32 0, i32 2
  store ptr %89, ptr %91, align 8, !tbaa !24
  %92 = load ptr, ptr @gBS, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %92, i32 0, i32 33
  %94 = load ptr, ptr %93, align 8, !tbaa !28
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !29
  %98 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gArpDriverBinding, i32 0, i32 5), align 8, !tbaa !30
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !24
  %102 = call i64 %94(ptr noundef %97, ptr noundef @gEfiManagedNetworkProtocolGuid, ptr noundef %9, ptr noundef %98, ptr noundef %101, i32 noundef 8)
  store i64 %102, ptr %6, align 8, !tbaa !23
  %103 = load i64, ptr %6, align 8, !tbaa !23
  %104 = icmp slt i64 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %87
  br label %124

106:                                              ; preds = %87
  %107 = load ptr, ptr @gBS, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %107, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8, !tbaa !32
  %110 = call i64 %109(i64 noundef 8)
  store i64 %110, ptr %10, align 8, !tbaa !23
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %111, i32 0, i32 10
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %113, i32 0, i32 4
  %115 = call ptr @InsertTailList(ptr noundef %112, ptr noundef %114)
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %116, i32 0, i32 9
  %118 = load i64, ptr %117, align 8, !tbaa !33
  %119 = add i64 %118, 1
  store i64 %119, ptr %117, align 8, !tbaa !33
  %120 = load ptr, ptr @gBS, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %120, i32 0, i32 2
  %122 = load ptr, ptr %121, align 8, !tbaa !34
  %123 = load i64, ptr %10, align 8, !tbaa !23
  call void %122(i64 noundef %123)
  br label %124

124:                                              ; preds = %106, %105
  %125 = load i64, ptr %6, align 8, !tbaa !23
  %126 = icmp slt i64 %125, 0
  br i1 %126, label %127, label %149

127:                                              ; preds = %124
  %128 = load ptr, ptr @gBS, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %128, i32 0, i32 34
  %130 = load ptr, ptr %129, align 8, !tbaa !35
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %131, i32 0, i32 2
  %133 = load ptr, ptr %132, align 8, !tbaa !29
  %134 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gArpDriverBinding, i32 0, i32 5), align 8, !tbaa !30
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %135, i32 0, i32 2
  %137 = load ptr, ptr %136, align 8, !tbaa !24
  %138 = call i64 %130(ptr noundef %133, ptr noundef @gEfiManagedNetworkProtocolGuid, ptr noundef %134, ptr noundef %137)
  %139 = load ptr, ptr @gBS, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %139, i32 0, i32 40
  %141 = load ptr, ptr %140, align 8, !tbaa !36
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %142, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !24
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %145, i32 0, i32 3
  %147 = call i64 (ptr, ...) %141(ptr noundef %144, ptr noundef @gEfiArpProtocolGuid, ptr noundef %146, ptr noundef null)
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  call void @FreePool(ptr noundef %148)
  br label %149

149:                                              ; preds = %127, %124
  %150 = load i64, ptr %6, align 8, !tbaa !23
  store i64 %150, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %151

151:                                              ; preds = %149, %84, %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
  %152 = load i64, ptr %3, align 8
  ret i64 %152
}

; 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 void @FreePool(ptr noundef) #1

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

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

declare void @ArpInitInstance(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 = !{!"_ARP_SERVICE_DATA", !11, i64 0, !12, i64 8, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !15, i64 80, !17, i64 104, !16, i64 760, !19, i64 768, !19, i64 784, !19, i64 800, !19, i64 816, !6, i64 832}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!13 = !{!"", !11, i64 0, !11, i64 4, !14, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!14 = !{!"short", !7, i64 0}
!15 = !{!"", !6, i64 0, !16, i64 8, !7, i64 16}
!16 = !{!"long long", !7, i64 0}
!17 = !{!"", !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, !18, i64 552, !18, i64 584, !18, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!18 = !{!"", !7, i64 0}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!21, !6, i64 328}
!21 = !{!"", !22, 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}
!22 = !{!"", !16, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!23 = !{!16, !16, i64 0}
!24 = !{!25, !6, i64 16}
!25 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !26, i64 24, !19, i64 80, !27, i64 96, !7, i64 128, !7, i64 129}
!26 = !{!"_EFI_ARP_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!27 = !{!"", !14, i64 0, !7, i64 2, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24}
!28 = !{!21, !6, i64 280}
!29 = !{!10, !6, i64 24}
!30 = !{!31, !6, i64 40}
!31 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40}
!32 = !{!21, !6, i64 24}
!33 = !{!10, !16, i64 760}
!34 = !{!21, !6, i64 32}
!35 = !{!21, !6, i64 288}
!36 = !{!21, !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] }

@gArpDriverBinding = 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
@gBS = external local_unnamed_addr global ptr, align 8
@gEfiManagedNetworkProtocolGuid = external global %struct.GUID, align 4
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [59 x i8], align 1
@gEfiArpProtocolGuid = external global %struct.GUID, align 4
@.str.9 = external hidden unnamed_addr constant [54 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: nounwind uwtable
define dso_local i64 @ArpServiceBindingCreateChild(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 %68, label %6

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

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

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

._crit_edge:                                      ; preds = %6, %8, %10
  %11 = phi ptr [ %0, %10 ], [ %.pre42, %8 ], [ %.pre42, %6 ]
  %12 = tail call ptr @AllocateZeroPool(i64 noundef 136) #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
  %.not38 = icmp eq i8 %15, 0
  br i1 %.not38, label %68, label %16

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

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

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

26:                                               ; preds = %19
  %27 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not36 = icmp eq i8 %27, 0
  br i1 %.not36, label %31, 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 %31, label %30

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

31:                                               ; preds = %28, %30, %26
  tail call void @FreePool(ptr noundef nonnull %12) #3
  br label %68

32:                                               ; preds = %19
  %33 = load ptr, ptr %1, align 8, !tbaa !19
  %34 = getelementptr inbounds i8, ptr %12, i64 16
  store ptr %33, ptr %34, align 8, !tbaa !23
  %35 = load ptr, ptr @gBS, align 8, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %35, i64 280
  %37 = load ptr, ptr %36, align 8, !tbaa !27
  %38 = getelementptr inbounds i8, ptr %11, i64 24
  %39 = load ptr, ptr %38, align 8, !tbaa !28
  %40 = load ptr, ptr getelementptr inbounds (i8, ptr @gArpDriverBinding, i64 40), align 8, !tbaa !29
  %41 = call i64 %37(ptr noundef %39, ptr noundef nonnull @gEfiManagedNetworkProtocolGuid, ptr noundef nonnull %3, ptr noundef %40, ptr noundef %33, i32 noundef 8) #3
  %42 = icmp slt i64 %41, 0
  %43 = load ptr, ptr @gBS, align 8, !tbaa !19
  br i1 %42, label %.critedge, label %44

44:                                               ; preds = %32
  %45 = getelementptr inbounds i8, ptr %43, i64 24
  %46 = load ptr, ptr %45, align 8, !tbaa !31
  %47 = call i64 %46(i64 noundef 8) #3
  %48 = getelementptr inbounds i8, ptr %11, i64 768
  %49 = getelementptr inbounds i8, ptr %12, i64 80
  %50 = call ptr @InsertTailList(ptr noundef nonnull %48, ptr noundef nonnull %49) #3
  %51 = getelementptr inbounds i8, ptr %11, i64 760
  %52 = load i64, ptr %51, align 8, !tbaa !32
  %53 = add i64 %52, 1
  store i64 %53, ptr %51, align 8, !tbaa !32
  %54 = load ptr, ptr @gBS, align 8, !tbaa !19
  %55 = getelementptr inbounds i8, ptr %54, i64 32
  %56 = load ptr, ptr %55, align 8, !tbaa !33
  call void %56(i64 noundef %47) #3
  br label %68

.critedge:                                        ; preds = %32
  %57 = getelementptr inbounds i8, ptr %43, i64 288
  %58 = load ptr, ptr %57, align 8, !tbaa !34
  %59 = load ptr, ptr %38, align 8, !tbaa !28
  %60 = load ptr, ptr getelementptr inbounds (i8, ptr @gArpDriverBinding, i64 40), align 8, !tbaa !29
  %61 = load ptr, ptr %34, align 8, !tbaa !23
  %62 = call i64 %58(ptr noundef %59, ptr noundef nonnull @gEfiManagedNetworkProtocolGuid, ptr noundef %60, ptr noundef %61) #3
  %63 = load ptr, ptr @gBS, align 8, !tbaa !19
  %64 = getelementptr inbounds i8, ptr %63, i64 336
  %65 = load ptr, ptr %64, align 8, !tbaa !35
  %66 = load ptr, ptr %34, align 8, !tbaa !23
  %67 = call i64 (ptr, ...) %65(ptr noundef %66, ptr noundef nonnull @gEfiArpProtocolGuid, ptr noundef nonnull %23, ptr noundef null) #3
  call void @FreePool(ptr noundef nonnull %12) #3
  br label %68

68:                                               ; preds = %44, %.critedge, %14, %18, %16, %2, %31
  %.0 = phi i64 [ %24, %31 ], [ -9223372036854775806, %2 ], [ -9223372036854775799, %16 ], [ -9223372036854775799, %18 ], [ -9223372036854775799, %14 ], [ %41, %.critedge ], [ %41, %44 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i64 %.0
}

; 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 void @FreePool(ptr 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 @ArpInitInstance(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 = !{!"_ARP_SERVICE_DATA", !7, i64 0, !10, i64 8, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !14, i64 80, !16, i64 104, !15, i64 760, !18, i64 768, !18, i64 784, !18, i64 800, !18, i64 816, !11, i64 832}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"", !7, i64 0, !7, i64 4, !13, i64 8, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16}
!13 = !{!"short", !8, i64 0}
!14 = !{!"", !11, i64 0, !15, i64 8, !8, i64 16}
!15 = !{!"long long", !8, i64 0}
!16 = !{!"", !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, !17, i64 552, !17, i64 584, !17, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!17 = !{!"", !8, i64 0}
!18 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!19 = !{!11, !11, i64 0}
!20 = !{!21, !11, i64 328}
!21 = !{!"", !22, 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}
!22 = !{!"", !15, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!23 = !{!24, !11, i64 16}
!24 = !{!"", !7, i64 0, !11, i64 8, !11, i64 16, !25, i64 24, !18, i64 80, !26, i64 96, !8, i64 128, !8, i64 129}
!25 = !{!"_EFI_ARP_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!26 = !{!"", !13, i64 0, !8, i64 2, !11, i64 8, !7, i64 16, !7, i64 20, !7, i64 24}
!27 = !{!21, !11, i64 280}
!28 = !{!6, !11, i64 24}
!29 = !{!30, !11, i64 40}
!30 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !11, i64 40}
!31 = !{!21, !11, i64 24}
!32 = !{!6, !15, i64 760}
!33 = !{!21, !11, i64 32}
!34 = !{!21, !11, i64 288}
!35 = !{!21, !11, i64 336}


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