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

; 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._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.EFI_DHCP6_IA = type { %struct.EFI_DHCP6_IA_DESCRIPTOR, i32, ptr, i32, [1 x %struct.EFI_DHCP6_IA_ADDRESS] }
%struct.EFI_DHCP6_IA_DESCRIPTOR = type { i16, i32 }
%struct.EFI_DHCP6_IA_ADDRESS = type { %struct.EFI_IPv6_ADDRESS, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 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_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.EFI_DHCP6_CONFIG_DATA = type { ptr, ptr, i32, ptr, %struct.EFI_DHCP6_IA_DESCRIPTOR, ptr, i8, i8, 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_UDP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [133 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@gBS = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiDhcp6Start(ptr noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %1
  store i64 -9223372036854775806, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %130

12:                                               ; preds = %1
  %13 = call zeroext i8 @DebugAssertEnabled()
  %14 = zext i8 %13 to i32
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %26

16:                                               ; preds = %12
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = ptrtoint ptr %17 to i64
  %19 = sub i64 %18, ptrtoint (ptr getelementptr inbounds (%struct._DHCP6_INSTANCE, ptr null, i32 0, i32 4) to i64)
  %20 = inttoptr i64 %19 to ptr
  %21 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = icmp ne i32 %22, 1228294212
  br i1 %23, label %24, label %26

24:                                               ; preds = %16
  call void @DebugAssert(ptr noundef @.str, i64 noundef 84, ptr noundef @.str.1)
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  br label %31

26:                                               ; preds = %16, %12
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = ptrtoint ptr %27 to i64
  %29 = sub i64 %28, ptrtoint (ptr getelementptr inbounds (%struct._DHCP6_INSTANCE, ptr null, i32 0, i32 4) to i64)
  %30 = inttoptr i64 %29 to ptr
  br label %31

31:                                               ; preds = %26, %24
  %32 = phi ptr [ %25, %24 ], [ %30, %26 ]
  store ptr %32, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %33, i32 0, i32 2
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  store ptr %35, ptr %7, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %36, i32 0, i32 6
  %38 = load ptr, ptr %37, align 8, !tbaa !17
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %41

40:                                               ; preds = %31
  store i64 -9223372036854775793, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %130

41:                                               ; preds = %31
  br label %42

42:                                               ; preds = %41
  %43 = call zeroext i8 @DebugAssertEnabled()
  %44 = icmp ne i8 %43, 0
  br i1 %44, label %45, label %53

45:                                               ; preds = %42
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %46, i32 0, i32 8
  %48 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !18
  %50 = icmp ne ptr %49, null
  br i1 %50, label %52, label %51

51:                                               ; preds = %45
  call void @DebugAssert(ptr noundef @.str, i64 noundef 94, ptr noundef @.str.2)
  br label %52

52:                                               ; preds = %51, %45
  br label %53

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

54:                                               ; preds = %53
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %56, i32 0, i32 8
  %58 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !18
  %60 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 8, !tbaa !19
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %55
  store i64 -9223372036854775788, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %130

64:                                               ; preds = %55
  %65 = load ptr, ptr @gBS, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %65, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8, !tbaa !23
  %68 = call i64 %67(i64 noundef 8)
  store i64 %68, ptr %5, align 8, !tbaa !26
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %69, i32 0, i32 14
  store volatile i64 -9223372036854775788, ptr %70, align 8, !tbaa !27
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = call i64 @Dhcp6SendSolicitMsg(ptr noundef %71)
  store i64 %72, ptr %4, align 8, !tbaa !26
  %73 = load i64, ptr %4, align 8, !tbaa !26
  %74 = icmp slt i64 %73, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %64
  br label %124

76:                                               ; preds = %64
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %77, i32 0, i32 7
  %79 = load ptr, ptr %78, align 8, !tbaa !28
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = call i64 @UdpIoRecvDatagram(ptr noundef %79, ptr noundef @Dhcp6ReceivePacket, ptr noundef %80, i32 noundef 0)
  store i64 %81, ptr %4, align 8, !tbaa !26
  %82 = load i64, ptr %4, align 8, !tbaa !26
  %83 = icmp slt i64 %82, 0
  br i1 %83, label %84, label %88

84:                                               ; preds = %76
  %85 = load i64, ptr %4, align 8, !tbaa !26
  %86 = icmp ne i64 %85, -9223372036854775788
  br i1 %86, label %87, label %88

87:                                               ; preds = %84
  br label %124

88:                                               ; preds = %84, %76
  %89 = load ptr, ptr @gBS, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %89, i32 0, i32 2
  %91 = load ptr, ptr %90, align 8, !tbaa !31
  %92 = load i64, ptr %5, align 8, !tbaa !26
  call void %91(i64 noundef %92)
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %93, i32 0, i32 6
  %95 = load ptr, ptr %94, align 8, !tbaa !17
  %96 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %95, i32 0, i32 5
  %97 = load ptr, ptr %96, align 8, !tbaa !32
  %98 = icmp eq ptr %97, null
  br i1 %98, label %99, label %123

99:                                               ; preds = %88
  br label %100

100:                                              ; preds = %105, %99
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %101, i32 0, i32 14
  %103 = load volatile i64, ptr %102, align 8, !tbaa !27
  %104 = icmp eq i64 %103, -9223372036854775788
  br i1 %104, label %105, label %119

105:                                              ; preds = %100
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %106, i32 0, i32 7
  %108 = load ptr, ptr %107, align 8, !tbaa !28
  %109 = getelementptr inbounds %struct._UDP_IO, ptr %108, i32 0, i32 10
  %110 = load ptr, ptr %109, align 8, !tbaa !34
  %111 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %110, i32 0, i32 6
  %112 = load ptr, ptr %111, align 8, !tbaa !35
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %113, i32 0, i32 7
  %115 = load ptr, ptr %114, align 8, !tbaa !28
  %116 = getelementptr inbounds %struct._UDP_IO, ptr %115, i32 0, i32 10
  %117 = load ptr, ptr %116, align 8, !tbaa !34
  %118 = call i64 %112(ptr noundef %117)
  br label %100, !llvm.loop !37

119:                                              ; preds = %100
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %120, i32 0, i32 14
  %122 = load volatile i64, ptr %121, align 8, !tbaa !27
  store i64 %122, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %130

123:                                              ; preds = %88
  store i64 0, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %130

124:                                              ; preds = %87, %75
  %125 = load ptr, ptr @gBS, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %125, i32 0, i32 2
  %127 = load ptr, ptr %126, align 8, !tbaa !31
  %128 = load i64, ptr %5, align 8, !tbaa !26
  call void %127(i64 noundef %128)
  %129 = load i64, ptr %4, align 8, !tbaa !26
  store i64 %129, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %130

130:                                              ; preds = %124, %123, %119, %63, %40, %11
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %131 = load i64, ptr %2, align 8
  ret i64 %131
}

; 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

declare i64 @Dhcp6SendSolicitMsg(ptr noundef) #2

declare i64 @UdpIoRecvDatagram(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare void @Dhcp6ReceivePacket(ptr noundef, 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

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_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !12, i64 160, !12, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !15, i64 216, !7, i64 224, !7, i64 225, !15, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_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}
!14 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!15 = !{!"long long", !7, i64 0}
!16 = !{!10, !6, i64 16}
!17 = !{!10, !6, i64 120}
!18 = !{!10, !6, i64 136}
!19 = !{!20, !11, i64 8}
!20 = !{!"", !21, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !7, i64 28}
!21 = !{!"", !22, i64 0, !11, i64 4}
!22 = !{!"short", !7, i64 0}
!23 = !{!24, !6, i64 24}
!24 = !{!"", !25, 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}
!25 = !{!"", !15, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!26 = !{!15, !15, i64 0}
!27 = !{!10, !15, i64 216}
!28 = !{!29, !6, i64 64}
!29 = !{!"_DHCP6_SERVICE", !11, i64 0, !6, i64 8, !6, i64 16, !30, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !12, i64 80, !15, i64 96}
!30 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!31 = !{!24, !6, i64 32}
!32 = !{!33, !6, i64 40}
!33 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !21, i64 32, !6, i64 40, !7, i64 48, !7, i64 49, !6, i64 56}
!34 = !{!7, !7, i64 0}
!35 = !{!36, !6, i64 48}
!36 = !{!"_EFI_UDP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}


; 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"

@.str = external hidden unnamed_addr constant [133 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiDhcp6Start(ptr noundef %0) local_unnamed_addr #0 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %62, label %3

3:                                                ; preds = %1
  %4 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %4, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre33 = add i64 %.pre, -40
  %.pre35 = inttoptr i64 %.pre33 to ptr
  br i1 %.not, label %._crit_edge32, label %5

5:                                                ; preds = %3
  %6 = load i32, ptr %.pre35, align 8, !tbaa !5
  %.not28 = icmp eq i32 %6, 1228294212
  br i1 %.not28, label %._crit_edge32, label %7

7:                                                ; preds = %5
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 84, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge32

._crit_edge32:                                    ; preds = %3, %5, %7
  %8 = phi ptr [ %0, %7 ], [ %.pre35, %5 ], [ %.pre35, %3 ]
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %8, i64 120
  %12 = load ptr, ptr %11, align 8, !tbaa !16
  %13 = icmp eq ptr %12, null
  br i1 %13, label %62, label %14

14:                                               ; preds = %._crit_edge32
  %15 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not29 = icmp eq i8 %15, 0
  br i1 %.not29, label %20, label %16

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %8, i64 136
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  %.not30 = icmp eq ptr %18, null
  br i1 %.not30, label %19, label %20

19:                                               ; preds = %16
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 94, ptr noundef nonnull @.str.2) #2
  br label %20

20:                                               ; preds = %16, %19, %14
  %21 = getelementptr inbounds i8, ptr %8, i64 136
  %22 = load ptr, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load i32, ptr %23, align 8, !tbaa !18
  %.not31 = icmp eq i32 %24, 0
  br i1 %.not31, label %25, label %62

25:                                               ; preds = %20
  %26 = load ptr, ptr @gBS, align 8, !tbaa !22
  %27 = getelementptr inbounds i8, ptr %26, i64 24
  %28 = load ptr, ptr %27, align 8, !tbaa !23
  %29 = tail call i64 %28(i64 noundef 8) #2
  %30 = getelementptr inbounds i8, ptr %8, i64 216
  store volatile i64 -9223372036854775788, ptr %30, align 8, !tbaa !26
  %31 = tail call i64 @Dhcp6SendSolicitMsg(ptr noundef nonnull %8) #2
  %32 = icmp slt i64 %31, 0
  br i1 %32, label %58, label %33

33:                                               ; preds = %25
  %34 = getelementptr inbounds i8, ptr %10, i64 64
  %35 = load ptr, ptr %34, align 8, !tbaa !27
  %36 = tail call i64 @UdpIoRecvDatagram(ptr noundef %35, ptr noundef nonnull @Dhcp6ReceivePacket, ptr noundef %10, i32 noundef 0) #2
  %37 = icmp slt i64 %36, 0
  %38 = icmp ne i64 %36, -9223372036854775788
  %or.cond = and i1 %37, %38
  br i1 %or.cond, label %58, label %39

39:                                               ; preds = %33
  %40 = load ptr, ptr @gBS, align 8, !tbaa !22
  %41 = getelementptr inbounds i8, ptr %40, i64 32
  %42 = load ptr, ptr %41, align 8, !tbaa !30
  tail call void %42(i64 noundef %29) #2
  %43 = load ptr, ptr %11, align 8, !tbaa !16
  %44 = getelementptr inbounds i8, ptr %43, i64 40
  %45 = load ptr, ptr %44, align 8, !tbaa !31
  %46 = icmp eq ptr %45, null
  br i1 %46, label %.preheader, label %62

.preheader:                                       ; preds = %39
  %47 = load volatile i64, ptr %30, align 8, !tbaa !26
  %48 = icmp eq i64 %47, -9223372036854775788
  br i1 %48, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %49 = load ptr, ptr %34, align 8, !tbaa !27
  %50 = getelementptr inbounds i8, ptr %49, i64 744
  %51 = load ptr, ptr %50, align 8, !tbaa !33
  %52 = getelementptr inbounds i8, ptr %51, i64 48
  %53 = load ptr, ptr %52, align 8, !tbaa !34
  %54 = tail call i64 %53(ptr noundef %51) #2
  %55 = load volatile i64, ptr %30, align 8, !tbaa !26
  %56 = icmp eq i64 %55, -9223372036854775788
  br i1 %56, label %.lr.ph, label %._crit_edge, !llvm.loop !36

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %57 = load volatile i64, ptr %30, align 8, !tbaa !26
  br label %62

58:                                               ; preds = %33, %25
  %.024 = phi i64 [ %31, %25 ], [ %36, %33 ]
  %59 = load ptr, ptr @gBS, align 8, !tbaa !22
  %60 = getelementptr inbounds i8, ptr %59, i64 32
  %61 = load ptr, ptr %60, align 8, !tbaa !30
  tail call void %61(i64 noundef %29) #2
  br label %62

62:                                               ; preds = %39, %20, %._crit_edge32, %1, %58, %._crit_edge
  %.0 = phi i64 [ %.024, %58 ], [ %57, %._crit_edge ], [ -9223372036854775806, %1 ], [ -9223372036854775793, %._crit_edge32 ], [ -9223372036854775788, %20 ], [ 0, %39 ]
  ret i64 %.0
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare i64 @Dhcp6SendSolicitMsg(ptr noundef) local_unnamed_addr #1

declare i64 @UdpIoRecvDatagram(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @Dhcp6ReceivePacket(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!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_INSTANCE", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 40, !10, i64 112, !10, i64 120, !10, i64 128, !13, i64 136, !11, i64 160, !11, i64 176, !10, i64 192, !8, i64 200, !10, i64 208, !14, i64 216, !8, i64 224, !8, i64 225, !14, i64 232}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!12 = !{!"_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}
!13 = !{!"_DHCP6_IA_CB", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!14 = !{!"long long", !8, i64 0}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !10, i64 120}
!17 = !{!6, !10, i64 136}
!18 = !{!19, !7, i64 8}
!19 = !{!"", !20, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !8, i64 28}
!20 = !{!"", !21, i64 0, !7, i64 4}
!21 = !{!"short", !8, i64 0}
!22 = !{!10, !10, i64 0}
!23 = !{!24, !10, i64 24}
!24 = !{!"", !25, 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}
!25 = !{!"", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!26 = !{!6, !14, i64 216}
!27 = !{!28, !10, i64 64}
!28 = !{!"_DHCP6_SERVICE", !7, i64 0, !10, i64 8, !10, i64 16, !29, i64 24, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !11, i64 80, !14, i64 96}
!29 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!30 = !{!24, !10, i64 32}
!31 = !{!32, !10, i64 40}
!32 = !{!"", !10, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !20, i64 32, !10, i64 40, !8, i64 48, !8, i64 49, !10, i64 56}
!33 = !{!8, !8, i64 0}
!34 = !{!35, !10, i64 48}
!35 = !{!"_EFI_UDP6_PROTOCOL", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


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