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

; 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 = type <{ i32, i32, %struct.anon }>
%struct.anon = type <{ %struct.EFI_DHCP6_HEADER, [1 x i8] }>
%struct.EFI_DHCP6_HEADER = type { i32 }
%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_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.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.10 = external hidden unnamed_addr constant [35 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

; 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 @Dhcp6SendRequestMsg(ptr noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, 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 i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i16, align 2
  %16 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  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 4, 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 = %1
  %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 %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %21, i32 0, i32 11
  %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 1100, ptr noundef @.str.10)
  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 %40

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

38:                                               ; preds = %33
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1101, ptr noundef @.str.5)
  br label %39

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

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

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  br label %43

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

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

52:                                               ; preds = %46
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1102, ptr noundef @.str.6)
  br label %53

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

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

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  br label %57

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

60:                                               ; preds = %57
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %61, i32 0, i32 2
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = icmp ne ptr %63, null
  br i1 %64, label %66, label %65

65:                                               ; preds = %60
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1103, ptr noundef @.str.11)
  br label %66

66:                                               ; preds = %65, %60
  br label %67

67:                                               ; preds = %66, %57
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %70, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !18
  store ptr %72, ptr %9, align 8, !tbaa !5
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %73, i32 0, i32 6
  %75 = load ptr, ptr %74, align 8, !tbaa !19
  store ptr %75, ptr %7, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %69
  %77 = call zeroext i8 @DebugAssertEnabled()
  %78 = icmp ne i8 %77, 0
  br i1 %78, label %79, label %84

79:                                               ; preds = %76
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = icmp ne ptr %80, null
  br i1 %81, label %83, label %82

82:                                               ; preds = %79
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1108, ptr noundef @.str.12)
  br label %83

83:                                               ; preds = %82, %79
  br label %84

84:                                               ; preds = %83, %76
  br label %85

85:                                               ; preds = %84
  br label %86

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

102:                                              ; preds = %86
  store i64 -9223372036854775801, ptr %2, align 8
  store i32 1, ptr %16, align 4
  br label %305

103:                                              ; preds = %86
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 2
  store ptr %105, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !26
  store i64 0, ptr %14, align 8, !tbaa !27
  br label %106

106:                                              ; preds = %131, %103
  %107 = load i64, ptr %14, align 8, !tbaa !27
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %108, i32 0, i32 6
  %110 = load ptr, ptr %109, align 8, !tbaa !16
  %111 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 8, !tbaa !28
  %113 = zext i32 %112 to i64
  %114 = icmp ult i64 %107, %113
  br i1 %114, label %115, label %134

115:                                              ; preds = %106
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %116, i32 0, i32 6
  %118 = load ptr, ptr %117, align 8, !tbaa !16
  %119 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %118, i32 0, i32 3
  %120 = load ptr, ptr %119, align 8, !tbaa !32
  %121 = load i64, ptr %14, align 8, !tbaa !27
  %122 = getelementptr inbounds ptr, ptr %120, i64 %121
  %123 = load ptr, ptr %122, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %123, i32 0, i32 1
  %125 = load i16, ptr %124, align 1, !tbaa !33
  %126 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %125)
  %127 = zext i16 %126 to i32
  %128 = add nsw i32 %127, 4
  %129 = load i32, ptr %13, align 4, !tbaa !26
  %130 = add i32 %129, %128
  store i32 %130, ptr %13, align 4, !tbaa !26
  br label %131

131:                                              ; preds = %115
  %132 = load i64, ptr %14, align 8, !tbaa !27
  %133 = add i64 %132, 1
  store i64 %133, ptr %14, align 8, !tbaa !27
  br label %106, !llvm.loop !35

134:                                              ; preds = %106
  %135 = load i32, ptr %13, align 4, !tbaa !26
  %136 = add i32 1024, %135
  %137 = zext i32 %136 to i64
  %138 = call ptr @AllocateZeroPool(i64 noundef %137)
  store ptr %138, ptr %5, align 8, !tbaa !5
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = icmp eq ptr %139, null
  br i1 %140, label %141, label %142

141:                                              ; preds = %134
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %16, align 4
  br label %305

142:                                              ; preds = %134
  %143 = load i32, ptr %13, align 4, !tbaa !26
  %144 = add i32 1024, %143
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %145, i32 0, i32 0
  store i32 %144, ptr %146, align 1, !tbaa !37
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %147, i32 0, i32 1
  store i32 4, ptr %148, align 1, !tbaa !22
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %149, i32 0, i32 2
  %151 = getelementptr inbounds %struct.anon, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %151, align 1
  %153 = and i32 %152, -256
  %154 = or i32 %153, 3
  store i32 %154, ptr %151, align 1
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._DHCP6_SERVICE, ptr %155, i32 0, i32 8
  %157 = load i32, ptr %156, align 8, !tbaa !38
  %158 = add i32 %157, 1
  store i32 %158, ptr %156, align 8, !tbaa !38
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %159, i32 0, i32 2
  %161 = getelementptr inbounds %struct.anon, ptr %160, i32 0, i32 0
  %162 = load i32, ptr %161, align 1
  %163 = and i32 %157, 16777215
  %164 = shl i32 %163, 8
  %165 = and i32 %162, 255
  %166 = or i32 %165, %164
  store i32 %166, ptr %161, align 1
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %167, i32 0, i32 2
  %169 = getelementptr inbounds %struct.anon, ptr %168, i32 0, i32 1
  %170 = getelementptr inbounds [1 x i8], ptr %169, i64 0, i64 0
  store ptr %170, ptr %11, align 8, !tbaa !5
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %171, i32 0, i32 0
  %173 = load i16, ptr %172, align 2, !tbaa !39
  %174 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %173)
  store i16 %174, ptr %15, align 2, !tbaa !41
  %175 = load ptr, ptr %11, align 8, !tbaa !5
  %176 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 1)
  %177 = load i16, ptr %15, align 2, !tbaa !41
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %178, i32 0, i32 1
  %180 = getelementptr inbounds [1 x i8], ptr %179, i64 0, i64 0
  %181 = call ptr @Dhcp6AppendOption(ptr noundef %175, i16 noundef zeroext %176, i16 noundef zeroext %177, ptr noundef %180)
  store ptr %181, ptr %11, align 8, !tbaa !5
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = call ptr @Dhcp6AppendETOption(ptr noundef %182, ptr noundef %183, ptr noundef %12)
  store ptr %184, ptr %11, align 8, !tbaa !5
  %185 = load ptr, ptr %11, align 8, !tbaa !5
  %186 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 2)
  %187 = load ptr, ptr %8, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %187, i32 0, i32 0
  %189 = load i16, ptr %188, align 2, !tbaa !39
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.EFI_DHCP6_DUID, ptr %190, i32 0, i32 1
  %192 = getelementptr inbounds [1 x i8], ptr %191, i64 0, i64 0
  %193 = call ptr @Dhcp6AppendOption(ptr noundef %185, i16 noundef zeroext %186, i16 noundef zeroext %189, ptr noundef %192)
  store ptr %193, ptr %11, align 8, !tbaa !5
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = load ptr, ptr %3, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %195, i32 0, i32 8
  %197 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8, !tbaa !17
  %199 = load ptr, ptr %3, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %199, i32 0, i32 8
  %201 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %200, i32 0, i32 1
  %202 = load i32, ptr %201, align 8, !tbaa !42
  %203 = load ptr, ptr %3, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %203, i32 0, i32 8
  %205 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %204, i32 0, i32 2
  %206 = load i32, ptr %205, align 4, !tbaa !43
  %207 = load ptr, ptr %5, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %207, i32 0, i32 2
  %209 = getelementptr inbounds %struct.anon, ptr %208, i32 0, i32 0
  %210 = load i32, ptr %209, align 1
  %211 = and i32 %210, 255
  %212 = call ptr @Dhcp6AppendIaOption(ptr noundef %194, ptr noundef %198, i32 noundef %202, i32 noundef %206, i32 noundef %211)
  store ptr %212, ptr %11, align 8, !tbaa !5
  store i64 0, ptr %14, align 8, !tbaa !27
  br label %213

213:                                              ; preds = %242, %142
  %214 = load i64, ptr %14, align 8, !tbaa !27
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %215, i32 0, i32 6
  %217 = load ptr, ptr %216, align 8, !tbaa !16
  %218 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %217, i32 0, i32 2
  %219 = load i32, ptr %218, align 8, !tbaa !28
  %220 = zext i32 %219 to i64
  %221 = icmp ult i64 %214, %220
  br i1 %221, label %222, label %245

222:                                              ; preds = %213
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %223, i32 0, i32 6
  %225 = load ptr, ptr %224, align 8, !tbaa !16
  %226 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %225, i32 0, i32 3
  %227 = load ptr, ptr %226, align 8, !tbaa !32
  %228 = load i64, ptr %14, align 8, !tbaa !27
  %229 = getelementptr inbounds ptr, ptr %227, i64 %228
  %230 = load ptr, ptr %229, align 8, !tbaa !5
  store ptr %230, ptr %6, align 8, !tbaa !5
  %231 = load ptr, ptr %11, align 8, !tbaa !5
  %232 = load ptr, ptr %6, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %232, i32 0, i32 0
  %234 = load i16, ptr %233, align 1, !tbaa !44
  %235 = load ptr, ptr %6, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %235, i32 0, i32 1
  %237 = load i16, ptr %236, align 1, !tbaa !33
  %238 = load ptr, ptr %6, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %238, i32 0, i32 2
  %240 = getelementptr inbounds [1 x i8], ptr %239, i64 0, i64 0
  %241 = call ptr @Dhcp6AppendOption(ptr noundef %231, i16 noundef zeroext %234, i16 noundef zeroext %237, ptr noundef %240)
  store ptr %241, ptr %11, align 8, !tbaa !5
  br label %242

242:                                              ; preds = %222
  %243 = load i64, ptr %14, align 8, !tbaa !27
  %244 = add i64 %243, 1
  store i64 %244, ptr %14, align 8, !tbaa !27
  br label %213, !llvm.loop !45

245:                                              ; preds = %213
  %246 = load ptr, ptr %11, align 8, !tbaa !5
  %247 = load ptr, ptr %5, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %247, i32 0, i32 2
  %249 = getelementptr inbounds %struct.anon, ptr %248, i32 0, i32 1
  %250 = getelementptr inbounds [1 x i8], ptr %249, i64 0, i64 0
  %251 = ptrtoint ptr %246 to i64
  %252 = ptrtoint ptr %250 to i64
  %253 = sub i64 %251, %252
  %254 = trunc i64 %253 to i32
  %255 = load ptr, ptr %5, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %255, i32 0, i32 1
  %257 = load i32, ptr %256, align 1, !tbaa !22
  %258 = add i32 %257, %254
  store i32 %258, ptr %256, align 1, !tbaa !22
  br label %259

259:                                              ; preds = %245
  %260 = call zeroext i8 @DebugAssertEnabled()
  %261 = icmp ne i8 %260, 0
  br i1 %261, label %262, label %273

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

271:                                              ; preds = %262
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1197, ptr noundef @.str.9)
  br label %272

272:                                              ; preds = %271, %262
  br label %273

273:                                              ; preds = %272, %259
  br label %274

274:                                              ; preds = %273
  br label %275

275:                                              ; preds = %274
  %276 = load ptr, ptr %3, align 8, !tbaa !5
  %277 = call i64 @Dhcp6CallbackUser(ptr noundef %276, i32 noundef 3, ptr noundef %5)
  store i64 %277, ptr %4, align 8, !tbaa !27
  %278 = load i64, ptr %4, align 8, !tbaa !27
  %279 = icmp slt i64 %278, 0
  br i1 %279, label %280, label %283

280:                                              ; preds = %275
  %281 = load ptr, ptr %5, align 8, !tbaa !5
  call void @FreePool(ptr noundef %281)
  %282 = load i64, ptr %4, align 8, !tbaa !27
  store i64 %282, ptr %2, align 8
  store i32 1, ptr %16, align 4
  br label %305

283:                                              ; preds = %275
  %284 = load ptr, ptr %3, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %284, i32 0, i32 8
  %286 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %285, i32 0, i32 0
  %287 = load ptr, ptr %286, align 8, !tbaa !17
  %288 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %287, i32 0, i32 1
  store i32 2, ptr %288, align 8, !tbaa !46
  %289 = load ptr, ptr %3, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %289, i32 0, i32 17
  store i64 0, ptr %290, align 8, !tbaa !48
  %291 = load ptr, ptr %3, align 8, !tbaa !5
  %292 = load ptr, ptr %5, align 8, !tbaa !5
  %293 = load ptr, ptr %12, align 8, !tbaa !5
  %294 = call i64 @Dhcp6TransmitPacket(ptr noundef %291, ptr noundef %292, ptr noundef %293)
  store i64 %294, ptr %4, align 8, !tbaa !27
  %295 = load i64, ptr %4, align 8, !tbaa !27
  %296 = icmp slt i64 %295, 0
  br i1 %296, label %297, label %300

297:                                              ; preds = %283
  %298 = load ptr, ptr %5, align 8, !tbaa !5
  call void @FreePool(ptr noundef %298)
  %299 = load i64, ptr %4, align 8, !tbaa !27
  store i64 %299, ptr %2, align 8
  store i32 1, ptr %16, align 4
  br label %305

300:                                              ; preds = %283
  %301 = load ptr, ptr %3, align 8, !tbaa !5
  %302 = load ptr, ptr %5, align 8, !tbaa !5
  %303 = load ptr, ptr %12, align 8, !tbaa !5
  %304 = call i64 @Dhcp6EnqueueRetry(ptr noundef %301, ptr noundef %302, ptr noundef %303, ptr noundef null)
  store i64 %304, ptr %2, align 8
  store i32 1, ptr %16, align 4
  br label %305

305:                                              ; preds = %300, %297, %280, %141, %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 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %306 = load i64, ptr %2, align 8
  ret i64 %306
}

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 192}
!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 120}
!17 = !{!10, !6, i64 136}
!18 = !{!10, !6, i64 16}
!19 = !{!20, !6, i64 56}
!20 = !{!"_DHCP6_SERVICE", !11, i64 0, !6, i64 8, !6, i64 16, !21, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !12, i64 80, !15, i64 96}
!21 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!22 = !{!23, !11, i64 4}
!23 = !{!"", !11, i64 0, !11, i64 4, !24, i64 8}
!24 = !{!"", !25, i64 0, !7, i64 4}
!25 = !{!"", !11, i64 0, !11, i64 1}
!26 = !{!11, !11, i64 0}
!27 = !{!15, !15, i64 0}
!28 = !{!29, !11, i64 16}
!29 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !30, i64 32, !6, i64 40, !7, i64 48, !7, i64 49, !6, i64 56}
!30 = !{!"", !31, i64 0, !11, i64 4}
!31 = !{!"short", !7, i64 0}
!32 = !{!29, !6, i64 24}
!33 = !{!34, !31, i64 2}
!34 = !{!"", !31, i64 0, !31, i64 2, !7, i64 4}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!23, !11, i64 0}
!38 = !{!20, !11, i64 72}
!39 = !{!40, !31, i64 0}
!40 = !{!"", !31, i64 0, !7, i64 2}
!41 = !{!31, !31, i64 0}
!42 = !{!10, !11, i64 144}
!43 = !{!10, !11, i64 148}
!44 = !{!34, !31, i64 0}
!45 = distinct !{!45, !36}
!46 = !{!47, !11, i64 8}
!47 = !{!"", !30, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !7, i64 28}
!48 = !{!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.10 = external hidden unnamed_addr constant [35 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

; 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 @Dhcp6SendRequestMsg(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %4 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %4, 0
  br i1 %.not, label %9, label %5

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

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

9:                                                ; preds = %1, %8, %5
  %10 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not61 = icmp eq i8 %10, 0
  br i1 %.not61, label %15, label %11

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %0, i64 120
  %13 = load ptr, ptr %12, align 8, !tbaa !15
  %.not62 = icmp eq ptr %13, null
  br i1 %.not62, label %14, label %15

14:                                               ; preds = %11
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1101, ptr noundef nonnull @.str.5) #3
  br label %15

15:                                               ; preds = %9, %14, %11
  %16 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not63 = icmp eq i8 %16, 0
  br i1 %.not63, label %21, label %17

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

20:                                               ; preds = %17
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1102, ptr noundef nonnull @.str.6) #3
  br label %21

21:                                               ; preds = %15, %20, %17
  %22 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not65 = icmp eq i8 %22, 0
  br i1 %.not65, label %27, label %23

23:                                               ; preds = %21
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  %25 = load ptr, ptr %24, align 8, !tbaa !17
  %.not66 = icmp eq ptr %25, null
  br i1 %.not66, label %26, label %27

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

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

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

36:                                               ; preds = %35, %27
  %37 = getelementptr inbounds i8, ptr %0, i64 192
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 12
  %40 = getelementptr inbounds i8, ptr %38, i64 4
  %41 = load i32, ptr %40, align 1, !tbaa !21
  %42 = add i32 %41, -4
  %43 = tail call ptr @Dhcp6SeekOption(ptr noundef nonnull %39, i32 noundef %42, i16 noundef zeroext 2) #3
  %44 = icmp eq ptr %43, null
  br i1 %44, label %155, label %45

45:                                               ; preds = %36
  %46 = getelementptr inbounds i8, ptr %43, i64 2
  %47 = getelementptr inbounds i8, ptr %0, i64 120
  %48 = load ptr, ptr %47, align 8, !tbaa !15
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load i32, ptr %49, align 8, !tbaa !25
  %.not76 = icmp eq i32 %50, 0
  br i1 %.not76, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %45, %.lr.ph
  %51 = phi ptr [ %63, %.lr.ph ], [ %48, %45 ]
  %.05369 = phi i64 [ %62, %.lr.ph ], [ 0, %45 ]
  %.05468 = phi i32 [ %61, %.lr.ph ], [ 0, %45 ]
  %52 = getelementptr inbounds i8, ptr %51, i64 24
  %53 = load ptr, ptr %52, align 8, !tbaa !29
  %54 = getelementptr inbounds ptr, ptr %53, i64 %.05369
  %55 = load ptr, ptr %54, align 8, !tbaa !30
  %56 = getelementptr inbounds i8, ptr %55, i64 2
  %57 = load i16, ptr %56, align 1, !tbaa !31
  %58 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %57) #3
  %59 = zext i16 %58 to i32
  %60 = add i32 %.05468, 4
  %61 = add i32 %60, %59
  %62 = add nuw nsw i64 %.05369, 1
  %63 = load ptr, ptr %47, align 8, !tbaa !15
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %65 = load i32, ptr %64, align 8, !tbaa !25
  %66 = zext i32 %65 to i64
  %67 = icmp ult i64 %62, %66
  br i1 %67, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !33

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %45
  %.054.lcssa = phi i32 [ 1024, %45 ], [ %68, %._crit_edge.loopexit ]
  %69 = zext i32 %.054.lcssa to i64
  %70 = tail call ptr @AllocateZeroPool(i64 noundef %69) #3
  store ptr %70, ptr %2, align 8, !tbaa !30
  %71 = icmp eq ptr %70, null
  br i1 %71, label %155, label %72

72:                                               ; preds = %._crit_edge
  store i32 %.054.lcssa, ptr %70, align 1, !tbaa !35
  %73 = getelementptr inbounds i8, ptr %70, i64 4
  store i32 4, ptr %73, align 1, !tbaa !21
  %74 = getelementptr inbounds i8, ptr %70, i64 8
  %75 = load i32, ptr %74, align 1
  %76 = and i32 %75, -256
  %77 = or disjoint i32 %76, 3
  store i32 %77, ptr %74, align 1
  %78 = getelementptr inbounds i8, ptr %29, i64 72
  %79 = load i32, ptr %78, align 8, !tbaa !36
  %80 = add i32 %79, 1
  store i32 %80, ptr %78, align 8, !tbaa !36
  %81 = load i32, ptr %74, align 1
  %82 = shl i32 %79, 8
  %83 = and i32 %81, 255
  %84 = or disjoint i32 %83, %82
  store i32 %84, ptr %74, align 1
  %85 = getelementptr inbounds i8, ptr %70, i64 12
  %86 = load i16, ptr %31, align 2, !tbaa !37
  %87 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %86) #3
  %88 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext 1) #3
  %89 = getelementptr inbounds i8, ptr %31, i64 2
  %90 = tail call ptr @Dhcp6AppendOption(ptr noundef nonnull %85, i16 noundef zeroext %88, i16 noundef zeroext %87, ptr noundef nonnull %89) #3
  %91 = call ptr @Dhcp6AppendETOption(ptr noundef %90, ptr noundef nonnull %0, ptr noundef nonnull %3) #3
  %92 = call zeroext i16 @SwapBytes16(i16 noundef zeroext 2) #3
  %93 = load i16, ptr %46, align 2, !tbaa !37
  %94 = getelementptr inbounds i8, ptr %43, i64 4
  %95 = call ptr @Dhcp6AppendOption(ptr noundef %91, i16 noundef zeroext %92, i16 noundef zeroext %93, ptr noundef nonnull %94) #3
  %96 = getelementptr inbounds i8, ptr %0, i64 136
  %97 = load ptr, ptr %96, align 8, !tbaa !16
  %98 = getelementptr inbounds i8, ptr %0, i64 144
  %99 = load i32, ptr %98, align 8, !tbaa !39
  %100 = getelementptr inbounds i8, ptr %0, i64 148
  %101 = load i32, ptr %100, align 4, !tbaa !40
  %102 = load i32, ptr %74, align 1
  %103 = and i32 %102, 255
  %104 = call ptr @Dhcp6AppendIaOption(ptr noundef %95, ptr noundef %97, i32 noundef %99, i32 noundef %101, i32 noundef %103) #3
  %105 = load ptr, ptr %47, align 8, !tbaa !15
  %106 = getelementptr inbounds i8, ptr %105, i64 16
  %107 = load i32, ptr %106, align 8, !tbaa !25
  %.not77 = icmp eq i32 %107, 0
  br i1 %.not77, label %._crit_edge74, label %.lr.ph73

.lr.ph73:                                         ; preds = %72, %.lr.ph73
  %108 = phi ptr [ %119, %.lr.ph73 ], [ %105, %72 ]
  %.171 = phi i64 [ %118, %.lr.ph73 ], [ 0, %72 ]
  %.05570 = phi ptr [ %117, %.lr.ph73 ], [ %104, %72 ]
  %109 = getelementptr inbounds i8, ptr %108, i64 24
  %110 = load ptr, ptr %109, align 8, !tbaa !29
  %111 = getelementptr inbounds ptr, ptr %110, i64 %.171
  %112 = load ptr, ptr %111, align 8, !tbaa !30
  %113 = load i16, ptr %112, align 1, !tbaa !41
  %114 = getelementptr inbounds i8, ptr %112, i64 2
  %115 = load i16, ptr %114, align 1, !tbaa !31
  %116 = getelementptr inbounds i8, ptr %112, i64 4
  %117 = call ptr @Dhcp6AppendOption(ptr noundef %.05570, i16 noundef zeroext %113, i16 noundef zeroext %115, ptr noundef nonnull %116) #3
  %118 = add nuw nsw i64 %.171, 1
  %119 = load ptr, ptr %47, align 8, !tbaa !15
  %120 = getelementptr inbounds i8, ptr %119, i64 16
  %121 = load i32, ptr %120, align 8, !tbaa !25
  %122 = zext i32 %121 to i64
  %123 = icmp ult i64 %118, %122
  br i1 %123, label %.lr.ph73, label %._crit_edge74, !llvm.loop !42

._crit_edge74:                                    ; preds = %.lr.ph73, %72
  %.055.lcssa = phi ptr [ %104, %72 ], [ %117, %.lr.ph73 ]
  %124 = ptrtoint ptr %.055.lcssa to i64
  %125 = ptrtoint ptr %85 to i64
  %126 = sub i64 %124, %125
  %127 = trunc i64 %126 to i32
  %128 = load i32, ptr %73, align 1, !tbaa !21
  %129 = add i32 %128, %127
  store i32 %129, ptr %73, align 1, !tbaa !21
  %130 = call zeroext i8 @DebugAssertEnabled() #3
  %.not67 = icmp eq i8 %130, 0
  br i1 %.not67, label %137, label %131

131:                                              ; preds = %._crit_edge74
  %132 = load i32, ptr %70, align 1, !tbaa !35
  %133 = load i32, ptr %73, align 1, !tbaa !21
  %134 = add i32 %133, 8
  %135 = icmp ugt i32 %132, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %131
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1197, ptr noundef nonnull @.str.9) #3
  br label %137

137:                                              ; preds = %131, %136, %._crit_edge74
  %138 = call i64 @Dhcp6CallbackUser(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull %2)
  %139 = icmp slt i64 %138, 0
  br i1 %139, label %140, label %142

140:                                              ; preds = %137
  %141 = load ptr, ptr %2, align 8, !tbaa !30
  call void @FreePool(ptr noundef %141) #3
  br label %155

142:                                              ; preds = %137
  %143 = load ptr, ptr %96, align 8, !tbaa !16
  %144 = getelementptr inbounds i8, ptr %143, i64 8
  store i32 2, ptr %144, align 8, !tbaa !43
  %145 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 0, ptr %145, align 8, !tbaa !45
  %146 = load ptr, ptr %2, align 8, !tbaa !30
  %147 = load ptr, ptr %3, align 8, !tbaa !30
  %148 = call i64 @Dhcp6TransmitPacket(ptr noundef nonnull %0, ptr noundef %146, ptr noundef %147)
  %149 = icmp slt i64 %148, 0
  %150 = load ptr, ptr %2, align 8, !tbaa !30
  br i1 %149, label %151, label %152

151:                                              ; preds = %142
  call void @FreePool(ptr noundef %150) #3
  br label %155

152:                                              ; preds = %142
  %153 = load ptr, ptr %3, align 8, !tbaa !30
  %154 = call i64 @Dhcp6EnqueueRetry(ptr noundef nonnull %0, ptr noundef %150, ptr noundef %153, ptr noundef null)
  br label %155

155:                                              ; preds = %._crit_edge, %36, %152, %151, %140
  %.0 = phi i64 [ %138, %140 ], [ %148, %151 ], [ %154, %152 ], [ -9223372036854775801, %36 ], [ -9223372036854775799, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #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 192}
!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 120}
!16 = !{!6, !10, i64 136}
!17 = !{!6, !10, i64 16}
!18 = !{!19, !10, i64 56}
!19 = !{!"_DHCP6_SERVICE", !7, i64 0, !10, i64 8, !10, i64 16, !20, i64 24, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !11, i64 80, !14, i64 96}
!20 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !10, i64 0, !10, i64 8}
!21 = !{!22, !7, i64 4}
!22 = !{!"", !7, i64 0, !7, i64 4, !23, i64 8}
!23 = !{!"", !24, i64 0, !8, i64 4}
!24 = !{!"", !7, i64 0, !7, i64 1}
!25 = !{!26, !7, i64 16}
!26 = !{!"", !10, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !27, i64 32, !10, i64 40, !8, i64 48, !8, i64 49, !10, i64 56}
!27 = !{!"", !28, i64 0, !7, i64 4}
!28 = !{!"short", !8, i64 0}
!29 = !{!26, !10, i64 24}
!30 = !{!10, !10, i64 0}
!31 = !{!32, !28, i64 2}
!32 = !{!"", !28, i64 0, !28, i64 2, !8, i64 4}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!22, !7, i64 0}
!36 = !{!19, !7, i64 72}
!37 = !{!38, !28, i64 0}
!38 = !{!"", !28, i64 0, !8, i64 2}
!39 = !{!6, !7, i64 144}
!40 = !{!6, !7, i64 148}
!41 = !{!32, !28, i64 0}
!42 = distinct !{!42, !34}
!43 = !{!44, !7, i64 8}
!44 = !{!"", !27, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !8, i64 28}
!45 = !{!6, !14, i64 232}


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