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

; 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._UDP4_SERVICE_DATA_ = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, ptr, %struct._LIST_ENTRY, i64, ptr, ptr }
%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._UDP4_INSTANCE_DATA_ = type { i32, %struct._LIST_ENTRY, ptr, %struct._EFI_UDP4_PROTOCOL, %struct.EFI_UDP4_CONFIG_DATA, ptr, i8, i8, %struct.NET_MAP, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i16, i64, ptr, i8 }
%struct._EFI_UDP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_UDP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct._IP_IO = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, ptr, %union.IP_IO_IP_PROTOCOL, i8, i8, %union.IP_IO_IP_COMPLETION_TOKEN, %struct._LIST_ENTRY, ptr, ptr, ptr, ptr, i8 }
%union.IP_IO_IP_PROTOCOL = type { ptr }
%union.IP_IO_IP_COMPLETION_TOKEN = type { %struct.EFI_IP4_COMPLETION_TOKEN }
%struct.EFI_IP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%struct._IP_IO_IP_INFO = type { %union.EFI_IP_ADDRESS, %union.IP_IO_IP_MASK, %struct._LIST_ENTRY, ptr, %union.IP_IO_IP_PROTOCOL, %union.IP_IO_IP_COMPLETION_TOKEN, i64, i8 }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%union.IP_IO_IP_MASK = type { i32 }

@gUdp4DriverBinding = external dso_local global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@.str = external hidden unnamed_addr constant [153 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@gEfiIp4ProtocolGuid = external global %struct.GUID, align 4
@gEfiUdp4ProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local i64 @Udp4ServiceBindingDestroyChild(ptr noundef %0, ptr noundef %1) #0 {
  %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 %146

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

30:                                               ; preds = %22
  call void @DebugAssert(ptr noundef @.str, i64 noundef 455, 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._UDP4_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 !15
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gUdp4DriverBinding, i32 0, i32 5), align 8, !tbaa !18
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = call i64 %41(ptr noundef %42, ptr noundef @gEfiUdp4ProtocolGuid, ptr noundef %8, ptr noundef %43, ptr noundef %44, i32 noundef 2)
  store i64 %45, ptr %6, align 8, !tbaa !20
  %46 = load i64, ptr %6, align 8, !tbaa !20
  %47 = icmp slt i64 %46, 0
  br i1 %47, label %48, label %49

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

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

53:                                               ; preds = %49
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = ptrtoint ptr %54 to i64
  %56 = sub i64 %55, ptrtoint (ptr getelementptr inbounds (%struct._UDP4_INSTANCE_DATA_, ptr null, i32 0, i32 3) to i64)
  %57 = inttoptr i64 %56 to ptr
  %58 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 8, !tbaa !21
  %60 = icmp ne i32 %59, 1232102485
  br i1 %60, label %61, label %63

61:                                               ; preds = %53
  call void @DebugAssert(ptr noundef @.str, i64 noundef 472, ptr noundef @.str.1)
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  br label %68

63:                                               ; preds = %53, %49
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = ptrtoint ptr %64 to i64
  %66 = sub i64 %65, ptrtoint (ptr getelementptr inbounds (%struct._UDP4_INSTANCE_DATA_, ptr null, i32 0, i32 3) to i64)
  %67 = inttoptr i64 %66 to ptr
  br label %68

68:                                               ; preds = %63, %61
  %69 = phi ptr [ %62, %61 ], [ %67, %63 ]
  store ptr %69, ptr %9, align 8, !tbaa !5
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %70, i32 0, i32 16
  %72 = load i8, ptr %71, align 8, !tbaa !28
  %73 = icmp ne i8 %72, 0
  br i1 %73, label %74, label %75

74:                                               ; preds = %68
  store i64 0, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %146

75:                                               ; preds = %68
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %76, i32 0, i32 16
  store i8 1, ptr %77, align 8, !tbaa !28
  %78 = load ptr, ptr @gBS, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %78, i32 0, i32 34
  %80 = load ptr, ptr %79, align 8, !tbaa !29
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._UDP4_SERVICE_DATA_, ptr %81, i32 0, i32 6
  %83 = load ptr, ptr %82, align 8, !tbaa !30
  %84 = getelementptr inbounds %struct._IP_IO, ptr %83, i32 0, i32 4
  %85 = load ptr, ptr %84, align 8, !tbaa !31
  %86 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gUdp4DriverBinding, i32 0, i32 5), align 8, !tbaa !18
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %87, i32 0, i32 5
  %89 = load ptr, ptr %88, align 8, !tbaa !33
  %90 = call i64 %80(ptr noundef %85, ptr noundef @gEfiIp4ProtocolGuid, ptr noundef %86, ptr noundef %89)
  %91 = load ptr, ptr @gBS, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %91, i32 0, i32 34
  %93 = load ptr, ptr %92, align 8, !tbaa !29
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %94, i32 0, i32 15
  %96 = load ptr, ptr %95, align 8, !tbaa !34
  %97 = getelementptr inbounds %struct._IP_IO_IP_INFO, ptr %96, i32 0, i32 3
  %98 = load ptr, ptr %97, align 8, !tbaa !35
  %99 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gUdp4DriverBinding, i32 0, i32 5), align 8, !tbaa !18
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %100, i32 0, i32 5
  %102 = load ptr, ptr %101, align 8, !tbaa !33
  %103 = call i64 %93(ptr noundef %98, ptr noundef @gEfiIp4ProtocolGuid, ptr noundef %99, ptr noundef %102)
  %104 = load ptr, ptr @gBS, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %104, i32 0, i32 40
  %106 = load ptr, ptr %105, align 8, !tbaa !37
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %108, i32 0, i32 3
  %110 = call i64 (ptr, ...) %106(ptr noundef %107, ptr noundef @gEfiUdp4ProtocolGuid, ptr noundef %109, ptr noundef null)
  store i64 %110, ptr %6, align 8, !tbaa !20
  %111 = load i64, ptr %6, align 8, !tbaa !20
  %112 = icmp slt i64 %111, 0
  br i1 %112, label %113, label %117

113:                                              ; preds = %75
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %114, i32 0, i32 16
  store i8 0, ptr %115, align 8, !tbaa !28
  %116 = load i64, ptr %6, align 8, !tbaa !20
  store i64 %116, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %146

117:                                              ; preds = %75
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._EFI_UDP4_PROTOCOL, ptr %118, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !38
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = call i64 %120(ptr noundef %121, ptr noundef null)
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._UDP4_SERVICE_DATA_, ptr %123, i32 0, i32 6
  %125 = load ptr, ptr %124, align 8, !tbaa !30
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %126, i32 0, i32 15
  %128 = load ptr, ptr %127, align 8, !tbaa !34
  call void @IpIoRemoveIp(ptr noundef %125, ptr noundef %128)
  %129 = load ptr, ptr @gBS, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %129, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !39
  %132 = call i64 %131(i64 noundef 8)
  store i64 %132, ptr %10, align 8, !tbaa !20
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._UDP4_INSTANCE_DATA_, ptr %133, i32 0, i32 1
  %135 = call ptr @RemoveEntryList(ptr noundef %134)
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._UDP4_SERVICE_DATA_, ptr %136, i32 0, i32 5
  %138 = load i64, ptr %137, align 8, !tbaa !40
  %139 = add i64 %138, -1
  store i64 %139, ptr %137, align 8, !tbaa !40
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  call void @Udp4CleanInstance(ptr noundef %140)
  %141 = load ptr, ptr @gBS, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %141, i32 0, i32 2
  %143 = load ptr, ptr %142, align 8, !tbaa !41
  %144 = load i64, ptr %10, align 8, !tbaa !20
  call void %143(i64 noundef %144)
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  call void @FreePool(ptr noundef %145)
  store i64 0, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %146

146:                                              ; preds = %117, %113, %74, %48, %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
  %147 = load i64, ptr %3, align 8
  ret i64 %147
}

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

declare void @FreePool(ptr noundef) #2

declare void @IpIoRemoveIp(ptr noundef, ptr noundef) #2

declare void @Udp4CleanInstance(ptr noundef) #2

declare ptr @RemoveEntryList(ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_UDP4_SERVICE_DATA_", !11, i64 0, !12, i64 8, !6, i64 24, !6, i64 32, !13, i64 40, !14, i64 56, !6, i64 64, !6, i64 72}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!"long long", !7, i64 0}
!15 = !{!16, !6, i64 280}
!16 = !{!"", !17, 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}
!17 = !{!"", !14, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!18 = !{!19, !6, i64 40}
!19 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40}
!20 = !{!14, !14, i64 0}
!21 = !{!22, !11, i64 0}
!22 = !{!"_UDP4_INSTANCE_DATA_", !11, i64 0, !13, i64 8, !6, i64 24, !23, i64 32, !24, i64 96, !6, i64 136, !7, i64 144, !7, i64 145, !27, i64 152, !27, i64 192, !27, i64 232, !13, i64 272, !13, i64 288, !26, i64 304, !14, i64 312, !6, i64 320, !7, i64 328}
!23 = !{!"_EFI_UDP4_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}
!24 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !11, i64 8, !11, i64 12, !7, i64 16, !25, i64 17, !25, i64 21, !26, i64 26, !25, i64 28, !26, i64 32}
!25 = !{!"", !7, i64 0}
!26 = !{!"short", !7, i64 0}
!27 = !{!"", !13, i64 0, !13, i64 16, !14, i64 32}
!28 = !{!22, !7, i64 328}
!29 = !{!16, !6, i64 288}
!30 = !{!10, !6, i64 64}
!31 = !{!32, !6, i64 48}
!32 = !{!"_IP_IO", !13, i64 0, !13, i64 16, !6, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !7, i64 64, !7, i64 65, !7, i64 72, !13, i64 96, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !7, i64 144}
!33 = !{!22, !6, i64 136}
!34 = !{!22, !6, i64 320}
!35 = !{!36, !6, i64 40}
!36 = !{!"_IP_IO_IP_INFO", !7, i64 0, !7, i64 16, !13, i64 24, !6, i64 40, !7, i64 48, !7, i64 56, !14, i64 80, !7, i64 88}
!37 = !{!16, !6, i64 336}
!38 = !{!23, !6, i64 8}
!39 = !{!16, !6, i64 24}
!40 = !{!10, !14, i64 56}
!41 = !{!16, !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] }

@gUdp4DriverBinding = external dso_local local_unnamed_addr global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@.str = external hidden unnamed_addr constant [153 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
@gEfiIp4ProtocolGuid = external global %struct.GUID, align 4
@gEfiUdp4ProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @Udp4ServiceBindingDestroyChild(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %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 %75, label %6

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

8:                                                ; preds = %6
  %9 = load i32, ptr %.pre38, align 8, !tbaa !5
  %.not30 = icmp eq i32 %9, 879780949
  br i1 %.not30, label %._crit_edge34, label %10

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

._crit_edge34:                                    ; preds = %6, %8, %10
  %11 = phi ptr [ %0, %10 ], [ %.pre38, %8 ], [ %.pre38, %6 ]
  %12 = load ptr, ptr @gBS, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %12, i64 280
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @gUdp4DriverBinding, i64 40), align 8, !tbaa !18
  %16 = call i64 %14(ptr noundef nonnull %1, ptr noundef nonnull @gEfiUdp4ProtocolGuid, ptr noundef nonnull %3, ptr noundef %15, ptr noundef nonnull %1, i32 noundef 2) #3
  %17 = icmp slt i64 %16, 0
  br i1 %17, label %75, label %18

18:                                               ; preds = %._crit_edge34
  %19 = call zeroext i8 @DebugAssertEnabled() #3
  %.not31 = icmp eq i8 %19, 0
  %.pre = load ptr, ptr %3, align 8, !tbaa !14
  %.pre40 = ptrtoint ptr %.pre to i64
  %.pre42 = add i64 %.pre40, -32
  %.pre44 = inttoptr i64 %.pre42 to ptr
  br i1 %.not31, label %._crit_edge, label %20

20:                                               ; preds = %18
  %21 = load i32, ptr %.pre44, align 8, !tbaa !20
  %.not32 = icmp eq i32 %21, 1232102485
  br i1 %.not32, label %._crit_edge, label %22

22:                                               ; preds = %20
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 472, ptr noundef nonnull @.str.1) #3
  %23 = load ptr, ptr %3, align 8, !tbaa !14
  br label %._crit_edge

._crit_edge:                                      ; preds = %18, %20, %22
  %24 = phi ptr [ %23, %22 ], [ %.pre44, %20 ], [ %.pre44, %18 ]
  %25 = getelementptr inbounds i8, ptr %24, i64 328
  %26 = load i8, ptr %25, align 8, !tbaa !27
  %.not33 = icmp eq i8 %26, 0
  br i1 %.not33, label %27, label %75

27:                                               ; preds = %._crit_edge
  store i8 1, ptr %25, align 8, !tbaa !27
  %28 = load ptr, ptr @gBS, align 8, !tbaa !14
  %29 = getelementptr inbounds i8, ptr %28, i64 288
  %30 = load ptr, ptr %29, align 8, !tbaa !28
  %31 = getelementptr inbounds i8, ptr %11, i64 64
  %32 = load ptr, ptr %31, align 8, !tbaa !29
  %33 = getelementptr inbounds i8, ptr %32, i64 48
  %34 = load ptr, ptr %33, align 8, !tbaa !30
  %35 = load ptr, ptr getelementptr inbounds (i8, ptr @gUdp4DriverBinding, i64 40), align 8, !tbaa !18
  %36 = getelementptr inbounds i8, ptr %24, i64 136
  %37 = load ptr, ptr %36, align 8, !tbaa !32
  %38 = call i64 %30(ptr noundef %34, ptr noundef nonnull @gEfiIp4ProtocolGuid, ptr noundef %35, ptr noundef %37) #3
  %39 = load ptr, ptr @gBS, align 8, !tbaa !14
  %40 = getelementptr inbounds i8, ptr %39, i64 288
  %41 = load ptr, ptr %40, align 8, !tbaa !28
  %42 = getelementptr inbounds i8, ptr %24, i64 320
  %43 = load ptr, ptr %42, align 8, !tbaa !33
  %44 = getelementptr inbounds i8, ptr %43, i64 40
  %45 = load ptr, ptr %44, align 8, !tbaa !34
  %46 = load ptr, ptr getelementptr inbounds (i8, ptr @gUdp4DriverBinding, i64 40), align 8, !tbaa !18
  %47 = load ptr, ptr %36, align 8, !tbaa !32
  %48 = call i64 %41(ptr noundef %45, ptr noundef nonnull @gEfiIp4ProtocolGuid, ptr noundef %46, ptr noundef %47) #3
  %49 = load ptr, ptr @gBS, align 8, !tbaa !14
  %50 = getelementptr inbounds i8, ptr %49, i64 336
  %51 = load ptr, ptr %50, align 8, !tbaa !36
  %52 = getelementptr inbounds i8, ptr %24, i64 32
  %53 = call i64 (ptr, ...) %51(ptr noundef nonnull %1, ptr noundef nonnull @gEfiUdp4ProtocolGuid, ptr noundef nonnull %52, ptr noundef null) #3
  %54 = icmp slt i64 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %27
  store i8 0, ptr %25, align 8, !tbaa !27
  br label %75

56:                                               ; preds = %27
  %57 = load ptr, ptr %3, align 8, !tbaa !14
  %58 = getelementptr inbounds i8, ptr %57, i64 8
  %59 = load ptr, ptr %58, align 8, !tbaa !37
  %60 = call i64 %59(ptr noundef %57, ptr noundef null) #3
  %61 = load ptr, ptr %31, align 8, !tbaa !29
  %62 = load ptr, ptr %42, align 8, !tbaa !33
  call void @IpIoRemoveIp(ptr noundef %61, ptr noundef %62) #3
  %63 = load ptr, ptr @gBS, align 8, !tbaa !14
  %64 = getelementptr inbounds i8, ptr %63, i64 24
  %65 = load ptr, ptr %64, align 8, !tbaa !38
  %66 = call i64 %65(i64 noundef 8) #3
  %67 = getelementptr inbounds i8, ptr %24, i64 8
  %68 = call ptr @RemoveEntryList(ptr noundef nonnull %67) #3
  %69 = getelementptr inbounds i8, ptr %11, i64 56
  %70 = load i64, ptr %69, align 8, !tbaa !39
  %71 = add i64 %70, -1
  store i64 %71, ptr %69, align 8, !tbaa !39
  call void @Udp4CleanInstance(ptr noundef nonnull %24) #3
  %72 = load ptr, ptr @gBS, align 8, !tbaa !14
  %73 = getelementptr inbounds i8, ptr %72, i64 32
  %74 = load ptr, ptr %73, align 8, !tbaa !40
  call void %74(i64 noundef %66) #3
  call void @FreePool(ptr noundef nonnull %24) #3
  br label %75

75:                                               ; preds = %._crit_edge, %._crit_edge34, %2, %56, %55
  %.0 = phi i64 [ %53, %55 ], [ 0, %56 ], [ -9223372036854775806, %2 ], [ -9223372036854775805, %._crit_edge34 ], [ 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.start.p0(i64 immarg, ptr nocapture) #1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

declare void @FreePool(ptr noundef) local_unnamed_addr #2

declare void @IpIoRemoveIp(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @Udp4CleanInstance(ptr noundef) local_unnamed_addr #2

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_UDP4_SERVICE_DATA_", !7, i64 0, !10, i64 8, !11, i64 24, !11, i64 32, !12, i64 40, !13, i64 56, !11, i64 64, !11, i64 72}
!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 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!13 = !{!"long long", !8, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !11, i64 280}
!16 = !{!"", !17, 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}
!17 = !{!"", !13, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!18 = !{!19, !11, i64 40}
!19 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !11, i64 40}
!20 = !{!21, !7, i64 0}
!21 = !{!"_UDP4_INSTANCE_DATA_", !7, i64 0, !12, i64 8, !11, i64 24, !22, i64 32, !23, i64 96, !11, i64 136, !8, i64 144, !8, i64 145, !26, i64 152, !26, i64 192, !26, i64 232, !12, i64 272, !12, i64 288, !25, i64 304, !13, i64 312, !11, i64 320, !8, i64 328}
!22 = !{!"_EFI_UDP4_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}
!23 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !7, i64 8, !7, i64 12, !8, i64 16, !24, i64 17, !24, i64 21, !25, i64 26, !24, i64 28, !25, i64 32}
!24 = !{!"", !8, i64 0}
!25 = !{!"short", !8, i64 0}
!26 = !{!"", !12, i64 0, !12, i64 16, !13, i64 32}
!27 = !{!21, !8, i64 328}
!28 = !{!16, !11, i64 288}
!29 = !{!6, !11, i64 64}
!30 = !{!31, !11, i64 48}
!31 = !{!"_IP_IO", !12, i64 0, !12, i64 16, !11, i64 32, !11, i64 40, !11, i64 48, !8, i64 56, !8, i64 64, !8, i64 65, !8, i64 72, !12, i64 96, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !8, i64 144}
!32 = !{!21, !11, i64 136}
!33 = !{!21, !11, i64 320}
!34 = !{!35, !11, i64 40}
!35 = !{!"_IP_IO_IP_INFO", !8, i64 0, !8, i64 16, !12, i64 24, !11, i64 40, !8, i64 48, !8, i64 56, !13, i64 80, !8, i64 88}
!36 = !{!16, !11, i64 336}
!37 = !{!22, !11, i64 8}
!38 = !{!16, !11, i64 24}
!39 = !{!6, !13, i64 56}
!40 = !{!16, !11, i64 32}


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