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

; 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
@gEfiArpProtocolGuid = external global %struct.GUID, align 4
@.str.10 = external hidden unnamed_addr constant [62 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 @ArpServiceBindingDestroyChild(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 %145

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 707, 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 = load ptr, ptr @gBS, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %39, i32 0, i32 33
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %43, i32 0, i32 3
  %45 = load ptr, ptr %44, align 8, !tbaa !23
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = call i64 %41(ptr noundef %42, ptr noundef @gEfiArpProtocolGuid, ptr noundef %9, ptr noundef %45, ptr noundef %46, i32 noundef 2)
  store i64 %47, ptr %6, align 8, !tbaa !24
  %48 = load i64, ptr %6, align 8, !tbaa !24
  %49 = icmp slt i64 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %37
  store i64 -9223372036854775805, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %145

51:                                               ; preds = %37
  %52 = call zeroext i8 @DebugAssertEnabled()
  %53 = zext i8 %52 to i32
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %65

55:                                               ; preds = %51
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = ptrtoint ptr %56 to i64
  %58 = sub i64 %57, ptrtoint (ptr getelementptr inbounds (%struct.ARP_INSTANCE_DATA, ptr null, i32 0, i32 3) to i64)
  %59 = inttoptr i64 %58 to ptr
  %60 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !25
  %62 = icmp ne i32 %61, 1230000705
  br i1 %62, label %63, label %65

63:                                               ; preds = %55
  call void @DebugAssert(ptr noundef @.str, i64 noundef 724, ptr noundef @.str.3)
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  br label %70

65:                                               ; preds = %55, %51
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = ptrtoint ptr %66 to i64
  %68 = sub i64 %67, ptrtoint (ptr getelementptr inbounds (%struct.ARP_INSTANCE_DATA, ptr null, i32 0, i32 3) to i64)
  %69 = inttoptr i64 %68 to ptr
  br label %70

70:                                               ; preds = %65, %63
  %71 = phi ptr [ %64, %63 ], [ %69, %65 ]
  store ptr %71, ptr %8, align 8, !tbaa !5
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %72, i32 0, i32 7
  %74 = load i8, ptr %73, align 1, !tbaa !29
  %75 = icmp ne i8 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %70
  store i64 0, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %145

77:                                               ; preds = %70
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %78, i32 0, i32 7
  store i8 1, ptr %79, align 1, !tbaa !29
  %80 = load ptr, ptr @gBS, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %80, i32 0, i32 34
  %82 = load ptr, ptr %81, align 8, !tbaa !30
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %83, i32 0, i32 2
  %85 = load ptr, ptr %84, align 8, !tbaa !31
  %86 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gArpDriverBinding, i32 0, i32 5), align 8, !tbaa !32
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = call i64 %82(ptr noundef %85, ptr noundef @gEfiManagedNetworkProtocolGuid, ptr noundef %86, ptr noundef %87)
  %89 = load ptr, ptr @gBS, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %89, i32 0, i32 40
  %91 = load ptr, ptr %90, align 8, !tbaa !34
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %93, i32 0, i32 3
  %95 = call i64 (ptr, ...) %91(ptr noundef %92, ptr noundef @gEfiArpProtocolGuid, ptr noundef %94, ptr noundef null)
  store i64 %95, ptr %6, align 8, !tbaa !24
  %96 = load i64, ptr %6, align 8, !tbaa !24
  %97 = icmp slt i64 %96, 0
  br i1 %97, label %98, label %117

98:                                               ; preds = %77
  br label %99

99:                                               ; preds = %98
  %100 = call zeroext i8 @DebugPrintEnabled()
  %101 = icmp ne i8 %100, 0
  br i1 %101, label %102, label %111

102:                                              ; preds = %99
  br label %103

103:                                              ; preds = %102
  %104 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %105 = icmp ne i8 %104, 0
  br i1 %105, label %106, label %108

106:                                              ; preds = %103
  %107 = load i64, ptr %6, align 8, !tbaa !24
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.10, i64 noundef %107)
  br label %108

108:                                              ; preds = %106, %103
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110, %99
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %114, i32 0, i32 7
  store i8 0, ptr %115, align 1, !tbaa !29
  %116 = load i64, ptr %6, align 8, !tbaa !24
  store i64 %116, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %145

117:                                              ; preds = %77
  %118 = load ptr, ptr @gBS, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %118, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !35
  %121 = call i64 %120(i64 noundef 8)
  store i64 %121, ptr %10, align 8, !tbaa !24
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %122, i32 0, i32 6
  %124 = load i8, ptr %123, align 8, !tbaa !36
  %125 = icmp ne i8 %124, 0
  br i1 %125, label %126, label %131

126:                                              ; preds = %117
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = call i64 @ArpDeleteCacheEntry(ptr noundef %127, i8 noundef zeroext 0, ptr noundef null, i8 noundef zeroext 1)
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = call i64 @ArpConfigureInstance(ptr noundef %129, ptr noundef null)
  br label %131

131:                                              ; preds = %126, %117
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.ARP_INSTANCE_DATA, ptr %132, i32 0, i32 4
  %134 = call ptr @RemoveEntryList(ptr noundef %133)
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._ARP_SERVICE_DATA, ptr %135, i32 0, i32 9
  %137 = load i64, ptr %136, align 8, !tbaa !37
  %138 = add i64 %137, -1
  store i64 %138, ptr %136, align 8, !tbaa !37
  %139 = load ptr, ptr @gBS, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %139, i32 0, i32 2
  %141 = load ptr, ptr %140, align 8, !tbaa !38
  %142 = load i64, ptr %10, align 8, !tbaa !24
  call void %141(i64 noundef %142)
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  call void @FreePool(ptr noundef %143)
  %144 = load i64, ptr %6, align 8, !tbaa !24
  store i64 %144, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %145

145:                                              ; preds = %131, %113, %76, %50, %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
  %146 = load i64, ptr %3, align 8
  ret i64 %146
}

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

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 i64 @ArpDeleteCacheEntry(ptr noundef, i8 noundef zeroext, ptr noundef, i8 noundef zeroext) #1

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

declare ptr @RemoveEntryList(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 280}
!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 = !{!10, !6, i64 32}
!24 = !{!16, !16, i64 0}
!25 = !{!26, !11, i64 0}
!26 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !27, i64 24, !19, i64 80, !28, i64 96, !7, i64 128, !7, i64 129}
!27 = !{!"_EFI_ARP_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!28 = !{!"", !14, i64 0, !7, i64 2, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24}
!29 = !{!26, !7, i64 129}
!30 = !{!21, !6, i64 288}
!31 = !{!10, !6, i64 24}
!32 = !{!33, !6, i64 40}
!33 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40}
!34 = !{!21, !6, i64 336}
!35 = !{!21, !6, i64 24}
!36 = !{!26, !7, i64 128}
!37 = !{!10, !16, i64 760}
!38 = !{!21, !6, i64 32}


; 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
@gEfiArpProtocolGuid = external global %struct.GUID, align 4
@.str.10 = external hidden unnamed_addr constant [62 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 @ArpServiceBindingDestroyChild(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 %67, label %6

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

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

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

._crit_edge38:                                    ; preds = %6, %8, %10
  %11 = phi ptr [ %0, %10 ], [ %.pre42, %8 ], [ %.pre42, %6 ]
  %12 = load ptr, ptr @gBS, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %12, i64 280
  %14 = load ptr, ptr %13, align 8, !tbaa !20
  %15 = getelementptr inbounds i8, ptr %11, i64 32
  %16 = load ptr, ptr %15, align 8, !tbaa !23
  %17 = call i64 %14(ptr noundef nonnull %1, ptr noundef nonnull @gEfiArpProtocolGuid, ptr noundef nonnull %3, ptr noundef %16, ptr noundef nonnull %1, i32 noundef 2) #3
  %18 = icmp slt i64 %17, 0
  br i1 %18, label %67, label %19

19:                                               ; preds = %._crit_edge38
  %20 = call zeroext i8 @DebugAssertEnabled() #3
  %.not32 = icmp eq i8 %20, 0
  %.pre = load ptr, ptr %3, align 8, !tbaa !19
  %.pre44 = ptrtoint ptr %.pre to i64
  %.pre46 = add i64 %.pre44, -24
  %.pre48 = inttoptr i64 %.pre46 to ptr
  br i1 %.not32, label %._crit_edge, label %21

21:                                               ; preds = %19
  %22 = load i32, ptr %.pre48, align 8, !tbaa !24
  %.not33 = icmp eq i32 %22, 1230000705
  br i1 %.not33, label %._crit_edge, label %23

23:                                               ; preds = %21
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 724, ptr noundef nonnull @.str.3) #3
  %24 = load ptr, ptr %3, align 8, !tbaa !19
  br label %._crit_edge

._crit_edge:                                      ; preds = %19, %21, %23
  %25 = phi ptr [ %24, %23 ], [ %.pre48, %21 ], [ %.pre48, %19 ]
  %26 = getelementptr inbounds i8, ptr %25, i64 129
  %27 = load i8, ptr %26, align 1, !tbaa !28
  %.not34 = icmp eq i8 %27, 0
  br i1 %.not34, label %28, label %67

28:                                               ; preds = %._crit_edge
  store i8 1, ptr %26, align 1, !tbaa !28
  %29 = load ptr, ptr @gBS, align 8, !tbaa !19
  %30 = getelementptr inbounds i8, ptr %29, i64 288
  %31 = load ptr, ptr %30, align 8, !tbaa !29
  %32 = getelementptr inbounds i8, ptr %11, i64 24
  %33 = load ptr, ptr %32, align 8, !tbaa !30
  %34 = load ptr, ptr getelementptr inbounds (i8, ptr @gArpDriverBinding, i64 40), align 8, !tbaa !31
  %35 = call i64 %31(ptr noundef %33, ptr noundef nonnull @gEfiManagedNetworkProtocolGuid, ptr noundef %34, ptr noundef nonnull %1) #3
  %36 = load ptr, ptr @gBS, align 8, !tbaa !19
  %37 = getelementptr inbounds i8, ptr %36, i64 336
  %38 = load ptr, ptr %37, align 8, !tbaa !33
  %39 = getelementptr inbounds i8, ptr %25, i64 24
  %40 = call i64 (ptr, ...) %38(ptr noundef nonnull %1, ptr noundef nonnull @gEfiArpProtocolGuid, ptr noundef nonnull %39, ptr noundef null) #3
  %41 = icmp slt i64 %40, 0
  br i1 %41, label %42, label %48

42:                                               ; preds = %28
  %43 = call zeroext i8 @DebugPrintEnabled() #3
  %.not36 = icmp eq i8 %43, 0
  br i1 %.not36, label %47, label %44

44:                                               ; preds = %42
  %45 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not37 = icmp eq i8 %45, 0
  br i1 %.not37, label %47, label %46

46:                                               ; preds = %44
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.10, i64 noundef %40) #3
  br label %47

47:                                               ; preds = %44, %46, %42
  store i8 0, ptr %26, align 1, !tbaa !28
  br label %67

48:                                               ; preds = %28
  %49 = load ptr, ptr @gBS, align 8, !tbaa !19
  %50 = getelementptr inbounds i8, ptr %49, i64 24
  %51 = load ptr, ptr %50, align 8, !tbaa !34
  %52 = call i64 %51(i64 noundef 8) #3
  %53 = getelementptr inbounds i8, ptr %25, i64 128
  %54 = load i8, ptr %53, align 8, !tbaa !35
  %.not35 = icmp eq i8 %54, 0
  br i1 %.not35, label %58, label %55

55:                                               ; preds = %48
  %56 = call i64 @ArpDeleteCacheEntry(ptr noundef nonnull %25, i8 noundef zeroext 0, ptr noundef null, i8 noundef zeroext 1) #3
  %57 = call i64 @ArpConfigureInstance(ptr noundef nonnull %25, ptr noundef null) #3
  br label %58

58:                                               ; preds = %55, %48
  %59 = getelementptr inbounds i8, ptr %25, i64 80
  %60 = call ptr @RemoveEntryList(ptr noundef nonnull %59) #3
  %61 = getelementptr inbounds i8, ptr %11, i64 760
  %62 = load i64, ptr %61, align 8, !tbaa !36
  %63 = add i64 %62, -1
  store i64 %63, ptr %61, align 8, !tbaa !36
  %64 = load ptr, ptr @gBS, align 8, !tbaa !19
  %65 = getelementptr inbounds i8, ptr %64, i64 32
  %66 = load ptr, ptr %65, align 8, !tbaa !37
  call void %66(i64 noundef %52) #3
  call void @FreePool(ptr noundef nonnull %25) #3
  br label %67

67:                                               ; preds = %._crit_edge, %._crit_edge38, %2, %58, %47
  %.0 = phi i64 [ %40, %47 ], [ %40, %58 ], [ -9223372036854775806, %2 ], [ -9223372036854775805, %._crit_edge38 ], [ 0, %._crit_edge ]
  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 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 i64 @ArpDeleteCacheEntry(ptr noundef, i8 noundef zeroext, ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

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

declare ptr @RemoveEntryList(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 280}
!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 = !{!6, !11, i64 32}
!24 = !{!25, !7, i64 0}
!25 = !{!"", !7, i64 0, !11, i64 8, !11, i64 16, !26, i64 24, !18, i64 80, !27, i64 96, !8, i64 128, !8, i64 129}
!26 = !{!"_EFI_ARP_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!27 = !{!"", !13, i64 0, !8, i64 2, !11, i64 8, !7, i64 16, !7, i64 20, !7, i64 24}
!28 = !{!25, !8, i64 129}
!29 = !{!21, !11, i64 288}
!30 = !{!6, !11, i64 24}
!31 = !{!32, !11, i64 40}
!32 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !11, i64 40}
!33 = !{!21, !11, i64 336}
!34 = !{!21, !11, i64 24}
!35 = !{!25, !8, i64 128}
!36 = !{!6, !15, i64 760}
!37 = !{!21, !11, i64 32}


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