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

; 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_CONFIG_DATA = type { ptr, ptr, i32, ptr, %struct.EFI_DHCP6_IA_DESCRIPTOR, ptr, i8, i8, ptr }
%struct.EFI_DHCP6_IA_DESCRIPTOR = type { i16, i32 }
%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.EFI_DHCP6_DUID = type { i16, [1 x i8] }
%struct.EFI_DHCP6_IA = type { %struct.EFI_DHCP6_IA_DESCRIPTOR, i32, ptr, i32, [1 x %struct.EFI_DHCP6_IA_ADDRESS] }
%struct.EFI_DHCP6_IA_ADDRESS = type { %struct.EFI_IPv6_ADDRESS, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 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 @Dhcp6SendRenewRebindMsg(ptr noundef %0, i8 noundef zeroext %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %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 i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i16, align 2
  %21 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i8 %1, ptr %5, align 1, !tbaa !9
  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 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  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 4, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #3
  br label %22

22:                                               ; preds = %2
  %23 = call zeroext i8 @DebugAssertEnabled()
  %24 = icmp ne i8 %23, 0
  br i1 %24, label %25, label %32

25:                                               ; preds = %22
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %26, i32 0, i32 6
  %28 = load ptr, ptr %27, align 8, !tbaa !10
  %29 = icmp ne ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1539, ptr noundef @.str.3)
  br label %31

31:                                               ; preds = %30, %25
  br label %32

32:                                               ; preds = %31, %22
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  %36 = call zeroext i8 @DebugAssertEnabled()
  %37 = icmp ne i8 %36, 0
  br i1 %37, label %38, label %46

38:                                               ; preds = %35
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %39, i32 0, i32 8
  %41 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !17
  %43 = icmp ne ptr %42, null
  br i1 %43, label %45, label %44

44:                                               ; preds = %38
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1540, ptr noundef @.str.4)
  br label %45

45:                                               ; preds = %44, %38
  br label %46

46:                                               ; preds = %45, %35
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !18
  store ptr %51, ptr %14, align 8, !tbaa !5
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %52, i32 0, i32 6
  %54 = load ptr, ptr %53, align 8, !tbaa !19
  store ptr %54, ptr %10, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %48
  %56 = call zeroext i8 @DebugAssertEnabled()
  %57 = icmp ne i8 %56, 0
  br i1 %57, label %58, label %63

58:                                               ; preds = %55
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1545, ptr noundef @.str.14)
  br label %62

62:                                               ; preds = %61, %58
  br label %63

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

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  store i32 0, ptr %18, align 4, !tbaa !22
  store i64 0, ptr %19, align 8, !tbaa !23
  br label %66

66:                                               ; preds = %91, %65
  %67 = load i64, ptr %19, align 8, !tbaa !23
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %68, i32 0, i32 6
  %70 = load ptr, ptr %69, align 8, !tbaa !10
  %71 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %70, i32 0, i32 2
  %72 = load i32, ptr %71, align 8, !tbaa !24
  %73 = zext i32 %72 to i64
  %74 = icmp ult i64 %67, %73
  br i1 %74, label %75, label %94

75:                                               ; preds = %66
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %76, i32 0, i32 6
  %78 = load ptr, ptr %77, align 8, !tbaa !10
  %79 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %78, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !28
  %81 = load i64, ptr %19, align 8, !tbaa !23
  %82 = getelementptr inbounds ptr, ptr %80, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %83, i32 0, i32 1
  %85 = load i16, ptr %84, align 1, !tbaa !29
  %86 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %85)
  %87 = zext i16 %86 to i32
  %88 = add nsw i32 %87, 4
  %89 = load i32, ptr %18, align 4, !tbaa !22
  %90 = add i32 %89, %88
  store i32 %90, ptr %18, align 4, !tbaa !22
  br label %91

91:                                               ; preds = %75
  %92 = load i64, ptr %19, align 8, !tbaa !23
  %93 = add i64 %92, 1
  store i64 %93, ptr %19, align 8, !tbaa !23
  br label %66, !llvm.loop !31

94:                                               ; preds = %66
  %95 = load i32, ptr %18, align 4, !tbaa !22
  %96 = add i32 1024, %95
  %97 = zext i32 %96 to i64
  %98 = call ptr @AllocateZeroPool(i64 noundef %97)
  store ptr %98, ptr %7, align 8, !tbaa !5
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = icmp eq ptr %99, null
  br i1 %100, label %101, label %102

101:                                              ; preds = %94
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %338

102:                                              ; preds = %94
  %103 = load i32, ptr %18, align 4, !tbaa !22
  %104 = add i32 1024, %103
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %105, i32 0, i32 0
  store i32 %104, ptr %106, align 1, !tbaa !33
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %107, i32 0, i32 1
  store i32 4, ptr %108, align 1, !tbaa !37
  %109 = load i8, ptr %5, align 1, !tbaa !9
  %110 = zext i8 %109 to i32
  %111 = icmp ne i32 %110, 0
  %112 = zext i1 %111 to i64
  %113 = select i1 %111, i32 6, i32 5
  %114 = load ptr, ptr %7, 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 = and i32 %113, 255
  %119 = and i32 %117, -256
  %120 = or i32 %119, %118
  store i32 %120, ptr %116, align 1
  %121 = load ptr, ptr %14, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %121, i32 0, i32 8
  %123 = load i32, ptr %122, align 8, !tbaa !38
  %124 = add i32 %123, 1
  store i32 %124, ptr %122, align 8, !tbaa !38
  %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 %16, align 8, !tbaa !5
  %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 !39
  %140 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %139)
  store i16 %140, ptr %20, align 2, !tbaa !41
  %141 = load ptr, ptr %16, align 8, !tbaa !5
  %142 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 1)
  %143 = load i16, ptr %20, align 2, !tbaa !41
  %144 = load ptr, ptr %10, 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 %16, align 8, !tbaa !5
  %148 = load ptr, ptr %16, 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 %17)
  store ptr %150, ptr %16, align 8, !tbaa !5
  %151 = load ptr, ptr %16, align 8, !tbaa !5
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %152, i32 0, i32 8
  %154 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !17
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %156, i32 0, i32 8
  %158 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %157, i32 0, i32 1
  %159 = load i32, ptr %158, align 8, !tbaa !42
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %160, i32 0, i32 8
  %162 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %161, i32 0, i32 2
  %163 = load i32, ptr %162, align 4, !tbaa !43
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %164, i32 0, i32 2
  %166 = getelementptr inbounds %struct.anon, ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 1
  %168 = and i32 %167, 255
  %169 = call ptr @Dhcp6AppendIaOption(ptr noundef %151, ptr noundef %155, i32 noundef %159, i32 noundef %163, i32 noundef %168)
  store ptr %169, ptr %16, align 8, !tbaa !5
  %170 = load i8, ptr %5, align 1, !tbaa !9
  %171 = icmp ne i8 %170, 0
  br i1 %171, label %215, label %172

172:                                              ; preds = %102
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %173, i32 0, i32 8
  %175 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %174, i32 0, i32 0
  %176 = load ptr, ptr %175, align 8, !tbaa !17
  %177 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %176, i32 0, i32 2
  %178 = load ptr, ptr %177, align 8, !tbaa !44
  store ptr %178, ptr %8, align 8, !tbaa !5
  br label %179

179:                                              ; preds = %172
  %180 = call zeroext i8 @DebugAssertEnabled()
  %181 = icmp ne i8 %180, 0
  br i1 %181, label %182, label %187

182:                                              ; preds = %179
  %183 = load ptr, ptr %8, align 8, !tbaa !5
  %184 = icmp ne ptr %183, null
  br i1 %184, label %186, label %185

185:                                              ; preds = %182
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1601, ptr noundef @.str.15)
  br label %186

186:                                              ; preds = %185, %182
  br label %187

187:                                              ; preds = %186, %179
  br label %188

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %190, i32 0, i32 2
  %192 = getelementptr inbounds %struct.anon, ptr %191, i32 0, i32 1
  %193 = getelementptr inbounds [1 x i8], ptr %192, i64 0, i64 0
  %194 = load ptr, ptr %8, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %194, i32 0, i32 1
  %196 = load i32, ptr %195, align 1, !tbaa !37
  %197 = sub i32 %196, 4
  %198 = call ptr @Dhcp6SeekOption(ptr noundef %193, i32 noundef %197, i16 noundef zeroext 2)
  store ptr %198, ptr %15, align 8, !tbaa !5
  %199 = load ptr, ptr %15, align 8, !tbaa !5
  %200 = icmp eq ptr %199, null
  br i1 %200, label %201, label %203

201:                                              ; preds = %189
  %202 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %202)
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %338

203:                                              ; preds = %189
  %204 = load ptr, ptr %15, align 8, !tbaa !5
  %205 = getelementptr inbounds i8, ptr %204, i64 2
  store ptr %205, ptr %11, align 8, !tbaa !5
  %206 = load ptr, ptr %16, align 8, !tbaa !5
  %207 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 2)
  %208 = load ptr, ptr %11, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %208, i32 0, i32 0
  %210 = load i16, ptr %209, align 2, !tbaa !39
  %211 = load ptr, ptr %11, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %211, i32 0, i32 1
  %213 = getelementptr inbounds [1 x i8], ptr %212, i64 0, i64 0
  %214 = call ptr @Dhcp6AppendOption(ptr noundef %206, i16 noundef zeroext %207, i16 noundef zeroext %210, ptr noundef %213)
  store ptr %214, ptr %16, align 8, !tbaa !5
  br label %215

215:                                              ; preds = %203, %102
  store i64 0, ptr %19, align 8, !tbaa !23
  br label %216

216:                                              ; preds = %245, %215
  %217 = load i64, ptr %19, align 8, !tbaa !23
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %218, i32 0, i32 6
  %220 = load ptr, ptr %219, align 8, !tbaa !10
  %221 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %220, i32 0, i32 2
  %222 = load i32, ptr %221, align 8, !tbaa !24
  %223 = zext i32 %222 to i64
  %224 = icmp ult i64 %217, %223
  br i1 %224, label %225, label %248

225:                                              ; preds = %216
  %226 = load ptr, ptr %4, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %226, i32 0, i32 6
  %228 = load ptr, ptr %227, align 8, !tbaa !10
  %229 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %228, i32 0, i32 3
  %230 = load ptr, ptr %229, align 8, !tbaa !28
  %231 = load i64, ptr %19, align 8, !tbaa !23
  %232 = getelementptr inbounds ptr, ptr %230, i64 %231
  %233 = load ptr, ptr %232, align 8, !tbaa !5
  store ptr %233, ptr %9, align 8, !tbaa !5
  %234 = load ptr, ptr %16, align 8, !tbaa !5
  %235 = load ptr, ptr %9, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %235, i32 0, i32 0
  %237 = load i16, ptr %236, align 1, !tbaa !46
  %238 = load ptr, ptr %9, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %238, i32 0, i32 1
  %240 = load i16, ptr %239, align 1, !tbaa !29
  %241 = load ptr, ptr %9, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %241, i32 0, i32 2
  %243 = getelementptr inbounds [1 x i8], ptr %242, i64 0, i64 0
  %244 = call ptr @Dhcp6AppendOption(ptr noundef %234, i16 noundef zeroext %237, i16 noundef zeroext %240, ptr noundef %243)
  store ptr %244, ptr %16, align 8, !tbaa !5
  br label %245

245:                                              ; preds = %225
  %246 = load i64, ptr %19, align 8, !tbaa !23
  %247 = add i64 %246, 1
  store i64 %247, ptr %19, align 8, !tbaa !23
  br label %216, !llvm.loop !47

248:                                              ; preds = %216
  %249 = load ptr, ptr %16, align 8, !tbaa !5
  %250 = load ptr, ptr %7, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %250, i32 0, i32 2
  %252 = getelementptr inbounds %struct.anon, ptr %251, i32 0, i32 1
  %253 = getelementptr inbounds [1 x i8], ptr %252, i64 0, i64 0
  %254 = ptrtoint ptr %249 to i64
  %255 = ptrtoint ptr %253 to i64
  %256 = sub i64 %254, %255
  %257 = trunc i64 %256 to i32
  %258 = load ptr, ptr %7, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %258, i32 0, i32 1
  %260 = load i32, ptr %259, align 1, !tbaa !37
  %261 = add i32 %260, %257
  store i32 %261, ptr %259, align 1, !tbaa !37
  br label %262

262:                                              ; preds = %248
  %263 = call zeroext i8 @DebugAssertEnabled()
  %264 = icmp ne i8 %263, 0
  br i1 %264, label %265, label %276

265:                                              ; preds = %262
  %266 = load ptr, ptr %7, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %266, i32 0, i32 0
  %268 = load i32, ptr %267, align 1, !tbaa !33
  %269 = load ptr, ptr %7, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %269, i32 0, i32 1
  %271 = load i32, ptr %270, align 1, !tbaa !37
  %272 = add i32 %271, 8
  %273 = icmp ugt i32 %268, %272
  br i1 %273, label %275, label %274

274:                                              ; preds = %265
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1641, ptr noundef @.str.9)
  br label %275

275:                                              ; preds = %274, %265
  br label %276

276:                                              ; preds = %275, %262
  br label %277

277:                                              ; preds = %276
  br label %278

278:                                              ; preds = %277
  %279 = load i8, ptr %5, align 1, !tbaa !9
  %280 = zext i8 %279 to i32
  %281 = icmp ne i32 %280, 0
  %282 = zext i1 %281 to i64
  %283 = select i1 %281, i32 8, i32 7
  store i32 %283, ptr %12, align 4, !tbaa !22
  %284 = load i8, ptr %5, align 1, !tbaa !9
  %285 = zext i8 %284 to i32
  %286 = icmp ne i32 %285, 0
  %287 = zext i1 %286 to i64
  %288 = select i1 %286, i32 10, i32 9
  store i32 %288, ptr %13, align 4, !tbaa !22
  %289 = load ptr, ptr %4, align 8, !tbaa !5
  %290 = load i32, ptr %13, align 4, !tbaa !22
  %291 = call i64 @Dhcp6CallbackUser(ptr noundef %289, i32 noundef %290, ptr noundef %7)
  store i64 %291, ptr %6, align 8, !tbaa !23
  %292 = load i64, ptr %6, align 8, !tbaa !23
  %293 = icmp slt i64 %292, 0
  br i1 %293, label %294, label %297

294:                                              ; preds = %278
  %295 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %295)
  %296 = load i64, ptr %6, align 8, !tbaa !23
  store i64 %296, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %338

297:                                              ; preds = %278
  %298 = load i32, ptr %12, align 4, !tbaa !22
  %299 = load ptr, ptr %4, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %299, i32 0, i32 8
  %301 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %300, i32 0, i32 0
  %302 = load ptr, ptr %301, align 8, !tbaa !17
  %303 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %302, i32 0, i32 1
  store i32 %298, ptr %303, align 8, !tbaa !48
  %304 = load i8, ptr %5, align 1, !tbaa !9
  %305 = zext i8 %304 to i32
  %306 = icmp ne i32 %305, 0
  br i1 %306, label %307, label %312

307:                                              ; preds = %297
  %308 = load ptr, ptr %4, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %308, i32 0, i32 8
  %310 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %309, i32 0, i32 2
  %311 = load i32, ptr %310, align 4, !tbaa !43
  br label %317

312:                                              ; preds = %297
  %313 = load ptr, ptr %4, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %313, i32 0, i32 8
  %315 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %314, i32 0, i32 1
  %316 = load i32, ptr %315, align 8, !tbaa !42
  br label %317

317:                                              ; preds = %312, %307
  %318 = phi i32 [ %311, %307 ], [ %316, %312 ]
  %319 = load ptr, ptr %4, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %319, i32 0, i32 8
  %321 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %320, i32 0, i32 4
  store i32 %318, ptr %321, align 4, !tbaa !49
  %322 = load ptr, ptr %4, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %322, i32 0, i32 17
  store i64 0, ptr %323, align 8, !tbaa !50
  %324 = load ptr, ptr %4, align 8, !tbaa !5
  %325 = load ptr, ptr %7, align 8, !tbaa !5
  %326 = load ptr, ptr %17, align 8, !tbaa !5
  %327 = call i64 @Dhcp6TransmitPacket(ptr noundef %324, ptr noundef %325, ptr noundef %326)
  store i64 %327, ptr %6, align 8, !tbaa !23
  %328 = load i64, ptr %6, align 8, !tbaa !23
  %329 = icmp slt i64 %328, 0
  br i1 %329, label %330, label %333

330:                                              ; preds = %317
  %331 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %331)
  %332 = load i64, ptr %6, align 8, !tbaa !23
  store i64 %332, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %338

333:                                              ; preds = %317
  %334 = load ptr, ptr %4, align 8, !tbaa !5
  %335 = load ptr, ptr %7, align 8, !tbaa !5
  %336 = load ptr, ptr %17, align 8, !tbaa !5
  %337 = call i64 @Dhcp6EnqueueRetry(ptr noundef %334, ptr noundef %335, ptr noundef %336, ptr noundef null)
  store i64 %337, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %338

338:                                              ; preds = %333, %330, %294, %201, %101
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  %339 = load i64, ptr %3, align 8
  ret i64 %339
}

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, !6, i64 120}
!11 = !{!"_DHCP6_INSTANCE", !12, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !14, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !15, i64 136, !13, i64 160, !13, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !16, i64 216, !7, i64 224, !7, i64 225, !16, i64 232}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!14 = !{!"_EFI_DHCP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!15 = !{!"_DHCP6_IA_CB", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!16 = !{!"long long", !7, i64 0}
!17 = !{!11, !6, i64 136}
!18 = !{!11, !6, i64 16}
!19 = !{!20, !6, i64 56}
!20 = !{!"_DHCP6_SERVICE", !12, i64 0, !6, i64 8, !6, i64 16, !21, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !13, i64 80, !16, i64 96}
!21 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!22 = !{!12, !12, i64 0}
!23 = !{!16, !16, i64 0}
!24 = !{!25, !12, i64 16}
!25 = !{!"", !6, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !26, i64 32, !6, i64 40, !7, i64 48, !7, i64 49, !6, i64 56}
!26 = !{!"", !27, i64 0, !12, i64 4}
!27 = !{!"short", !7, i64 0}
!28 = !{!25, !6, i64 24}
!29 = !{!30, !27, i64 2}
!30 = !{!"", !27, i64 0, !27, i64 2, !7, i64 4}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!34, !12, i64 0}
!34 = !{!"", !12, i64 0, !12, i64 4, !35, i64 8}
!35 = !{!"", !36, i64 0, !7, i64 4}
!36 = !{!"", !12, i64 0, !12, i64 1}
!37 = !{!34, !12, i64 4}
!38 = !{!20, !12, i64 72}
!39 = !{!40, !27, i64 0}
!40 = !{!"", !27, i64 0, !7, i64 2}
!41 = !{!27, !27, i64 0}
!42 = !{!11, !12, i64 144}
!43 = !{!11, !12, i64 148}
!44 = !{!45, !6, i64 16}
!45 = !{!"", !26, i64 0, !12, i64 8, !6, i64 16, !12, i64 24, !7, i64 28}
!46 = !{!30, !27, i64 0}
!47 = distinct !{!47, !32}
!48 = !{!45, !12, i64 8}
!49 = !{!11, !12, i64 156}
!50 = !{!11, !16, 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.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 @Dhcp6SendRenewRebindMsg(ptr noundef %0, i8 noundef zeroext %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
  %.not73 = icmp eq ptr %8, null
  br i1 %.not73, label %9, label %10

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

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

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

15:                                               ; preds = %12
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1540, 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 = tail call zeroext i8 @DebugAssertEnabled() #3
  %22 = icmp eq i8 %21, 0
  %23 = icmp ne ptr %20, null
  %or.cond = select i1 %22, i1 true, i1 %23
  br i1 %or.cond, label %25, label %24

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

25:                                               ; preds = %24, %16
  %26 = getelementptr inbounds i8, ptr %0, i64 120
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %29 = load i32, ptr %28, align 8, !tbaa !20
  %.not87 = icmp eq i32 %29, 0
  br i1 %.not87, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %25, %.lr.ph
  %30 = phi ptr [ %42, %.lr.ph ], [ %27, %25 ]
  %.06580 = phi i64 [ %41, %.lr.ph ], [ 0, %25 ]
  %.06679 = phi i32 [ %40, %.lr.ph ], [ 0, %25 ]
  %31 = getelementptr inbounds i8, ptr %30, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !24
  %33 = getelementptr inbounds ptr, ptr %32, i64 %.06580
  %34 = load ptr, ptr %33, align 8, !tbaa !25
  %35 = getelementptr inbounds i8, ptr %34, i64 2
  %36 = load i16, ptr %35, align 1, !tbaa !26
  %37 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %36) #3
  %38 = zext i16 %37 to i32
  %39 = add i32 %.06679, 4
  %40 = add i32 %39, %38
  %41 = add nuw nsw i64 %.06580, 1
  %42 = load ptr, ptr %26, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = load i32, ptr %43, align 8, !tbaa !20
  %45 = zext i32 %44 to i64
  %46 = icmp ult i64 %41, %45
  br i1 %46, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !28

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %47 = add i32 %40, 1024
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %25
  %.066.lcssa = phi i32 [ 1024, %25 ], [ %47, %._crit_edge.loopexit ]
  %48 = zext i32 %.066.lcssa to i64
  %49 = tail call ptr @AllocateZeroPool(i64 noundef %48) #3
  store ptr %49, ptr %3, align 8, !tbaa !25
  %50 = icmp eq ptr %49, null
  br i1 %50, label %161, label %51

51:                                               ; preds = %._crit_edge
  store i32 %.066.lcssa, ptr %49, align 1, !tbaa !30
  %52 = getelementptr inbounds i8, ptr %49, i64 4
  store i32 4, ptr %52, align 1, !tbaa !34
  %.not76 = icmp eq i8 %1, 0
  %53 = select i1 %.not76, i32 5, i32 6
  %54 = getelementptr inbounds i8, ptr %49, i64 8
  %55 = load i32, ptr %54, align 1
  %56 = and i32 %55, -256
  %57 = or disjoint i32 %56, %53
  store i32 %57, ptr %54, align 1
  %58 = getelementptr inbounds i8, ptr %18, i64 72
  %59 = load i32, ptr %58, align 8, !tbaa !35
  %60 = add i32 %59, 1
  store i32 %60, ptr %58, align 8, !tbaa !35
  %61 = load i32, ptr %54, align 1
  %62 = shl i32 %59, 8
  %63 = and i32 %61, 255
  %64 = or disjoint i32 %63, %62
  store i32 %64, ptr %54, align 1
  %65 = getelementptr inbounds i8, ptr %49, i64 12
  %66 = load i16, ptr %20, align 2, !tbaa !36
  %67 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %66) #3
  %68 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext 1) #3
  %69 = getelementptr inbounds i8, ptr %20, i64 2
  %70 = tail call ptr @Dhcp6AppendOption(ptr noundef nonnull %65, i16 noundef zeroext %68, i16 noundef zeroext %67, ptr noundef nonnull %69) #3
  %71 = call ptr @Dhcp6AppendETOption(ptr noundef %70, ptr noundef nonnull %0, ptr noundef nonnull %4) #3
  %72 = getelementptr inbounds i8, ptr %0, i64 136
  %73 = load ptr, ptr %72, align 8, !tbaa !15
  %74 = getelementptr inbounds i8, ptr %0, i64 144
  %75 = load i32, ptr %74, align 8, !tbaa !38
  %76 = getelementptr inbounds i8, ptr %0, i64 148
  %77 = load i32, ptr %76, align 4, !tbaa !39
  %78 = load i32, ptr %54, align 1
  %79 = and i32 %78, 255
  %80 = call ptr @Dhcp6AppendIaOption(ptr noundef %71, ptr noundef %73, i32 noundef %75, i32 noundef %77, i32 noundef %79) #3
  br i1 %.not76, label %81, label %103

81:                                               ; preds = %51
  %82 = load ptr, ptr %72, align 8, !tbaa !15
  %83 = getelementptr inbounds i8, ptr %82, i64 16
  %84 = load ptr, ptr %83, align 8, !tbaa !40
  %85 = call zeroext i8 @DebugAssertEnabled() #3
  %86 = icmp eq i8 %85, 0
  %87 = icmp ne ptr %84, null
  %or.cond3 = select i1 %86, i1 true, i1 %87
  br i1 %or.cond3, label %89, label %88

88:                                               ; preds = %81
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1601, ptr noundef nonnull @.str.15) #3
  br label %89

89:                                               ; preds = %88, %81
  %90 = getelementptr inbounds i8, ptr %84, i64 12
  %91 = getelementptr inbounds i8, ptr %84, i64 4
  %92 = load i32, ptr %91, align 1, !tbaa !34
  %93 = add i32 %92, -4
  %94 = call ptr @Dhcp6SeekOption(ptr noundef nonnull %90, i32 noundef %93, i16 noundef zeroext 2) #3
  %95 = icmp eq ptr %94, null
  br i1 %95, label %96, label %97

96:                                               ; preds = %89
  call void @FreePool(ptr noundef nonnull %49) #3
  br label %161

97:                                               ; preds = %89
  %98 = getelementptr inbounds i8, ptr %94, i64 2
  %99 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 2) #3
  %100 = load i16, ptr %98, align 2, !tbaa !36
  %101 = getelementptr inbounds i8, ptr %94, i64 4
  %102 = call ptr @Dhcp6AppendOption(ptr noundef %80, i16 noundef zeroext %99, i16 noundef zeroext %100, ptr noundef nonnull %101) #3
  br label %103

103:                                              ; preds = %97, %51
  %.067 = phi ptr [ %80, %51 ], [ %102, %97 ]
  %104 = load ptr, ptr %26, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 16
  %106 = load i32, ptr %105, align 8, !tbaa !20
  %.not88 = icmp eq i32 %106, 0
  br i1 %.not88, label %._crit_edge85, label %.lr.ph84

.lr.ph84:                                         ; preds = %103, %.lr.ph84
  %107 = phi ptr [ %118, %.lr.ph84 ], [ %104, %103 ]
  %.182 = phi i64 [ %117, %.lr.ph84 ], [ 0, %103 ]
  %.16881 = phi ptr [ %116, %.lr.ph84 ], [ %.067, %103 ]
  %108 = getelementptr inbounds i8, ptr %107, i64 24
  %109 = load ptr, ptr %108, align 8, !tbaa !24
  %110 = getelementptr inbounds ptr, ptr %109, i64 %.182
  %111 = load ptr, ptr %110, align 8, !tbaa !25
  %112 = load i16, ptr %111, align 1, !tbaa !42
  %113 = getelementptr inbounds i8, ptr %111, i64 2
  %114 = load i16, ptr %113, align 1, !tbaa !26
  %115 = getelementptr inbounds i8, ptr %111, i64 4
  %116 = call ptr @Dhcp6AppendOption(ptr noundef %.16881, i16 noundef zeroext %112, i16 noundef zeroext %114, ptr noundef nonnull %115) #3
  %117 = add nuw nsw i64 %.182, 1
  %118 = load ptr, ptr %26, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i64 16
  %120 = load i32, ptr %119, align 8, !tbaa !20
  %121 = zext i32 %120 to i64
  %122 = icmp ult i64 %117, %121
  br i1 %122, label %.lr.ph84, label %._crit_edge85.loopexit, !llvm.loop !43

._crit_edge85.loopexit:                           ; preds = %.lr.ph84
  %.pre = load ptr, ptr %3, align 8, !tbaa !25
  br label %._crit_edge85

._crit_edge85:                                    ; preds = %._crit_edge85.loopexit, %103
  %123 = phi ptr [ %49, %103 ], [ %.pre, %._crit_edge85.loopexit ]
  %.168.lcssa = phi ptr [ %.067, %103 ], [ %116, %._crit_edge85.loopexit ]
  %124 = getelementptr inbounds i8, ptr %123, i64 12
  %125 = ptrtoint ptr %.168.lcssa to i64
  %126 = ptrtoint ptr %124 to i64
  %127 = sub i64 %125, %126
  %128 = trunc i64 %127 to i32
  %129 = getelementptr inbounds i8, ptr %123, i64 4
  %130 = load i32, ptr %129, align 1, !tbaa !34
  %131 = add i32 %130, %128
  store i32 %131, ptr %129, align 1, !tbaa !34
  %132 = call zeroext i8 @DebugAssertEnabled() #3
  %.not78 = icmp eq i8 %132, 0
  br i1 %.not78, label %139, label %133

133:                                              ; preds = %._crit_edge85
  %134 = load i32, ptr %123, align 1, !tbaa !30
  %135 = load i32, ptr %129, align 1, !tbaa !34
  %136 = add i32 %135, 8
  %137 = icmp ugt i32 %134, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %133
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1641, ptr noundef nonnull @.str.9) #3
  br label %139

139:                                              ; preds = %133, %138, %._crit_edge85
  %140 = select i1 %.not76, i32 9, i32 10
  %141 = call i64 @Dhcp6CallbackUser(ptr noundef nonnull %0, i32 noundef %140, ptr noundef nonnull %3)
  %142 = icmp slt i64 %141, 0
  br i1 %142, label %143, label %145

143:                                              ; preds = %139
  %144 = load ptr, ptr %3, align 8, !tbaa !25
  call void @FreePool(ptr noundef %144) #3
  br label %161

145:                                              ; preds = %139
  %146 = select i1 %.not76, i32 7, i32 8
  %147 = load ptr, ptr %72, align 8, !tbaa !15
  %148 = getelementptr inbounds i8, ptr %147, i64 8
  store i32 %146, ptr %148, align 8, !tbaa !44
  %. = select i1 %.not76, ptr %74, ptr %76
  %149 = load i32, ptr %., align 4, !tbaa !45
  %150 = getelementptr inbounds i8, ptr %0, i64 156
  store i32 %149, ptr %150, align 4, !tbaa !46
  %151 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 0, ptr %151, align 8, !tbaa !47
  %152 = load ptr, ptr %3, align 8, !tbaa !25
  %153 = load ptr, ptr %4, align 8, !tbaa !25
  %154 = call i64 @Dhcp6TransmitPacket(ptr noundef nonnull %0, ptr noundef %152, ptr noundef %153)
  %155 = icmp slt i64 %154, 0
  %156 = load ptr, ptr %3, align 8, !tbaa !25
  br i1 %155, label %157, label %158

157:                                              ; preds = %145
  call void @FreePool(ptr noundef %156) #3
  br label %161

158:                                              ; preds = %145
  %159 = load ptr, ptr %4, align 8, !tbaa !25
  %160 = call i64 @Dhcp6EnqueueRetry(ptr noundef nonnull %0, ptr noundef %156, ptr noundef %159, ptr noundef null)
  br label %161

161:                                              ; preds = %._crit_edge, %158, %157, %143, %96
  %.0 = phi i64 [ %141, %143 ], [ %154, %157 ], [ %160, %158 ], [ -9223372036854775801, %96 ], [ -9223372036854775799, %._crit_edge ]
  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, !7, i64 16}
!21 = !{!"", !10, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !22, i64 32, !10, i64 40, !8, i64 48, !8, i64 49, !10, i64 56}
!22 = !{!"", !23, i64 0, !7, i64 4}
!23 = !{!"short", !8, i64 0}
!24 = !{!21, !10, i64 24}
!25 = !{!10, !10, i64 0}
!26 = !{!27, !23, i64 2}
!27 = !{!"", !23, i64 0, !23, i64 2, !8, i64 4}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !7, i64 0}
!31 = !{!"", !7, i64 0, !7, i64 4, !32, i64 8}
!32 = !{!"", !33, i64 0, !8, i64 4}
!33 = !{!"", !7, i64 0, !7, i64 1}
!34 = !{!31, !7, i64 4}
!35 = !{!18, !7, i64 72}
!36 = !{!37, !23, i64 0}
!37 = !{!"", !23, i64 0, !8, i64 2}
!38 = !{!6, !7, i64 144}
!39 = !{!6, !7, i64 148}
!40 = !{!41, !10, i64 16}
!41 = !{!"", !22, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !8, i64 28}
!42 = !{!27, !23, i64 0}
!43 = distinct !{!43, !29}
!44 = !{!41, !7, i64 8}
!45 = !{!7, !7, i64 0}
!46 = !{!6, !7, i64 156}
!47 = !{!6, !14, i64 232}


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