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

; 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._DHCP6_TX_CB = type { %struct._LIST_ENTRY, i32, ptr, %struct.EFI_DHCP6_RETRANSMISSION, i32, i32, i32, i32, ptr, i8 }
%struct.EFI_DHCP6_RETRANSMISSION = type { i32, i32, i32, i32 }
%struct.EFI_DHCP6_PACKET = type <{ i32, i32, %struct.anon }>
%struct.anon = type <{ %struct.EFI_DHCP6_HEADER, [1 x i8] }>
%struct.EFI_DHCP6_HEADER = type { i32 }
%struct._DHCP6_INF_CB = type { %struct._LIST_ENTRY, i32, ptr, 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 }

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

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

declare zeroext i8 @DebugAssertEnabled() #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6DequeueRetry(ptr noundef %0, i32 noundef %1, i8 noundef zeroext %2) #2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i8 %2, ptr %7, align 1, !tbaa !11
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %13, i32 0, i32 9
  %15 = getelementptr inbounds %struct._LIST_ENTRY, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !12
  store ptr %16, ptr %8, align 8, !tbaa !5
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._LIST_ENTRY, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !18
  store ptr %19, ptr %9, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %131, %3
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %22, i32 0, i32 9
  %24 = icmp ne ptr %21, %23
  br i1 %24, label %25, label %136

25:                                               ; preds = %20
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = ptrtoint ptr %26 to i64
  %28 = sub i64 %27, 0
  %29 = inttoptr i64 %28 to ptr
  store ptr %29, ptr %10, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %25
  %31 = call zeroext i8 @DebugAssertEnabled()
  %32 = icmp ne i8 %31, 0
  br i1 %32, label %33, label %40

33:                                               ; preds = %30
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !19
  %37 = icmp ne ptr %36, null
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  call void @DebugAssert(ptr noundef @.str, i64 noundef 253, ptr noundef @.str.2)
  br label %39

39:                                               ; preds = %38, %33
  br label %40

40:                                               ; preds = %39, %30
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %43, i32 0, i32 1
  %45 = load i32, ptr %44, align 8, !tbaa !22
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = icmp eq i32 %45, %46
  br i1 %47, label %48, label %130

48:                                               ; preds = %42
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !19
  %52 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %51, i32 0, i32 2
  %53 = getelementptr inbounds %struct.anon, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 1
  %55 = and i32 %54, 255
  %56 = icmp eq i32 %55, 11
  br i1 %56, label %57, label %109

57:                                               ; preds = %48
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %58, i32 0, i32 10
  %60 = getelementptr inbounds %struct._LIST_ENTRY, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !23
  store ptr %61, ptr %8, align 8, !tbaa !5
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._LIST_ENTRY, ptr %62, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !18
  store ptr %64, ptr %9, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %103, %57
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %67, i32 0, i32 10
  %69 = icmp ne ptr %66, %68
  br i1 %69, label %70, label %108

70:                                               ; preds = %65
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = ptrtoint ptr %71 to i64
  %73 = sub i64 %72, 0
  %74 = inttoptr i64 %73 to ptr
  store ptr %74, ptr %11, align 8, !tbaa !5
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._DHCP6_INF_CB, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 8, !tbaa !24
  %78 = load i32, ptr %6, align 4, !tbaa !9
  %79 = icmp eq i32 %77, %78
  br i1 %79, label %80, label %102

80:                                               ; preds = %70
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._DHCP6_INF_CB, ptr %81, i32 0, i32 4
  %83 = load ptr, ptr %82, align 8, !tbaa !26
  %84 = icmp ne ptr %83, null
  br i1 %84, label %85, label %97

85:                                               ; preds = %80
  %86 = load i8, ptr %7, align 1, !tbaa !11
  %87 = zext i8 %86 to i32
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %97

89:                                               ; preds = %85
  %90 = load ptr, ptr @gBS, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %90, i32 0, i32 11
  %92 = load ptr, ptr %91, align 8, !tbaa !27
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._DHCP6_INF_CB, ptr %93, i32 0, i32 4
  %95 = load ptr, ptr %94, align 8, !tbaa !26
  %96 = call i64 %92(ptr noundef %95)
  br label %97

97:                                               ; preds = %89, %85, %80
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._DHCP6_INF_CB, ptr %98, i32 0, i32 0
  %100 = call ptr @RemoveEntryList(ptr noundef %99)
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %101)
  br label %102

102:                                              ; preds = %97, %70
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %104, ptr %8, align 8, !tbaa !5
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._LIST_ENTRY, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !18
  store ptr %107, ptr %9, align 8, !tbaa !5
  br label %65, !llvm.loop !30

108:                                              ; preds = %65
  br label %109

109:                                              ; preds = %108, %48
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %110, i32 0, i32 0
  %112 = call ptr @RemoveEntryList(ptr noundef %111)
  br label %113

113:                                              ; preds = %109
  %114 = call zeroext i8 @DebugAssertEnabled()
  %115 = icmp ne i8 %114, 0
  br i1 %115, label %116, label %123

116:                                              ; preds = %113
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %117, i32 0, i32 2
  %119 = load ptr, ptr %118, align 8, !tbaa !19
  %120 = icmp ne ptr %119, null
  br i1 %120, label %122, label %121

121:                                              ; preds = %116
  call void @DebugAssert(ptr noundef @.str, i64 noundef 283, ptr noundef @.str.2)
  br label %122

122:                                              ; preds = %121, %116
  br label %123

123:                                              ; preds = %122, %113
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %126, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !19
  call void @FreePool(ptr noundef %128)
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  call void @FreePool(ptr noundef %129)
  store i64 0, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %137

130:                                              ; preds = %42
  br label %131

131:                                              ; preds = %130
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %132, ptr %8, align 8, !tbaa !5
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._LIST_ENTRY, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !18
  store ptr %135, ptr %9, align 8, !tbaa !5
  br label %20, !llvm.loop !32

136:                                              ; preds = %20
  store i64 -9223372036854775794, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %137

137:                                              ; preds = %136, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  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
  %138 = load i64, ptr %4, align 8
  ret i64 %138
}

declare ptr @RemoveEntryList(ptr noundef) #1

declare void @FreePool(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 160}
!13 = !{!"_DHCP6_INSTANCE", !10, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !15, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !16, i64 136, !14, i64 160, !14, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !17, i64 216, !7, i64 224, !7, i64 225, !17, i64 232}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"_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}
!16 = !{!"_DHCP6_IA_CB", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!17 = !{!"long long", !7, i64 0}
!18 = !{!14, !6, i64 0}
!19 = !{!20, !6, i64 24}
!20 = !{!"_DHCP6_TX_CB", !14, i64 0, !10, i64 16, !6, i64 24, !21, i64 32, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !6, i64 64, !7, i64 72}
!21 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!22 = !{!20, !10, i64 16}
!23 = !{!13, !6, i64 176}
!24 = !{!25, !10, i64 16}
!25 = !{!"_DHCP6_INF_CB", !14, i64 0, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!26 = !{!25, !6, i64 40}
!27 = !{!28, !6, i64 104}
!28 = !{!"", !29, 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}
!29 = !{!"", !17, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}


; 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 [131 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775794, 1) i64 @Dhcp6DequeueRetry(ptr noundef readonly %0, i32 noundef %1, i8 noundef zeroext %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %0, i64 160
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  br label %6

6:                                                ; preds = %13, %3
  %.031 = phi ptr [ %5, %3 ], [ %.032, %13 ]
  %.032 = load ptr, ptr %.031, align 8, !tbaa !15
  %.not = icmp eq ptr %.031, %4
  br i1 %.not, label %.loopexit41, label %7

7:                                                ; preds = %6
  %8 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not36 = icmp eq i8 %8, 0
  br i1 %.not36, label %13, label %9

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %.031, i64 24
  %11 = load ptr, ptr %10, align 8, !tbaa !16
  %.not37 = icmp eq ptr %11, null
  br i1 %.not37, label %12, label %13

12:                                               ; preds = %9
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 253, ptr noundef nonnull @.str.2) #2
  br label %13

13:                                               ; preds = %9, %12, %7
  %14 = getelementptr inbounds i8, ptr %.031, i64 16
  %15 = load i32, ptr %14, align 8, !tbaa !19
  %16 = icmp eq i32 %15, %1
  br i1 %16, label %17, label %6, !llvm.loop !20

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %.031, i64 24
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load i32, ptr %20, align 1
  %22 = and i32 %21, 255
  %23 = icmp eq i32 %22, 11
  br i1 %23, label %24, label %.loopexit

24:                                               ; preds = %17
  %25 = getelementptr inbounds i8, ptr %0, i64 176
  %26 = load ptr, ptr %25, align 8, !tbaa !22
  %.not3844 = icmp eq ptr %26, %25
  br i1 %.not3844, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %24
  %.13343 = load ptr, ptr %26, align 8, !tbaa !15
  %.not47 = icmp eq i8 %2, 0
  br i1 %.not47, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %32
  %.13346.us = phi ptr [ %.133.us, %32 ], [ %.13343, %.lr.ph ]
  %.145.us = phi ptr [ %.13346.us, %32 ], [ %26, %.lr.ph ]
  %27 = getelementptr inbounds i8, ptr %.145.us, i64 16
  %28 = load i32, ptr %27, align 8, !tbaa !23
  %29 = icmp eq i32 %28, %1
  br i1 %29, label %30, label %32

30:                                               ; preds = %.lr.ph.split.us
  %31 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.145.us) #2
  tail call void @FreePool(ptr noundef nonnull %.145.us) #2
  br label %32

32:                                               ; preds = %30, %.lr.ph.split.us
  %.133.us = load ptr, ptr %.13346.us, align 8, !tbaa !15
  %.not38.us = icmp eq ptr %.13346.us, %25
  br i1 %.not38.us, label %.loopexit, label %.lr.ph.split.us, !llvm.loop !25

.lr.ph.split:                                     ; preds = %.lr.ph, %46
  %.13346 = phi ptr [ %.133, %46 ], [ %.13343, %.lr.ph ]
  %.145 = phi ptr [ %.13346, %46 ], [ %26, %.lr.ph ]
  %33 = getelementptr inbounds i8, ptr %.145, i64 16
  %34 = load i32, ptr %33, align 8, !tbaa !23
  %35 = icmp eq i32 %34, %1
  br i1 %35, label %36, label %46

36:                                               ; preds = %.lr.ph.split
  %37 = getelementptr inbounds i8, ptr %.145, i64 40
  %38 = load ptr, ptr %37, align 8, !tbaa !26
  %.not48 = icmp eq ptr %38, null
  br i1 %.not48, label %44, label %39

39:                                               ; preds = %36
  %40 = load ptr, ptr @gBS, align 8, !tbaa !27
  %41 = getelementptr inbounds i8, ptr %40, i64 104
  %42 = load ptr, ptr %41, align 8, !tbaa !28
  %43 = tail call i64 %42(ptr noundef nonnull %38) #2
  br label %44

44:                                               ; preds = %39, %36
  %45 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.145) #2
  tail call void @FreePool(ptr noundef nonnull %.145) #2
  br label %46

46:                                               ; preds = %.lr.ph.split, %44
  %.133 = load ptr, ptr %.13346, align 8, !tbaa !15
  %.not38 = icmp eq ptr %.13346, %25
  br i1 %.not38, label %.loopexit, label %.lr.ph.split, !llvm.loop !25

.loopexit:                                        ; preds = %46, %32, %24, %17
  %47 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.031) #2
  %48 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not39 = icmp ne i8 %48, 0
  %.pre51 = load ptr, ptr %18, align 8, !tbaa !16
  %.not40 = icmp eq ptr %.pre51, null
  %or.cond = select i1 %.not39, i1 %.not40, i1 false
  br i1 %or.cond, label %49, label %50

49:                                               ; preds = %.loopexit
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 283, ptr noundef nonnull @.str.2) #2
  %.pre = load ptr, ptr %18, align 8, !tbaa !16
  br label %50

50:                                               ; preds = %49, %.loopexit
  %51 = phi ptr [ %.pre, %49 ], [ %.pre51, %.loopexit ]
  tail call void @FreePool(ptr noundef %51) #2
  tail call void @FreePool(ptr noundef nonnull %.031) #2
  br label %.loopexit41

.loopexit41:                                      ; preds = %6, %50
  %.0 = phi i64 [ 0, %50 ], [ -9223372036854775794, %6 ]
  ret i64 %.0
}

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 #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, !10, i64 160}
!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 = !{!11, !10, i64 0}
!16 = !{!17, !10, i64 24}
!17 = !{!"_DHCP6_TX_CB", !11, i64 0, !7, i64 16, !10, i64 24, !18, i64 32, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !10, i64 64, !8, i64 72}
!18 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12}
!19 = !{!17, !7, i64 16}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!6, !10, i64 176}
!23 = !{!24, !7, i64 16}
!24 = !{!"_DHCP6_INF_CB", !11, i64 0, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!25 = distinct !{!25, !21}
!26 = !{!24, !10, i64 40}
!27 = !{!10, !10, i64 0}
!28 = !{!29, !10, i64 104}
!29 = !{!"", !30, 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}
!30 = !{!"", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass