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

; 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.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._DHCP_PROTOCOL = type { i32, %struct._EFI_DHCP4_PROTOCOL, %struct._LIST_ENTRY, ptr, ptr, i8, ptr, ptr, ptr, ptr, i32, i16, %struct.NET_BUF_QUEUE }
%struct._EFI_DHCP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.NET_BUF_QUEUE = type { i32, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i32 }
%struct._DHCP_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, ptr, ptr, %struct._LIST_ENTRY, i64, i64, i64, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, i64, ptr, ptr, ptr, %struct.EFI_MAC_ADDRESS, i8, i8, [16 x i8], ptr, %struct.EFI_DHCP4_CONFIG_DATA, i32, ptr, i32, i32, i64, i64, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.EFI_DHCP4_CONFIG_DATA = type { i32, ptr, i32, ptr, %struct.EFI_IPv4_ADDRESS, ptr, ptr, i32, ptr }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._UDP_IO = type { i32, %struct._LIST_ENTRY, i64, i8, ptr, ptr, ptr, %struct.EFI_SIMPLE_NETWORK_MODE, %struct._LIST_ENTRY, ptr, %union.anon, %union.anon.0 }
%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 }
%union.anon = type { ptr }
%union.anon.0 = type { %struct.EFI_UDP6_CONFIG_DATA }
%struct.EFI_UDP6_CONFIG_DATA = type { i8, i8, i8, i8, i8, i32, i32, %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }

@gDhcp4DriverBinding = external dso_local global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [155 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@gEfiUdp4ProtocolGuid = external global %struct.GUID, align 4
@gEfiDhcp4ProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp4ServiceBindingDestroyChild(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, 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 = load ptr, ptr @gBS, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %19, i32 0, i32 33
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gDhcp4DriverBinding, i32 0, i32 5), align 8, !tbaa !14
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call i64 %21(ptr noundef %22, ptr noundef @gEfiDhcp4ProtocolGuid, ptr noundef %8, ptr noundef %23, ptr noundef %24, i32 noundef 2)
  store i64 %25, ptr %10, align 8, !tbaa !16
  %26 = load i64, ptr %10, align 8, !tbaa !16
  %27 = icmp slt i64 %26, 0
  br i1 %27, label %28, label %29

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

29:                                               ; preds = %18
  %30 = call zeroext i8 @DebugAssertEnabled()
  %31 = zext i8 %30 to i32
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %43

33:                                               ; preds = %29
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = ptrtoint ptr %34 to i64
  %36 = sub i64 %35, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %37 = inttoptr i64 %36 to ptr
  %38 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !17
  %40 = icmp ne i32 %39, 1885562980
  br i1 %40, label %41, label %43

41:                                               ; preds = %33
  call void @DebugAssert(ptr noundef @.str, i64 noundef 667, ptr noundef @.str.2)
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  br label %48

43:                                               ; preds = %33, %29
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = ptrtoint ptr %44 to i64
  %46 = sub i64 %45, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %47 = inttoptr i64 %46 to ptr
  br label %48

48:                                               ; preds = %43, %41
  %49 = phi ptr [ %42, %41 ], [ %47, %43 ]
  store ptr %49, ptr %7, align 8, !tbaa !5
  %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 = %48
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = ptrtoint ptr %54 to i64
  %56 = sub i64 %55, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_SERVICE, ptr null, i32 0, i32 1) to i64)
  %57 = inttoptr i64 %56 to ptr
  %58 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 8, !tbaa !23
  %60 = icmp ne i32 %59, 1346586692
  br i1 %60, label %61, label %63

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

63:                                               ; preds = %53, %48
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = ptrtoint ptr %64 to i64
  %66 = sub i64 %65, ptrtoint (ptr getelementptr inbounds (%struct._DHCP_SERVICE, ptr null, i32 0, i32 1) 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 %6, align 8, !tbaa !5
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %70, i32 0, i32 4
  %72 = load ptr, ptr %71, align 8, !tbaa !28
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = icmp ne ptr %72, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %68
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %145

76:                                               ; preds = %68
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %77, i32 0, i32 5
  %79 = load i8, ptr %78, align 8, !tbaa !29
  %80 = icmp ne i8 %79, 0
  br i1 %80, label %81, label %82

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

82:                                               ; preds = %76
  %83 = load ptr, ptr @gBS, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !30
  %86 = call i64 %85(i64 noundef 8)
  store i64 %86, ptr %9, align 8, !tbaa !16
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %87, i32 0, i32 5
  store i8 1, ptr %88, align 8, !tbaa !29
  %89 = load ptr, ptr @gBS, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %89, i32 0, i32 34
  %91 = load ptr, ptr %90, align 8, !tbaa !31
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %92, i32 0, i32 20
  %94 = load ptr, ptr %93, align 8, !tbaa !32
  %95 = getelementptr inbounds %struct._UDP_IO, ptr %94, i32 0, i32 6
  %96 = load ptr, ptr %95, align 8, !tbaa !33
  %97 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gDhcp4DriverBinding, i32 0, i32 5), align 8, !tbaa !14
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = call i64 %91(ptr noundef %96, ptr noundef @gEfiUdp4ProtocolGuid, ptr noundef %97, ptr noundef %98)
  %100 = load ptr, ptr @gBS, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !36
  %103 = load i64, ptr %9, align 8, !tbaa !16
  call void %102(i64 noundef %103)
  %104 = load ptr, ptr @gBS, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %104, i32 0, i32 16
  %106 = load ptr, ptr %105, align 8, !tbaa !37
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = call i64 %106(ptr noundef %107, ptr noundef @gEfiDhcp4ProtocolGuid, ptr noundef %108)
  store i64 %109, ptr %10, align 8, !tbaa !16
  %110 = load ptr, ptr @gBS, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %110, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8, !tbaa !30
  %113 = call i64 %112(i64 noundef 8)
  store i64 %113, ptr %9, align 8, !tbaa !16
  %114 = load i64, ptr %10, align 8, !tbaa !16
  %115 = icmp slt i64 %114, 0
  br i1 %115, label %116, label %124

116:                                              ; preds = %82
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %117, i32 0, i32 5
  store i8 0, ptr %118, align 8, !tbaa !29
  %119 = load ptr, ptr @gBS, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !36
  %122 = load i64, ptr %9, align 8, !tbaa !16
  call void %121(i64 noundef %122)
  %123 = load i64, ptr %10, align 8, !tbaa !16
  store i64 %123, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %145

124:                                              ; preds = %82
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %125, i32 0, i32 27
  %127 = load ptr, ptr %126, align 8, !tbaa !38
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = icmp eq ptr %127, %128
  br i1 %129, label %130, label %132

130:                                              ; preds = %124
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  call void @DhcpYieldControl(ptr noundef %131)
  br label %132

132:                                              ; preds = %130, %124
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._DHCP_PROTOCOL, ptr %133, i32 0, i32 2
  %135 = call ptr @RemoveEntryList(ptr noundef %134)
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._DHCP_SERVICE, ptr %136, i32 0, i32 6
  %138 = load i64, ptr %137, align 8, !tbaa !39
  %139 = add i64 %138, -1
  store i64 %139, ptr %137, align 8, !tbaa !39
  %140 = load ptr, ptr @gBS, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %140, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !36
  %143 = load i64, ptr %9, align 8, !tbaa !16
  call void %142(i64 noundef %143)
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %144)
  store i64 0, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %145

145:                                              ; preds = %132, %116, %81, %75, %28, %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.start.p0(i64 immarg, ptr nocapture) #1

; 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 zeroext i8 @DebugAssertEnabled() #2

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

declare void @DhcpYieldControl(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, !6, i64 280}
!10 = !{!"", !11, 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}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 40}
!15 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !6, i64 40}
!16 = !{!12, !12, i64 0}
!17 = !{!18, !13, i64 0}
!18 = !{!"_DHCP_PROTOCOL", !13, i64 0, !19, i64 8, !20, i64 80, !6, i64 96, !6, i64 104, !7, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !13, i64 152, !21, i64 156, !22, i64 160}
!19 = !{!"_EFI_DHCP4_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, !6, i64 64}
!20 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!21 = !{!"short", !7, i64 0}
!22 = !{!"", !13, i64 0, !12, i64 8, !20, i64 16, !20, i64 32, !13, i64 48, !13, i64 52}
!23 = !{!24, !13, i64 0}
!24 = !{!"_DHCP_SERVICE", !13, i64 0, !25, i64 8, !12, i64 24, !6, i64 32, !6, i64 40, !20, i64 48, !12, i64 64, !12, i64 72, !12, i64 80, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !13, i64 132, !13, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !26, i64 176, !7, i64 208, !7, i64 209, !7, i64 210, !6, i64 232, !27, i64 240, !13, i64 312, !6, i64 320, !13, i64 328, !13, i64 332, !12, i64 336, !12, i64 344, !13, i64 352}
!25 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!26 = !{!"", !7, i64 0}
!27 = !{!"", !13, i64 0, !6, i64 8, !13, i64 16, !6, i64 24, !26, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !6, i64 64}
!28 = !{!18, !6, i64 104}
!29 = !{!18, !7, i64 112}
!30 = !{!10, !6, i64 24}
!31 = !{!10, !6, i64 288}
!32 = !{!24, !6, i64 152}
!33 = !{!34, !6, i64 56}
!34 = !{!"_UDP_IO", !13, i64 0, !20, i64 8, !12, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !35, i64 64, !20, i64 720, !6, i64 736, !7, i64 744, !7, i64 752}
!35 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !7, i64 40, !26, i64 552, !26, i64 584, !26, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!36 = !{!10, !6, i64 32}
!37 = !{!10, !6, i64 144}
!38 = !{!24, !6, i64 232}
!39 = !{!24, !12, i64 64}


; 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] }

@gDhcp4DriverBinding = external dso_local local_unnamed_addr global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@gBS = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [155 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@gEfiUdp4ProtocolGuid = external global %struct.GUID, align 4
@gEfiDhcp4ProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @Dhcp4ServiceBindingDestroyChild(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 = load ptr, ptr @gBS, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 280
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = load ptr, ptr getelementptr inbounds (i8, ptr @gDhcp4DriverBinding, i64 40), align 8, !tbaa !14
  %11 = call i64 %9(ptr noundef nonnull %1, ptr noundef nonnull @gEfiDhcp4ProtocolGuid, ptr noundef nonnull %3, ptr noundef %10, ptr noundef nonnull %1, i32 noundef 2) #3
  %12 = icmp slt i64 %11, 0
  br i1 %12, label %75, label %13

13:                                               ; preds = %6
  %14 = call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %14, 0
  %.pre = load ptr, ptr %3, align 8, !tbaa !5
  %.pre38 = ptrtoint ptr %.pre to i64
  %.pre39 = add i64 %.pre38, -8
  %.pre41 = inttoptr i64 %.pre39 to ptr
  br i1 %.not, label %._crit_edge37, label %15

15:                                               ; preds = %13
  %16 = load i32, ptr %.pre41, align 8, !tbaa !16
  %.not32 = icmp eq i32 %16, 1885562980
  br i1 %.not32, label %._crit_edge37, label %17

17:                                               ; preds = %15
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 667, ptr noundef nonnull @.str.2) #3
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  br label %._crit_edge37

._crit_edge37:                                    ; preds = %13, %15, %17
  %19 = phi ptr [ %18, %17 ], [ %.pre41, %15 ], [ %.pre41, %13 ]
  %20 = call zeroext i8 @DebugAssertEnabled() #3
  %.not33 = icmp eq i8 %20, 0
  %.pre43 = ptrtoint ptr %0 to i64
  %.pre45 = add i64 %.pre43, -8
  %.pre47 = inttoptr i64 %.pre45 to ptr
  br i1 %.not33, label %._crit_edge, label %21

21:                                               ; preds = %._crit_edge37
  %22 = load i32, ptr %.pre47, align 8, !tbaa !22
  %.not34 = icmp eq i32 %22, 1346586692
  br i1 %.not34, label %._crit_edge, label %23

23:                                               ; preds = %21
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 668, ptr noundef nonnull @.str.2) #3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge37, %21, %23
  %24 = phi ptr [ %0, %23 ], [ %.pre47, %21 ], [ %.pre47, %._crit_edge37 ]
  %25 = getelementptr inbounds i8, ptr %19, i64 104
  %26 = load ptr, ptr %25, align 8, !tbaa !27
  %.not35 = icmp eq ptr %26, %24
  br i1 %.not35, label %27, label %75

27:                                               ; preds = %._crit_edge
  %28 = getelementptr inbounds i8, ptr %19, i64 112
  %29 = load i8, ptr %28, align 8, !tbaa !28
  %.not36 = icmp eq i8 %29, 0
  br i1 %.not36, label %30, label %75

30:                                               ; preds = %27
  %31 = load ptr, ptr @gBS, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 24
  %33 = load ptr, ptr %32, align 8, !tbaa !29
  %34 = call i64 %33(i64 noundef 8) #3
  store i8 1, ptr %28, align 8, !tbaa !28
  %35 = load ptr, ptr @gBS, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 288
  %37 = load ptr, ptr %36, align 8, !tbaa !30
  %38 = getelementptr inbounds i8, ptr %24, i64 152
  %39 = load ptr, ptr %38, align 8, !tbaa !31
  %40 = getelementptr inbounds i8, ptr %39, i64 56
  %41 = load ptr, ptr %40, align 8, !tbaa !32
  %42 = load ptr, ptr getelementptr inbounds (i8, ptr @gDhcp4DriverBinding, i64 40), align 8, !tbaa !14
  %43 = call i64 %37(ptr noundef %41, ptr noundef nonnull @gEfiUdp4ProtocolGuid, ptr noundef %42, ptr noundef nonnull %1) #3
  %44 = load ptr, ptr @gBS, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 32
  %46 = load ptr, ptr %45, align 8, !tbaa !35
  call void %46(i64 noundef %34) #3
  %47 = load ptr, ptr @gBS, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 144
  %49 = load ptr, ptr %48, align 8, !tbaa !36
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = call i64 %49(ptr noundef nonnull %1, ptr noundef nonnull @gEfiDhcp4ProtocolGuid, ptr noundef %50) #3
  %52 = load ptr, ptr @gBS, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 24
  %54 = load ptr, ptr %53, align 8, !tbaa !29
  %55 = call i64 %54(i64 noundef 8) #3
  %56 = icmp slt i64 %51, 0
  br i1 %56, label %57, label %61

57:                                               ; preds = %30
  store i8 0, ptr %28, align 8, !tbaa !28
  %58 = load ptr, ptr @gBS, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 32
  %60 = load ptr, ptr %59, align 8, !tbaa !35
  call void %60(i64 noundef %55) #3
  br label %75

61:                                               ; preds = %30
  %62 = getelementptr inbounds i8, ptr %24, i64 232
  %63 = load ptr, ptr %62, align 8, !tbaa !37
  %64 = icmp eq ptr %63, %19
  br i1 %64, label %65, label %66

65:                                               ; preds = %61
  call void @DhcpYieldControl(ptr noundef nonnull %24) #3
  br label %66

66:                                               ; preds = %65, %61
  %67 = getelementptr inbounds i8, ptr %19, i64 80
  %68 = call ptr @RemoveEntryList(ptr noundef nonnull %67) #3
  %69 = getelementptr inbounds i8, ptr %24, i64 64
  %70 = load i64, ptr %69, align 8, !tbaa !38
  %71 = add i64 %70, -1
  store i64 %71, ptr %69, align 8, !tbaa !38
  %72 = load ptr, ptr @gBS, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i64 32
  %74 = load ptr, ptr %73, align 8, !tbaa !35
  call void %74(i64 noundef %55) #3
  call void @FreePool(ptr noundef nonnull %19) #3
  br label %75

75:                                               ; preds = %27, %._crit_edge, %6, %2, %66, %57
  %.0 = phi i64 [ %51, %57 ], [ 0, %66 ], [ -9223372036854775806, %2 ], [ -9223372036854775805, %6 ], [ -9223372036854775806, %._crit_edge ], [ 0, %27 ]
  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

; 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 zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

declare void @DhcpYieldControl(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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 280}
!10 = !{!"", !11, 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}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 40}
!15 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !6, i64 40}
!16 = !{!17, !13, i64 0}
!17 = !{!"_DHCP_PROTOCOL", !13, i64 0, !18, i64 8, !19, i64 80, !6, i64 96, !6, i64 104, !7, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !13, i64 152, !20, i64 156, !21, i64 160}
!18 = !{!"_EFI_DHCP4_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, !6, i64 64}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!"short", !7, i64 0}
!21 = !{!"", !13, i64 0, !12, i64 8, !19, i64 16, !19, i64 32, !13, i64 48, !13, i64 52}
!22 = !{!23, !13, i64 0}
!23 = !{!"_DHCP_SERVICE", !13, i64 0, !24, i64 8, !12, i64 24, !6, i64 32, !6, i64 40, !19, i64 48, !12, i64 64, !12, i64 72, !12, i64 80, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !13, i64 132, !13, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !25, i64 176, !7, i64 208, !7, i64 209, !7, i64 210, !6, i64 232, !26, i64 240, !13, i64 312, !6, i64 320, !13, i64 328, !13, i64 332, !12, i64 336, !12, i64 344, !13, i64 352}
!24 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!25 = !{!"", !7, i64 0}
!26 = !{!"", !13, i64 0, !6, i64 8, !13, i64 16, !6, i64 24, !25, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !6, i64 64}
!27 = !{!17, !6, i64 104}
!28 = !{!17, !7, i64 112}
!29 = !{!10, !6, i64 24}
!30 = !{!10, !6, i64 288}
!31 = !{!23, !6, i64 152}
!32 = !{!33, !6, i64 56}
!33 = !{!"_UDP_IO", !13, i64 0, !19, i64 8, !12, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !34, i64 64, !19, i64 720, !6, i64 736, !7, i64 744, !7, i64 752}
!34 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !7, i64 40, !25, i64 552, !25, i64 584, !25, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!35 = !{!10, !6, i64 32}
!36 = !{!10, !6, i64 144}
!37 = !{!23, !6, i64 232}
!38 = !{!23, !12, i64 64}


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