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

; 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_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_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_DHCP6_PACKET = type <{ i32, i32, %struct.anon }>
%struct.anon = type <{ %struct.EFI_DHCP6_HEADER, [1 x i8] }>
%struct.EFI_DHCP6_HEADER = type { i32 }
%struct.EFI_DHCP6_DUID = type { i16, [1 x i8] }

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6EnqueueRetry(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; 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 ptr @AllocateZeroPool(i64 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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6CallbackUser(ptr noundef, i32 noundef, ptr noundef) #0

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) #2

declare ptr @Dhcp6SeekOption(ptr noundef, i32 noundef, i16 noundef zeroext) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6TransmitPacket(ptr noundef, ptr noundef, ptr noundef) #0

declare ptr @Dhcp6AppendOption(ptr noundef, i16 noundef zeroext, i16 noundef zeroext, ptr noundef) #2

declare ptr @Dhcp6AppendETOption(ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6SendReleaseMsg(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, 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 ptr, align 8
  %15 = alloca i16, align 2
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  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
  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 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #3
  br label %17

17:                                               ; preds = %2
  %18 = call zeroext i8 @DebugAssertEnabled()
  %19 = icmp ne i8 %18, 0
  br i1 %19, label %20, label %27

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

25:                                               ; preds = %20
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1400, ptr noundef @.str.3)
  br label %26

26:                                               ; preds = %25, %20
  br label %27

27:                                               ; preds = %26, %17
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %30

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

33:                                               ; preds = %30
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %34, i32 0, i32 8
  %36 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = icmp ne ptr %37, null
  br i1 %38, label %40, label %39

39:                                               ; preds = %33
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1401, ptr noundef @.str.4)
  br label %40

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

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

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  %44 = load ptr, ptr %4, 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 %11, align 8, !tbaa !5
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %47, i32 0, i32 6
  %49 = load ptr, ptr %48, align 8, !tbaa !18
  store ptr %49, ptr %9, align 8, !tbaa !5
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %50, i32 0, i32 8
  %52 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  store ptr %55, ptr %8, align 8, !tbaa !5
  br label %56

56:                                               ; preds = %43
  %57 = call zeroext i8 @DebugAssertEnabled()
  %58 = icmp ne i8 %57, 0
  br i1 %58, label %59, label %64

59:                                               ; preds = %56
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1407, ptr noundef @.str.14)
  br label %63

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

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

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  %68 = call zeroext i8 @DebugAssertEnabled()
  %69 = icmp ne i8 %68, 0
  br i1 %69, label %70, label %75

70:                                               ; preds = %67
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = icmp ne ptr %71, null
  br i1 %72, label %74, label %73

73:                                               ; preds = %70
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1408, ptr noundef @.str.15)
  br label %74

74:                                               ; preds = %73, %70
  br label %75

75:                                               ; preds = %74, %67
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %78, i32 0, i32 2
  %80 = getelementptr inbounds %struct.anon, ptr %79, i32 0, i32 1
  %81 = getelementptr inbounds [1 x i8], ptr %80, i64 0, i64 0
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 1, !tbaa !25
  %85 = sub i32 %84, 4
  %86 = call ptr @Dhcp6SeekOption(ptr noundef %81, i32 noundef %85, i16 noundef zeroext 2)
  store ptr %86, ptr %12, align 8, !tbaa !5
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = icmp eq ptr %87, null
  br i1 %88, label %89, label %90

89:                                               ; preds = %77
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %212

90:                                               ; preds = %77
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 2
  store ptr %92, ptr %10, align 8, !tbaa !5
  %93 = call ptr @AllocateZeroPool(i64 noundef 1024)
  store ptr %93, ptr %7, align 8, !tbaa !5
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = icmp eq ptr %94, null
  br i1 %95, label %96, label %97

96:                                               ; preds = %90
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %212

97:                                               ; preds = %90
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %98, i32 0, i32 0
  store i32 1024, ptr %99, align 1, !tbaa !29
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %100, i32 0, i32 1
  store i32 4, ptr %101, align 1, !tbaa !25
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %102, i32 0, i32 2
  %104 = getelementptr inbounds %struct.anon, ptr %103, i32 0, i32 0
  %105 = load i32, ptr %104, align 1
  %106 = and i32 %105, -256
  %107 = or i32 %106, 8
  store i32 %107, ptr %104, align 1
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %108, i32 0, i32 8
  %110 = load i32, ptr %109, align 8, !tbaa !30
  %111 = add i32 %110, 1
  store i32 %111, ptr %109, align 8, !tbaa !30
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %112, i32 0, i32 2
  %114 = getelementptr inbounds %struct.anon, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 1
  %116 = and i32 %110, 16777215
  %117 = shl i32 %116, 8
  %118 = and i32 %115, 255
  %119 = or i32 %118, %117
  store i32 %119, ptr %114, align 1
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %120, i32 0, i32 2
  %122 = getelementptr inbounds %struct.anon, ptr %121, i32 0, i32 1
  %123 = getelementptr inbounds [1 x i8], ptr %122, i64 0, i64 0
  store ptr %123, ptr %13, align 8, !tbaa !5
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %124, i32 0, i32 0
  %126 = load i16, ptr %125, align 2, !tbaa !31
  %127 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %126)
  store i16 %127, ptr %15, align 2, !tbaa !33
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 1)
  %130 = load i16, ptr %15, align 2, !tbaa !33
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %131, i32 0, i32 1
  %133 = getelementptr inbounds [1 x i8], ptr %132, i64 0, i64 0
  %134 = call ptr @Dhcp6AppendOption(ptr noundef %128, i16 noundef zeroext %129, i16 noundef zeroext %130, ptr noundef %133)
  store ptr %134, ptr %13, align 8, !tbaa !5
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 2)
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %137, i32 0, i32 0
  %139 = load i16, ptr %138, align 2, !tbaa !31
  %140 = load ptr, ptr %10, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %140, i32 0, i32 1
  %142 = getelementptr inbounds [1 x i8], ptr %141, i64 0, i64 0
  %143 = call ptr @Dhcp6AppendOption(ptr noundef %135, i16 noundef zeroext %136, i16 noundef zeroext %139, ptr noundef %142)
  store ptr %143, ptr %13, align 8, !tbaa !5
  %144 = load ptr, ptr %13, align 8, !tbaa !5
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = call ptr @Dhcp6AppendETOption(ptr noundef %144, ptr noundef %145, ptr noundef %14)
  store ptr %146, ptr %13, align 8, !tbaa !5
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %149, i32 0, i32 2
  %151 = getelementptr inbounds %struct.anon, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %151, align 1
  %153 = and i32 %152, 255
  %154 = call ptr @Dhcp6AppendIaOption(ptr noundef %147, ptr noundef %148, i32 noundef 0, i32 noundef 0, i32 noundef %153)
  store ptr %154, ptr %13, align 8, !tbaa !5
  %155 = load ptr, ptr %13, align 8, !tbaa !5
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %156, i32 0, i32 2
  %158 = getelementptr inbounds %struct.anon, ptr %157, i32 0, i32 1
  %159 = getelementptr inbounds [1 x i8], ptr %158, i64 0, i64 0
  %160 = ptrtoint ptr %155 to i64
  %161 = ptrtoint ptr %159 to i64
  %162 = sub i64 %160, %161
  %163 = trunc i64 %162 to i32
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %164, i32 0, i32 1
  %166 = load i32, ptr %165, align 1, !tbaa !25
  %167 = add i32 %166, %163
  store i32 %167, ptr %165, align 1, !tbaa !25
  br label %168

168:                                              ; preds = %97
  %169 = call zeroext i8 @DebugAssertEnabled()
  %170 = icmp ne i8 %169, 0
  br i1 %170, label %171, label %182

171:                                              ; preds = %168
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %172, i32 0, i32 0
  %174 = load i32, ptr %173, align 1, !tbaa !29
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %175, i32 0, i32 1
  %177 = load i32, ptr %176, align 1, !tbaa !25
  %178 = add i32 %177, 8
  %179 = icmp ugt i32 %174, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %171
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1472, ptr noundef @.str.9)
  br label %181

181:                                              ; preds = %180, %171
  br label %182

182:                                              ; preds = %181, %168
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = call i64 @Dhcp6CallbackUser(ptr noundef %185, i32 noundef 8, ptr noundef %7)
  store i64 %186, ptr %6, align 8, !tbaa !34
  %187 = load i64, ptr %6, align 8, !tbaa !34
  %188 = icmp slt i64 %187, 0
  br i1 %188, label %189, label %192

189:                                              ; preds = %184
  %190 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %190)
  %191 = load i64, ptr %6, align 8, !tbaa !34
  store i64 %191, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %212

192:                                              ; preds = %184
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %193, i32 0, i32 8
  %195 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %194, i32 0, i32 0
  %196 = load ptr, ptr %195, align 8, !tbaa !16
  %197 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %196, i32 0, i32 1
  store i32 5, ptr %197, align 8, !tbaa !35
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = load ptr, ptr %14, align 8, !tbaa !5
  %201 = call i64 @Dhcp6TransmitPacket(ptr noundef %198, ptr noundef %199, ptr noundef %200)
  store i64 %201, ptr %6, align 8, !tbaa !34
  %202 = load i64, ptr %6, align 8, !tbaa !34
  %203 = icmp slt i64 %202, 0
  br i1 %203, label %204, label %207

204:                                              ; preds = %192
  %205 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %205)
  %206 = load i64, ptr %6, align 8, !tbaa !34
  store i64 %206, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %212

207:                                              ; preds = %192
  %208 = load ptr, ptr %4, align 8, !tbaa !5
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  %210 = load ptr, ptr %14, align 8, !tbaa !5
  %211 = call i64 @Dhcp6EnqueueRetry(ptr noundef %208, ptr noundef %209, ptr noundef %210, ptr noundef null)
  store i64 %211, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %212

212:                                              ; preds = %207, %204, %189, %96, %89
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, 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
  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
  %213 = load i64, ptr %3, align 8
  ret i64 %213
}

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, !6, i64 120}
!10 = !{!"_DHCP6_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !12, i64 160, !12, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !15, i64 216, !7, i64 224, !7, i64 225, !15, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_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}
!14 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!15 = !{!"long long", !7, i64 0}
!16 = !{!10, !6, i64 136}
!17 = !{!10, !6, i64 16}
!18 = !{!19, !6, i64 56}
!19 = !{!"_DHCP6_SERVICE", !11, i64 0, !6, i64 8, !6, i64 16, !20, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !12, i64 80, !15, i64 96}
!20 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!21 = !{!22, !6, i64 16}
!22 = !{!"", !23, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !7, i64 28}
!23 = !{!"", !24, i64 0, !11, i64 4}
!24 = !{!"short", !7, i64 0}
!25 = !{!26, !11, i64 4}
!26 = !{!"", !11, i64 0, !11, i64 4, !27, i64 8}
!27 = !{!"", !28, i64 0, !7, i64 4}
!28 = !{!"", !11, i64 0, !11, i64 1}
!29 = !{!26, !11, i64 0}
!30 = !{!19, !11, i64 72}
!31 = !{!32, !24, i64 0}
!32 = !{!"", !24, i64 0, !7, i64 2}
!33 = !{!24, !24, i64 0}
!34 = !{!15, !15, i64 0}
!35 = !{!22, !11, i64 8}


; 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.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6EnqueueRetry(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

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

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #2

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

declare void @FreePool(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6CallbackUser(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) local_unnamed_addr #2

declare ptr @Dhcp6SeekOption(ptr noundef, i32 noundef, i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6TransmitPacket(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @Dhcp6AppendOption(ptr noundef, i16 noundef zeroext, i16 noundef zeroext, ptr noundef) local_unnamed_addr #2

declare ptr @Dhcp6AppendETOption(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @Dhcp6AppendIaOption(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6SendReleaseMsg(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %5 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %5, 0
  br i1 %.not, label %10, label %6

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 120
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %.not39 = icmp eq ptr %8, null
  br i1 %.not39, label %9, label %10

9:                                                ; preds = %6
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1400, ptr noundef nonnull @.str.3) #3
  br label %10

10:                                               ; preds = %2, %9, %6
  %11 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not40 = icmp eq i8 %11, 0
  br i1 %.not40, label %16, label %12

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 136
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  %.not41 = icmp eq ptr %14, null
  br i1 %.not41, label %15, label %16

15:                                               ; preds = %12
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1401, ptr noundef nonnull @.str.4) #3
  br label %16

16:                                               ; preds = %12, %15, %10
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = load ptr, ptr %17, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %18, i64 56
  %20 = load ptr, ptr %19, align 8, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %0, i64 136
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !20
  %25 = tail call zeroext i8 @DebugAssertEnabled() #3
  %26 = icmp eq i8 %25, 0
  %27 = icmp ne ptr %20, null
  %or.cond = select i1 %26, i1 true, i1 %27
  br i1 %or.cond, label %29, label %28

28:                                               ; preds = %16
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1407, ptr noundef nonnull @.str.14) #3
  br label %29

29:                                               ; preds = %16, %28
  %30 = tail call zeroext i8 @DebugAssertEnabled() #3
  %31 = icmp eq i8 %30, 0
  %32 = icmp ne ptr %24, null
  %or.cond3 = select i1 %31, i1 true, i1 %32
  br i1 %or.cond3, label %34, label %33

33:                                               ; preds = %29
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1408, ptr noundef nonnull @.str.15) #3
  br label %34

34:                                               ; preds = %33, %29
  %35 = getelementptr inbounds i8, ptr %24, i64 12
  %36 = getelementptr inbounds i8, ptr %24, i64 4
  %37 = load i32, ptr %36, align 1, !tbaa !24
  %38 = add i32 %37, -4
  %39 = tail call ptr @Dhcp6SeekOption(ptr noundef nonnull %35, i32 noundef %38, i16 noundef zeroext 2) #3
  %40 = icmp eq ptr %39, null
  br i1 %40, label %102, label %41

41:                                               ; preds = %34
  %42 = tail call ptr @AllocateZeroPool(i64 noundef 1024) #3
  store ptr %42, ptr %3, align 8, !tbaa !28
  %43 = icmp eq ptr %42, null
  br i1 %43, label %102, label %44

44:                                               ; preds = %41
  %45 = getelementptr inbounds i8, ptr %39, i64 2
  store i32 1024, ptr %42, align 1, !tbaa !29
  %46 = getelementptr inbounds i8, ptr %42, i64 4
  store i32 4, ptr %46, align 1, !tbaa !24
  %47 = getelementptr inbounds i8, ptr %42, i64 8
  %48 = load i32, ptr %47, align 1
  %49 = and i32 %48, -256
  %50 = or disjoint i32 %49, 8
  store i32 %50, ptr %47, align 1
  %51 = getelementptr inbounds i8, ptr %18, i64 72
  %52 = load i32, ptr %51, align 8, !tbaa !30
  %53 = add i32 %52, 1
  store i32 %53, ptr %51, align 8, !tbaa !30
  %54 = load i32, ptr %47, align 1
  %55 = shl i32 %52, 8
  %56 = and i32 %54, 255
  %57 = or disjoint i32 %56, %55
  store i32 %57, ptr %47, align 1
  %58 = getelementptr inbounds i8, ptr %42, i64 12
  %59 = load i16, ptr %20, align 2, !tbaa !31
  %60 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %59) #3
  %61 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext 1) #3
  %62 = getelementptr inbounds i8, ptr %20, i64 2
  %63 = tail call ptr @Dhcp6AppendOption(ptr noundef nonnull %58, i16 noundef zeroext %61, i16 noundef zeroext %60, ptr noundef nonnull %62) #3
  %64 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext 2) #3
  %65 = load i16, ptr %45, align 2, !tbaa !31
  %66 = getelementptr inbounds i8, ptr %39, i64 4
  %67 = tail call ptr @Dhcp6AppendOption(ptr noundef %63, i16 noundef zeroext %64, i16 noundef zeroext %65, ptr noundef nonnull %66) #3
  %68 = call ptr @Dhcp6AppendETOption(ptr noundef %67, ptr noundef nonnull %0, ptr noundef nonnull %4) #3
  %69 = load i32, ptr %47, align 1
  %70 = and i32 %69, 255
  %71 = call ptr @Dhcp6AppendIaOption(ptr noundef %68, ptr noundef %1, i32 noundef 0, i32 noundef 0, i32 noundef %70) #3
  %72 = ptrtoint ptr %71 to i64
  %73 = ptrtoint ptr %58 to i64
  %74 = sub i64 %72, %73
  %75 = trunc i64 %74 to i32
  %76 = load i32, ptr %46, align 1, !tbaa !24
  %77 = add i32 %76, %75
  store i32 %77, ptr %46, align 1, !tbaa !24
  %78 = call zeroext i8 @DebugAssertEnabled() #3
  %.not42 = icmp eq i8 %78, 0
  br i1 %.not42, label %85, label %79

79:                                               ; preds = %44
  %80 = load i32, ptr %42, align 1, !tbaa !29
  %81 = load i32, ptr %46, align 1, !tbaa !24
  %82 = add i32 %81, 8
  %83 = icmp ugt i32 %80, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %79
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1472, ptr noundef nonnull @.str.9) #3
  br label %85

85:                                               ; preds = %79, %84, %44
  %86 = call i64 @Dhcp6CallbackUser(ptr noundef nonnull %0, i32 noundef 8, ptr noundef nonnull %3)
  %87 = icmp slt i64 %86, 0
  br i1 %87, label %88, label %90

88:                                               ; preds = %85
  %89 = load ptr, ptr %3, align 8, !tbaa !28
  call void @FreePool(ptr noundef %89) #3
  br label %102

90:                                               ; preds = %85
  %91 = load ptr, ptr %21, align 8, !tbaa !15
  %92 = getelementptr inbounds i8, ptr %91, i64 8
  store i32 5, ptr %92, align 8, !tbaa !33
  %93 = load ptr, ptr %3, align 8, !tbaa !28
  %94 = load ptr, ptr %4, align 8, !tbaa !28
  %95 = call i64 @Dhcp6TransmitPacket(ptr noundef nonnull %0, ptr noundef %93, ptr noundef %94)
  %96 = icmp slt i64 %95, 0
  %97 = load ptr, ptr %3, align 8, !tbaa !28
  br i1 %96, label %98, label %99

98:                                               ; preds = %90
  call void @FreePool(ptr noundef %97) #3
  br label %102

99:                                               ; preds = %90
  %100 = load ptr, ptr %4, align 8, !tbaa !28
  %101 = call i64 @Dhcp6EnqueueRetry(ptr noundef nonnull %0, ptr noundef %97, ptr noundef %100, ptr noundef null)
  br label %102

102:                                              ; preds = %41, %34, %99, %98, %88
  %.0 = phi i64 [ %86, %88 ], [ %95, %98 ], [ %101, %99 ], [ -9223372036854775801, %34 ], [ -9223372036854775799, %41 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i64 %.0
}

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 = { mustprogress 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, !10, i64 120}
!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 136}
!16 = !{!6, !10, i64 16}
!17 = !{!18, !10, i64 56}
!18 = !{!"_DHCP6_SERVICE", !7, i64 0, !10, i64 8, !10, i64 16, !19, i64 24, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !11, i64 80, !14, i64 96}
!19 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!20 = !{!21, !10, i64 16}
!21 = !{!"", !22, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !8, i64 28}
!22 = !{!"", !23, i64 0, !7, i64 4}
!23 = !{!"short", !8, i64 0}
!24 = !{!25, !7, i64 4}
!25 = !{!"", !7, i64 0, !7, i64 4, !26, i64 8}
!26 = !{!"", !27, i64 0, !8, i64 4}
!27 = !{!"", !7, i64 0, !7, i64 1}
!28 = !{!10, !10, i64 0}
!29 = !{!25, !7, i64 0}
!30 = !{!18, !7, i64 72}
!31 = !{!32, !23, i64 0}
!32 = !{!"", !23, i64 0, !8, i64 2}
!33 = !{!21, !7, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass