; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal (DhcpBuild)

; 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.DHCP_OPTION = type { i8, i16, ptr }
%struct.EFI_DHCP4_PACKET_OPTION = type { i8, i8, [1 x i8] }
%struct.EFI_DHCP4_PACKET = type <{ i32, i32, %struct.anon }>
%struct.anon = type <{ %struct.EFI_DHCP4_HEADER, i32, [1 x i8] }>
%struct.EFI_DHCP4_HEADER = type { i8, i8, i8, i8, i32, i16, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, [16 x i8], [64 x i8], [128 x i8] }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }

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

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

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

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

declare void @FreePool(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @DhcpAppendOption(ptr noundef, i8 noundef zeroext, i16 noundef zeroext, ptr noundef) #2

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

26:                                               ; preds = %6
  store i64 -9223372036854775799, ptr %7, align 8
  store i32 1, ptr %22, align 4
  br label %273

27:                                               ; preds = %6
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %44, %27
  %29 = load i32, ptr %19, align 4, !tbaa !9
  %30 = icmp ult i32 %29, 256
  br i1 %30, label %31, label %47

31:                                               ; preds = %28
  %32 = load i32, ptr %19, align 4, !tbaa !9
  %33 = trunc i32 %32 to i8
  %34 = load ptr, ptr %14, align 8, !tbaa !5
  %35 = load i32, ptr %19, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds %struct.DHCP_OPTION, ptr %34, i64 %36
  %38 = getelementptr inbounds %struct.DHCP_OPTION, ptr %37, i32 0, i32 0
  store i8 %33, ptr %38, align 8, !tbaa !11
  %39 = load ptr, ptr %14, align 8, !tbaa !5
  %40 = load i32, ptr %19, align 4, !tbaa !9
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds %struct.DHCP_OPTION, ptr %39, i64 %41
  %43 = getelementptr inbounds %struct.DHCP_OPTION, ptr %42, i32 0, i32 1
  store i16 0, ptr %43, align 2, !tbaa !14
  br label %44

44:                                               ; preds = %31
  %45 = load i32, ptr %19, align 4, !tbaa !9
  %46 = add i32 %45, 1
  store i32 %46, ptr %19, align 4, !tbaa !9
  br label %28, !llvm.loop !15

47:                                               ; preds = %28
  store ptr null, ptr %15, align 8, !tbaa !5
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = call i64 @DhcpParseOption(ptr noundef %48, ptr noundef %18, ptr noundef %15)
  store i64 %49, ptr %17, align 8, !tbaa !17
  %50 = load i64, ptr %17, align 8, !tbaa !17
  %51 = icmp slt i64 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %47
  br label %265

53:                                               ; preds = %47
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %80

56:                                               ; preds = %53
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %76, %56
  %58 = load i32, ptr %19, align 4, !tbaa !9
  %59 = load i64, ptr %18, align 8, !tbaa !17
  %60 = trunc i64 %59 to i32
  %61 = icmp ult i32 %58, %60
  br i1 %61, label %62, label %79

62:                                               ; preds = %57
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = load i32, ptr %19, align 4, !tbaa !9
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds %struct.DHCP_OPTION, ptr %64, i64 %66
  %68 = getelementptr inbounds %struct.DHCP_OPTION, ptr %67, i32 0, i32 0
  %69 = load i8, ptr %68, align 8, !tbaa !11
  %70 = zext i8 %69 to i64
  %71 = getelementptr inbounds %struct.DHCP_OPTION, ptr %63, i64 %70
  %72 = load ptr, ptr %15, align 8, !tbaa !5
  %73 = load i32, ptr %19, align 4, !tbaa !9
  %74 = zext i32 %73 to i64
  %75 = getelementptr inbounds %struct.DHCP_OPTION, ptr %72, i64 %74
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %71, ptr align 8 %75, i64 16, i1 false), !tbaa.struct !19
  br label %76

76:                                               ; preds = %62
  %77 = load i32, ptr %19, align 4, !tbaa !9
  %78 = add i32 %77, 1
  store i32 %78, ptr %19, align 4, !tbaa !9
  br label %57, !llvm.loop !22

79:                                               ; preds = %57
  br label %80

80:                                               ; preds = %79, %53
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %95, %80
  %82 = load i32, ptr %19, align 4, !tbaa !9
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = icmp ult i32 %82, %83
  br i1 %84, label %85, label %98

85:                                               ; preds = %81
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = load i32, ptr %19, align 4, !tbaa !9
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %87, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !20
  %92 = zext i8 %91 to i64
  %93 = getelementptr inbounds %struct.DHCP_OPTION, ptr %86, i64 %92
  %94 = getelementptr inbounds %struct.DHCP_OPTION, ptr %93, i32 0, i32 1
  store i16 0, ptr %94, align 2, !tbaa !14
  br label %95

95:                                               ; preds = %85
  %96 = load i32, ptr %19, align 4, !tbaa !9
  %97 = add i32 %96, 1
  store i32 %97, ptr %19, align 4, !tbaa !9
  br label %81, !llvm.loop !23

98:                                               ; preds = %81
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %141, %98
  %100 = load i32, ptr %19, align 4, !tbaa !9
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = icmp ult i32 %100, %101
  br i1 %102, label %103, label %144

103:                                              ; preds = %99
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = load i32, ptr %19, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds ptr, ptr %104, i64 %106
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %108, i32 0, i32 1
  %110 = load i8, ptr %109, align 1, !tbaa !24
  %111 = zext i8 %110 to i16
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  %114 = load i32, ptr %19, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %117, i32 0, i32 0
  %119 = load i8, ptr %118, align 1, !tbaa !26
  %120 = zext i8 %119 to i64
  %121 = getelementptr inbounds %struct.DHCP_OPTION, ptr %112, i64 %120
  %122 = getelementptr inbounds %struct.DHCP_OPTION, ptr %121, i32 0, i32 1
  store i16 %111, ptr %122, align 2, !tbaa !14
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  %124 = load i32, ptr %19, align 4, !tbaa !9
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds ptr, ptr %123, i64 %125
  %127 = load ptr, ptr %126, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %127, i32 0, i32 2
  %129 = getelementptr inbounds [1 x i8], ptr %128, i64 0, i64 0
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = load i32, ptr %19, align 4, !tbaa !9
  %133 = zext i32 %132 to i64
  %134 = getelementptr inbounds ptr, ptr %131, i64 %133
  %135 = load ptr, ptr %134, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %135, i32 0, i32 0
  %137 = load i8, ptr %136, align 1, !tbaa !26
  %138 = zext i8 %137 to i64
  %139 = getelementptr inbounds %struct.DHCP_OPTION, ptr %130, i64 %138
  %140 = getelementptr inbounds %struct.DHCP_OPTION, ptr %139, i32 0, i32 2
  store ptr %129, ptr %140, align 8, !tbaa !27
  br label %141

141:                                              ; preds = %103
  %142 = load i32, ptr %19, align 4, !tbaa !9
  %143 = add i32 %142, 1
  store i32 %143, ptr %19, align 4, !tbaa !9
  br label %99, !llvm.loop !28

144:                                              ; preds = %99
  store i32 249, ptr %20, align 4, !tbaa !9
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %179, %144
  %146 = load i32, ptr %19, align 4, !tbaa !9
  %147 = icmp ult i32 %146, 256
  br i1 %147, label %148, label %182

148:                                              ; preds = %145
  %149 = load ptr, ptr %14, align 8, !tbaa !5
  %150 = load i32, ptr %19, align 4, !tbaa !9
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds %struct.DHCP_OPTION, ptr %149, i64 %151
  %153 = getelementptr inbounds %struct.DHCP_OPTION, ptr %152, i32 0, i32 1
  %154 = load i16, ptr %153, align 2, !tbaa !14
  %155 = zext i16 %154 to i32
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %178

157:                                              ; preds = %148
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = load i32, ptr %19, align 4, !tbaa !9
  %160 = zext i32 %159 to i64
  %161 = getelementptr inbounds %struct.DHCP_OPTION, ptr %158, i64 %160
  %162 = getelementptr inbounds %struct.DHCP_OPTION, ptr %161, i32 0, i32 1
  %163 = load i16, ptr %162, align 2, !tbaa !14
  %164 = zext i16 %163 to i32
  %165 = add nsw i32 %164, 254
  %166 = sdiv i32 %165, 255
  %167 = mul nsw i32 %166, 2
  %168 = load ptr, ptr %14, align 8, !tbaa !5
  %169 = load i32, ptr %19, align 4, !tbaa !9
  %170 = zext i32 %169 to i64
  %171 = getelementptr inbounds %struct.DHCP_OPTION, ptr %168, i64 %170
  %172 = getelementptr inbounds %struct.DHCP_OPTION, ptr %171, i32 0, i32 1
  %173 = load i16, ptr %172, align 2, !tbaa !14
  %174 = zext i16 %173 to i32
  %175 = add nsw i32 %167, %174
  %176 = load i32, ptr %20, align 4, !tbaa !9
  %177 = add i32 %176, %175
  store i32 %177, ptr %20, align 4, !tbaa !9
  br label %178

178:                                              ; preds = %157, %148
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %19, align 4, !tbaa !9
  %181 = add i32 %180, 1
  store i32 %181, ptr %19, align 4, !tbaa !9
  br label %145, !llvm.loop !29

182:                                              ; preds = %145
  store i64 -9223372036854775799, ptr %17, align 8, !tbaa !17
  %183 = load i32, ptr %20, align 4, !tbaa !9
  %184 = zext i32 %183 to i64
  %185 = call ptr @AllocatePool(i64 noundef %184)
  store ptr %185, ptr %16, align 8, !tbaa !5
  %186 = load ptr, ptr %16, align 8, !tbaa !5
  %187 = icmp eq ptr %186, null
  br i1 %187, label %188, label %189

188:                                              ; preds = %182
  br label %265

189:                                              ; preds = %182
  %190 = load i32, ptr %20, align 4, !tbaa !9
  %191 = load ptr, ptr %16, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %191, i32 0, i32 0
  store i32 %190, ptr %192, align 1, !tbaa !30
  %193 = load ptr, ptr %16, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %193, i32 0, i32 1
  store i32 0, ptr %194, align 1, !tbaa !35
  %195 = load ptr, ptr %16, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %195, i32 0, i32 2
  %197 = getelementptr inbounds %struct.anon, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %8, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %198, i32 0, i32 2
  %200 = getelementptr inbounds %struct.anon, ptr %199, i32 0, i32 0
  %201 = call ptr @CopyMem(ptr noundef %197, ptr noundef %200, i64 noundef 236)
  %202 = load ptr, ptr %16, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %202, i32 0, i32 2
  %204 = getelementptr inbounds %struct.anon, ptr %203, i32 0, i32 1
  store i32 1666417251, ptr %204, align 1, !tbaa !36
  %205 = load ptr, ptr %16, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %205, i32 0, i32 2
  %207 = getelementptr inbounds %struct.anon, ptr %206, i32 0, i32 2
  %208 = getelementptr inbounds [1 x i8], ptr %207, i64 0, i64 0
  store ptr %208, ptr %21, align 8, !tbaa !5
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %209

209:                                              ; preds = %243, %189
  %210 = load i32, ptr %19, align 4, !tbaa !9
  %211 = icmp ult i32 %210, 256
  br i1 %211, label %212, label %246

212:                                              ; preds = %209
  %213 = load ptr, ptr %14, align 8, !tbaa !5
  %214 = load i32, ptr %19, align 4, !tbaa !9
  %215 = zext i32 %214 to i64
  %216 = getelementptr inbounds %struct.DHCP_OPTION, ptr %213, i64 %215
  %217 = getelementptr inbounds %struct.DHCP_OPTION, ptr %216, i32 0, i32 1
  %218 = load i16, ptr %217, align 2, !tbaa !14
  %219 = zext i16 %218 to i32
  %220 = icmp ne i32 %219, 0
  br i1 %220, label %221, label %242

221:                                              ; preds = %212
  %222 = load ptr, ptr %21, align 8, !tbaa !5
  %223 = load ptr, ptr %14, align 8, !tbaa !5
  %224 = load i32, ptr %19, align 4, !tbaa !9
  %225 = zext i32 %224 to i64
  %226 = getelementptr inbounds %struct.DHCP_OPTION, ptr %223, i64 %225
  %227 = getelementptr inbounds %struct.DHCP_OPTION, ptr %226, i32 0, i32 0
  %228 = load i8, ptr %227, align 8, !tbaa !11
  %229 = load ptr, ptr %14, align 8, !tbaa !5
  %230 = load i32, ptr %19, align 4, !tbaa !9
  %231 = zext i32 %230 to i64
  %232 = getelementptr inbounds %struct.DHCP_OPTION, ptr %229, i64 %231
  %233 = getelementptr inbounds %struct.DHCP_OPTION, ptr %232, i32 0, i32 1
  %234 = load i16, ptr %233, align 2, !tbaa !14
  %235 = load ptr, ptr %14, align 8, !tbaa !5
  %236 = load i32, ptr %19, align 4, !tbaa !9
  %237 = zext i32 %236 to i64
  %238 = getelementptr inbounds %struct.DHCP_OPTION, ptr %235, i64 %237
  %239 = getelementptr inbounds %struct.DHCP_OPTION, ptr %238, i32 0, i32 2
  %240 = load ptr, ptr %239, align 8, !tbaa !27
  %241 = call ptr @DhcpAppendOption(ptr noundef %222, i8 noundef zeroext %228, i16 noundef zeroext %234, ptr noundef %240)
  store ptr %241, ptr %21, align 8, !tbaa !5
  br label %242

242:                                              ; preds = %221, %212
  br label %243

243:                                              ; preds = %242
  %244 = load i32, ptr %19, align 4, !tbaa !9
  %245 = add i32 %244, 1
  store i32 %245, ptr %19, align 4, !tbaa !9
  br label %209, !llvm.loop !37

246:                                              ; preds = %209
  %247 = load ptr, ptr %21, align 8, !tbaa !5
  %248 = getelementptr inbounds i8, ptr %247, i32 1
  store ptr %248, ptr %21, align 8, !tbaa !5
  store i8 -1, ptr %247, align 1, !tbaa !20
  %249 = load ptr, ptr %21, align 8, !tbaa !5
  %250 = load ptr, ptr %16, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %250, i32 0, i32 2
  %252 = getelementptr inbounds %struct.anon, ptr %251, i32 0, i32 2
  %253 = getelementptr inbounds [1 x i8], ptr %252, i64 0, i64 0
  %254 = ptrtoint ptr %249 to i64
  %255 = ptrtoint ptr %253 to i64
  %256 = sub i64 %254, %255
  %257 = trunc i64 %256 to i32
  %258 = zext i32 %257 to i64
  %259 = add i64 240, %258
  %260 = trunc i64 %259 to i32
  %261 = load ptr, ptr %16, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.EFI_DHCP4_PACKET, ptr %261, i32 0, i32 1
  store i32 %260, ptr %262, align 1, !tbaa !35
  %263 = load ptr, ptr %16, align 8, !tbaa !5
  %264 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %263, ptr %264, align 8, !tbaa !5
  store i64 0, ptr %17, align 8, !tbaa !17
  br label %265

265:                                              ; preds = %246, %188, %52
  %266 = load ptr, ptr %15, align 8, !tbaa !5
  %267 = icmp ne ptr %266, null
  br i1 %267, label %268, label %270

268:                                              ; preds = %265
  %269 = load ptr, ptr %15, align 8, !tbaa !5
  call void @FreePool(ptr noundef %269)
  br label %270

270:                                              ; preds = %268, %265
  %271 = load ptr, ptr %14, align 8, !tbaa !5
  call void @FreePool(ptr noundef %271)
  %272 = load i64, ptr %17, align 8, !tbaa !17
  store i64 %272, ptr %7, align 8
  store i32 1, ptr %22, align 4
  br label %273

273:                                              ; preds = %270, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %274 = load i64, ptr %7, align 8
  ret i64 %274
}

declare ptr @AllocatePool(i64 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"", !7, i64 0, !13, i64 2, !6, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !13, i64 2}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !7, i64 0}
!19 = !{i64 0, i64 1, !20, i64 2, i64 2, !21, i64 8, i64 8, !5}
!20 = !{!7, !7, i64 0}
!21 = !{!13, !13, i64 0}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !16}
!24 = !{!25, !7, i64 1}
!25 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2}
!26 = !{!25, !7, i64 0}
!27 = !{!12, !6, i64 8}
!28 = distinct !{!28, !16}
!29 = distinct !{!29, !16}
!30 = !{!31, !10, i64 0}
!31 = !{!"", !10, i64 0, !10, i64 4, !32, i64 8}
!32 = !{!"", !33, i64 0, !10, i64 236, !7, i64 240}
!33 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !13, i64 8, !13, i64 10, !34, i64 12, !34, i64 16, !34, i64 20, !34, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!34 = !{!"", !7, i64 0}
!35 = !{!31, !10, i64 4}
!36 = !{!31, !10, i64 244}
!37 = distinct !{!37, !16}


; 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"

%struct.DHCP_OPTION = type { i8, i16, ptr }

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

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

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

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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @DhcpAppendOption(ptr noundef, i8 noundef zeroext, i16 noundef zeroext, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @DhcpBuild(ptr noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3, ptr nocapture noundef readonly %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #2 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %9 = tail call ptr @AllocatePool(i64 noundef 4096) #5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %253, label %.preheader87

.preheader87:                                     ; preds = %6, %.preheader87
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.preheader87 ], [ 0, %6 ]
  %11 = trunc i64 %indvars.iv to i8
  %12 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %indvars.iv
  store i8 %11, ptr %12, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 2
  store i16 0, ptr %13, align 2, !tbaa !11
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %14 = trunc i64 %indvars.iv.next to i8
  %15 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %indvars.iv.next
  store i8 %14, ptr %15, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 2
  store i16 0, ptr %16, align 2, !tbaa !11
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %17 = trunc i64 %indvars.iv.next.1 to i8
  %18 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %indvars.iv.next.1
  store i8 %17, ptr %18, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 2
  store i16 0, ptr %19, align 2, !tbaa !11
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %20 = trunc i64 %indvars.iv.next.2 to i8
  %21 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %indvars.iv.next.2
  store i8 %20, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 2
  store i16 0, ptr %22, align 2, !tbaa !11
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, 256
  br i1 %exitcond.not.3, label %23, label %.preheader87, !llvm.loop !12

23:                                               ; preds = %.preheader87
  store ptr null, ptr %7, align 8, !tbaa !14
  %24 = call i64 @DhcpParseOption(ptr noundef %0, ptr noundef nonnull %8, ptr noundef nonnull %7)
  %25 = icmp slt i64 %24, 0
  br i1 %25, label %249, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr %7, align 8, !tbaa !14
  %.not = icmp eq ptr %27, null
  br i1 %.not, label %.loopexit, label %.preheader86

.preheader86:                                     ; preds = %26
  %28 = load i64, ptr %8, align 8, !tbaa !15
  %29 = and i64 %28, 4294967295
  %.not98 = icmp eq i64 %29, 0
  br i1 %.not98, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader86
  %wide.trip.count = and i64 %28, 4294967295
  %xtraiter = and i64 %28, 1
  %30 = icmp eq i64 %wide.trip.count, 1
  br i1 %30, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv102 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next103.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %31 = getelementptr inbounds %struct.DHCP_OPTION, ptr %27, i64 %indvars.iv102
  %32 = load i8, ptr %31, align 8, !tbaa !5
  %33 = zext i8 %32 to i64
  %34 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %33
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(16) %31, i64 16, i1 false), !tbaa.struct !17
  %indvars.iv.next103 = or disjoint i64 %indvars.iv102, 1
  %35 = getelementptr inbounds %struct.DHCP_OPTION, ptr %27, i64 %indvars.iv.next103
  %36 = load i8, ptr %35, align 8, !tbaa !5
  %37 = zext i8 %36 to i64
  %38 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %37
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %35, i64 16, i1 false), !tbaa.struct !17
  %indvars.iv.next103.1 = add nuw nsw i64 %indvars.iv102, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !20

.loopexit.loopexit.unr-lcssa:                     ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv102.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next103.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.loopexit.loopexit.unr-lcssa
  %39 = getelementptr inbounds %struct.DHCP_OPTION, ptr %27, i64 %indvars.iv102.unr
  %40 = load i8, ptr %39, align 8, !tbaa !5
  %41 = zext i8 %40 to i64
  %42 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 8 dereferenceable(16) %39, i64 16, i1 false), !tbaa.struct !17
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.epil, %.loopexit.loopexit.unr-lcssa, %.preheader86, %26
  %.not99 = icmp eq i32 %1, 0
  br i1 %.not99, label %.preheader85, label %.lr.ph91.preheader

.lr.ph91.preheader:                               ; preds = %.loopexit
  %wide.trip.count109 = zext i32 %1 to i64
  %xtraiter126 = and i64 %wide.trip.count109, 3
  %43 = icmp ult i32 %1, 4
  br i1 %43, label %.preheader85.loopexit.unr-lcssa, label %.lr.ph91.preheader.new

.lr.ph91.preheader.new:                           ; preds = %.lr.ph91.preheader
  %unroll_iter128 = and i64 %wide.trip.count109, 4294967292
  br label %.lr.ph91

.preheader85.loopexit.unr-lcssa:                  ; preds = %.lr.ph91, %.lr.ph91.preheader
  %indvars.iv106.unr = phi i64 [ 0, %.lr.ph91.preheader ], [ %indvars.iv.next107.3, %.lr.ph91 ]
  %lcmp.mod127.not = icmp eq i64 %xtraiter126, 0
  br i1 %lcmp.mod127.not, label %.preheader85, label %.lr.ph91.epil

.lr.ph91.epil:                                    ; preds = %.preheader85.loopexit.unr-lcssa, %.lr.ph91.epil
  %indvars.iv106.epil = phi i64 [ %indvars.iv.next107.epil, %.lr.ph91.epil ], [ %indvars.iv106.unr, %.preheader85.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph91.epil ], [ 0, %.preheader85.loopexit.unr-lcssa ]
  %44 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv106.epil
  %45 = load i8, ptr %44, align 1, !tbaa !18
  %46 = zext i8 %45 to i64
  %47 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %46, i32 1
  store i16 0, ptr %47, align 2, !tbaa !11
  %indvars.iv.next107.epil = add nuw nsw i64 %indvars.iv106.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter126
  br i1 %epil.iter.cmp.not, label %.preheader85, label %.lr.ph91.epil, !llvm.loop !21

.preheader85:                                     ; preds = %.preheader85.loopexit.unr-lcssa, %.lr.ph91.epil, %.loopexit
  %.not100 = icmp eq i32 %3, 0
  br i1 %.not100, label %vector.body.preheader, label %.lr.ph93.preheader

.lr.ph93.preheader:                               ; preds = %.preheader85
  %wide.trip.count114 = zext i32 %3 to i64
  %xtraiter130 = and i64 %wide.trip.count114, 1
  %48 = icmp eq i32 %3, 1
  br i1 %48, label %vector.body.preheader.loopexit.unr-lcssa, label %.lr.ph93.preheader.new

.lr.ph93.preheader.new:                           ; preds = %.lr.ph93.preheader
  %unroll_iter133 = and i64 %wide.trip.count114, 4294967294
  br label %.lr.ph93

.lr.ph91:                                         ; preds = %.lr.ph91, %.lr.ph91.preheader.new
  %indvars.iv106 = phi i64 [ 0, %.lr.ph91.preheader.new ], [ %indvars.iv.next107.3, %.lr.ph91 ]
  %niter129 = phi i64 [ 0, %.lr.ph91.preheader.new ], [ %niter129.next.3, %.lr.ph91 ]
  %49 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv106
  %50 = load i8, ptr %49, align 1, !tbaa !18
  %51 = zext i8 %50 to i64
  %52 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %51, i32 1
  store i16 0, ptr %52, align 2, !tbaa !11
  %indvars.iv.next107 = or disjoint i64 %indvars.iv106, 1
  %53 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv.next107
  %54 = load i8, ptr %53, align 1, !tbaa !18
  %55 = zext i8 %54 to i64
  %56 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %55, i32 1
  store i16 0, ptr %56, align 2, !tbaa !11
  %indvars.iv.next107.1 = or disjoint i64 %indvars.iv106, 2
  %57 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv.next107.1
  %58 = load i8, ptr %57, align 1, !tbaa !18
  %59 = zext i8 %58 to i64
  %60 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %59, i32 1
  store i16 0, ptr %60, align 2, !tbaa !11
  %indvars.iv.next107.2 = or disjoint i64 %indvars.iv106, 3
  %61 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv.next107.2
  %62 = load i8, ptr %61, align 1, !tbaa !18
  %63 = zext i8 %62 to i64
  %64 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %63, i32 1
  store i16 0, ptr %64, align 2, !tbaa !11
  %indvars.iv.next107.3 = add nuw nsw i64 %indvars.iv106, 4
  %niter129.next.3 = add i64 %niter129, 4
  %niter129.ncmp.3 = icmp eq i64 %niter129.next.3, %unroll_iter128
  br i1 %niter129.ncmp.3, label %.preheader85.loopexit.unr-lcssa, label %.lr.ph91, !llvm.loop !23

vector.body:                                      ; preds = %vector.body.preheader, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.body.preheader ]
  %vec.phi = phi <4 x i32> [ %predphi, %vector.body ], [ <i32 249, i32 0, i32 0, i32 0>, %vector.body.preheader ]
  %vec.phi124 = phi <4 x i32> [ %predphi125, %vector.body ], [ zeroinitializer, %vector.body.preheader ]
  %65 = or disjoint i64 %index, 1
  %66 = or disjoint i64 %index, 2
  %67 = or disjoint i64 %index, 3
  %68 = or disjoint i64 %index, 4
  %69 = or disjoint i64 %index, 5
  %70 = or disjoint i64 %index, 6
  %71 = or disjoint i64 %index, 7
  %72 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %index, i32 1
  %73 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %65, i32 1
  %74 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %66, i32 1
  %75 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %67, i32 1
  %76 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %68, i32 1
  %77 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %69, i32 1
  %78 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %70, i32 1
  %79 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %71, i32 1
  %80 = load i16, ptr %72, align 2, !tbaa !11
  %81 = load i16, ptr %73, align 2, !tbaa !11
  %82 = load i16, ptr %74, align 2, !tbaa !11
  %83 = load i16, ptr %75, align 2, !tbaa !11
  %84 = insertelement <4 x i16> poison, i16 %80, i64 0
  %85 = insertelement <4 x i16> %84, i16 %81, i64 1
  %86 = insertelement <4 x i16> %85, i16 %82, i64 2
  %87 = insertelement <4 x i16> %86, i16 %83, i64 3
  %88 = load i16, ptr %76, align 2, !tbaa !11
  %89 = load i16, ptr %77, align 2, !tbaa !11
  %90 = load i16, ptr %78, align 2, !tbaa !11
  %91 = load i16, ptr %79, align 2, !tbaa !11
  %92 = insertelement <4 x i16> poison, i16 %88, i64 0
  %93 = insertelement <4 x i16> %92, i16 %89, i64 1
  %94 = insertelement <4 x i16> %93, i16 %90, i64 2
  %95 = insertelement <4 x i16> %94, i16 %91, i64 3
  %96 = icmp eq <4 x i16> %87, zeroinitializer
  %97 = icmp eq <4 x i16> %95, zeroinitializer
  %98 = zext <4 x i16> %87 to <4 x i32>
  %99 = zext <4 x i16> %95 to <4 x i32>
  %100 = add nuw nsw <4 x i32> %98, <i32 254, i32 254, i32 254, i32 254>
  %101 = add nuw nsw <4 x i32> %99, <i32 254, i32 254, i32 254, i32 254>
  %102 = udiv <4 x i32> %100, <i32 255, i32 255, i32 255, i32 255>
  %103 = udiv <4 x i32> %101, <i32 255, i32 255, i32 255, i32 255>
  %104 = shl nuw nsw <4 x i32> %102, <i32 1, i32 1, i32 1, i32 1>
  %105 = shl nuw nsw <4 x i32> %103, <i32 1, i32 1, i32 1, i32 1>
  %106 = add <4 x i32> %vec.phi, %98
  %107 = add <4 x i32> %vec.phi124, %99
  %108 = add <4 x i32> %106, %104
  %109 = add <4 x i32> %107, %105
  %predphi = select <4 x i1> %96, <4 x i32> %vec.phi, <4 x i32> %108
  %predphi125 = select <4 x i1> %97, <4 x i32> %vec.phi124, <4 x i32> %109
  %index.next = add nuw i64 %index, 8
  %110 = icmp eq i64 %index.next, 248
  br i1 %110, label %middle.block, label %vector.body, !llvm.loop !24

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %predphi125, %predphi
  %111 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %112 = getelementptr inbounds i8, ptr %9, i64 3970
  %113 = load i16, ptr %112, align 2, !tbaa !11
  %.not83 = icmp eq i16 %113, 0
  br i1 %.not83, label %151, label %144

.lr.ph93:                                         ; preds = %.lr.ph93, %.lr.ph93.preheader.new
  %indvars.iv111 = phi i64 [ 0, %.lr.ph93.preheader.new ], [ %indvars.iv.next112.1, %.lr.ph93 ]
  %niter134 = phi i64 [ 0, %.lr.ph93.preheader.new ], [ %niter134.next.1, %.lr.ph93 ]
  %114 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv111
  %115 = load ptr, ptr %114, align 8, !tbaa !14
  %116 = getelementptr inbounds i8, ptr %115, i64 1
  %117 = load i8, ptr %116, align 1, !tbaa !27
  %118 = zext i8 %117 to i16
  %119 = load i8, ptr %115, align 1, !tbaa !29
  %120 = zext i8 %119 to i64
  %121 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %120, i32 1
  store i16 %118, ptr %121, align 2, !tbaa !11
  %122 = getelementptr inbounds i8, ptr %115, i64 2
  %123 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %120, i32 2
  store ptr %122, ptr %123, align 8, !tbaa !30
  %indvars.iv.next112 = or disjoint i64 %indvars.iv111, 1
  %124 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv.next112
  %125 = load ptr, ptr %124, align 8, !tbaa !14
  %126 = getelementptr inbounds i8, ptr %125, i64 1
  %127 = load i8, ptr %126, align 1, !tbaa !27
  %128 = zext i8 %127 to i16
  %129 = load i8, ptr %125, align 1, !tbaa !29
  %130 = zext i8 %129 to i64
  %131 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %130, i32 1
  store i16 %128, ptr %131, align 2, !tbaa !11
  %132 = getelementptr inbounds i8, ptr %125, i64 2
  %133 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %130, i32 2
  store ptr %132, ptr %133, align 8, !tbaa !30
  %indvars.iv.next112.1 = add nuw nsw i64 %indvars.iv111, 2
  %niter134.next.1 = add i64 %niter134, 2
  %niter134.ncmp.1 = icmp eq i64 %niter134.next.1, %unroll_iter133
  br i1 %niter134.ncmp.1, label %vector.body.preheader.loopexit.unr-lcssa, label %.lr.ph93, !llvm.loop !31

vector.body.preheader.loopexit.unr-lcssa:         ; preds = %.lr.ph93, %.lr.ph93.preheader
  %indvars.iv111.unr = phi i64 [ 0, %.lr.ph93.preheader ], [ %indvars.iv.next112.1, %.lr.ph93 ]
  %lcmp.mod132.not = icmp eq i64 %xtraiter130, 0
  br i1 %lcmp.mod132.not, label %vector.body.preheader, label %.lr.ph93.epil

.lr.ph93.epil:                                    ; preds = %vector.body.preheader.loopexit.unr-lcssa
  %134 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv111.unr
  %135 = load ptr, ptr %134, align 8, !tbaa !14
  %136 = getelementptr inbounds i8, ptr %135, i64 1
  %137 = load i8, ptr %136, align 1, !tbaa !27
  %138 = zext i8 %137 to i16
  %139 = load i8, ptr %135, align 1, !tbaa !29
  %140 = zext i8 %139 to i64
  %141 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %140, i32 1
  store i16 %138, ptr %141, align 2, !tbaa !11
  %142 = getelementptr inbounds i8, ptr %135, i64 2
  %143 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %140, i32 2
  store ptr %142, ptr %143, align 8, !tbaa !30
  br label %vector.body.preheader

vector.body.preheader:                            ; preds = %.lr.ph93.epil, %vector.body.preheader.loopexit.unr-lcssa, %.preheader85
  br label %vector.body

144:                                              ; preds = %middle.block
  %145 = zext i16 %113 to i32
  %146 = add nuw nsw i32 %145, 254
  %147 = udiv i32 %146, 255
  %148 = shl nuw nsw i32 %147, 1
  %149 = add i32 %111, %145
  %150 = add i32 %149, %148
  br label %151

151:                                              ; preds = %middle.block, %144
  %.172 = phi i32 [ %150, %144 ], [ %111, %middle.block ]
  %152 = getelementptr inbounds i8, ptr %9, i64 3986
  %153 = load i16, ptr %152, align 2, !tbaa !11
  %.not83.1 = icmp eq i16 %153, 0
  br i1 %.not83.1, label %161, label %154

154:                                              ; preds = %151
  %155 = zext i16 %153 to i32
  %156 = add nuw nsw i32 %155, 254
  %157 = udiv i32 %156, 255
  %158 = shl nuw nsw i32 %157, 1
  %159 = add i32 %.172, %155
  %160 = add i32 %159, %158
  br label %161

161:                                              ; preds = %154, %151
  %.172.1 = phi i32 [ %160, %154 ], [ %.172, %151 ]
  %162 = getelementptr inbounds i8, ptr %9, i64 4002
  %163 = load i16, ptr %162, align 2, !tbaa !11
  %.not83.2 = icmp eq i16 %163, 0
  br i1 %.not83.2, label %171, label %164

164:                                              ; preds = %161
  %165 = zext i16 %163 to i32
  %166 = add nuw nsw i32 %165, 254
  %167 = udiv i32 %166, 255
  %168 = shl nuw nsw i32 %167, 1
  %169 = add i32 %.172.1, %165
  %170 = add i32 %169, %168
  br label %171

171:                                              ; preds = %164, %161
  %.172.2 = phi i32 [ %170, %164 ], [ %.172.1, %161 ]
  %172 = getelementptr inbounds i8, ptr %9, i64 4018
  %173 = load i16, ptr %172, align 2, !tbaa !11
  %.not83.3 = icmp eq i16 %173, 0
  br i1 %.not83.3, label %181, label %174

174:                                              ; preds = %171
  %175 = zext i16 %173 to i32
  %176 = add nuw nsw i32 %175, 254
  %177 = udiv i32 %176, 255
  %178 = shl nuw nsw i32 %177, 1
  %179 = add i32 %.172.2, %175
  %180 = add i32 %179, %178
  br label %181

181:                                              ; preds = %174, %171
  %.172.3 = phi i32 [ %180, %174 ], [ %.172.2, %171 ]
  %182 = getelementptr inbounds i8, ptr %9, i64 4034
  %183 = load i16, ptr %182, align 2, !tbaa !11
  %.not83.4 = icmp eq i16 %183, 0
  br i1 %.not83.4, label %191, label %184

184:                                              ; preds = %181
  %185 = zext i16 %183 to i32
  %186 = add nuw nsw i32 %185, 254
  %187 = udiv i32 %186, 255
  %188 = shl nuw nsw i32 %187, 1
  %189 = add i32 %.172.3, %185
  %190 = add i32 %189, %188
  br label %191

191:                                              ; preds = %184, %181
  %.172.4 = phi i32 [ %190, %184 ], [ %.172.3, %181 ]
  %192 = getelementptr inbounds i8, ptr %9, i64 4050
  %193 = load i16, ptr %192, align 2, !tbaa !11
  %.not83.5 = icmp eq i16 %193, 0
  br i1 %.not83.5, label %201, label %194

194:                                              ; preds = %191
  %195 = zext i16 %193 to i32
  %196 = add nuw nsw i32 %195, 254
  %197 = udiv i32 %196, 255
  %198 = shl nuw nsw i32 %197, 1
  %199 = add i32 %.172.4, %195
  %200 = add i32 %199, %198
  br label %201

201:                                              ; preds = %194, %191
  %.172.5 = phi i32 [ %200, %194 ], [ %.172.4, %191 ]
  %202 = getelementptr inbounds i8, ptr %9, i64 4066
  %203 = load i16, ptr %202, align 2, !tbaa !11
  %.not83.6 = icmp eq i16 %203, 0
  br i1 %.not83.6, label %211, label %204

204:                                              ; preds = %201
  %205 = zext i16 %203 to i32
  %206 = add nuw nsw i32 %205, 254
  %207 = udiv i32 %206, 255
  %208 = shl nuw nsw i32 %207, 1
  %209 = add i32 %.172.5, %205
  %210 = add i32 %209, %208
  br label %211

211:                                              ; preds = %204, %201
  %.172.6 = phi i32 [ %210, %204 ], [ %.172.5, %201 ]
  %212 = getelementptr inbounds i8, ptr %9, i64 4082
  %213 = load i16, ptr %212, align 2, !tbaa !11
  %.not83.7 = icmp eq i16 %213, 0
  br i1 %.not83.7, label %221, label %214

214:                                              ; preds = %211
  %215 = zext i16 %213 to i32
  %216 = add nuw nsw i32 %215, 254
  %217 = udiv i32 %216, 255
  %218 = shl nuw nsw i32 %217, 1
  %219 = add i32 %.172.6, %215
  %220 = add i32 %219, %218
  br label %221

221:                                              ; preds = %214, %211
  %.172.7 = phi i32 [ %220, %214 ], [ %.172.6, %211 ]
  %222 = zext i32 %.172.7 to i64
  %223 = call ptr @AllocatePool(i64 noundef %222) #5
  %224 = icmp eq ptr %223, null
  br i1 %224, label %249, label %225

225:                                              ; preds = %221
  store i32 %.172.7, ptr %223, align 1, !tbaa !32
  %226 = getelementptr inbounds i8, ptr %223, i64 4
  store i32 0, ptr %226, align 1, !tbaa !38
  %227 = getelementptr inbounds i8, ptr %223, i64 8
  %228 = getelementptr inbounds i8, ptr %0, i64 8
  %229 = call ptr @CopyMem(ptr noundef nonnull %227, ptr noundef nonnull %228, i64 noundef 236) #5
  %230 = getelementptr inbounds i8, ptr %223, i64 244
  store i32 1666417251, ptr %230, align 1, !tbaa !39
  %231 = getelementptr inbounds i8, ptr %223, i64 248
  br label %232

232:                                              ; preds = %225, %241
  %indvars.iv120 = phi i64 [ 0, %225 ], [ %indvars.iv.next121, %241 ]
  %.097 = phi ptr [ %231, %225 ], [ %.1, %241 ]
  %233 = getelementptr inbounds %struct.DHCP_OPTION, ptr %9, i64 %indvars.iv120
  %234 = getelementptr inbounds i8, ptr %233, i64 2
  %235 = load i16, ptr %234, align 2, !tbaa !11
  %.not82 = icmp eq i16 %235, 0
  br i1 %.not82, label %241, label %236

236:                                              ; preds = %232
  %237 = load i8, ptr %233, align 8, !tbaa !5
  %238 = getelementptr inbounds i8, ptr %233, i64 8
  %239 = load ptr, ptr %238, align 8, !tbaa !30
  %240 = call ptr @DhcpAppendOption(ptr noundef %.097, i8 noundef zeroext %237, i16 noundef zeroext %235, ptr noundef %239)
  br label %241

241:                                              ; preds = %232, %236
  %.1 = phi ptr [ %240, %236 ], [ %.097, %232 ]
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %exitcond123.not = icmp eq i64 %indvars.iv.next121, 256
  br i1 %exitcond123.not, label %242, label %232, !llvm.loop !40

242:                                              ; preds = %241
  %243 = getelementptr inbounds i8, ptr %.1, i64 1
  store i8 -1, ptr %.1, align 1, !tbaa !18
  %244 = ptrtoint ptr %243 to i64
  %245 = ptrtoint ptr %231 to i64
  %246 = sub i64 %244, %245
  %247 = trunc i64 %246 to i32
  %248 = add i32 %247, 240
  store i32 %248, ptr %226, align 1, !tbaa !38
  store ptr %223, ptr %5, align 8, !tbaa !14
  br label %249

249:                                              ; preds = %221, %23, %242
  %.075 = phi i64 [ %24, %23 ], [ -9223372036854775799, %221 ], [ 0, %242 ]
  %250 = load ptr, ptr %7, align 8, !tbaa !14
  %.not84 = icmp eq ptr %250, null
  br i1 %.not84, label %252, label %251

251:                                              ; preds = %249
  call void @FreePool(ptr noundef nonnull %250) #5
  br label %252

252:                                              ; preds = %251, %249
  call void @FreePool(ptr noundef nonnull %9) #5
  br label %253

253:                                              ; preds = %6, %252
  %.076 = phi i64 [ %.075, %252 ], [ -9223372036854775799, %6 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  ret i64 %.076
}

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !9, i64 2, !10, i64 8}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"short", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!6, !9, i64 2}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{i64 0, i64 1, !18, i64 2, i64 2, !19, i64 8, i64 8, !14}
!18 = !{!7, !7, i64 0}
!19 = !{!9, !9, i64 0}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13, !25, !26}
!25 = !{!"llvm.loop.isvectorized", i32 1}
!26 = !{!"llvm.loop.unroll.runtime.disable"}
!27 = !{!28, !7, i64 1}
!28 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2}
!29 = !{!28, !7, i64 0}
!30 = !{!6, !10, i64 8}
!31 = distinct !{!31, !13}
!32 = !{!33, !34, i64 0}
!33 = !{!"", !34, i64 0, !34, i64 4, !35, i64 8}
!34 = !{!"int", !7, i64 0}
!35 = !{!"", !36, i64 0, !34, i64 236, !7, i64 240}
!36 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !34, i64 4, !9, i64 8, !9, i64 10, !37, i64 12, !37, i64 16, !37, i64 20, !37, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}
!37 = !{!"", !7, i64 0}
!38 = !{!33, !34, i64 4}
!39 = !{!33, !34, i64 244}
!40 = distinct !{!40, !13}


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