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

; 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.NET_BUF = type { i32, i64, %struct._LIST_ENTRY, %union.NET_IP_HEAD, ptr, ptr, [64 x i8], ptr, i32, i32, [1 x %struct.NET_BLOCK_OP] }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, 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_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._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._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 }

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [24 x i8], align 1

; 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

declare ptr @AllocateZeroPool(i64 noundef) #1

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

declare void @FreePool(ptr noundef) #1

declare void @NetbufFree(ptr noundef) #1

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

22:                                               ; preds = %4
  %23 = call zeroext i8 @DebugAssertEnabled()
  %24 = icmp ne i8 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %22
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2819, ptr noundef @.str.19)
  br label %29

29:                                               ; preds = %28, %25
  br label %30

30:                                               ; preds = %29, %22
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  br label %33

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

36:                                               ; preds = %33
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2820, ptr noundef @.str.20)
  br label %40

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

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

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %44, ptr %11, align 8, !tbaa !5
  store ptr null, ptr %12, align 8, !tbaa !5
  store ptr null, ptr %10, align 8, !tbaa !5
  store i8 0, ptr %15, align 1, !tbaa !11
  store i8 0, ptr %16, align 1, !tbaa !11
  %45 = load i64, ptr %7, align 8, !tbaa !9
  %46 = icmp slt i64 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %43
  store i32 1, ptr %21, align 4
  br label %173

48:                                               ; preds = %43
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.NET_BUF, ptr %49, i32 0, i32 9
  %51 = load i32, ptr %50, align 4, !tbaa !12
  %52 = zext i32 %51 to i64
  %53 = add i64 13, %52
  %54 = trunc i64 %53 to i32
  store i32 %54, ptr %14, align 4, !tbaa !16
  %55 = load i32, ptr %14, align 4, !tbaa !16
  %56 = zext i32 %55 to i64
  %57 = call ptr @AllocateZeroPool(i64 noundef %56)
  store ptr %57, ptr %10, align 8, !tbaa !5
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %61

60:                                               ; preds = %48
  br label %166

61:                                               ; preds = %48
  %62 = load i32, ptr %14, align 4, !tbaa !16
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %63, i32 0, i32 0
  store i32 %62, ptr %64, align 1, !tbaa !17
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %65, i32 0, i32 2
  %67 = getelementptr inbounds %struct.anon, ptr %66, i32 0, i32 0
  store ptr %67, ptr %9, align 8, !tbaa !5
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.NET_BUF, ptr %69, i32 0, i32 9
  %71 = load i32, ptr %70, align 4, !tbaa !12
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = call i32 @NetbufCopy(ptr noundef %68, i32 noundef 0, i32 noundef %71, ptr noundef %72)
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %74, i32 0, i32 1
  store i32 %73, ptr %75, align 1, !tbaa !21
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 1, !tbaa !21
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %61
  br label %166

81:                                               ; preds = %61
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %82, i32 0, i32 9
  %84 = getelementptr inbounds %struct._LIST_ENTRY, ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !22
  store ptr %85, ptr %17, align 8, !tbaa !5
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._LIST_ENTRY, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !25
  store ptr %88, ptr %18, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %147, %81
  %90 = load ptr, ptr %17, align 8, !tbaa !5
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %91, i32 0, i32 9
  %93 = icmp ne ptr %90, %92
  br i1 %93, label %94, label %152

94:                                               ; preds = %89
  %95 = load ptr, ptr %17, align 8, !tbaa !5
  %96 = ptrtoint ptr %95 to i64
  %97 = sub i64 %96, ptrtoint (ptr getelementptr inbounds (%struct._DHCP6_INSTANCE, ptr null, i32 0, i32 3) to i64)
  %98 = inttoptr i64 %97 to ptr
  store ptr %98, ptr %12, align 8, !tbaa !5
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %99, i32 0, i32 9
  %101 = getelementptr inbounds %struct._LIST_ENTRY, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !26
  store ptr %102, ptr %19, align 8, !tbaa !5
  %103 = load ptr, ptr %19, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._LIST_ENTRY, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !25
  store ptr %105, ptr %20, align 8, !tbaa !5
  br label %106

106:                                              ; preds = %137, %94
  %107 = load ptr, ptr %19, align 8, !tbaa !5
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %108, i32 0, i32 9
  %110 = icmp ne ptr %107, %109
  br i1 %110, label %111, label %142

111:                                              ; preds = %106
  %112 = load ptr, ptr %19, align 8, !tbaa !5
  %113 = ptrtoint ptr %112 to i64
  %114 = sub i64 %113, 0
  %115 = inttoptr i64 %114 to ptr
  store ptr %115, ptr %13, align 8, !tbaa !5
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %116, i32 0, i32 2
  %118 = getelementptr inbounds %struct.anon, ptr %117, i32 0, i32 0
  %119 = load i32, ptr %118, align 1
  %120 = lshr i32 %119, 8
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._DHCP6_TX_CB, ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 8, !tbaa !30
  %124 = icmp eq i32 %120, %123
  br i1 %124, label %125, label %136

125:                                              ; preds = %111
  %126 = load ptr, ptr %13, 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 !33
  %129 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %128, i32 0, i32 2
  %130 = getelementptr inbounds %struct.anon, ptr %129, i32 0, i32 0
  %131 = load i32, ptr %130, align 1
  %132 = and i32 %131, 255
  %133 = icmp eq i32 %132, 11
  br i1 %133, label %134, label %135

134:                                              ; preds = %125
  store i8 1, ptr %16, align 1, !tbaa !11
  br label %135

135:                                              ; preds = %134, %125
  store i8 1, ptr %15, align 1, !tbaa !11
  br label %142

136:                                              ; preds = %111
  br label %137

137:                                              ; preds = %136
  %138 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %138, ptr %19, align 8, !tbaa !5
  %139 = load ptr, ptr %19, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._LIST_ENTRY, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !25
  store ptr %141, ptr %20, align 8, !tbaa !5
  br label %106, !llvm.loop !34

142:                                              ; preds = %135, %106
  %143 = load i8, ptr %15, align 1, !tbaa !11
  %144 = icmp ne i8 %143, 0
  br i1 %144, label %145, label %146

145:                                              ; preds = %142
  br label %152

146:                                              ; preds = %142
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %148, ptr %17, align 8, !tbaa !5
  %149 = load ptr, ptr %17, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct._LIST_ENTRY, ptr %149, i32 0, i32 0
  %151 = load ptr, ptr %150, align 8, !tbaa !25
  store ptr %151, ptr %18, align 8, !tbaa !5
  br label %89, !llvm.loop !36

152:                                              ; preds = %145, %89
  %153 = load i8, ptr %15, align 1, !tbaa !11
  %154 = icmp ne i8 %153, 0
  br i1 %154, label %156, label %155

155:                                              ; preds = %152
  br label %166

156:                                              ; preds = %152
  %157 = load i8, ptr %16, align 1, !tbaa !11
  %158 = icmp ne i8 %157, 0
  br i1 %158, label %159, label %162

159:                                              ; preds = %156
  %160 = load ptr, ptr %12, align 8, !tbaa !5
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  call void @Dhcp6HandleStateless(ptr noundef %160, ptr noundef %161)
  br label %165

162:                                              ; preds = %156
  %163 = load ptr, ptr %12, align 8, !tbaa !5
  %164 = load ptr, ptr %10, align 8, !tbaa !5
  call void @Dhcp6HandleStateful(ptr noundef %163, ptr noundef %164)
  br label %165

165:                                              ; preds = %162, %159
  br label %166

166:                                              ; preds = %165, %155, %80, %60
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %167)
  %168 = load ptr, ptr %10, align 8, !tbaa !5
  %169 = icmp ne ptr %168, null
  br i1 %169, label %170, label %172

170:                                              ; preds = %166
  %171 = load ptr, ptr %10, align 8, !tbaa !5
  call void @FreePool(ptr noundef %171)
  br label %172

172:                                              ; preds = %170, %166
  store i32 0, ptr %21, align 4
  br label %173

173:                                              ; preds = %172, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  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
  %174 = load i32, ptr %21, align 4
  switch i32 %174, label %176 [
    i32 0, label %175
    i32 1, label %175
  ]

175:                                              ; preds = %173, %173
  ret void

176:                                              ; preds = %173
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local void @Dhcp6HandleStateful(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Dhcp6HandleStateless(ptr noundef, ptr noundef) #2

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


; 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.19 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [24 x i8], align 1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

declare void @NetbufFree(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @Dhcp6ReceivePacket(ptr noundef %0, ptr nocapture noundef readnone %1, i64 noundef %2, ptr noundef readonly %3) local_unnamed_addr #1 {
  %5 = tail call zeroext i8 @DebugAssertEnabled() #2
  %6 = icmp eq i8 %5, 0
  %7 = icmp ne ptr %0, null
  %or.cond = or i1 %7, %6
  br i1 %or.cond, label %9, label %8

8:                                                ; preds = %4
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 2819, ptr noundef nonnull @.str.19) #2
  br label %9

9:                                                ; preds = %4, %8
  %10 = tail call zeroext i8 @DebugAssertEnabled() #2
  %11 = icmp eq i8 %10, 0
  %12 = icmp ne ptr %3, null
  %or.cond3 = or i1 %12, %11
  br i1 %or.cond3, label %14, label %13

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

14:                                               ; preds = %13, %9
  %15 = icmp slt i64 %2, 0
  br i1 %15, label %51, label %16

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %0, i64 132
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = add i32 %18, 13
  %20 = zext i32 %19 to i64
  %21 = tail call ptr @AllocateZeroPool(i64 noundef %20) #2
  %22 = icmp eq ptr %21, null
  br i1 %22, label %.thread65, label %23

.thread65:                                        ; preds = %16
  tail call void @NetbufFree(ptr noundef nonnull %0) #2
  br label %51

23:                                               ; preds = %16
  store i32 %19, ptr %21, align 1, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %21, i64 8
  %25 = load i32, ptr %17, align 4, !tbaa !5
  %26 = tail call i32 @NetbufCopy(ptr noundef nonnull %0, i32 noundef 0, i32 noundef %25, ptr noundef nonnull %24) #2
  %27 = getelementptr inbounds i8, ptr %21, i64 4
  store i32 %26, ptr %27, align 1, !tbaa !17
  %28 = icmp eq i32 %26, 0
  br i1 %28, label %.thread64, label %29

29:                                               ; preds = %23
  %30 = getelementptr inbounds i8, ptr %3, i64 80
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  %.not70 = icmp eq ptr %31, %30
  br i1 %.not70, label %.thread64, label %.lr.ph

.loopexit:                                        ; preds = %36
  %.not = icmp eq ptr %.04572, %30
  br i1 %.not, label %.thread64, label %.lr.ph

.lr.ph:                                           ; preds = %29, %.loopexit
  %.04671 = phi ptr [ %.04572, %.loopexit ], [ %31, %29 ]
  %.04572 = load ptr, ptr %.04671, align 8, !tbaa !21
  %32 = ptrtoint ptr %.04671 to i64
  %33 = add i64 %32, -24
  %34 = inttoptr i64 %33 to ptr
  %35 = getelementptr inbounds i8, ptr %34, i64 160
  br label %36

36:                                               ; preds = %37, %.lr.ph
  %.044.in = phi ptr [ %35, %.lr.ph ], [ %.044, %37 ]
  %.044 = load ptr, ptr %.044.in, align 8, !tbaa !21
  %.not55 = icmp eq ptr %.044, %35
  br i1 %.not55, label %.loopexit, label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %24, align 1
  %39 = lshr i32 %38, 8
  %40 = getelementptr inbounds i8, ptr %.044, i64 16
  %41 = load i32, ptr %40, align 8, !tbaa !22
  %42 = icmp eq i32 %39, %41
  br i1 %42, label %43, label %36, !llvm.loop !25

43:                                               ; preds = %37
  %44 = getelementptr inbounds i8, ptr %.044, i64 24
  %45 = load ptr, ptr %44, align 8, !tbaa !27
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = load i32, ptr %46, align 1
  %48 = and i32 %47, 255
  %.not66 = icmp eq i32 %48, 11
  br i1 %.not66, label %49, label %50

49:                                               ; preds = %43
  tail call void @Dhcp6HandleStateless(ptr noundef %34, ptr noundef nonnull %21)
  br label %.thread64

50:                                               ; preds = %43
  tail call void @Dhcp6HandleStateful(ptr noundef %34, ptr noundef nonnull %21)
  br label %.thread64

.thread64:                                        ; preds = %.loopexit, %29, %23, %50, %49
  tail call void @NetbufFree(ptr noundef %0) #2
  tail call void @FreePool(ptr noundef nonnull %21) #2
  br label %51

51:                                               ; preds = %.thread65, %.thread64, %14
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @Dhcp6HandleStateful(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @Dhcp6HandleStateless(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @NetbufCopy(ptr noundef, i32 noundef, i32 noundef, 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, !7, i64 132}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 16, !8, i64 32, !12, i64 40, !12, i64 48, !8, i64 56, !12, i64 120, !7, i64 128, !7, i64 132, !8, i64 136}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!"_LIST_ENTRY", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!14, !7, i64 0}
!14 = !{!"", !7, i64 0, !7, i64 4, !15, i64 8}
!15 = !{!"", !16, i64 0, !8, i64 4}
!16 = !{!"", !7, i64 0, !7, i64 1}
!17 = !{!14, !7, i64 4}
!18 = !{!19, !12, i64 80}
!19 = !{!"_DHCP6_SERVICE", !7, i64 0, !12, i64 8, !12, i64 16, !20, i64 24, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !7, i64 72, !11, i64 80, !10, i64 96}
!20 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !12, i64 0, !12, i64 8}
!21 = !{!11, !12, i64 0}
!22 = !{!23, !7, i64 16}
!23 = !{!"_DHCP6_TX_CB", !11, i64 0, !7, i64 16, !12, i64 24, !24, i64 32, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !12, i64 64, !8, i64 72}
!24 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!23, !12, i64 24}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass