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

; 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_PACKET_OPTION = type <{ i16, i16, [1 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._DHCP6_INF_CB = type { %struct._LIST_ENTRY, i32, ptr, ptr, ptr }
%struct.EFI_DHCP6_DUID = type { i16, [1 x i8] }

@.str = external hidden unnamed_addr constant [131 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.16 = external hidden unnamed_addr constant [14 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

declare zeroext i16 @SwapBytes16(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

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6SendInfoRequestMsg(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6) #0 {
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i64, align 8
  %25 = alloca i16, align 2
  %26 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i8 %2, ptr %11, align 1, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store i32 %4, ptr %13, align 4, !tbaa !10
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %25) #3
  br label %27

27:                                               ; preds = %7
  %28 = call zeroext i8 @DebugAssertEnabled()
  %29 = icmp ne i8 %28, 0
  br i1 %29, label %30, label %35

30:                                               ; preds = %27
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1823, ptr noundef @.str.16)
  br label %34

34:                                               ; preds = %33, %30
  br label %35

35:                                               ; preds = %34, %27
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !12
  store ptr %40, ptr %20, align 8, !tbaa !5
  %41 = load ptr, ptr %20, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %41, i32 0, i32 6
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  store ptr %43, ptr %19, align 8, !tbaa !5
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %44, i32 0, i32 1
  %46 = load i16, ptr %45, align 1, !tbaa !21
  %47 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %46)
  %48 = zext i16 %47 to i32
  %49 = add nsw i32 %48, 4
  store i32 %49, ptr %23, align 4, !tbaa !10
  br label %50

50:                                               ; preds = %37
  %51 = call zeroext i8 @DebugAssertEnabled()
  %52 = icmp ne i8 %51, 0
  br i1 %52, label %53, label %58

53:                                               ; preds = %50
  %54 = load ptr, ptr %19, align 8, !tbaa !5
  %55 = icmp ne ptr %54, null
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1829, ptr noundef @.str.14)
  br label %57

57:                                               ; preds = %56, %53
  br label %58

58:                                               ; preds = %57, %50
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  store i64 0, ptr %24, align 8, !tbaa !24
  br label %61

61:                                               ; preds = %78, %60
  %62 = load i64, ptr %24, align 8, !tbaa !24
  %63 = load i32, ptr %13, align 4, !tbaa !10
  %64 = zext i32 %63 to i64
  %65 = icmp ult i64 %62, %64
  br i1 %65, label %66, label %81

66:                                               ; preds = %61
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = load i64, ptr %24, align 8, !tbaa !24
  %69 = getelementptr inbounds ptr, ptr %67, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %70, i32 0, i32 1
  %72 = load i16, ptr %71, align 1, !tbaa !21
  %73 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %72)
  %74 = zext i16 %73 to i32
  %75 = add nsw i32 %74, 4
  %76 = load i32, ptr %23, align 4, !tbaa !10
  %77 = add i32 %76, %75
  store i32 %77, ptr %23, align 4, !tbaa !10
  br label %78

78:                                               ; preds = %66
  %79 = load i64, ptr %24, align 8, !tbaa !24
  %80 = add i64 %79, 1
  store i64 %80, ptr %24, align 8, !tbaa !24
  br label %61, !llvm.loop !25

81:                                               ; preds = %61
  %82 = load i32, ptr %23, align 4, !tbaa !10
  %83 = add i32 1024, %82
  %84 = zext i32 %83 to i64
  %85 = call ptr @AllocateZeroPool(i64 noundef %84)
  store ptr %85, ptr %17, align 8, !tbaa !5
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = icmp eq ptr %86, null
  br i1 %87, label %88, label %89

88:                                               ; preds = %81
  store i64 -9223372036854775799, ptr %8, align 8
  store i32 1, ptr %26, align 4
  br label %226

89:                                               ; preds = %81
  %90 = load i32, ptr %23, align 4, !tbaa !10
  %91 = add i32 1024, %90
  %92 = load ptr, ptr %17, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %92, i32 0, i32 0
  store i32 %91, ptr %93, align 1, !tbaa !27
  %94 = load ptr, ptr %17, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %94, i32 0, i32 1
  store i32 4, ptr %95, align 1, !tbaa !31
  %96 = load ptr, ptr %17, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %96, i32 0, i32 2
  %98 = getelementptr inbounds %struct.anon, ptr %97, i32 0, i32 0
  %99 = load i32, ptr %98, align 1
  %100 = and i32 %99, -256
  %101 = or i32 %100, 11
  store i32 %101, ptr %98, align 1
  %102 = load ptr, ptr %20, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %102, i32 0, i32 8
  %104 = load i32, ptr %103, align 8, !tbaa !32
  %105 = add i32 %104, 1
  store i32 %105, ptr %103, align 8, !tbaa !32
  %106 = load ptr, ptr %17, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %106, i32 0, i32 2
  %108 = getelementptr inbounds %struct.anon, ptr %107, i32 0, i32 0
  %109 = load i32, ptr %108, align 1
  %110 = and i32 %104, 16777215
  %111 = shl i32 %110, 8
  %112 = and i32 %109, 255
  %113 = or i32 %112, %111
  store i32 %113, ptr %108, align 1
  %114 = load ptr, ptr %17, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %114, i32 0, i32 2
  %116 = getelementptr inbounds %struct.anon, ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 1
  %118 = lshr i32 %117, 8
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._DHCP6_INF_CB, ptr %119, i32 0, i32 1
  store i32 %118, ptr %120, align 8, !tbaa !33
  %121 = load ptr, ptr %17, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %121, i32 0, i32 2
  %123 = getelementptr inbounds %struct.anon, ptr %122, i32 0, i32 1
  %124 = getelementptr inbounds [1 x i8], ptr %123, i64 0, i64 0
  store ptr %124, ptr %21, align 8, !tbaa !5
  %125 = load i8, ptr %11, align 1, !tbaa !9
  %126 = icmp ne i8 %125, 0
  br i1 %126, label %127, label %139

127:                                              ; preds = %89
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %128, i32 0, i32 0
  %130 = load i16, ptr %129, align 2, !tbaa !35
  %131 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %130)
  store i16 %131, ptr %25, align 2, !tbaa !37
  %132 = load ptr, ptr %21, align 8, !tbaa !5
  %133 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 1)
  %134 = load i16, ptr %25, align 2, !tbaa !37
  %135 = load ptr, ptr %19, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %135, i32 0, i32 1
  %137 = getelementptr inbounds [1 x i8], ptr %136, i64 0, i64 0
  %138 = call ptr @Dhcp6AppendOption(ptr noundef %132, i16 noundef zeroext %133, i16 noundef zeroext %134, ptr noundef %137)
  store ptr %138, ptr %21, align 8, !tbaa !5
  br label %139

139:                                              ; preds = %127, %89
  %140 = load ptr, ptr %21, align 8, !tbaa !5
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = call ptr @Dhcp6AppendETOption(ptr noundef %140, ptr noundef %141, ptr noundef %22)
  store ptr %142, ptr %21, align 8, !tbaa !5
  %143 = load ptr, ptr %21, align 8, !tbaa !5
  %144 = load ptr, ptr %12, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %144, i32 0, i32 0
  %146 = load i16, ptr %145, align 1, !tbaa !38
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %147, i32 0, i32 1
  %149 = load i16, ptr %148, align 1, !tbaa !21
  %150 = load ptr, ptr %12, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %150, i32 0, i32 2
  %152 = getelementptr inbounds [1 x i8], ptr %151, i64 0, i64 0
  %153 = call ptr @Dhcp6AppendOption(ptr noundef %143, i16 noundef zeroext %146, i16 noundef zeroext %149, ptr noundef %152)
  store ptr %153, ptr %21, align 8, !tbaa !5
  store i64 0, ptr %24, align 8, !tbaa !24
  br label %154

154:                                              ; preds = %175, %139
  %155 = load i64, ptr %24, align 8, !tbaa !24
  %156 = load i32, ptr %13, align 4, !tbaa !10
  %157 = zext i32 %156 to i64
  %158 = icmp ult i64 %155, %157
  br i1 %158, label %159, label %178

159:                                              ; preds = %154
  %160 = load ptr, ptr %14, align 8, !tbaa !5
  %161 = load i64, ptr %24, align 8, !tbaa !24
  %162 = getelementptr inbounds ptr, ptr %160, i64 %161
  %163 = load ptr, ptr %162, align 8, !tbaa !5
  store ptr %163, ptr %18, align 8, !tbaa !5
  %164 = load ptr, ptr %21, align 8, !tbaa !5
  %165 = load ptr, ptr %18, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %165, i32 0, i32 0
  %167 = load i16, ptr %166, align 1, !tbaa !38
  %168 = load ptr, ptr %18, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %168, i32 0, i32 1
  %170 = load i16, ptr %169, align 1, !tbaa !21
  %171 = load ptr, ptr %18, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %171, i32 0, i32 2
  %173 = getelementptr inbounds [1 x i8], ptr %172, i64 0, i64 0
  %174 = call ptr @Dhcp6AppendOption(ptr noundef %164, i16 noundef zeroext %167, i16 noundef zeroext %170, ptr noundef %173)
  store ptr %174, ptr %21, align 8, !tbaa !5
  br label %175

175:                                              ; preds = %159
  %176 = load i64, ptr %24, align 8, !tbaa !24
  %177 = add i64 %176, 1
  store i64 %177, ptr %24, align 8, !tbaa !24
  br label %154, !llvm.loop !39

178:                                              ; preds = %154
  %179 = load ptr, ptr %21, align 8, !tbaa !5
  %180 = load ptr, ptr %17, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %180, i32 0, i32 2
  %182 = getelementptr inbounds %struct.anon, ptr %181, i32 0, i32 1
  %183 = getelementptr inbounds [1 x i8], ptr %182, i64 0, i64 0
  %184 = ptrtoint ptr %179 to i64
  %185 = ptrtoint ptr %183 to i64
  %186 = sub i64 %184, %185
  %187 = trunc i64 %186 to i32
  %188 = load ptr, ptr %17, 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 !31
  %191 = add i32 %190, %187
  store i32 %191, ptr %189, align 1, !tbaa !31
  br label %192

192:                                              ; preds = %178
  %193 = call zeroext i8 @DebugAssertEnabled()
  %194 = icmp ne i8 %193, 0
  br i1 %194, label %195, label %206

195:                                              ; preds = %192
  %196 = load ptr, ptr %17, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %196, i32 0, i32 0
  %198 = load i32, ptr %197, align 1, !tbaa !27
  %199 = load ptr, ptr %17, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %199, i32 0, i32 1
  %201 = load i32, ptr %200, align 1, !tbaa !31
  %202 = add i32 %201, 8
  %203 = icmp ugt i32 %198, %202
  br i1 %203, label %205, label %204

204:                                              ; preds = %195
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1899, ptr noundef @.str.9)
  br label %205

205:                                              ; preds = %204, %195
  br label %206

206:                                              ; preds = %205, %192
  br label %207

207:                                              ; preds = %206
  br label %208

208:                                              ; preds = %207
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %209, i32 0, i32 17
  store i64 0, ptr %210, align 8, !tbaa !40
  %211 = load ptr, ptr %9, align 8, !tbaa !5
  %212 = load ptr, ptr %17, align 8, !tbaa !5
  %213 = load ptr, ptr %22, align 8, !tbaa !5
  %214 = call i64 @Dhcp6TransmitPacket(ptr noundef %211, ptr noundef %212, ptr noundef %213)
  store i64 %214, ptr %16, align 8, !tbaa !24
  %215 = load i64, ptr %16, align 8, !tbaa !24
  %216 = icmp slt i64 %215, 0
  br i1 %216, label %217, label %220

217:                                              ; preds = %208
  %218 = load ptr, ptr %17, align 8, !tbaa !5
  call void @FreePool(ptr noundef %218)
  %219 = load i64, ptr %16, align 8, !tbaa !24
  store i64 %219, ptr %8, align 8
  store i32 1, ptr %26, align 4
  br label %226

220:                                              ; preds = %208
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  %222 = load ptr, ptr %17, align 8, !tbaa !5
  %223 = load ptr, ptr %22, align 8, !tbaa !5
  %224 = load ptr, ptr %15, align 8, !tbaa !5
  %225 = call i64 @Dhcp6EnqueueRetry(ptr noundef %221, ptr noundef %222, ptr noundef %223, ptr noundef %224)
  store i64 %225, ptr %8, align 8
  store i32 1, ptr %26, align 4
  br label %226

226:                                              ; preds = %220, %217, %88
  call void @llvm.lifetime.end.p0(i64 2, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  %227 = load i64, ptr %8, align 8
  ret i64 %227
}

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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 16}
!13 = !{!"_DHCP6_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !15, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !16, i64 136, !14, i64 160, !14, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !17, i64 216, !7, i64 224, !7, i64 225, !17, i64 232}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"_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}
!16 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!17 = !{!"long long", !7, i64 0}
!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, !14, i64 80, !17, i64 96}
!20 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!21 = !{!22, !23, i64 2}
!22 = !{!"", !23, i64 0, !23, i64 2, !7, i64 4}
!23 = !{!"short", !7, i64 0}
!24 = !{!17, !17, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !11, i64 0}
!28 = !{!"", !11, i64 0, !11, i64 4, !29, i64 8}
!29 = !{!"", !30, i64 0, !7, i64 4}
!30 = !{!"", !11, i64 0, !11, i64 1}
!31 = !{!28, !11, i64 4}
!32 = !{!19, !11, i64 72}
!33 = !{!34, !11, i64 16}
!34 = !{!"_DHCP6_INF_CB", !14, i64 0, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!35 = !{!36, !23, i64 0}
!36 = !{!"", !23, i64 0, !7, i64 2}
!37 = !{!23, !23, i64 0}
!38 = !{!22, !23, i64 0}
!39 = distinct !{!39, !26}
!40 = !{!13, !17, 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.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 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

declare zeroext i16 @SwapBytes16(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

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6SendInfoRequestMsg(ptr noundef %0, ptr nocapture noundef writeonly %1, i8 noundef zeroext %2, ptr noundef %3, i32 noundef %4, ptr nocapture noundef readonly %5, ptr noundef %6) local_unnamed_addr #0 {
  %8 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  %9 = tail call zeroext i8 @DebugAssertEnabled() #3
  %10 = icmp eq i8 %9, 0
  %11 = icmp ne ptr %3, null
  %or.cond = or i1 %11, %10
  br i1 %or.cond, label %13, label %12

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

13:                                               ; preds = %12, %7
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 56
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %3, i64 2
  %19 = load i16, ptr %18, align 1, !tbaa !18
  %20 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %19) #3
  %21 = zext i16 %20 to i32
  %22 = add nuw nsw i32 %21, 4
  %23 = tail call zeroext i8 @DebugAssertEnabled() #3
  %24 = icmp eq i8 %23, 0
  %25 = icmp ne ptr %17, null
  %or.cond3 = select i1 %24, i1 true, i1 %25
  br i1 %or.cond3, label %27, label %26

26:                                               ; preds = %13
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1829, ptr noundef nonnull @.str.14) #3
  br label %27

27:                                               ; preds = %26, %13
  %28 = zext i32 %4 to i64
  %.not76 = icmp eq i32 %4, 0
  br i1 %.not76, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %27, %.lr.ph
  %.05968 = phi i64 [ %37, %.lr.ph ], [ 0, %27 ]
  %.06067 = phi i32 [ %36, %.lr.ph ], [ %22, %27 ]
  %29 = getelementptr inbounds ptr, ptr %5, i64 %.05968
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %31 = getelementptr inbounds i8, ptr %30, i64 2
  %32 = load i16, ptr %31, align 1, !tbaa !18
  %33 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %32) #3
  %34 = zext i16 %33 to i32
  %35 = add i32 %.06067, 4
  %36 = add i32 %35, %34
  %37 = add nuw nsw i64 %.05968, 1
  %exitcond.not = icmp eq i64 %37, %28
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !22

._crit_edge:                                      ; preds = %.lr.ph, %27
  %.060.lcssa = phi i32 [ %22, %27 ], [ %36, %.lr.ph ]
  %38 = add i32 %.060.lcssa, 1024
  %39 = zext i32 %38 to i64
  %40 = tail call ptr @AllocateZeroPool(i64 noundef %39) #3
  %41 = icmp eq ptr %40, null
  br i1 %41, label %100, label %42

42:                                               ; preds = %._crit_edge
  store i32 %38, ptr %40, align 1, !tbaa !24
  %43 = getelementptr inbounds i8, ptr %40, i64 4
  store i32 4, ptr %43, align 1, !tbaa !28
  %44 = getelementptr inbounds i8, ptr %40, i64 8
  %45 = load i32, ptr %44, align 1
  %46 = and i32 %45, -256
  %47 = or disjoint i32 %46, 11
  store i32 %47, ptr %44, align 1
  %48 = getelementptr inbounds i8, ptr %15, i64 72
  %49 = load i32, ptr %48, align 8, !tbaa !29
  %50 = add i32 %49, 1
  store i32 %50, ptr %48, align 8, !tbaa !29
  %51 = load i32, ptr %44, align 1
  %52 = shl i32 %49, 8
  %53 = and i32 %51, 255
  %54 = or disjoint i32 %53, %52
  store i32 %54, ptr %44, align 1
  %55 = and i32 %49, 16777215
  %56 = getelementptr inbounds i8, ptr %1, i64 16
  store i32 %55, ptr %56, align 8, !tbaa !30
  %57 = getelementptr inbounds i8, ptr %40, i64 12
  %.not = icmp eq i8 %2, 0
  br i1 %.not, label %64, label %58

58:                                               ; preds = %42
  %59 = load i16, ptr %17, align 2, !tbaa !32
  %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 %17, i64 2
  %63 = tail call ptr @Dhcp6AppendOption(ptr noundef nonnull %57, i16 noundef zeroext %61, i16 noundef zeroext %60, ptr noundef nonnull %62) #3
  br label %64

64:                                               ; preds = %58, %42
  %.061 = phi ptr [ %63, %58 ], [ %57, %42 ]
  %65 = call ptr @Dhcp6AppendETOption(ptr noundef %.061, ptr noundef %0, ptr noundef nonnull %8) #3
  %66 = load i16, ptr %3, align 1, !tbaa !34
  %67 = load i16, ptr %18, align 1, !tbaa !18
  %68 = getelementptr inbounds i8, ptr %3, i64 4
  %69 = call ptr @Dhcp6AppendOption(ptr noundef %65, i16 noundef zeroext %66, i16 noundef zeroext %67, ptr noundef nonnull %68) #3
  br i1 %.not76, label %._crit_edge74, label %.lr.ph73

.lr.ph73:                                         ; preds = %64, %.lr.ph73
  %.171 = phi i64 [ %77, %.lr.ph73 ], [ 0, %64 ]
  %.16270 = phi ptr [ %76, %.lr.ph73 ], [ %69, %64 ]
  %70 = getelementptr inbounds ptr, ptr %5, i64 %.171
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = load i16, ptr %71, align 1, !tbaa !34
  %73 = getelementptr inbounds i8, ptr %71, i64 2
  %74 = load i16, ptr %73, align 1, !tbaa !18
  %75 = getelementptr inbounds i8, ptr %71, i64 4
  %76 = call ptr @Dhcp6AppendOption(ptr noundef %.16270, i16 noundef zeroext %72, i16 noundef zeroext %74, ptr noundef nonnull %75) #3
  %77 = add nuw nsw i64 %.171, 1
  %exitcond79.not = icmp eq i64 %77, %28
  br i1 %exitcond79.not, label %._crit_edge74, label %.lr.ph73, !llvm.loop !35

._crit_edge74:                                    ; preds = %.lr.ph73, %64
  %.162.lcssa = phi ptr [ %69, %64 ], [ %76, %.lr.ph73 ]
  %78 = ptrtoint ptr %.162.lcssa to i64
  %79 = ptrtoint ptr %57 to i64
  %80 = sub i64 %78, %79
  %81 = trunc i64 %80 to i32
  %82 = load i32, ptr %43, align 1, !tbaa !28
  %83 = add i32 %82, %81
  store i32 %83, ptr %43, align 1, !tbaa !28
  %84 = call zeroext i8 @DebugAssertEnabled() #3
  %.not66 = icmp eq i8 %84, 0
  br i1 %.not66, label %91, label %85

85:                                               ; preds = %._crit_edge74
  %86 = load i32, ptr %40, align 1, !tbaa !24
  %87 = load i32, ptr %43, align 1, !tbaa !28
  %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 1899, ptr noundef nonnull @.str.9) #3
  br label %91

91:                                               ; preds = %85, %90, %._crit_edge74
  %92 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 0, ptr %92, align 8, !tbaa !36
  %93 = load ptr, ptr %8, align 8, !tbaa !21
  %94 = call i64 @Dhcp6TransmitPacket(ptr noundef %0, ptr noundef nonnull %40, ptr noundef %93)
  %95 = icmp slt i64 %94, 0
  br i1 %95, label %96, label %97

96:                                               ; preds = %91
  call void @FreePool(ptr noundef nonnull %40) #3
  br label %100

97:                                               ; preds = %91
  %98 = load ptr, ptr %8, align 8, !tbaa !21
  %99 = call i64 @Dhcp6EnqueueRetry(ptr noundef nonnull %0, ptr noundef nonnull %40, ptr noundef %98, ptr noundef %6)
  br label %100

100:                                              ; preds = %._crit_edge, %97, %96
  %.0 = phi i64 [ %94, %96 ], [ %99, %97 ], [ -9223372036854775799, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #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 16}
!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 = !{!16, !10, i64 56}
!16 = !{!"_DHCP6_SERVICE", !7, i64 0, !10, i64 8, !10, i64 16, !17, i64 24, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !11, i64 80, !14, i64 96}
!17 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!18 = !{!19, !20, i64 2}
!19 = !{!"", !20, i64 0, !20, i64 2, !8, i64 4}
!20 = !{!"short", !8, i64 0}
!21 = !{!10, !10, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !7, i64 0}
!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 = !{!25, !7, i64 4}
!29 = !{!16, !7, i64 72}
!30 = !{!31, !7, i64 16}
!31 = !{!"_DHCP6_INF_CB", !11, i64 0, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!32 = !{!33, !20, i64 0}
!33 = !{!"", !20, i64 0, !8, i64 2}
!34 = !{!19, !20, i64 0}
!35 = distinct !{!35, !23}
!36 = !{!6, !14, i64 232}


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