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

; 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.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [26 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 @Dhcp6SendDeclineMsg(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 1262, ptr noundef @.str.5)
  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 1263, ptr noundef @.str.6)
  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
  br label %44

44:                                               ; preds = %43
  %45 = call zeroext i8 @DebugAssertEnabled()
  %46 = icmp ne i8 %45, 0
  br i1 %46, label %47, label %54

47:                                               ; preds = %44
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !17
  %51 = icmp ne ptr %50, null
  br i1 %51, label %53, label %52

52:                                               ; preds = %47
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1264, ptr noundef @.str.11)
  br label %53

53:                                               ; preds = %52, %47
  br label %54

54:                                               ; preds = %53, %44
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %57, i32 0, i32 2
  %59 = load ptr, ptr %58, align 8, !tbaa !17
  store ptr %59, ptr %11, align 8, !tbaa !5
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %60, i32 0, i32 6
  %62 = load ptr, ptr %61, align 8, !tbaa !18
  store ptr %62, ptr %9, align 8, !tbaa !5
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %63, i32 0, i32 8
  %65 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !16
  %67 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !21
  store ptr %68, ptr %8, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %56
  %70 = call zeroext i8 @DebugAssertEnabled()
  %71 = icmp ne i8 %70, 0
  br i1 %71, label %72, label %77

72:                                               ; preds = %69
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %76, label %75

75:                                               ; preds = %72
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1270, ptr noundef @.str.12)
  br label %76

76:                                               ; preds = %75, %72
  br label %77

77:                                               ; preds = %76, %69
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  %81 = call zeroext i8 @DebugAssertEnabled()
  %82 = icmp ne i8 %81, 0
  br i1 %82, label %83, label %88

83:                                               ; preds = %80
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %87, label %86

86:                                               ; preds = %83
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1271, ptr noundef @.str.13)
  br label %87

87:                                               ; preds = %86, %83
  br label %88

88:                                               ; preds = %87, %80
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %91, i32 0, i32 2
  %93 = getelementptr inbounds %struct.anon, ptr %92, i32 0, i32 1
  %94 = getelementptr inbounds [1 x i8], ptr %93, i64 0, i64 0
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %95, i32 0, i32 1
  %97 = load i32, ptr %96, align 1, !tbaa !25
  %98 = sub i32 %97, 4
  %99 = call ptr @Dhcp6SeekOption(ptr noundef %94, i32 noundef %98, i16 noundef zeroext 2)
  store ptr %99, ptr %12, align 8, !tbaa !5
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = icmp eq ptr %100, null
  br i1 %101, label %102, label %103

102:                                              ; preds = %90
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %227

103:                                              ; preds = %90
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 2
  store ptr %105, ptr %10, align 8, !tbaa !5
  %106 = call ptr @AllocateZeroPool(i64 noundef 1024)
  store ptr %106, ptr %7, align 8, !tbaa !5
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = icmp eq ptr %107, null
  br i1 %108, label %109, label %110

109:                                              ; preds = %103
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %227

110:                                              ; preds = %103
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %111, i32 0, i32 0
  store i32 1024, ptr %112, align 1, !tbaa !29
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %113, i32 0, i32 1
  store i32 4, ptr %114, align 1, !tbaa !25
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %115, i32 0, i32 2
  %117 = getelementptr inbounds %struct.anon, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 1
  %119 = and i32 %118, -256
  %120 = or i32 %119, 9
  store i32 %120, ptr %117, align 1
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %121, i32 0, i32 8
  %123 = load i32, ptr %122, align 8, !tbaa !30
  %124 = add i32 %123, 1
  store i32 %124, ptr %122, align 8, !tbaa !30
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %125, i32 0, i32 2
  %127 = getelementptr inbounds %struct.anon, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 1
  %129 = and i32 %123, 16777215
  %130 = shl i32 %129, 8
  %131 = and i32 %128, 255
  %132 = or i32 %131, %130
  store i32 %132, ptr %127, align 1
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %133, i32 0, i32 2
  %135 = getelementptr inbounds %struct.anon, ptr %134, i32 0, i32 1
  %136 = getelementptr inbounds [1 x i8], ptr %135, i64 0, i64 0
  store ptr %136, ptr %13, align 8, !tbaa !5
  %137 = load ptr, ptr %9, 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 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %139)
  store i16 %140, ptr %15, align 2, !tbaa !33
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 1)
  %143 = load i16, ptr %15, align 2, !tbaa !33
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %144, i32 0, i32 1
  %146 = getelementptr inbounds [1 x i8], ptr %145, i64 0, i64 0
  %147 = call ptr @Dhcp6AppendOption(ptr noundef %141, i16 noundef zeroext %142, i16 noundef zeroext %143, ptr noundef %146)
  store ptr %147, ptr %13, align 8, !tbaa !5
  %148 = load ptr, ptr %13, align 8, !tbaa !5
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = call ptr @Dhcp6AppendETOption(ptr noundef %148, ptr noundef %149, ptr noundef %14)
  store ptr %150, ptr %13, align 8, !tbaa !5
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  %152 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 2)
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %153, i32 0, i32 0
  %155 = load i16, ptr %154, align 2, !tbaa !31
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %156, i32 0, i32 1
  %158 = getelementptr inbounds [1 x i8], ptr %157, i64 0, i64 0
  %159 = call ptr @Dhcp6AppendOption(ptr noundef %151, i16 noundef zeroext %152, i16 noundef zeroext %155, ptr noundef %158)
  store ptr %159, ptr %13, align 8, !tbaa !5
  %160 = load ptr, ptr %13, align 8, !tbaa !5
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %162, i32 0, i32 2
  %164 = getelementptr inbounds %struct.anon, ptr %163, i32 0, i32 0
  %165 = load i32, ptr %164, align 1
  %166 = and i32 %165, 255
  %167 = call ptr @Dhcp6AppendIaOption(ptr noundef %160, ptr noundef %161, i32 noundef 0, i32 noundef 0, i32 noundef %166)
  store ptr %167, ptr %13, align 8, !tbaa !5
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %169, i32 0, i32 2
  %171 = getelementptr inbounds %struct.anon, ptr %170, i32 0, i32 1
  %172 = getelementptr inbounds [1 x i8], ptr %171, i64 0, i64 0
  %173 = ptrtoint ptr %168 to i64
  %174 = ptrtoint ptr %172 to i64
  %175 = sub i64 %173, %174
  %176 = trunc i64 %175 to i32
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %177, i32 0, i32 1
  %179 = load i32, ptr %178, align 1, !tbaa !25
  %180 = add i32 %179, %176
  store i32 %180, ptr %178, align 1, !tbaa !25
  br label %181

181:                                              ; preds = %110
  %182 = call zeroext i8 @DebugAssertEnabled()
  %183 = icmp ne i8 %182, 0
  br i1 %183, label %184, label %195

184:                                              ; preds = %181
  %185 = load ptr, ptr %7, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %185, i32 0, i32 0
  %187 = load i32, ptr %186, align 1, !tbaa !29
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %188, i32 0, i32 1
  %190 = load i32, ptr %189, align 1, !tbaa !25
  %191 = add i32 %190, 8
  %192 = icmp ugt i32 %187, %191
  br i1 %192, label %194, label %193

193:                                              ; preds = %184
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1335, ptr noundef @.str.9)
  br label %194

194:                                              ; preds = %193, %184
  br label %195

195:                                              ; preds = %194, %181
  br label %196

196:                                              ; preds = %195
  br label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = call i64 @Dhcp6CallbackUser(ptr noundef %198, i32 noundef 6, ptr noundef %7)
  store i64 %199, ptr %6, align 8, !tbaa !34
  %200 = load i64, ptr %6, align 8, !tbaa !34
  %201 = icmp slt i64 %200, 0
  br i1 %201, label %202, label %205

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

205:                                              ; preds = %197
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %206, i32 0, i32 8
  %208 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %207, i32 0, i32 0
  %209 = load ptr, ptr %208, align 8, !tbaa !16
  %210 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %209, i32 0, i32 1
  store i32 3, ptr %210, align 8, !tbaa !35
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %211, i32 0, i32 17
  store i64 0, ptr %212, align 8, !tbaa !36
  %213 = load ptr, ptr %4, align 8, !tbaa !5
  %214 = load ptr, ptr %7, align 8, !tbaa !5
  %215 = load ptr, ptr %14, align 8, !tbaa !5
  %216 = call i64 @Dhcp6TransmitPacket(ptr noundef %213, ptr noundef %214, ptr noundef %215)
  store i64 %216, ptr %6, align 8, !tbaa !34
  %217 = load i64, ptr %6, align 8, !tbaa !34
  %218 = icmp slt i64 %217, 0
  br i1 %218, label %219, label %222

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

222:                                              ; preds = %205
  %223 = load ptr, ptr %4, align 8, !tbaa !5
  %224 = load ptr, ptr %7, align 8, !tbaa !5
  %225 = load ptr, ptr %14, align 8, !tbaa !5
  %226 = call i64 @Dhcp6EnqueueRetry(ptr noundef %223, ptr noundef %224, ptr noundef %225, ptr noundef null)
  store i64 %226, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %227

227:                                              ; preds = %222, %219, %202, %109, %102
  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
  %228 = load i64, ptr %3, align 8
  ret i64 %228
}

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}
!36 = !{!10, !15, i64 232}


; 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.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [26 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 @Dhcp6SendDeclineMsg(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
  %.not41 = icmp eq ptr %8, null
  br i1 %.not41, label %9, label %10

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

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

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

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

16:                                               ; preds = %10, %15, %12
  %17 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not44 = icmp eq i8 %17, 0
  br i1 %.not44, label %22, label %18

18:                                               ; preds = %16
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !16
  %.not45 = icmp eq ptr %20, null
  br i1 %.not45, label %21, label %22

21:                                               ; preds = %18
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1264, ptr noundef nonnull @.str.11) #3
  br label %22

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

34:                                               ; preds = %22
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1270, ptr noundef nonnull @.str.12) #3
  br label %35

35:                                               ; preds = %22, %34
  %36 = tail call zeroext i8 @DebugAssertEnabled() #3
  %37 = icmp eq i8 %36, 0
  %38 = icmp ne ptr %30, null
  %or.cond3 = select i1 %37, i1 true, i1 %38
  br i1 %or.cond3, label %40, label %39

39:                                               ; preds = %35
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1271, ptr noundef nonnull @.str.13) #3
  br label %40

40:                                               ; preds = %39, %35
  %41 = getelementptr inbounds i8, ptr %30, i64 12
  %42 = getelementptr inbounds i8, ptr %30, i64 4
  %43 = load i32, ptr %42, align 1, !tbaa !24
  %44 = add i32 %43, -4
  %45 = tail call ptr @Dhcp6SeekOption(ptr noundef nonnull %41, i32 noundef %44, i16 noundef zeroext 2) #3
  %46 = icmp eq ptr %45, null
  br i1 %46, label %109, label %47

47:                                               ; preds = %40
  %48 = tail call ptr @AllocateZeroPool(i64 noundef 1024) #3
  store ptr %48, ptr %3, align 8, !tbaa !28
  %49 = icmp eq ptr %48, null
  br i1 %49, label %109, label %50

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

85:                                               ; preds = %50
  %86 = load i32, ptr %48, align 1, !tbaa !29
  %87 = load i32, ptr %52, align 1, !tbaa !24
  %88 = add i32 %87, 8
  %89 = icmp ugt i32 %86, %88
  br i1 %89, label %91, label %90

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

91:                                               ; preds = %85, %90, %50
  %92 = call i64 @Dhcp6CallbackUser(ptr noundef nonnull %0, i32 noundef 6, ptr noundef nonnull %3)
  %93 = icmp slt i64 %92, 0
  br i1 %93, label %94, label %96

94:                                               ; preds = %91
  %95 = load ptr, ptr %3, align 8, !tbaa !28
  call void @FreePool(ptr noundef %95) #3
  br label %109

96:                                               ; preds = %91
  %97 = load ptr, ptr %27, align 8, !tbaa !15
  %98 = getelementptr inbounds i8, ptr %97, i64 8
  store i32 3, ptr %98, align 8, !tbaa !33
  %99 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 0, ptr %99, align 8, !tbaa !34
  %100 = load ptr, ptr %3, align 8, !tbaa !28
  %101 = load ptr, ptr %4, align 8, !tbaa !28
  %102 = call i64 @Dhcp6TransmitPacket(ptr noundef nonnull %0, ptr noundef %100, ptr noundef %101)
  %103 = icmp slt i64 %102, 0
  %104 = load ptr, ptr %3, align 8, !tbaa !28
  br i1 %103, label %105, label %106

105:                                              ; preds = %96
  call void @FreePool(ptr noundef %104) #3
  br label %109

106:                                              ; preds = %96
  %107 = load ptr, ptr %4, align 8, !tbaa !28
  %108 = call i64 @Dhcp6EnqueueRetry(ptr noundef nonnull %0, ptr noundef %104, ptr noundef %107, ptr noundef null)
  br label %109

109:                                              ; preds = %47, %40, %106, %105, %94
  %.0 = phi i64 [ %92, %94 ], [ %102, %105 ], [ %108, %106 ], [ -9223372036854775801, %40 ], [ -9223372036854775799, %47 ]
  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}
!34 = !{!6, !14, i64 232}


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