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

; 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._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._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._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._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
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@gEfiDhcp6ProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6ServiceBindingCreateChild(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 %129

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

30:                                               ; preds = %22
  call void @DebugAssert(ptr noundef @.str, i64 noundef 634, ptr noundef @.str.2)
  %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._DHCP6_SERVICE, ptr null, i32 0, i32 3) 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 %8, align 8, !tbaa !5
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = call i64 @Dhcp6CreateInstance(ptr noundef %39, ptr noundef %9)
  store i64 %40, ptr %6, align 8, !tbaa !15
  %41 = load i64, ptr %6, align 8, !tbaa !15
  %42 = icmp slt i64 %41, 0
  br i1 %42, label %43, label %45

43:                                               ; preds = %37
  %44 = load i64, ptr %6, align 8, !tbaa !15
  store i64 %44, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %129

45:                                               ; preds = %37
  br label %46

46:                                               ; preds = %45
  %47 = call zeroext i8 @DebugAssertEnabled()
  %48 = icmp ne i8 %47, 0
  br i1 %48, label %49, label %54

49:                                               ; preds = %46
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  call void @DebugAssert(ptr noundef @.str, i64 noundef 642, ptr noundef @.str.4)
  br label %53

53:                                               ; preds = %52, %49
  br label %54

54:                                               ; preds = %53, %46
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  %57 = load ptr, ptr @gBS, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %57, i32 0, i32 9
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %60, i32 0, i32 5
  %62 = load ptr, ptr %61, align 8, !tbaa !19
  %63 = call i64 %59(ptr noundef %62, i32 noundef 1, i64 noundef 10000000)
  store i64 %63, ptr %6, align 8, !tbaa !15
  %64 = load i64, ptr %6, align 8, !tbaa !15
  %65 = icmp slt i64 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %56
  br label %126

67:                                               ; preds = %56
  %68 = load ptr, ptr @gBS, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %68, i32 0, i32 39
  %70 = load ptr, ptr %69, align 8, !tbaa !23
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %72, i32 0, i32 4
  %74 = call i64 (ptr, ...) %70(ptr noundef %71, ptr noundef @gEfiDhcp6ProtocolGuid, ptr noundef %73, ptr noundef null)
  store i64 %74, ptr %6, align 8, !tbaa !15
  %75 = load i64, ptr %6, align 8, !tbaa !15
  %76 = icmp slt i64 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %67
  br label %126

78:                                               ; preds = %67
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %81, i32 0, i32 1
  store ptr %80, ptr %82, align 8, !tbaa !24
  %83 = load ptr, ptr @gBS, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %83, i32 0, i32 33
  %85 = load ptr, ptr %84, align 8, !tbaa !25
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %86, i32 0, i32 7
  %88 = load ptr, ptr %87, align 8, !tbaa !26
  %89 = getelementptr inbounds %struct._UDP_IO, ptr %88, i32 0, i32 6
  %90 = load ptr, ptr %89, align 8, !tbaa !27
  %91 = load ptr, ptr getelementptr inbounds (%struct._EFI_DRIVER_BINDING_PROTOCOL, ptr @gDhcp6DriverBinding, i32 0, i32 5), align 8, !tbaa !31
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !24
  %95 = call i64 %85(ptr noundef %90, ptr noundef @gEfiUdp6ProtocolGuid, ptr noundef %10, ptr noundef %91, ptr noundef %94, i32 noundef 8)
  store i64 %95, ptr %6, align 8, !tbaa !15
  %96 = load i64, ptr %6, align 8, !tbaa !15
  %97 = icmp slt i64 %96, 0
  br i1 %97, label %98, label %108

98:                                               ; preds = %78
  %99 = load ptr, ptr @gBS, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %99, i32 0, i32 40
  %101 = load ptr, ptr %100, align 8, !tbaa !33
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %102, i32 0, i32 1
  %104 = load ptr, ptr %103, align 8, !tbaa !24
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %105, i32 0, i32 4
  %107 = call i64 (ptr, ...) %101(ptr noundef %104, ptr noundef @gEfiDhcp6ProtocolGuid, ptr noundef %106, ptr noundef null)
  br label %126

108:                                              ; preds = %78
  %109 = load ptr, ptr @gBS, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %109, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8, !tbaa !34
  %112 = call i64 %111(i64 noundef 8)
  store i64 %112, ptr %7, align 8, !tbaa !15
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %113, i32 0, i32 9
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %115, i32 0, i32 3
  %117 = call ptr @InsertTailList(ptr noundef %114, ptr noundef %116)
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %118, i32 0, i32 10
  %120 = load i64, ptr %119, align 8, !tbaa !35
  %121 = add i64 %120, 1
  store i64 %121, ptr %119, align 8, !tbaa !35
  %122 = load ptr, ptr @gBS, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %122, i32 0, i32 2
  %124 = load ptr, ptr %123, align 8, !tbaa !36
  %125 = load i64, ptr %7, align 8, !tbaa !15
  call void %124(i64 noundef %125)
  store i64 0, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %129

126:                                              ; preds = %98, %77, %66
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  call void @Dhcp6DestroyInstance(ptr noundef %127)
  %128 = load i64, ptr %6, align 8, !tbaa !15
  store i64 %128, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %129

129:                                              ; preds = %126, %108, %43, %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
  %130 = load i64, ptr %3, align 8
  ret i64 %130
}

; 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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6CreateInstance(ptr noundef, ptr noundef) #0

declare ptr @InsertTailList(ptr noundef, 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 = !{!"_DHCP6_SERVICE", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !13, i64 80, !14, i64 96}
!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 = !{!14, !14, i64 0}
!16 = !{!17, !6, i64 88}
!17 = !{!"", !18, 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}
!18 = !{!"", !14, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!19 = !{!20, !6, i64 112}
!20 = !{!"_DHCP6_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !21, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !22, i64 136, !13, i64 160, !13, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !14, i64 216, !7, i64 224, !7, i64 225, !14, i64 232}
!21 = !{!"_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}
!22 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!23 = !{!17, !6, i64 328}
!24 = !{!20, !6, i64 8}
!25 = !{!17, !6, i64 280}
!26 = !{!10, !6, i64 64}
!27 = !{!28, !6, i64 56}
!28 = !{!"_UDP_IO", !11, i64 0, !13, i64 8, !14, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !29, i64 64, !13, i64 720, !6, i64 736, !7, i64 744, !7, i64 752}
!29 = !{!"", !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, !30, i64 552, !30, i64 584, !30, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!30 = !{!"", !7, i64 0}
!31 = !{!32, !6, i64 40}
!32 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40}
!33 = !{!17, !6, i64 336}
!34 = !{!17, !6, i64 24}
!35 = !{!10, !14, i64 96}
!36 = !{!17, !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] }

@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
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@gEfiDhcp6ProtocolGuid = external global %struct.GUID, align 4

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @Dhcp6ServiceBindingCreateChild(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %5 = icmp eq ptr %0, null
  %6 = icmp eq ptr %1, null
  %or.cond = or i1 %5, %6
  br i1 %or.cond, label %77, label %7

7:                                                ; preds = %2
  %8 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %8, 0
  %.pre29 = ptrtoint ptr %0 to i64
  %.pre30 = add i64 %.pre29, -24
  %.pre32 = inttoptr i64 %.pre30 to ptr
  br i1 %.not, label %._crit_edge, label %9

9:                                                ; preds = %7
  %10 = load i32, ptr %.pre32, align 8, !tbaa !5
  %.not28 = icmp eq i32 %10, 1396066372
  br i1 %.not28, label %._crit_edge, label %11

11:                                               ; preds = %9
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 634, ptr noundef nonnull @.str.2) #3
  br label %._crit_edge

._crit_edge:                                      ; preds = %7, %9, %11
  %12 = phi ptr [ %0, %11 ], [ %.pre32, %9 ], [ %.pre32, %7 ]
  %13 = call i64 @Dhcp6CreateInstance(ptr noundef %12, ptr noundef nonnull %3)
  %14 = icmp slt i64 %13, 0
  br i1 %14, label %77, label %15

15:                                               ; preds = %._crit_edge
  %16 = call zeroext i8 @DebugAssertEnabled() #3
  %17 = icmp eq i8 %16, 0
  %18 = load ptr, ptr %3, align 8
  %19 = icmp ne ptr %18, null
  %or.cond3 = select i1 %17, i1 true, i1 %19
  br i1 %or.cond3, label %21, label %20

20:                                               ; preds = %15
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 642, ptr noundef nonnull @.str.4) #3
  %.pre = load ptr, ptr %3, align 8, !tbaa !14
  br label %21

21:                                               ; preds = %20, %15
  %22 = phi ptr [ %.pre, %20 ], [ %18, %15 ]
  %23 = load ptr, ptr @gBS, align 8, !tbaa !14
  %24 = getelementptr inbounds i8, ptr %23, i64 88
  %25 = load ptr, ptr %24, align 8, !tbaa !15
  %26 = getelementptr inbounds i8, ptr %22, i64 112
  %27 = load ptr, ptr %26, align 8, !tbaa !18
  %28 = call i64 %25(ptr noundef %27, i32 noundef 1, i64 noundef 10000000) #3
  %29 = icmp slt i64 %28, 0
  br i1 %29, label %75, label %30

30:                                               ; preds = %21
  %31 = load ptr, ptr @gBS, align 8, !tbaa !14
  %32 = getelementptr inbounds i8, ptr %31, i64 328
  %33 = load ptr, ptr %32, align 8, !tbaa !22
  %34 = load ptr, ptr %3, align 8, !tbaa !14
  %35 = getelementptr inbounds i8, ptr %34, i64 40
  %36 = call i64 (ptr, ...) %33(ptr noundef nonnull %1, ptr noundef nonnull @gEfiDhcp6ProtocolGuid, ptr noundef nonnull %35, ptr noundef null) #3
  %37 = icmp slt i64 %36, 0
  br i1 %37, label %75, label %38

38:                                               ; preds = %30
  %39 = load ptr, ptr %1, align 8, !tbaa !14
  %40 = load ptr, ptr %3, align 8, !tbaa !14
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  store ptr %39, ptr %41, align 8, !tbaa !23
  %42 = load ptr, ptr @gBS, align 8, !tbaa !14
  %43 = getelementptr inbounds i8, ptr %42, i64 280
  %44 = load ptr, ptr %43, align 8, !tbaa !24
  %45 = getelementptr inbounds i8, ptr %12, i64 64
  %46 = load ptr, ptr %45, align 8, !tbaa !25
  %47 = getelementptr inbounds i8, ptr %46, i64 56
  %48 = load ptr, ptr %47, align 8, !tbaa !26
  %49 = load ptr, ptr getelementptr inbounds (i8, ptr @gDhcp6DriverBinding, i64 40), align 8, !tbaa !30
  %50 = call i64 %44(ptr noundef %48, ptr noundef nonnull @gEfiUdp6ProtocolGuid, ptr noundef nonnull %4, ptr noundef %49, ptr noundef %39, i32 noundef 8) #3
  %51 = icmp slt i64 %50, 0
  %52 = load ptr, ptr @gBS, align 8, !tbaa !14
  br i1 %51, label %53, label %61

53:                                               ; preds = %38
  %54 = getelementptr inbounds i8, ptr %52, i64 336
  %55 = load ptr, ptr %54, align 8, !tbaa !32
  %56 = load ptr, ptr %3, align 8, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %56, i64 8
  %58 = load ptr, ptr %57, align 8, !tbaa !23
  %59 = getelementptr inbounds i8, ptr %56, i64 40
  %60 = call i64 (ptr, ...) %55(ptr noundef %58, ptr noundef nonnull @gEfiDhcp6ProtocolGuid, ptr noundef nonnull %59, ptr noundef null) #3
  br label %75

61:                                               ; preds = %38
  %62 = getelementptr inbounds i8, ptr %52, i64 24
  %63 = load ptr, ptr %62, align 8, !tbaa !33
  %64 = call i64 %63(i64 noundef 8) #3
  %65 = getelementptr inbounds i8, ptr %12, i64 80
  %66 = load ptr, ptr %3, align 8, !tbaa !14
  %67 = getelementptr inbounds i8, ptr %66, i64 24
  %68 = call ptr @InsertTailList(ptr noundef nonnull %65, ptr noundef nonnull %67) #3
  %69 = getelementptr inbounds i8, ptr %12, i64 96
  %70 = load i64, ptr %69, align 8, !tbaa !34
  %71 = add i64 %70, 1
  store i64 %71, ptr %69, align 8, !tbaa !34
  %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 !35
  call void %74(i64 noundef %64) #3
  br label %77

75:                                               ; preds = %30, %21, %53
  %.021 = phi i64 [ %28, %21 ], [ %36, %30 ], [ %50, %53 ]
  %76 = load ptr, ptr %3, align 8, !tbaa !14
  call void @Dhcp6DestroyInstance(ptr noundef %76)
  br label %77

77:                                               ; preds = %._crit_edge, %2, %75, %61
  %.0 = phi i64 [ %.021, %75 ], [ 0, %61 ], [ -9223372036854775806, %2 ], [ %13, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6CreateInstance(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @InsertTailList(ptr noundef, 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 = !{!"_DHCP6_SERVICE", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !12, i64 80, !13, i64 96}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!12 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!13 = !{!"long long", !8, i64 0}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !10, i64 88}
!16 = !{!"", !17, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!17 = !{!"", !13, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!18 = !{!19, !10, i64 112}
!19 = !{!"_DHCP6_INSTANCE", !7, i64 0, !10, i64 8, !10, i64 16, !12, i64 24, !20, i64 40, !10, i64 112, !10, i64 120, !10, i64 128, !21, i64 136, !12, i64 160, !12, i64 176, !10, i64 192, !8, i64 200, !10, i64 208, !13, i64 216, !8, i64 224, !8, i64 225, !13, i64 232}
!20 = !{!"_EFI_DHCP6_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!21 = !{!"_DHCP6_IA_CB", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!22 = !{!16, !10, i64 328}
!23 = !{!19, !10, i64 8}
!24 = !{!16, !10, i64 280}
!25 = !{!6, !10, i64 64}
!26 = !{!27, !10, i64 56}
!27 = !{!"_UDP_IO", !7, i64 0, !12, i64 8, !13, i64 24, !8, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !28, i64 64, !12, i64 720, !10, i64 736, !8, i64 744, !8, i64 752}
!28 = !{!"", !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, !29, i64 552, !29, i64 584, !29, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!29 = !{!"", !8, i64 0}
!30 = !{!31, !10, i64 40}
!31 = !{!"_EFI_DRIVER_BINDING_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !10, i64 40}
!32 = !{!16, !10, i64 336}
!33 = !{!16, !10, i64 24}
!34 = !{!6, !13, i64 96}
!35 = !{!16, !10, i64 32}


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