; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe (Dhcp6ServiceBindingDestroyChild)

; 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._DHCP6_INSTANCE = type { i32, ptr, ptr, %struct._LIST_ENTRY, %struct._EFI_DHCP6_PROTOCOL, ptr, ptr, ptr, %struct._DHCP6_IA_CB, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, i8, ptr, i64, i8, i8, i64 }
%struct._EFI_DHCP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._DHCP6_IA_CB = type { ptr, i32, i32, i32, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct._DHCP6_SERVICE = type { i32, ptr, ptr, %struct._EFI_SERVICE_BINDING_PROTOCOL, ptr, ptr, ptr, ptr, i32, %struct._LIST_ENTRY, i64 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%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 }
%struct.EFI_MAC_ADDRESS = type { [32 x 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] }

@gDhcp6DriverBinding = external dso_local global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@.str = external hidden unnamed_addr constant [135 x i8], align 1
@gBS = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@gEfiUdp6ProtocolGuid = external global %struct.GUID, align 4
@gEfiDhcp6ProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6ServiceBindingDestroyChild(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 i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, 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 %148

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 @gDhcp6DriverBinding, 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 @gEfiDhcp6ProtocolGuid, ptr noundef %8, ptr noundef %23, ptr noundef %24, i32 noundef 2)
  store i64 %25, ptr %6, align 8, !tbaa !16
  %26 = load i64, ptr %6, 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 %148

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._DHCP6_INSTANCE, ptr null, i32 0, i32 4) to i64)
  %37 = inttoptr i64 %36 to ptr
  %38 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !17
  %40 = icmp ne i32 %39, 1228294212
  br i1 %40, label %41, label %43

41:                                               ; preds = %33
  call void @DebugAssert(ptr noundef @.str, i64 noundef 765, 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._DHCP6_INSTANCE, ptr null, i32 0, i32 4) 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 %10, 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._DHCP6_SERVICE, ptr null, i32 0, i32 3) to i64)
  %57 = inttoptr i64 %56 to ptr
  %58 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 8, !tbaa !22
  %60 = icmp ne i32 %59, 1396066372
  br i1 %60, label %61, label %63

61:                                               ; preds = %53
  call void @DebugAssert(ptr noundef @.str, i64 noundef 766, 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._DHCP6_SERVICE, 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 %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %70, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !25
  %73 = load ptr, ptr %9, 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 %148

76:                                               ; preds = %68
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %77, i32 0, i32 15
  %79 = load i8, ptr %78, align 8, !tbaa !26
  %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 %148

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 !27
  %86 = call i64 %85(i64 noundef 8)
  store i64 %86, ptr %7, align 8, !tbaa !16
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %87, i32 0, i32 15
  store i8 1, ptr %88, align 8, !tbaa !26
  %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 !28
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %92, i32 0, i32 7
  %94 = load ptr, ptr %93, align 8, !tbaa !29
  %95 = getelementptr inbounds %struct._UDP_IO, ptr %94, i32 0, i32 6
  %96 = load ptr, ptr %95, align 8, !tbaa !30
  %97 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gDhcp6DriverBinding, 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 @gEfiUdp6ProtocolGuid, ptr noundef %97, ptr noundef %98)
  store i64 %99, ptr %6, align 8, !tbaa !16
  %100 = load i64, ptr %6, align 8, !tbaa !16
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %102, label %110

102:                                              ; preds = %82
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %103, i32 0, i32 15
  store i8 0, ptr %104, align 8, !tbaa !26
  %105 = load ptr, ptr @gBS, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %105, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !34
  %108 = load i64, ptr %7, align 8, !tbaa !16
  call void %107(i64 noundef %108)
  %109 = load i64, ptr %6, align 8, !tbaa !16
  store i64 %109, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %148

110:                                              ; preds = %82
  %111 = load ptr, ptr @gBS, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %111, i32 0, i32 2
  %113 = load ptr, ptr %112, align 8, !tbaa !34
  %114 = load i64, ptr %7, align 8, !tbaa !16
  call void %113(i64 noundef %114)
  %115 = load ptr, ptr @gBS, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %115, i32 0, i32 16
  %117 = load ptr, ptr %116, align 8, !tbaa !35
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = call i64 %117(ptr noundef %118, ptr noundef @gEfiDhcp6ProtocolGuid, ptr noundef %119)
  store i64 %120, ptr %6, align 8, !tbaa !16
  %121 = load ptr, ptr @gBS, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %121, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !27
  %124 = call i64 %123(i64 noundef 8)
  store i64 %124, ptr %7, align 8, !tbaa !16
  %125 = load i64, ptr %6, align 8, !tbaa !16
  %126 = icmp slt i64 %125, 0
  br i1 %126, label %127, label %135

127:                                              ; preds = %110
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %128, i32 0, i32 15
  store i8 0, ptr %129, align 8, !tbaa !26
  %130 = load ptr, ptr @gBS, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %130, i32 0, i32 2
  %132 = load ptr, ptr %131, align 8, !tbaa !34
  %133 = load i64, ptr %7, align 8, !tbaa !16
  call void %132(i64 noundef %133)
  %134 = load i64, ptr %6, align 8, !tbaa !16
  store i64 %134, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %148

135:                                              ; preds = %110
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %136, i32 0, i32 3
  %138 = call ptr @RemoveEntryList(ptr noundef %137)
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %139, i32 0, i32 10
  %141 = load i64, ptr %140, align 8, !tbaa !36
  %142 = add i64 %141, -1
  store i64 %142, ptr %140, align 8, !tbaa !36
  %143 = load ptr, ptr @gBS, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %143, i32 0, i32 2
  %145 = load ptr, ptr %144, align 8, !tbaa !34
  %146 = load i64, ptr %7, align 8, !tbaa !16
  call void %145(i64 noundef %146)
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  call void @Dhcp6DestroyInstance(ptr noundef %147)
  store i64 0, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %148

148:                                              ; preds = %135, %127, %102, %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
  %149 = load i64, ptr %3, align 8
  ret i64 %149
}

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @Dhcp6DestroyInstance(ptr noundef) #0

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 = !{!"_DHCP6_INSTANCE", !13, i64 0, !6, i64 8, !6, i64 16, !19, i64 24, !20, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !21, i64 136, !19, i64 160, !19, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !12, i64 216, !7, i64 224, !7, i64 225, !12, i64 232}
!19 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!20 = !{!"_EFI_DHCP6_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}
!21 = !{!"_DHCP6_IA_CB", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!22 = !{!23, !13, i64 0}
!23 = !{!"_DHCP6_SERVICE", !13, i64 0, !6, i64 8, !6, i64 16, !24, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !13, i64 72, !19, i64 80, !12, i64 96}
!24 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!25 = !{!18, !6, i64 16}
!26 = !{!18, !7, i64 224}
!27 = !{!10, !6, i64 24}
!28 = !{!10, !6, i64 288}
!29 = !{!23, !6, i64 64}
!30 = !{!31, !6, i64 56}
!31 = !{!"_UDP_IO", !13, i64 0, !19, i64 8, !12, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !32, i64 64, !19, i64 720, !6, i64 736, !7, i64 744, !7, i64 752}
!32 = !{!"", !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, !33, i64 552, !33, i64 584, !33, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!33 = !{!"", !7, i64 0}
!34 = !{!10, !6, i64 32}
!35 = !{!10, !6, i64 144}
!36 = !{!23, !12, i64 96}


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

@gDhcp6DriverBinding = external dso_local local_unnamed_addr global %struct._EFI_DRIVER_BINDING_PROTOCOL, align 8
@.str = external hidden unnamed_addr constant [135 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@gEfiUdp6ProtocolGuid = external global %struct.GUID, align 4
@gEfiDhcp6ProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @Dhcp6ServiceBindingDestroyChild(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 %76, 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 @gDhcp6DriverBinding, i64 40), align 8, !tbaa !14
  %11 = call i64 %9(ptr noundef nonnull %1, ptr noundef nonnull @gEfiDhcp6ProtocolGuid, 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 %76, 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
  %.pre40 = ptrtoint ptr %.pre to i64
  %.pre41 = add i64 %.pre40, -40
  %.pre43 = inttoptr i64 %.pre41 to ptr
  br i1 %.not, label %._crit_edge39, label %15

15:                                               ; preds = %13
  %16 = load i32, ptr %.pre43, align 8, !tbaa !16
  %.not34 = icmp eq i32 %16, 1228294212
  br i1 %.not34, label %._crit_edge39, label %17

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

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

21:                                               ; preds = %._crit_edge39
  %22 = load i32, ptr %.pre49, align 8, !tbaa !21
  %.not36 = icmp eq i32 %22, 1396066372
  br i1 %.not36, label %._crit_edge, label %23

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

._crit_edge:                                      ; preds = %._crit_edge39, %21, %23
  %24 = phi ptr [ %0, %23 ], [ %.pre49, %21 ], [ %.pre49, %._crit_edge39 ]
  %25 = getelementptr inbounds i8, ptr %19, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !24
  %.not37 = icmp eq ptr %26, %24
  br i1 %.not37, label %27, label %76

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

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 !26
  %34 = call i64 %33(i64 noundef 8) #3
  store i8 1, ptr %28, align 8, !tbaa !25
  %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 !27
  %38 = getelementptr inbounds i8, ptr %24, i64 64
  %39 = load ptr, ptr %38, align 8, !tbaa !28
  %40 = getelementptr inbounds i8, ptr %39, i64 56
  %41 = load ptr, ptr %40, align 8, !tbaa !29
  %42 = load ptr, ptr getelementptr inbounds (i8, ptr @gDhcp6DriverBinding, i64 40), align 8, !tbaa !14
  %43 = call i64 %37(ptr noundef %41, ptr noundef nonnull @gEfiUdp6ProtocolGuid, ptr noundef %42, ptr noundef nonnull %1) #3
  %44 = icmp slt i64 %43, 0
  br i1 %44, label %45, label %49

45:                                               ; preds = %30
  store i8 0, ptr %28, align 8, !tbaa !25
  %46 = load ptr, ptr @gBS, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 32
  %48 = load ptr, ptr %47, align 8, !tbaa !33
  call void %48(i64 noundef %34) #3
  br label %76

49:                                               ; preds = %30
  %50 = load ptr, ptr @gBS, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 32
  %52 = load ptr, ptr %51, align 8, !tbaa !33
  call void %52(i64 noundef %34) #3
  %53 = load ptr, ptr @gBS, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 144
  %55 = load ptr, ptr %54, align 8, !tbaa !34
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = call i64 %55(ptr noundef nonnull %1, ptr noundef nonnull @gEfiDhcp6ProtocolGuid, ptr noundef %56) #3
  %58 = load ptr, ptr @gBS, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 24
  %60 = load ptr, ptr %59, align 8, !tbaa !26
  %61 = call i64 %60(i64 noundef 8) #3
  %62 = icmp slt i64 %57, 0
  br i1 %62, label %63, label %67

63:                                               ; preds = %49
  store i8 0, ptr %28, align 8, !tbaa !25
  %64 = load ptr, ptr @gBS, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 32
  %66 = load ptr, ptr %65, align 8, !tbaa !33
  call void %66(i64 noundef %61) #3
  br label %76

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

76:                                               ; preds = %27, %._crit_edge, %6, %2, %67, %63, %45
  %.0 = phi i64 [ %43, %45 ], [ %57, %63 ], [ 0, %67 ], [ -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 zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @Dhcp6DestroyInstance(ptr noundef) local_unnamed_addr #0

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 = !{!"_DHCP6_INSTANCE", !13, i64 0, !6, i64 8, !6, i64 16, !18, i64 24, !19, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !20, i64 136, !18, i64 160, !18, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !12, i64 216, !7, i64 224, !7, i64 225, !12, i64 232}
!18 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!19 = !{!"_EFI_DHCP6_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 = !{!"_DHCP6_IA_CB", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!21 = !{!22, !13, i64 0}
!22 = !{!"_DHCP6_SERVICE", !13, i64 0, !6, i64 8, !6, i64 16, !23, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !13, i64 72, !18, i64 80, !12, i64 96}
!23 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!24 = !{!17, !6, i64 16}
!25 = !{!17, !7, i64 224}
!26 = !{!10, !6, i64 24}
!27 = !{!10, !6, i64 288}
!28 = !{!22, !6, i64 64}
!29 = !{!30, !6, i64 56}
!30 = !{!"_UDP_IO", !13, i64 0, !18, i64 8, !12, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !31, i64 64, !18, i64 720, !6, i64 736, !7, i64 744, !7, i64 752}
!31 = !{!"", !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, !32, i64 552, !32, i64 584, !32, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!32 = !{!"", !7, i64 0}
!33 = !{!10, !6, i64 32}
!34 = !{!10, !6, i64 144}
!35 = !{!22, !12, i64 96}


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