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

; 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 @EfiDhcp6Decline(ptr noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %22, label %16

16:                                               ; preds = %3
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %22, label %19

19:                                               ; preds = %16
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %19, %16, %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %171

23:                                               ; preds = %19
  %24 = call zeroext i8 @DebugAssertEnabled()
  %25 = zext i8 %24 to i32
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %37

27:                                               ; preds = %23
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = ptrtoint ptr %28 to i64
  %30 = sub i64 %29, ptrtoint (ptr getelementptr inbounds (%struct._DHCP6_INSTANCE, ptr null, i32 0, i32 4) to i64)
  %31 = inttoptr i64 %30 to ptr
  %32 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %31, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !11
  %34 = icmp ne i32 %33, 1228294212
  br i1 %34, label %35, label %37

35:                                               ; preds = %27
  call void @DebugAssert(ptr noundef @.str, i64 noundef 891, ptr noundef @.str.1)
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  br label %42

37:                                               ; preds = %27, %23
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = ptrtoint ptr %38 to i64
  %40 = sub i64 %39, ptrtoint (ptr getelementptr inbounds (%struct._DHCP6_INSTANCE, ptr null, i32 0, i32 4) to i64)
  %41 = inttoptr i64 %40 to ptr
  br label %42

42:                                               ; preds = %37, %35
  %43 = phi ptr [ %36, %35 ], [ %41, %37 ]
  store ptr %43, ptr %11, align 8, !tbaa !5
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %44, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !17
  store ptr %46, ptr %12, align 8, !tbaa !5
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %47, i32 0, i32 6
  %49 = load ptr, ptr %48, align 8, !tbaa !18
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %52

51:                                               ; preds = %42
  store i64 -9223372036854775793, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %171

52:                                               ; preds = %42
  br label %53

53:                                               ; preds = %52
  %54 = call zeroext i8 @DebugAssertEnabled()
  %55 = icmp ne i8 %54, 0
  br i1 %55, label %56, label %64

56:                                               ; preds = %53
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %57, i32 0, i32 8
  %59 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !19
  %61 = icmp ne ptr %60, null
  br i1 %61, label %63, label %62

62:                                               ; preds = %56
  call void @DebugAssert(ptr noundef @.str, i64 noundef 901, ptr noundef @.str.2)
  br label %63

63:                                               ; preds = %62, %56
  br label %64

64:                                               ; preds = %63, %53
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %67, i32 0, i32 8
  %69 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !19
  %71 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !20
  %73 = icmp ne i32 %72, 6
  br i1 %73, label %74, label %75

74:                                               ; preds = %66
  store i64 -9223372036854775793, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %171

75:                                               ; preds = %66
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %76, i32 0, i32 8
  %78 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !19
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = call i64 @Dhcp6CheckAddress(ptr noundef %79, i32 noundef %80, ptr noundef %81)
  store i64 %82, ptr %8, align 8, !tbaa !24
  %83 = load i64, ptr %8, align 8, !tbaa !24
  %84 = icmp slt i64 %83, 0
  br i1 %84, label %85, label %87

85:                                               ; preds = %75
  %86 = load i64, ptr %8, align 8, !tbaa !24
  store i64 %86, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %171

87:                                               ; preds = %75
  %88 = load ptr, ptr @gBS, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !25
  %91 = call i64 %90(i64 noundef 8)
  store i64 %91, ptr %9, align 8, !tbaa !24
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %92, i32 0, i32 14
  store volatile i64 -9223372036854775788, ptr %93, align 8, !tbaa !28
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %94, i32 0, i32 8
  %96 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !19
  %98 = load i32, ptr %6, align 4, !tbaa !9
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = call ptr @Dhcp6DepriveAddress(ptr noundef %97, i32 noundef %98, ptr noundef %99)
  store ptr %100, ptr %10, align 8, !tbaa !5
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = icmp eq ptr %101, null
  br i1 %102, label %103, label %104

103:                                              ; preds = %87
  store i64 -9223372036854775799, ptr %8, align 8, !tbaa !24
  br label %160

104:                                              ; preds = %87
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = call i64 @Dhcp6SendDeclineMsg(ptr noundef %105, ptr noundef %106)
  store i64 %107, ptr %8, align 8, !tbaa !24
  %108 = load i64, ptr %8, align 8, !tbaa !24
  %109 = icmp slt i64 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %104
  br label %160

111:                                              ; preds = %104
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %112, i32 0, i32 7
  %114 = load ptr, ptr %113, align 8, !tbaa !29
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = call i64 @UdpIoRecvDatagram(ptr noundef %114, ptr noundef @Dhcp6ReceivePacket, ptr noundef %115, i32 noundef 0)
  store i64 %116, ptr %8, align 8, !tbaa !24
  %117 = load i64, ptr %8, align 8, !tbaa !24
  %118 = icmp slt i64 %117, 0
  br i1 %118, label %119, label %123

119:                                              ; preds = %111
  %120 = load i64, ptr %8, align 8, !tbaa !24
  %121 = icmp ne i64 %120, -9223372036854775788
  br i1 %121, label %122, label %123

122:                                              ; preds = %119
  br label %160

123:                                              ; preds = %119, %111
  %124 = load ptr, ptr %10, align 8, !tbaa !5
  call void @FreePool(ptr noundef %124)
  %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 !32
  %128 = load i64, ptr %9, align 8, !tbaa !24
  call void %127(i64 noundef %128)
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %129, i32 0, i32 6
  %131 = load ptr, ptr %130, align 8, !tbaa !18
  %132 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %131, i32 0, i32 5
  %133 = load ptr, ptr %132, align 8, !tbaa !33
  %134 = icmp eq ptr %133, null
  br i1 %134, label %135, label %159

135:                                              ; preds = %123
  br label %136

136:                                              ; preds = %141, %135
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %137, i32 0, i32 14
  %139 = load volatile i64, ptr %138, align 8, !tbaa !28
  %140 = icmp eq i64 %139, -9223372036854775788
  br i1 %140, label %141, label %155

141:                                              ; preds = %136
  %142 = load ptr, ptr %12, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %142, i32 0, i32 7
  %144 = load ptr, ptr %143, align 8, !tbaa !29
  %145 = getelementptr inbounds %struct._UDP_IO, ptr %144, i32 0, i32 10
  %146 = load ptr, ptr %145, align 8, !tbaa !35
  %147 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %146, i32 0, i32 6
  %148 = load ptr, ptr %147, align 8, !tbaa !36
  %149 = load ptr, ptr %12, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %149, i32 0, i32 7
  %151 = load ptr, ptr %150, align 8, !tbaa !29
  %152 = getelementptr inbounds %struct._UDP_IO, ptr %151, i32 0, i32 10
  %153 = load ptr, ptr %152, align 8, !tbaa !35
  %154 = call i64 %148(ptr noundef %153)
  br label %136, !llvm.loop !38

155:                                              ; preds = %136
  %156 = load ptr, ptr %11, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %156, i32 0, i32 14
  %158 = load volatile i64, ptr %157, align 8, !tbaa !28
  store i64 %158, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %171

159:                                              ; preds = %123
  store i64 0, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %171

160:                                              ; preds = %122, %110, %103
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %165

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

165:                                              ; preds = %163, %160
  %166 = load ptr, ptr @gBS, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %166, i32 0, i32 2
  %168 = load ptr, ptr %167, align 8, !tbaa !32
  %169 = load i64, ptr %9, align 8, !tbaa !24
  call void %168(i64 noundef %169)
  %170 = load i64, ptr %8, align 8, !tbaa !24
  store i64 %170, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %171

171:                                              ; preds = %165, %159, %155, %85, %74, %51, %22
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %172 = load i64, ptr %4, align 8
  ret i64 %172
}

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

declare void @FreePool(ptr noundef) #2

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

declare ptr @Dhcp6DepriveAddress(ptr noundef, i32 noundef, ptr noundef) #2

declare i64 @Dhcp6SendDeclineMsg(ptr noundef, ptr noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!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 = !{!12, !6, i64 16}
!18 = !{!12, !6, i64 120}
!19 = !{!12, !6, i64 136}
!20 = !{!21, !10, i64 8}
!21 = !{!"", !22, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !7, i64 28}
!22 = !{!"", !23, i64 0, !10, i64 4}
!23 = !{!"short", !7, i64 0}
!24 = !{!16, !16, i64 0}
!25 = !{!26, !6, i64 24}
!26 = !{!"", !27, 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}
!27 = !{!"", !16, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!28 = !{!12, !16, i64 216}
!29 = !{!30, !6, i64 64}
!30 = !{!"_DHCP6_SERVICE", !10, i64 0, !6, i64 8, !6, i64 16, !31, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !13, i64 80, !16, i64 96}
!31 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!32 = !{!26, !6, i64 32}
!33 = !{!34, !6, i64 40}
!34 = !{!"", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !22, i64 32, !6, i64 40, !7, i64 48, !7, i64 49, !6, i64 56}
!35 = !{!7, !7, i64 0}
!36 = !{!37, !6, i64 48}
!37 = !{!"_EFI_UDP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!38 = distinct !{!38, !39}
!39 = !{!"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 @EfiDhcp6Decline(ptr noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  %5 = icmp eq i32 %1, 0
  %or.cond = or i1 %4, %5
  %6 = icmp eq ptr %2, null
  %or.cond3 = or i1 %or.cond, %6
  br i1 %or.cond3, label %74, label %7

7:                                                ; preds = %3
  %8 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %8, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre60 = add i64 %.pre, -40
  %.pre62 = inttoptr i64 %.pre60 to ptr
  br i1 %.not, label %._crit_edge59, label %9

9:                                                ; preds = %7
  %10 = load i32, ptr %.pre62, align 8, !tbaa !5
  %.not51 = icmp eq i32 %10, 1228294212
  br i1 %.not51, label %._crit_edge59, label %11

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

._crit_edge59:                                    ; preds = %7, %9, %11
  %12 = phi ptr [ %0, %11 ], [ %.pre62, %9 ], [ %.pre62, %7 ]
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %12, i64 120
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = icmp eq ptr %16, null
  br i1 %17, label %74, label %18

18:                                               ; preds = %._crit_edge59
  %19 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not52 = icmp eq i8 %19, 0
  br i1 %.not52, label %24, label %20

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %12, i64 136
  %22 = load ptr, ptr %21, align 8, !tbaa !17
  %.not53 = icmp eq ptr %22, null
  br i1 %.not53, label %23, label %24

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

24:                                               ; preds = %20, %23, %18
  %25 = getelementptr inbounds i8, ptr %12, i64 136
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !18
  %.not54 = icmp eq i32 %28, 6
  br i1 %.not54, label %29, label %74

29:                                               ; preds = %24
  %30 = tail call i64 @Dhcp6CheckAddress(ptr noundef nonnull %26, i32 noundef %1, ptr noundef nonnull %2) #2
  %31 = icmp slt i64 %30, 0
  br i1 %31, label %74, label %32

32:                                               ; preds = %29
  %33 = load ptr, ptr @gBS, align 8, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %33, i64 24
  %35 = load ptr, ptr %34, align 8, !tbaa !23
  %36 = tail call i64 %35(i64 noundef 8) #2
  %37 = getelementptr inbounds i8, ptr %12, i64 216
  store volatile i64 -9223372036854775788, ptr %37, align 8, !tbaa !26
  %38 = load ptr, ptr %25, align 8, !tbaa !17
  %39 = tail call ptr @Dhcp6DepriveAddress(ptr noundef %38, i32 noundef %1, ptr noundef nonnull %2) #2
  %40 = icmp eq ptr %39, null
  br i1 %40, label %70, label %41

41:                                               ; preds = %32
  %42 = tail call i64 @Dhcp6SendDeclineMsg(ptr noundef nonnull %12, ptr noundef nonnull %39) #2
  %43 = icmp slt i64 %42, 0
  br i1 %43, label %69, label %44

44:                                               ; preds = %41
  %45 = getelementptr inbounds i8, ptr %14, i64 64
  %46 = load ptr, ptr %45, align 8, !tbaa !27
  %47 = tail call i64 @UdpIoRecvDatagram(ptr noundef %46, ptr noundef nonnull @Dhcp6ReceivePacket, ptr noundef %14, i32 noundef 0) #2
  %48 = icmp slt i64 %47, 0
  %49 = icmp ne i64 %47, -9223372036854775788
  %or.cond5 = and i1 %48, %49
  br i1 %or.cond5, label %69, label %50

50:                                               ; preds = %44
  tail call void @FreePool(ptr noundef nonnull %39) #2
  %51 = load ptr, ptr @gBS, align 8, !tbaa !22
  %52 = getelementptr inbounds i8, ptr %51, i64 32
  %53 = load ptr, ptr %52, align 8, !tbaa !30
  tail call void %53(i64 noundef %36) #2
  %54 = load ptr, ptr %15, align 8, !tbaa !16
  %55 = getelementptr inbounds i8, ptr %54, i64 40
  %56 = load ptr, ptr %55, align 8, !tbaa !31
  %57 = icmp eq ptr %56, null
  br i1 %57, label %.preheader, label %74

.preheader:                                       ; preds = %50
  %58 = load volatile i64, ptr %37, align 8, !tbaa !26
  %59 = icmp eq i64 %58, -9223372036854775788
  br i1 %59, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %60 = load ptr, ptr %45, align 8, !tbaa !27
  %61 = getelementptr inbounds i8, ptr %60, i64 744
  %62 = load ptr, ptr %61, align 8, !tbaa !33
  %63 = getelementptr inbounds i8, ptr %62, i64 48
  %64 = load ptr, ptr %63, align 8, !tbaa !34
  %65 = tail call i64 %64(ptr noundef %62) #2
  %66 = load volatile i64, ptr %37, align 8, !tbaa !26
  %67 = icmp eq i64 %66, -9223372036854775788
  br i1 %67, label %.lr.ph, label %._crit_edge, !llvm.loop !36

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %68 = load volatile i64, ptr %37, align 8, !tbaa !26
  br label %74

69:                                               ; preds = %44, %41
  %.043.ph = phi i64 [ %47, %44 ], [ %42, %41 ]
  tail call void @FreePool(ptr noundef nonnull %39) #2
  br label %70

70:                                               ; preds = %32, %69
  %.04358 = phi i64 [ %.043.ph, %69 ], [ -9223372036854775799, %32 ]
  %71 = load ptr, ptr @gBS, align 8, !tbaa !22
  %72 = getelementptr inbounds i8, ptr %71, i64 32
  %73 = load ptr, ptr %72, align 8, !tbaa !30
  tail call void %73(i64 noundef %36) #2
  br label %74

74:                                               ; preds = %50, %29, %24, %._crit_edge59, %3, %70, %._crit_edge
  %.0 = phi i64 [ %.04358, %70 ], [ %68, %._crit_edge ], [ -9223372036854775806, %3 ], [ -9223372036854775793, %._crit_edge59 ], [ -9223372036854775793, %24 ], [ %30, %29 ], [ 0, %50 ]
  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 @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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

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

declare ptr @Dhcp6DepriveAddress(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare i64 @Dhcp6SendDeclineMsg(ptr noundef, ptr noundef) local_unnamed_addr #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