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

; 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.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_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] }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@gBS = external global ptr, align 8
@.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.17 = external hidden unnamed_addr constant [31 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() #1

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) #1

declare ptr @AllocateZeroPool(i64 noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6DequeueRetry(ptr noundef, i32 noundef, i8 noundef zeroext) #2

declare void @FreePool(ptr noundef) #1

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

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

declare ptr @Dhcp6SeekIaOption(ptr noundef, i32 noundef, ptr noundef) #1

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

declare zeroext i16 @ReadUnaligned16(ptr noundef) #1

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

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6InitSolicitMsg(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6SendRequestMsg(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6HandleReplyMsg(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i16, align 2
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #3
  br label %10

10:                                               ; preds = %2
  %11 = call zeroext i8 @DebugAssertEnabled()
  %12 = icmp ne i8 %11, 0
  br i1 %12, label %13, label %20

13:                                               ; preds = %10
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %14, i32 0, i32 6
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = icmp ne ptr %16, null
  br i1 %17, label %19, label %18

18:                                               ; preds = %13
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2082, ptr noundef @.str.5)
  br label %19

19:                                               ; preds = %18, %13
  br label %20

20:                                               ; preds = %19, %10
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  br label %23

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

26:                                               ; preds = %23
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %27, i32 0, i32 8
  %29 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %31 = icmp ne ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %26
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2083, ptr noundef @.str.6)
  br label %33

33:                                               ; preds = %32, %26
  br label %34

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

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = call zeroext i8 @DebugAssertEnabled()
  %39 = icmp ne i8 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %37
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2084, ptr noundef @.str.1)
  br label %44

44:                                               ; preds = %43, %40
  br label %45

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

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  store i64 0, ptr %6, align 8, !tbaa !17
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %48, i32 0, i32 2
  %50 = getelementptr inbounds %struct.anon, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 1
  %52 = and i32 %51, 255
  %53 = icmp ne i32 %52, 7
  br i1 %53, label %54, label %55

54:                                               ; preds = %47
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

55:                                               ; preds = %47
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %56, i32 0, i32 2
  %58 = getelementptr inbounds %struct.anon, ptr %57, i32 0, i32 1
  %59 = getelementptr inbounds [1 x i8], ptr %58, i64 0, i64 0
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 1, !tbaa !18
  %63 = sub i32 %62, 4
  %64 = call ptr @Dhcp6SeekOption(ptr noundef %59, i32 noundef %63, i16 noundef zeroext 14)
  store ptr %64, ptr %7, align 8, !tbaa !5
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %74

67:                                               ; preds = %55
  %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 !9
  %71 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %70, i32 0, i32 7
  %72 = load i8, ptr %71, align 1, !tbaa !22
  %73 = icmp ne i8 %72, 0
  br i1 %73, label %74, label %85

74:                                               ; preds = %67, %55
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = icmp eq ptr %75, null
  br i1 %76, label %77, label %86

77:                                               ; preds = %74
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %78, i32 0, i32 6
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %80, i32 0, i32 7
  %82 = load i8, ptr %81, align 1, !tbaa !22
  %83 = zext i8 %82 to i32
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %77, %67
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

86:                                               ; preds = %77, %74
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %87, i32 0, i32 8
  %89 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !16
  %91 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 8, !tbaa !26
  %93 = icmp eq i32 %92, 2
  br i1 %93, label %110, label %94

94:                                               ; preds = %86
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %95, i32 0, i32 8
  %97 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !16
  %99 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 8, !tbaa !26
  %101 = icmp eq i32 %100, 7
  br i1 %101, label %110, label %102

102:                                              ; preds = %94
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %103, i32 0, i32 8
  %105 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !16
  %107 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 8, !tbaa !26
  %109 = icmp eq i32 %108, 8
  br i1 %109, label %110, label %127

110:                                              ; preds = %102, %94, %86
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %111, i32 0, i32 2
  %113 = getelementptr inbounds %struct.anon, ptr %112, i32 0, i32 1
  %114 = getelementptr inbounds [1 x i8], ptr %113, i64 0, i64 0
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 1, !tbaa !18
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %118, i32 0, i32 6
  %120 = load ptr, ptr %119, align 8, !tbaa !9
  %121 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %120, i32 0, i32 4
  %122 = call ptr @Dhcp6SeekIaOption(ptr noundef %114, i32 noundef %117, ptr noundef %121)
  store ptr %122, ptr %7, align 8, !tbaa !5
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = icmp eq ptr %123, null
  br i1 %124, label %125, label %126

125:                                              ; preds = %110
  store i64 0, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

126:                                              ; preds = %110
  br label %127

127:                                              ; preds = %126, %102
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = call i64 @Dhcp6CallbackUser(ptr noundef %128, i32 noundef 4, ptr noundef %5)
  store i64 %129, ptr %6, align 8, !tbaa !17
  %130 = load i64, ptr %6, align 8, !tbaa !17
  %131 = icmp slt i64 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %127
  %133 = load i64, ptr %6, align 8, !tbaa !17
  store i64 %133, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

134:                                              ; preds = %127
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %135, i32 0, i32 8
  %137 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !16
  %139 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 8, !tbaa !26
  %141 = icmp eq i32 %140, 3
  br i1 %141, label %150, label %142

142:                                              ; preds = %134
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %143, i32 0, i32 8
  %145 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %144, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !16
  %147 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 8, !tbaa !26
  %149 = icmp eq i32 %148, 5
  br i1 %149, label %150, label %219

150:                                              ; preds = %142, %134
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %151, i32 0, i32 8
  %153 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !16
  %155 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %154, i32 0, i32 3
  %156 = load i32, ptr %155, align 8, !tbaa !28
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %164

158:                                              ; preds = %150
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %159, i32 0, i32 8
  %161 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !16
  %163 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %162, i32 0, i32 1
  store i32 6, ptr %163, align 8, !tbaa !26
  br label %197

164:                                              ; preds = %150
  br label %165

165:                                              ; preds = %164
  %166 = call zeroext i8 @DebugAssertEnabled()
  %167 = icmp ne i8 %166, 0
  br i1 %167, label %168, label %178

168:                                              ; preds = %165
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %169, i32 0, i32 8
  %171 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %170, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8, !tbaa !16
  %173 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %172, i32 0, i32 2
  %174 = load ptr, ptr %173, align 8, !tbaa !29
  %175 = icmp ne ptr %174, null
  br i1 %175, label %177, label %176

176:                                              ; preds = %168
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2147, ptr noundef @.str.17)
  br label %177

177:                                              ; preds = %176, %168
  br label %178

178:                                              ; preds = %177, %165
  br label %179

179:                                              ; preds = %178
  br label %180

180:                                              ; preds = %179
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %181, i32 0, i32 8
  %183 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !16
  %185 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %184, i32 0, i32 2
  %186 = load ptr, ptr %185, align 8, !tbaa !29
  call void @FreePool(ptr noundef %186)
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %187, i32 0, i32 8
  %189 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %188, i32 0, i32 0
  %190 = load ptr, ptr %189, align 8, !tbaa !16
  %191 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %190, i32 0, i32 2
  store ptr null, ptr %191, align 8, !tbaa !29
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %192, i32 0, i32 8
  %194 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %193, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8, !tbaa !16
  %196 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %195, i32 0, i32 1
  store i32 0, ptr %196, align 8, !tbaa !26
  br label %197

197:                                              ; preds = %180, %158
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %198, i32 0, i32 14
  store volatile i64 0, ptr %199, align 8, !tbaa !30
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %200, i32 0, i32 6
  %202 = load ptr, ptr %201, align 8, !tbaa !9
  %203 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %202, i32 0, i32 5
  %204 = load ptr, ptr %203, align 8, !tbaa !31
  %205 = icmp ne ptr %204, null
  br i1 %205, label %206, label %216

206:                                              ; preds = %197
  %207 = load ptr, ptr @gBS, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %207, i32 0, i32 11
  %209 = load ptr, ptr %208, align 8, !tbaa !32
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %210, i32 0, i32 6
  %212 = load ptr, ptr %211, align 8, !tbaa !9
  %213 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %212, i32 0, i32 5
  %214 = load ptr, ptr %213, align 8, !tbaa !31
  %215 = call i64 %209(ptr noundef %214)
  br label %216

216:                                              ; preds = %206, %197
  %217 = load ptr, ptr %4, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %217, i32 0, i32 17
  store i64 0, ptr %218, align 8, !tbaa !35
  store i64 0, ptr %6, align 8, !tbaa !17
  br label %386

219:                                              ; preds = %142
  store ptr null, ptr %7, align 8, !tbaa !5
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = load ptr, ptr %5, align 8, !tbaa !5
  %222 = call i64 @Dhcp6SeekStsOption(ptr noundef %220, ptr noundef %221, ptr noundef %7)
  store i64 %222, ptr %6, align 8, !tbaa !17
  %223 = load i64, ptr %6, align 8, !tbaa !17
  %224 = icmp slt i64 %223, 0
  br i1 %224, label %311, label %225

225:                                              ; preds = %219
  %226 = load ptr, ptr %4, align 8, !tbaa !5
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = call i64 @Dhcp6UpdateIaInfo(ptr noundef %226, ptr noundef %227)
  store i64 %228, ptr %6, align 8, !tbaa !17
  %229 = load i64, ptr %6, align 8, !tbaa !17
  %230 = icmp slt i64 %229, 0
  br i1 %230, label %305, label %231

231:                                              ; preds = %225
  %232 = load ptr, ptr %4, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %232, i32 0, i32 17
  store i64 0, ptr %233, align 8, !tbaa !35
  %234 = load ptr, ptr %4, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %234, i32 0, i32 8
  %236 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %235, i32 0, i32 0
  %237 = load ptr, ptr %236, align 8, !tbaa !16
  %238 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %237, i32 0, i32 2
  %239 = load ptr, ptr %238, align 8, !tbaa !29
  %240 = icmp ne ptr %239, null
  br i1 %240, label %241, label %248

241:                                              ; preds = %231
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %242, i32 0, i32 8
  %244 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %243, i32 0, i32 0
  %245 = load ptr, ptr %244, align 8, !tbaa !16
  %246 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %245, i32 0, i32 2
  %247 = load ptr, ptr %246, align 8, !tbaa !29
  call void @FreePool(ptr noundef %247)
  br label %248

248:                                              ; preds = %241, %231
  %249 = load ptr, ptr %5, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %249, i32 0, i32 0
  %251 = load i32, ptr %250, align 1, !tbaa !36
  %252 = zext i32 %251 to i64
  %253 = call ptr @AllocateZeroPool(i64 noundef %252)
  %254 = load ptr, ptr %4, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %254, i32 0, i32 8
  %256 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %255, i32 0, i32 0
  %257 = load ptr, ptr %256, align 8, !tbaa !16
  %258 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %257, i32 0, i32 2
  store ptr %253, ptr %258, align 8, !tbaa !29
  %259 = load ptr, ptr %4, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %259, i32 0, i32 8
  %261 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %260, i32 0, i32 0
  %262 = load ptr, ptr %261, align 8, !tbaa !16
  %263 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %262, i32 0, i32 2
  %264 = load ptr, ptr %263, align 8, !tbaa !29
  %265 = icmp eq ptr %264, null
  br i1 %265, label %266, label %267

266:                                              ; preds = %248
  store i64 -9223372036854775799, ptr %6, align 8, !tbaa !17
  br label %386

267:                                              ; preds = %248
  %268 = load ptr, ptr %4, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %268, i32 0, i32 8
  %270 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %269, i32 0, i32 0
  %271 = load ptr, ptr %270, align 8, !tbaa !16
  %272 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %271, i32 0, i32 2
  %273 = load ptr, ptr %272, align 8, !tbaa !29
  %274 = load ptr, ptr %5, align 8, !tbaa !5
  %275 = load ptr, ptr %5, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %275, i32 0, i32 0
  %277 = load i32, ptr %276, align 1, !tbaa !36
  %278 = zext i32 %277 to i64
  %279 = call ptr @CopyMem(ptr noundef %273, ptr noundef %274, i64 noundef %278)
  %280 = load ptr, ptr %4, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %280, i32 0, i32 8
  %282 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %281, i32 0, i32 0
  %283 = load ptr, ptr %282, align 8, !tbaa !16
  %284 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %283, i32 0, i32 1
  store i32 6, ptr %284, align 8, !tbaa !26
  %285 = load ptr, ptr %4, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %285, i32 0, i32 14
  store volatile i64 0, ptr %286, align 8, !tbaa !30
  %287 = load ptr, ptr %4, align 8, !tbaa !5
  call void @Dhcp6AppendCacheIa(ptr noundef %287)
  %288 = load ptr, ptr %4, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %288, i32 0, i32 6
  %290 = load ptr, ptr %289, align 8, !tbaa !9
  %291 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %290, i32 0, i32 5
  %292 = load ptr, ptr %291, align 8, !tbaa !31
  %293 = icmp ne ptr %292, null
  br i1 %293, label %294, label %304

294:                                              ; preds = %267
  %295 = load ptr, ptr @gBS, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %295, i32 0, i32 11
  %297 = load ptr, ptr %296, align 8, !tbaa !32
  %298 = load ptr, ptr %4, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %298, i32 0, i32 6
  %300 = load ptr, ptr %299, align 8, !tbaa !9
  %301 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %300, i32 0, i32 5
  %302 = load ptr, ptr %301, align 8, !tbaa !31
  %303 = call i64 %297(ptr noundef %302)
  br label %304

304:                                              ; preds = %294, %267
  br label %310

305:                                              ; preds = %225
  %306 = load i64, ptr %6, align 8, !tbaa !17
  %307 = icmp eq i64 %306, -9223372036854775794
  br i1 %307, label %308, label %309

308:                                              ; preds = %305
  store i64 0, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

309:                                              ; preds = %305
  br label %310

310:                                              ; preds = %309, %304
  br label %386

311:                                              ; preds = %219
  %312 = load ptr, ptr %7, align 8, !tbaa !5
  %313 = icmp ne ptr %312, null
  br i1 %313, label %314, label %384

314:                                              ; preds = %311
  %315 = load ptr, ptr %7, align 8, !tbaa !5
  %316 = getelementptr inbounds i8, ptr %315, i64 4
  %317 = call zeroext i16 @ReadUnaligned16(ptr noundef %316)
  %318 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %317)
  store i16 %318, ptr %8, align 2, !tbaa !37
  %319 = load i16, ptr %8, align 2, !tbaa !37
  %320 = zext i16 %319 to i32
  switch i32 %320, label %382 [
    i32 1, label %383
    i32 5, label %321
    i32 4, label %333
    i32 3, label %357
  ]

321:                                              ; preds = %314
  %322 = load ptr, ptr %4, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %322, i32 0, i32 13
  %324 = load ptr, ptr %323, align 8, !tbaa !38
  %325 = icmp ne ptr %324, null
  br i1 %325, label %326, label %332

326:                                              ; preds = %321
  %327 = load ptr, ptr %4, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %327, i32 0, i32 13
  %329 = load ptr, ptr %328, align 8, !tbaa !38
  call void @FreePool(ptr noundef %329)
  %330 = load ptr, ptr %4, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %330, i32 0, i32 13
  store ptr null, ptr %331, align 8, !tbaa !38
  br label %332

332:                                              ; preds = %326, %321
  br label %383

333:                                              ; preds = %314
  %334 = load ptr, ptr %4, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %334, i32 0, i32 8
  %336 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %335, i32 0, i32 0
  %337 = load ptr, ptr %336, align 8, !tbaa !16
  %338 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %337, i32 0, i32 1
  %339 = load i32, ptr %338, align 8, !tbaa !26
  %340 = icmp eq i32 %339, 4
  br i1 %340, label %341, label %356

341:                                              ; preds = %333
  %342 = load ptr, ptr %4, align 8, !tbaa !5
  %343 = call i64 @Dhcp6CacheIa(ptr noundef %342)
  store i64 %343, ptr %6, align 8, !tbaa !17
  %344 = load i64, ptr %6, align 8, !tbaa !17
  %345 = icmp slt i64 %344, 0
  br i1 %345, label %346, label %348

346:                                              ; preds = %341
  %347 = load i64, ptr %6, align 8, !tbaa !17
  store i64 %347, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

348:                                              ; preds = %341
  %349 = load ptr, ptr %4, align 8, !tbaa !5
  %350 = call i64 @Dhcp6InitSolicitMsg(ptr noundef %349)
  store i64 %350, ptr %6, align 8, !tbaa !17
  %351 = load i64, ptr %6, align 8, !tbaa !17
  %352 = icmp slt i64 %351, 0
  br i1 %352, label %353, label %355

353:                                              ; preds = %348
  %354 = load i64, ptr %6, align 8, !tbaa !17
  store i64 %354, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

355:                                              ; preds = %348
  br label %356

356:                                              ; preds = %355, %333
  br label %383

357:                                              ; preds = %314
  %358 = load ptr, ptr %4, align 8, !tbaa !5
  %359 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %358, i32 0, i32 8
  %360 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %359, i32 0, i32 0
  %361 = load ptr, ptr %360, align 8, !tbaa !16
  %362 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %361, i32 0, i32 1
  %363 = load i32, ptr %362, align 8, !tbaa !26
  %364 = icmp eq i32 %363, 7
  br i1 %364, label %373, label %365

365:                                              ; preds = %357
  %366 = load ptr, ptr %4, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %366, i32 0, i32 8
  %368 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %367, i32 0, i32 0
  %369 = load ptr, ptr %368, align 8, !tbaa !16
  %370 = getelementptr inbounds %struct.EFI_DHCP6_IA, ptr %369, i32 0, i32 1
  %371 = load i32, ptr %370, align 8, !tbaa !26
  %372 = icmp eq i32 %371, 8
  br i1 %372, label %373, label %381

373:                                              ; preds = %365, %357
  %374 = load ptr, ptr %4, align 8, !tbaa !5
  %375 = call i64 @Dhcp6SendRequestMsg(ptr noundef %374)
  store i64 %375, ptr %6, align 8, !tbaa !17
  %376 = load i64, ptr %6, align 8, !tbaa !17
  %377 = icmp slt i64 %376, 0
  br i1 %377, label %378, label %380

378:                                              ; preds = %373
  %379 = load i64, ptr %6, align 8, !tbaa !17
  store i64 %379, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

380:                                              ; preds = %373
  br label %381

381:                                              ; preds = %380, %365
  br label %383

382:                                              ; preds = %314
  br label %383

383:                                              ; preds = %382, %381, %356, %332, %314
  br label %384

384:                                              ; preds = %383, %311
  br label %385

385:                                              ; preds = %384
  store i64 0, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

386:                                              ; preds = %310, %266, %216
  %387 = load i64, ptr %6, align 8, !tbaa !17
  %388 = icmp slt i64 %387, 0
  br i1 %388, label %397, label %389

389:                                              ; preds = %386
  %390 = load ptr, ptr %4, align 8, !tbaa !5
  %391 = load ptr, ptr %5, align 8, !tbaa !5
  %392 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %391, i32 0, i32 2
  %393 = getelementptr inbounds %struct.anon, ptr %392, i32 0, i32 0
  %394 = load i32, ptr %393, align 1
  %395 = lshr i32 %394, 8
  %396 = call i64 @Dhcp6DequeueRetry(ptr noundef %390, i32 noundef %395, i8 noundef zeroext 0)
  store i64 %396, ptr %6, align 8, !tbaa !17
  br label %397

397:                                              ; preds = %389, %386
  %398 = load i64, ptr %6, align 8, !tbaa !17
  store i64 %398, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %399

399:                                              ; preds = %397, %385, %378, %353, %346, %308, %132, %125, %85, %54
  call void @llvm.lifetime.end.p0(i64 2, 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
  %400 = load i64, ptr %3, align 8
  ret i64 %400
}

declare void @Dhcp6AppendCacheIa(ptr noundef) #1

declare i64 @Dhcp6CacheIa(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #2 = { 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 #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 120}
!10 = !{!"_DHCP6_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !12, i64 160, !12, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !15, i64 216, !7, i64 224, !7, i64 225, !15, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_DHCP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!14 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!15 = !{!"long long", !7, i64 0}
!16 = !{!10, !6, i64 136}
!17 = !{!15, !15, i64 0}
!18 = !{!19, !11, i64 4}
!19 = !{!"", !11, i64 0, !11, i64 4, !20, i64 8}
!20 = !{!"", !21, i64 0, !7, i64 4}
!21 = !{!"", !11, i64 0, !11, i64 1}
!22 = !{!23, !7, i64 49}
!23 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !24, i64 32, !6, i64 40, !7, i64 48, !7, i64 49, !6, i64 56}
!24 = !{!"", !25, i64 0, !11, i64 4}
!25 = !{!"short", !7, i64 0}
!26 = !{!27, !11, i64 8}
!27 = !{!"", !24, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !7, i64 28}
!28 = !{!27, !11, i64 24}
!29 = !{!27, !6, i64 16}
!30 = !{!10, !15, i64 216}
!31 = !{!23, !6, i64 40}
!32 = !{!33, !6, i64 104}
!33 = !{!"", !34, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!34 = !{!"", !15, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!35 = !{!10, !15, i64 232}
!36 = !{!19, !11, i64 0}
!37 = !{!25, !25, i64 0}
!38 = !{!10, !6, i64 208}


; 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.1 = external hidden unnamed_addr constant [23 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.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.17 = external hidden unnamed_addr constant [31 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6DequeueRetry(ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #2

declare void @FreePool(ptr noundef) local_unnamed_addr #1

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

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

declare ptr @Dhcp6SeekIaOption(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

declare zeroext i16 @ReadUnaligned16(ptr noundef) local_unnamed_addr #1

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

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6InitSolicitMsg(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6SendRequestMsg(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6HandleReplyMsg(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %1, ptr %3, align 8, !tbaa !5
  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 !9
  %.not74 = icmp eq ptr %8, null
  br i1 %.not74, label %9, label %10

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

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

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

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

16:                                               ; preds = %10, %15, %12
  %17 = tail call zeroext i8 @DebugAssertEnabled() #3
  %18 = icmp eq i8 %17, 0
  %19 = icmp ne ptr %1, null
  %or.cond = or i1 %18, %19
  br i1 %or.cond, label %21, label %20

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

21:                                               ; preds = %20, %16
  %22 = getelementptr inbounds i8, ptr %1, i64 8
  %23 = load i32, ptr %22, align 1
  %24 = and i32 %23, 255
  %.not77 = icmp eq i32 %24, 7
  br i1 %.not77, label %25, label %160

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %1, i64 12
  %27 = getelementptr inbounds i8, ptr %1, i64 4
  %28 = load i32, ptr %27, align 1, !tbaa !17
  %29 = add i32 %28, -4
  %30 = tail call ptr @Dhcp6SeekOption(ptr noundef nonnull %26, i32 noundef %29, i16 noundef zeroext 14) #3
  store ptr %30, ptr %4, align 8, !tbaa !5
  %.not78 = icmp eq ptr %30, null
  %31 = getelementptr inbounds i8, ptr %0, i64 120
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %32, i64 49
  %34 = load i8, ptr %33, align 1, !tbaa !21
  %.not80 = icmp eq i8 %34, 0
  br i1 %.not78, label %36, label %35

35:                                               ; preds = %25
  br i1 %.not80, label %160, label %37

36:                                               ; preds = %25
  br i1 %.not80, label %37, label %160

37:                                               ; preds = %35, %36
  %38 = getelementptr inbounds i8, ptr %0, i64 136
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  %41 = load i32, ptr %40, align 8, !tbaa !25
  switch i32 %41, label %47 [
    i32 2, label %42
    i32 7, label %42
    i32 8, label %42
  ]

42:                                               ; preds = %37, %37, %37
  %43 = load i32, ptr %27, align 1, !tbaa !17
  %44 = getelementptr inbounds i8, ptr %32, i64 32
  %45 = tail call ptr @Dhcp6SeekIaOption(ptr noundef nonnull %26, i32 noundef %43, ptr noundef nonnull %44) #3
  store ptr %45, ptr %4, align 8, !tbaa !5
  %46 = icmp eq ptr %45, null
  br i1 %46, label %160, label %47

47:                                               ; preds = %37, %42
  %48 = call i64 @Dhcp6CallbackUser(ptr noundef nonnull %0, i32 noundef 4, ptr noundef nonnull %3)
  %49 = icmp slt i64 %48, 0
  br i1 %49, label %160, label %50

50:                                               ; preds = %47
  %51 = load ptr, ptr %38, align 8, !tbaa !16
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load i32, ptr %52, align 8, !tbaa !25
  switch i32 %53, label %84 [
    i32 3, label %54
    i32 5, label %54
  ]

54:                                               ; preds = %50, %50
  %55 = getelementptr inbounds i8, ptr %51, i64 24
  %56 = load i32, ptr %55, align 8, !tbaa !27
  %.not85 = icmp eq i32 %56, 0
  br i1 %.not85, label %58, label %57

57:                                               ; preds = %54
  store i32 6, ptr %52, align 8, !tbaa !25
  br label %71

58:                                               ; preds = %54
  %59 = call zeroext i8 @DebugAssertEnabled() #3
  %.not86 = icmp eq i8 %59, 0
  %.pre91 = load ptr, ptr %38, align 8, !tbaa !16
  br i1 %.not86, label %64, label %60

60:                                               ; preds = %58
  %61 = getelementptr inbounds i8, ptr %.pre91, i64 16
  %62 = load ptr, ptr %61, align 8, !tbaa !28
  %.not87 = icmp eq ptr %62, null
  br i1 %.not87, label %63, label %64

63:                                               ; preds = %60
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 2147, ptr noundef nonnull @.str.17) #3
  %.pre = load ptr, ptr %38, align 8, !tbaa !16
  br label %64

64:                                               ; preds = %60, %63, %58
  %65 = phi ptr [ %.pre91, %60 ], [ %.pre, %63 ], [ %.pre91, %58 ]
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  %67 = load ptr, ptr %66, align 8, !tbaa !28
  call void @FreePool(ptr noundef %67) #3
  %68 = load ptr, ptr %38, align 8, !tbaa !16
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  store ptr null, ptr %69, align 8, !tbaa !28
  %70 = getelementptr inbounds i8, ptr %68, i64 8
  store i32 0, ptr %70, align 8, !tbaa !25
  br label %71

71:                                               ; preds = %64, %57
  %72 = getelementptr inbounds i8, ptr %0, i64 216
  store volatile i64 0, ptr %72, align 8, !tbaa !29
  %73 = getelementptr inbounds i8, ptr %0, i64 120
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = getelementptr inbounds i8, ptr %74, i64 40
  %76 = load ptr, ptr %75, align 8, !tbaa !30
  %.not88 = icmp eq ptr %76, null
  br i1 %.not88, label %82, label %77

77:                                               ; preds = %71
  %78 = load ptr, ptr @gBS, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %78, i64 104
  %80 = load ptr, ptr %79, align 8, !tbaa !31
  %81 = call i64 %80(ptr noundef nonnull %76) #3
  br label %82

82:                                               ; preds = %77, %71
  %83 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 0, ptr %83, align 8, !tbaa !34
  br label %154

84:                                               ; preds = %50
  store ptr null, ptr %4, align 8, !tbaa !5
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = call i64 @Dhcp6SeekStsOption(ptr noundef nonnull %0, ptr noundef %85, ptr noundef nonnull %4)
  %87 = icmp slt i64 %86, 0
  br i1 %87, label %125, label %88

88:                                               ; preds = %84
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = call i64 @Dhcp6UpdateIaInfo(ptr noundef nonnull %0, ptr noundef %89)
  %91 = icmp slt i64 %90, 0
  br i1 %91, label %123, label %92

92:                                               ; preds = %88
  %93 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 0, ptr %93, align 8, !tbaa !34
  %94 = load ptr, ptr %38, align 8, !tbaa !16
  %95 = getelementptr inbounds i8, ptr %94, i64 16
  %96 = load ptr, ptr %95, align 8, !tbaa !28
  %.not81 = icmp eq ptr %96, null
  br i1 %.not81, label %98, label %97

97:                                               ; preds = %92
  call void @FreePool(ptr noundef nonnull %96) #3
  br label %98

98:                                               ; preds = %97, %92
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = load i32, ptr %99, align 1, !tbaa !35
  %101 = zext i32 %100 to i64
  %102 = call ptr @AllocateZeroPool(i64 noundef %101) #3
  %103 = load ptr, ptr %38, align 8, !tbaa !16
  %104 = getelementptr inbounds i8, ptr %103, i64 16
  store ptr %102, ptr %104, align 8, !tbaa !28
  %105 = icmp eq ptr %102, null
  br i1 %105, label %160, label %106

106:                                              ; preds = %98
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = load i32, ptr %107, align 1, !tbaa !35
  %109 = zext i32 %108 to i64
  %110 = call ptr @CopyMem(ptr noundef nonnull %102, ptr noundef nonnull %107, i64 noundef %109) #3
  %111 = load ptr, ptr %38, align 8, !tbaa !16
  %112 = getelementptr inbounds i8, ptr %111, i64 8
  store i32 6, ptr %112, align 8, !tbaa !25
  %113 = getelementptr inbounds i8, ptr %0, i64 216
  store volatile i64 0, ptr %113, align 8, !tbaa !29
  call void @Dhcp6AppendCacheIa(ptr noundef nonnull %0) #3
  %114 = getelementptr inbounds i8, ptr %0, i64 120
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  %116 = getelementptr inbounds i8, ptr %115, i64 40
  %117 = load ptr, ptr %116, align 8, !tbaa !30
  %.not82 = icmp eq ptr %117, null
  br i1 %.not82, label %154, label %118

118:                                              ; preds = %106
  %119 = load ptr, ptr @gBS, align 8, !tbaa !5
  %120 = getelementptr inbounds i8, ptr %119, i64 104
  %121 = load ptr, ptr %120, align 8, !tbaa !31
  %122 = call i64 %121(ptr noundef nonnull %117) #3
  br label %154

123:                                              ; preds = %88
  %124 = icmp eq i64 %90, -9223372036854775794
  %spec.select = select i1 %124, i64 0, i64 %90
  br label %160

125:                                              ; preds = %84
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %.not83 = icmp eq ptr %126, null
  br i1 %.not83, label %153, label %127

127:                                              ; preds = %125
  %128 = getelementptr inbounds i8, ptr %126, i64 4
  %129 = call zeroext i16 @ReadUnaligned16(ptr noundef nonnull %128) #3
  %130 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %129) #3
  switch i16 %130, label %153 [
    i16 3, label %146
    i16 5, label %131
    i16 4, label %135
  ]

131:                                              ; preds = %127
  %132 = getelementptr inbounds i8, ptr %0, i64 208
  %133 = load ptr, ptr %132, align 8, !tbaa !36
  %.not84 = icmp eq ptr %133, null
  br i1 %.not84, label %153, label %134

134:                                              ; preds = %131
  call void @FreePool(ptr noundef nonnull %133) #3
  store ptr null, ptr %132, align 8, !tbaa !36
  br label %153

135:                                              ; preds = %127
  %136 = load ptr, ptr %38, align 8, !tbaa !16
  %137 = getelementptr inbounds i8, ptr %136, i64 8
  %138 = load i32, ptr %137, align 8, !tbaa !25
  %139 = icmp eq i32 %138, 4
  br i1 %139, label %140, label %153

140:                                              ; preds = %135
  %141 = call i64 @Dhcp6CacheIa(ptr noundef nonnull %0) #3
  %142 = icmp slt i64 %141, 0
  br i1 %142, label %160, label %143

143:                                              ; preds = %140
  %144 = call i64 @Dhcp6InitSolicitMsg(ptr noundef nonnull %0)
  %145 = icmp slt i64 %144, 0
  br i1 %145, label %160, label %153

146:                                              ; preds = %127
  %147 = load ptr, ptr %38, align 8, !tbaa !16
  %148 = getelementptr inbounds i8, ptr %147, i64 8
  %149 = load i32, ptr %148, align 8, !tbaa !25
  %.off = add i32 %149, -7
  %switch = icmp ult i32 %.off, 2
  br i1 %switch, label %150, label %153

150:                                              ; preds = %146
  %151 = call i64 @Dhcp6SendRequestMsg(ptr noundef nonnull %0)
  %152 = icmp slt i64 %151, 0
  br i1 %152, label %160, label %153

153:                                              ; preds = %146, %125, %127, %150, %135, %143, %131, %134
  br label %160

154:                                              ; preds = %82, %118, %106
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds i8, ptr %155, i64 8
  %157 = load i32, ptr %156, align 1
  %158 = lshr i32 %157, 8
  %159 = call i64 @Dhcp6DequeueRetry(ptr noundef nonnull %0, i32 noundef %158, i8 noundef zeroext 0)
  br label %160

160:                                              ; preds = %123, %98, %154, %150, %143, %140, %47, %42, %35, %36, %21, %153
  %.0 = phi i64 [ 0, %153 ], [ -9223372036854775801, %21 ], [ -9223372036854775801, %36 ], [ -9223372036854775801, %35 ], [ 0, %42 ], [ %48, %47 ], [ %141, %140 ], [ %144, %143 ], [ %151, %150 ], [ %159, %154 ], [ -9223372036854775799, %98 ], [ %spec.select, %123 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i64 %.0
}

declare void @Dhcp6AppendCacheIa(ptr noundef) local_unnamed_addr #1

declare i64 @Dhcp6CacheIa(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #2 = { 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 #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 120}
!10 = !{!"_DHCP6_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !12, i64 160, !12, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !15, i64 216, !7, i64 224, !7, i64 225, !15, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_DHCP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!14 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!15 = !{!"long long", !7, i64 0}
!16 = !{!10, !6, i64 136}
!17 = !{!18, !11, i64 4}
!18 = !{!"", !11, i64 0, !11, i64 4, !19, i64 8}
!19 = !{!"", !20, i64 0, !7, i64 4}
!20 = !{!"", !11, i64 0, !11, i64 1}
!21 = !{!22, !7, i64 49}
!22 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !23, i64 32, !6, i64 40, !7, i64 48, !7, i64 49, !6, i64 56}
!23 = !{!"", !24, i64 0, !11, i64 4}
!24 = !{!"short", !7, i64 0}
!25 = !{!26, !11, i64 8}
!26 = !{!"", !23, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !7, i64 28}
!27 = !{!26, !11, i64 24}
!28 = !{!26, !6, i64 16}
!29 = !{!10, !15, i64 216}
!30 = !{!22, !6, i64 40}
!31 = !{!32, !6, i64 104}
!32 = !{!"", !33, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!33 = !{!"", !15, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!34 = !{!10, !15, i64 232}
!35 = !{!18, !11, i64 0}
!36 = !{!10, !6, i64 208}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass