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

; 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 @EfiDhcp6Release(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 ne i32 %17, 0
  br i1 %18, label %19, label %23

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, %3
  store i64 -9223372036854775806, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %171

23:                                               ; preds = %19, %16
  %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 1032, 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 1042, 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 @Dhcp6SendReleaseMsg(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 i64 @Dhcp6SendReleaseMsg(ptr noundef, ptr noundef) #2

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

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 @EfiDhcp6Release(ptr noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %75, label %5

5:                                                ; preds = %3
  %6 = icmp ne i32 %1, 0
  %7 = icmp eq ptr %2, null
  %or.cond = and i1 %6, %7
  br i1 %or.cond, label %75, label %8

8:                                                ; preds = %5
  %9 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %9, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre56 = add i64 %.pre, -40
  %.pre58 = inttoptr i64 %.pre56 to ptr
  br i1 %.not, label %._crit_edge55, label %10

10:                                               ; preds = %8
  %11 = load i32, ptr %.pre58, align 8, !tbaa !5
  %.not47 = icmp eq i32 %11, 1228294212
  br i1 %.not47, label %._crit_edge55, label %12

12:                                               ; preds = %10
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1032, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge55

._crit_edge55:                                    ; preds = %8, %10, %12
  %13 = phi ptr [ %0, %12 ], [ %.pre58, %10 ], [ %.pre58, %8 ]
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %13, i64 120
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %18 = icmp eq ptr %17, null
  br i1 %18, label %75, label %19

19:                                               ; preds = %._crit_edge55
  %20 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not48 = icmp eq i8 %20, 0
  br i1 %.not48, label %25, label %21

21:                                               ; preds = %19
  %22 = getelementptr inbounds i8, ptr %13, i64 136
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %.not49 = icmp eq ptr %23, null
  br i1 %.not49, label %24, label %25

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

25:                                               ; preds = %21, %24, %19
  %26 = getelementptr inbounds i8, ptr %13, i64 136
  %27 = load ptr, ptr %26, align 8, !tbaa !17
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %29 = load i32, ptr %28, align 8, !tbaa !18
  %.not50 = icmp eq i32 %29, 6
  br i1 %.not50, label %30, label %75

30:                                               ; preds = %25
  %31 = tail call i64 @Dhcp6CheckAddress(ptr noundef nonnull %27, i32 noundef %1, ptr noundef %2) #2
  %32 = icmp slt i64 %31, 0
  br i1 %32, label %75, label %33

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

42:                                               ; preds = %33
  %43 = tail call i64 @Dhcp6SendReleaseMsg(ptr noundef nonnull %13, ptr noundef nonnull %40) #2
  %44 = icmp slt i64 %43, 0
  br i1 %44, label %70, label %45

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

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

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

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

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %69 = load volatile i64, ptr %38, align 8, !tbaa !26
  br label %75

70:                                               ; preds = %45, %42
  %.041.ph = phi i64 [ %48, %45 ], [ %43, %42 ]
  tail call void @FreePool(ptr noundef nonnull %40) #2
  br label %71

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

75:                                               ; preds = %51, %30, %25, %._crit_edge55, %3, %5, %71, %._crit_edge
  %.0 = phi i64 [ %.04154, %71 ], [ %69, %._crit_edge ], [ -9223372036854775806, %5 ], [ -9223372036854775806, %3 ], [ -9223372036854775793, %._crit_edge55 ], [ -9223372036854775793, %25 ], [ %31, %30 ], [ 0, %51 ]
  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 i64 @Dhcp6SendReleaseMsg(ptr noundef, ptr noundef) local_unnamed_addr #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

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