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

; 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

declare ptr @RemoveEntryList(ptr noundef) #1

declare void @FreePool(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @Dhcp6CleanupRetry(ptr noundef %0, i32 noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = icmp eq i32 %9, 1
  br i1 %10, label %14, label %11

11:                                               ; preds = %2
  %12 = load i32, ptr %4, align 4, !tbaa !9
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %68

14:                                               ; preds = %11, %2
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %15, i32 0, i32 9
  %17 = getelementptr inbounds %struct._LIST_ENTRY, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  store ptr %18, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._LIST_ENTRY, ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  store ptr %21, ptr %6, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %62, %14
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %24, i32 0, i32 9
  %26 = icmp ne ptr %23, %25
  br i1 %26, label %27, label %67

27:                                               ; preds = %22
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = ptrtoint ptr %28 to i64
  %30 = sub i64 %29, 0
  %31 = inttoptr i64 %30 to ptr
  store ptr %31, ptr %7, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %27
  %33 = call zeroext i8 @DebugAssertEnabled()
  %34 = icmp ne i8 %33, 0
  br i1 %34, label %35, label %42

35:                                               ; preds = %32
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %36, i32 0, i32 2
  %38 = load ptr, ptr %37, align 8, !tbaa !18
  %39 = icmp ne ptr %38, null
  br i1 %39, label %41, label %40

40:                                               ; preds = %35
  call void @DebugAssert(ptr noundef @.str, i64 noundef 320, ptr noundef @.str.2)
  br label %41

41:                                               ; preds = %40, %35
  br label %42

42:                                               ; preds = %41, %32
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  %48 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %47, i32 0, i32 2
  %49 = getelementptr inbounds %struct.anon, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 1
  %51 = and i32 %50, 255
  %52 = icmp ne i32 %51, 11
  br i1 %52, label %53, label %61

53:                                               ; preds = %44
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %54, i32 0, i32 0
  %56 = call ptr @RemoveEntryList(ptr noundef %55)
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %57, i32 0, i32 2
  %59 = load ptr, ptr %58, align 8, !tbaa !18
  call void @FreePool(ptr noundef %59)
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %60)
  br label %61

61:                                               ; preds = %53, %44
  br label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %63, ptr %5, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._LIST_ENTRY, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !17
  store ptr %66, ptr %6, align 8, !tbaa !5
  br label %22, !llvm.loop !21

67:                                               ; preds = %22
  br label %68

68:                                               ; preds = %67, %11
  %69 = load i32, ptr %4, align 4, !tbaa !9
  %70 = icmp eq i32 %69, 2
  br i1 %70, label %74, label %71

71:                                               ; preds = %68
  %72 = load i32, ptr %4, align 4, !tbaa !9
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %168

74:                                               ; preds = %71, %68
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %75, i32 0, i32 9
  %77 = getelementptr inbounds %struct._LIST_ENTRY, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !11
  store ptr %78, ptr %5, align 8, !tbaa !5
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._LIST_ENTRY, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !17
  store ptr %81, ptr %6, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %122, %74
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %84, i32 0, i32 9
  %86 = icmp ne ptr %83, %85
  br i1 %86, label %87, label %127

87:                                               ; preds = %82
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = ptrtoint ptr %88 to i64
  %90 = sub i64 %89, 0
  %91 = inttoptr i64 %90 to ptr
  store ptr %91, ptr %7, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %87
  %93 = call zeroext i8 @DebugAssertEnabled()
  %94 = icmp ne i8 %93, 0
  br i1 %94, label %95, label %102

95:                                               ; preds = %92
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %96, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !18
  %99 = icmp ne ptr %98, null
  br i1 %99, label %101, label %100

100:                                              ; preds = %95
  call void @DebugAssert(ptr noundef @.str, i64 noundef 341, ptr noundef @.str.2)
  br label %101

101:                                              ; preds = %100, %95
  br label %102

102:                                              ; preds = %101, %92
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %105, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !18
  %108 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %107, i32 0, i32 2
  %109 = getelementptr inbounds %struct.anon, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 1
  %111 = and i32 %110, 255
  %112 = icmp eq i32 %111, 11
  br i1 %112, label %113, label %121

113:                                              ; preds = %104
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %114, i32 0, i32 0
  %116 = call ptr @RemoveEntryList(ptr noundef %115)
  %117 = load ptr, ptr %7, 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 !18
  call void @FreePool(ptr noundef %119)
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %120)
  br label %121

121:                                              ; preds = %113, %104
  br label %122

122:                                              ; preds = %121
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %123, ptr %5, align 8, !tbaa !5
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._LIST_ENTRY, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !17
  store ptr %126, ptr %6, align 8, !tbaa !5
  br label %82, !llvm.loop !23

127:                                              ; preds = %82
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %128, i32 0, i32 10
  %130 = getelementptr inbounds %struct._LIST_ENTRY, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !24
  store ptr %131, ptr %5, align 8, !tbaa !5
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._LIST_ENTRY, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !17
  store ptr %134, ptr %6, align 8, !tbaa !5
  br label %135

135:                                              ; preds = %162, %127
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %137, i32 0, i32 10
  %139 = icmp ne ptr %136, %138
  br i1 %139, label %140, label %167

140:                                              ; preds = %135
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = ptrtoint ptr %141 to i64
  %143 = sub i64 %142, 0
  %144 = inttoptr i64 %143 to ptr
  store ptr %144, ptr %8, align 8, !tbaa !5
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._DHCP6_INF_CB, ptr %145, i32 0, i32 4
  %147 = load ptr, ptr %146, align 8, !tbaa !25
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %157

149:                                              ; preds = %140
  %150 = load ptr, ptr @gBS, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %150, i32 0, i32 11
  %152 = load ptr, ptr %151, align 8, !tbaa !27
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._DHCP6_INF_CB, ptr %153, i32 0, i32 4
  %155 = load ptr, ptr %154, align 8, !tbaa !25
  %156 = call i64 %152(ptr noundef %155)
  br label %157

157:                                              ; preds = %149, %140
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._DHCP6_INF_CB, ptr %158, i32 0, i32 0
  %160 = call ptr @RemoveEntryList(ptr noundef %159)
  %161 = load ptr, ptr %8, align 8, !tbaa !5
  call void @FreePool(ptr noundef %161)
  br label %162

162:                                              ; preds = %157
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %163, ptr %5, align 8, !tbaa !5
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct._LIST_ENTRY, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !17
  store ptr %166, ptr %6, align 8, !tbaa !5
  br label %135, !llvm.loop !30

167:                                              ; preds = %135
  br label %168

168:                                              ; preds = %167, %71
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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 = !{!12, !6, i64 160}
!12 = !{!"_DHCP6_INSTANCE", !10, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !14, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !15, i64 136, !13, i64 160, !13, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !16, i64 216, !7, i64 224, !7, i64 225, !16, i64 232}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!"_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}
!15 = !{!"_DHCP6_IA_CB", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!16 = !{!"long long", !7, i64 0}
!17 = !{!13, !6, i64 0}
!18 = !{!19, !6, i64 24}
!19 = !{!"_DHCP6_TX_CB", !13, i64 0, !10, i64 16, !6, i64 24, !20, i64 32, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !6, i64 64, !7, i64 72}
!20 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!12, !6, i64 176}
!25 = !{!26, !6, i64 40}
!26 = !{!"_DHCP6_INF_CB", !13, i64 0, !10, i64 16, !6, i64 24, !6, i64 32, !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 = !{!"", !16, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!30 = distinct !{!30, !22}


; 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

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @Dhcp6CleanupRetry(ptr noundef readonly %0, i32 noundef %1) local_unnamed_addr #1 {
  %or.cond = icmp ult i32 %1, 2
  br i1 %or.cond, label %3, label %.loopexit53

3:                                                ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 160
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not55 = icmp eq ptr %5, %4
  br i1 %.not55, label %.loopexit53, label %.lr.ph

.lr.ph:                                           ; preds = %3, %20
  %.056 = phi ptr [ %.04157, %20 ], [ %5, %3 ]
  %.04157 = load ptr, ptr %.056, align 8, !tbaa !15
  %6 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not50 = icmp eq i8 %6, 0
  br i1 %.not50, label %11, label %7

7:                                                ; preds = %.lr.ph
  %8 = getelementptr inbounds i8, ptr %.056, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !16
  %.not51 = icmp eq ptr %9, null
  br i1 %.not51, label %10, label %11

10:                                               ; preds = %7
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 320, ptr noundef nonnull @.str.2) #2
  br label %11

11:                                               ; preds = %7, %10, %.lr.ph
  %12 = getelementptr inbounds i8, ptr %.056, i64 24
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load i32, ptr %14, align 1
  %16 = and i32 %15, 255
  %.not52 = icmp eq i32 %16, 11
  br i1 %.not52, label %20, label %17

17:                                               ; preds = %11
  %18 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.056) #2
  %19 = load ptr, ptr %12, align 8, !tbaa !16
  tail call void @FreePool(ptr noundef %19) #2
  tail call void @FreePool(ptr noundef nonnull %.056) #2
  br label %20

20:                                               ; preds = %11, %17
  %.not = icmp eq ptr %.04157, %4
  br i1 %.not, label %.loopexit53, label %.lr.ph, !llvm.loop !19

.loopexit53:                                      ; preds = %20, %3, %2
  %21 = and i32 %1, -3
  %or.cond3 = icmp eq i32 %21, 0
  br i1 %or.cond3, label %22, label %.loopexit

22:                                               ; preds = %.loopexit53
  %23 = getelementptr inbounds i8, ptr %0, i64 160
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %.not4559 = icmp eq ptr %24, %23
  br i1 %.not4559, label %._crit_edge, label %.lr.ph62

.lr.ph62:                                         ; preds = %22, %40
  %.160 = phi ptr [ %.14261, %40 ], [ %24, %22 ]
  %.14261 = load ptr, ptr %.160, align 8, !tbaa !15
  %25 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not48 = icmp eq i8 %25, 0
  br i1 %.not48, label %30, label %26

26:                                               ; preds = %.lr.ph62
  %27 = getelementptr inbounds i8, ptr %.160, i64 24
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %.not49 = icmp eq ptr %28, null
  br i1 %.not49, label %29, label %30

29:                                               ; preds = %26
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 341, ptr noundef nonnull @.str.2) #2
  br label %30

30:                                               ; preds = %26, %29, %.lr.ph62
  %31 = getelementptr inbounds i8, ptr %.160, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %34 = load i32, ptr %33, align 1
  %35 = and i32 %34, 255
  %36 = icmp eq i32 %35, 11
  br i1 %36, label %37, label %40

37:                                               ; preds = %30
  %38 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.160) #2
  %39 = load ptr, ptr %31, align 8, !tbaa !16
  tail call void @FreePool(ptr noundef %39) #2
  tail call void @FreePool(ptr noundef nonnull %.160) #2
  br label %40

40:                                               ; preds = %30, %37
  %.not45 = icmp eq ptr %.14261, %23
  br i1 %.not45, label %._crit_edge, label %.lr.ph62, !llvm.loop !21

._crit_edge:                                      ; preds = %40, %22
  %41 = getelementptr inbounds i8, ptr %0, i64 176
  %42 = load ptr, ptr %41, align 8, !tbaa !22
  %.not4664 = icmp eq ptr %42, %41
  br i1 %.not4664, label %.loopexit, label %.lr.ph68

.lr.ph68:                                         ; preds = %._crit_edge, %50
  %.265 = phi ptr [ %.24366, %50 ], [ %42, %._crit_edge ]
  %.24366 = load ptr, ptr %.265, align 8, !tbaa !15
  %43 = getelementptr inbounds i8, ptr %.265, i64 40
  %44 = load ptr, ptr %43, align 8, !tbaa !23
  %.not47 = icmp eq ptr %44, null
  br i1 %.not47, label %50, label %45

45:                                               ; preds = %.lr.ph68
  %46 = load ptr, ptr @gBS, align 8, !tbaa !25
  %47 = getelementptr inbounds i8, ptr %46, i64 104
  %48 = load ptr, ptr %47, align 8, !tbaa !26
  %49 = tail call i64 %48(ptr noundef nonnull %44) #2
  br label %50

50:                                               ; preds = %45, %.lr.ph68
  %51 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.265) #2
  tail call void @FreePool(ptr noundef nonnull %.265) #2
  %.not46 = icmp eq ptr %.24366, %41
  br i1 %.not46, label %.loopexit, label %.lr.ph68, !llvm.loop !29

.loopexit:                                        ; preds = %50, %._crit_edge, %.loopexit53
  ret void
}

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 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!6, !10, i64 176}
!23 = !{!24, !10, i64 40}
!24 = !{!"_DHCP6_INF_CB", !11, i64 0, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!25 = !{!10, !10, i64 0}
!26 = !{!27, !10, i64 104}
!27 = !{!"", !28, 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}
!28 = !{!"", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!29 = distinct !{!29, !20}


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