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

; 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.SNP_DRIVER = type <{ i32, [4 x i8], %struct.EFI_LOCK, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, ptr, i8, i8, i16, i32, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, %struct.s_pxe_cdb, [6 x i8], ptr, ptr, ptr, %struct.s_pxe_db_get_init_info, i8, ptr, [100 x %struct.MAP_LIST], ptr, i8, [7 x i8] }>
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._EFI_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.s_pxe_cdb = type { i16, i16, i16, i16, i64, i64, i16, i16, i16, i16 }
%struct.s_pxe_db_get_init_info = type <{ i32, i32, [4 x i32], i32, i16, i16, i16, i16, i16, i16, i16, i16, i8, i8, i8 }>
%struct.MAP_LIST = type { i64, ptr }
%struct.s_pxe_cpb_fill_header_fragmented = type <{ [32 x i8], [32 x i8], i32, i16, i16, i16, i16, [16 x %struct.anon] }>
%struct.anon = type { i64, i32, i32 }

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1

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

25:                                               ; preds = %8
  %26 = load ptr, ptr %18, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %26, i32 0, i32 0
  %28 = getelementptr inbounds [32 x i8], ptr %27, i64 0, i64 0
  %29 = load ptr, ptr %16, align 8, !tbaa !5
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.SNP_DRIVER, ptr %30, i32 0, i32 4
  %32 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !21
  %34 = zext i32 %33 to i64
  %35 = call ptr @CopyMem(ptr noundef %28, ptr noundef %29, i64 noundef %34)
  br label %49

36:                                               ; preds = %8
  %37 = load ptr, ptr %18, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds [32 x i8], ptr %38, i64 0, i64 0
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.SNP_DRIVER, ptr %40, i32 0, i32 4
  %42 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %41, i32 0, i32 11
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.SNP_DRIVER, ptr %43, i32 0, i32 4
  %45 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !21
  %47 = zext i32 %46 to i64
  %48 = call ptr @CopyMem(ptr noundef %39, ptr noundef %42, i64 noundef %47)
  br label %49

49:                                               ; preds = %36, %25
  %50 = load ptr, ptr %18, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %50, i32 0, i32 1
  %52 = getelementptr inbounds [32 x i8], ptr %51, i64 0, i64 0
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.SNP_DRIVER, ptr %54, i32 0, i32 4
  %56 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !21
  %58 = zext i32 %57 to i64
  %59 = call ptr @CopyMem(ptr noundef %52, ptr noundef %53, i64 noundef %58)
  %60 = load ptr, ptr %17, align 8, !tbaa !5
  %61 = load i16, ptr %60, align 2, !tbaa !22
  %62 = zext i16 %61 to i32
  %63 = and i32 %62, 255
  %64 = shl i32 %63, 8
  %65 = load ptr, ptr %17, align 8, !tbaa !5
  %66 = load i16, ptr %65, align 2, !tbaa !22
  %67 = zext i16 %66 to i32
  %68 = and i32 %67, 65280
  %69 = ashr i32 %68, 8
  %70 = or i32 %64, %69
  %71 = trunc i32 %70 to i16
  %72 = load ptr, ptr %18, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %72, i32 0, i32 3
  store i16 %71, ptr %73, align 1, !tbaa !23
  %74 = load i64, ptr %14, align 8, !tbaa !9
  %75 = trunc i64 %74 to i32
  %76 = load ptr, ptr %18, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %76, i32 0, i32 2
  store i32 %75, ptr %77, align 1, !tbaa !25
  %78 = load i64, ptr %12, align 8, !tbaa !9
  %79 = trunc i64 %78 to i16
  %80 = load ptr, ptr %18, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %80, i32 0, i32 4
  store i16 %79, ptr %81, align 1, !tbaa !26
  %82 = load ptr, ptr %18, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %82, i32 0, i32 5
  store i16 2, ptr %83, align 1, !tbaa !27
  %84 = load ptr, ptr %18, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %84, i32 0, i32 6
  store i16 0, ptr %85, align 1, !tbaa !28
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = ptrtoint ptr %86 to i64
  %88 = load ptr, ptr %18, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %88, i32 0, i32 7
  %90 = getelementptr inbounds [16 x %struct.anon], ptr %89, i64 0, i64 0
  %91 = getelementptr inbounds %struct.anon, ptr %90, i32 0, i32 0
  store i64 %87, ptr %91, align 1, !tbaa !29
  %92 = load i64, ptr %12, align 8, !tbaa !9
  %93 = trunc i64 %92 to i32
  %94 = load ptr, ptr %18, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %94, i32 0, i32 7
  %96 = getelementptr inbounds [16 x %struct.anon], ptr %95, i64 0, i64 0
  %97 = getelementptr inbounds %struct.anon, ptr %96, i32 0, i32 1
  store i32 %93, ptr %97, align 1, !tbaa !31
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = ptrtoint ptr %98 to i64
  %100 = load ptr, ptr %18, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %100, i32 0, i32 7
  %102 = getelementptr inbounds [16 x %struct.anon], ptr %101, i64 0, i64 1
  %103 = getelementptr inbounds %struct.anon, ptr %102, i32 0, i32 0
  store i64 %99, ptr %103, align 1, !tbaa !29
  %104 = load i64, ptr %14, align 8, !tbaa !9
  %105 = trunc i64 %104 to i32
  %106 = load ptr, ptr %18, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %106, i32 0, i32 7
  %108 = getelementptr inbounds [16 x %struct.anon], ptr %107, i64 0, i64 1
  %109 = getelementptr inbounds %struct.anon, ptr %108, i32 0, i32 1
  store i32 %105, ptr %109, align 1, !tbaa !31
  %110 = load ptr, ptr %18, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %110, i32 0, i32 7
  %112 = getelementptr inbounds [16 x %struct.anon], ptr %111, i64 0, i64 1
  %113 = getelementptr inbounds %struct.anon, ptr %112, i32 0, i32 2
  store i32 0, ptr %113, align 1, !tbaa !32
  %114 = load ptr, ptr %18, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.s_pxe_cpb_fill_header_fragmented, ptr %114, i32 0, i32 7
  %116 = getelementptr inbounds [16 x %struct.anon], ptr %115, i64 0, i64 0
  %117 = getelementptr inbounds %struct.anon, ptr %116, i32 0, i32 2
  store i32 0, ptr %117, align 1, !tbaa !32
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.SNP_DRIVER, ptr %118, i32 0, i32 20
  %120 = getelementptr inbounds %struct.s_pxe_cdb, ptr %119, i32 0, i32 0
  store i16 15, ptr %120, align 2, !tbaa !33
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.SNP_DRIVER, ptr %121, i32 0, i32 20
  %123 = getelementptr inbounds %struct.s_pxe_cdb, ptr %122, i32 0, i32 1
  store i16 1, ptr %123, align 2, !tbaa !34
  %124 = load ptr, ptr %10, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.SNP_DRIVER, ptr %124, i32 0, i32 20
  %126 = getelementptr inbounds %struct.s_pxe_cdb, ptr %125, i32 0, i32 3
  store i16 0, ptr %126, align 2, !tbaa !35
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.SNP_DRIVER, ptr %127, i32 0, i32 20
  %129 = getelementptr inbounds %struct.s_pxe_cdb, ptr %128, i32 0, i32 5
  store i64 0, ptr %129, align 2, !tbaa !36
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.SNP_DRIVER, ptr %130, i32 0, i32 20
  %132 = getelementptr inbounds %struct.s_pxe_cdb, ptr %131, i32 0, i32 2
  store i16 332, ptr %132, align 2, !tbaa !37
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = ptrtoint ptr %133 to i64
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.SNP_DRIVER, ptr %135, i32 0, i32 20
  %137 = getelementptr inbounds %struct.s_pxe_cdb, ptr %136, i32 0, i32 4
  store i64 %134, ptr %137, align 2, !tbaa !38
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.SNP_DRIVER, ptr %138, i32 0, i32 20
  %140 = getelementptr inbounds %struct.s_pxe_cdb, ptr %139, i32 0, i32 6
  store i16 0, ptr %140, align 2, !tbaa !39
  %141 = load ptr, ptr %10, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.SNP_DRIVER, ptr %141, i32 0, i32 20
  %143 = getelementptr inbounds %struct.s_pxe_cdb, ptr %142, i32 0, i32 7
  store i16 0, ptr %143, align 2, !tbaa !40
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.SNP_DRIVER, ptr %144, i32 0, i32 10
  %146 = load i16, ptr %145, align 2, !tbaa !41
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.SNP_DRIVER, ptr %147, i32 0, i32 20
  %149 = getelementptr inbounds %struct.s_pxe_cdb, ptr %148, i32 0, i32 8
  store i16 %146, ptr %149, align 2, !tbaa !42
  %150 = load ptr, ptr %10, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.SNP_DRIVER, ptr %150, i32 0, i32 20
  %152 = getelementptr inbounds %struct.s_pxe_cdb, ptr %151, i32 0, i32 9
  store i16 0, ptr %152, align 2, !tbaa !43
  br label %153

153:                                              ; preds = %49
  %154 = call zeroext i8 @DebugPrintEnabled()
  %155 = icmp ne i8 %154, 0
  br i1 %155, label %156, label %164

156:                                              ; preds = %153
  br label %157

157:                                              ; preds = %156
  %158 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 16384)
  %159 = icmp ne i8 %158, 0
  br i1 %159, label %160, label %161

160:                                              ; preds = %157
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef @.str)
  br label %161

161:                                              ; preds = %160, %157
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163, %153
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %10, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.SNP_DRIVER, ptr %167, i32 0, i32 7
  %169 = load ptr, ptr %168, align 8, !tbaa !44
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.SNP_DRIVER, ptr %170, i32 0, i32 20
  %172 = ptrtoint ptr %171 to i64
  %173 = call i64 %169(i64 noundef %172)
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.SNP_DRIVER, ptr %174, i32 0, i32 20
  %176 = getelementptr inbounds %struct.s_pxe_cdb, ptr %175, i32 0, i32 6
  %177 = load i16, ptr %176, align 2, !tbaa !39
  %178 = zext i16 %177 to i32
  switch i32 %178, label %205 [
    i32 0, label %179
    i32 14, label %180
  ]

179:                                              ; preds = %166
  store i64 0, ptr %9, align 8
  store i32 1, ptr %19, align 4
  br label %230

180:                                              ; preds = %166
  br label %181

181:                                              ; preds = %180
  %182 = call zeroext i8 @DebugPrintEnabled()
  %183 = icmp ne i8 %182, 0
  br i1 %183, label %184, label %202

184:                                              ; preds = %181
  br label %185

185:                                              ; preds = %184
  %186 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %187 = icmp ne i8 %186, 0
  br i1 %187, label %188, label %199

188:                                              ; preds = %185
  %189 = load ptr, ptr %10, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.SNP_DRIVER, ptr %189, i32 0, i32 20
  %191 = getelementptr inbounds %struct.s_pxe_cdb, ptr %190, i32 0, i32 7
  %192 = load i16, ptr %191, align 2, !tbaa !40
  %193 = zext i16 %192 to i32
  %194 = load ptr, ptr %10, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.SNP_DRIVER, ptr %194, i32 0, i32 20
  %196 = getelementptr inbounds %struct.s_pxe_cdb, ptr %195, i32 0, i32 6
  %197 = load i16, ptr %196, align 2, !tbaa !39
  %198 = zext i16 %197 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.1, i32 noundef %193, i32 noundef %198)
  br label %199

199:                                              ; preds = %188, %185
  br label %200

200:                                              ; preds = %199
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201, %181
  br label %203

203:                                              ; preds = %202
  br label %204

204:                                              ; preds = %203
  store i64 -9223372036854775806, ptr %9, align 8
  store i32 1, ptr %19, align 4
  br label %230

205:                                              ; preds = %166
  br label %206

206:                                              ; preds = %205
  %207 = call zeroext i8 @DebugPrintEnabled()
  %208 = icmp ne i8 %207, 0
  br i1 %208, label %209, label %227

209:                                              ; preds = %206
  br label %210

210:                                              ; preds = %209
  %211 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %212 = icmp ne i8 %211, 0
  br i1 %212, label %213, label %224

213:                                              ; preds = %210
  %214 = load ptr, ptr %10, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.SNP_DRIVER, ptr %214, i32 0, i32 20
  %216 = getelementptr inbounds %struct.s_pxe_cdb, ptr %215, i32 0, i32 7
  %217 = load i16, ptr %216, align 2, !tbaa !40
  %218 = zext i16 %217 to i32
  %219 = load ptr, ptr %10, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.SNP_DRIVER, ptr %219, i32 0, i32 20
  %221 = getelementptr inbounds %struct.s_pxe_cdb, ptr %220, i32 0, i32 6
  %222 = load i16, ptr %221, align 2, !tbaa !39
  %223 = zext i16 %222 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.1, i32 noundef %218, i32 noundef %223)
  br label %224

224:                                              ; preds = %213, %210
  br label %225

225:                                              ; preds = %224
  br label %226

226:                                              ; preds = %225
  br label %227

227:                                              ; preds = %226, %206
  br label %228

228:                                              ; preds = %227
  br label %229

229:                                              ; preds = %228
  store i64 -9223372036854775801, ptr %9, align 8
  store i32 1, ptr %19, align 4
  br label %230

230:                                              ; preds = %229, %204, %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  %231 = load i64, ptr %9, align 8
  ret i64 %231
}

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

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

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 936}
!12 = !{!"", !13, i64 0, !14, i64 8, !15, i64 32, !16, i64 160, !6, i64 816, !6, i64 824, !6, i64 832, !7, i64 840, !18, i64 842, !13, i64 844, !6, i64 848, !6, i64 856, !6, i64 864, !6, i64 872, !6, i64 880, !6, i64 888, !7, i64 896, !7, i64 897, !19, i64 898, !6, i64 936, !6, i64 944, !6, i64 952, !20, i64 960, !6, i64 1008, !7, i64 1016, !6, i64 2616, !7, i64 2624}
!13 = !{!"int", !7, i64 0}
!14 = !{!"", !10, i64 0, !10, i64 8, !13, i64 16}
!15 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !10, 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, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!16 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !7, i64 40, !17, i64 552, !17, i64 584, !17, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!17 = !{!"", !7, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!"s_pxe_cdb", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6, !10, i64 8, !10, i64 16, !18, i64 24, !18, i64 26, !18, i64 28, !18, i64 30}
!20 = !{!"s_pxe_db_get_init_info", !13, i64 0, !13, i64 4, !7, i64 8, !13, i64 24, !18, i64 28, !18, i64 30, !18, i64 32, !18, i64 34, !18, i64 36, !18, i64 38, !18, i64 40, !18, i64 42, !7, i64 44, !7, i64 45, !7, i64 46}
!21 = !{!12, !13, i64 164}
!22 = !{!18, !18, i64 0}
!23 = !{!24, !18, i64 68}
!24 = !{!"s_pxe_cpb_fill_header_fragmented", !7, i64 0, !7, i64 32, !13, i64 64, !18, i64 68, !18, i64 70, !18, i64 72, !18, i64 74, !7, i64 76}
!25 = !{!24, !13, i64 64}
!26 = !{!24, !18, i64 70}
!27 = !{!24, !18, i64 72}
!28 = !{!24, !18, i64 74}
!29 = !{!30, !10, i64 0}
!30 = !{!"", !10, i64 0, !13, i64 8, !13, i64 12}
!31 = !{!30, !13, i64 8}
!32 = !{!30, !13, i64 12}
!33 = !{!12, !18, i64 898}
!34 = !{!12, !18, i64 900}
!35 = !{!12, !18, i64 904}
!36 = !{!12, !10, i64 914}
!37 = !{!12, !18, i64 902}
!38 = !{!12, !10, i64 906}
!39 = !{!12, !18, i64 922}
!40 = !{!12, !18, i64 924}
!41 = !{!12, !18, i64 842}
!42 = !{!12, !18, i64 926}
!43 = !{!12, !18, i64 928}
!44 = !{!12, !6, i64 832}


; 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 [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @PxeFillHeader(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, ptr noundef %6, ptr nocapture noundef readonly %7) local_unnamed_addr #0 {
  %9 = getelementptr inbounds i8, ptr %0, i64 936
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  %11 = getelementptr inbounds i8, ptr %0, i64 712
  %.sink = select i1 %.not, ptr %11, ptr %6
  %12 = getelementptr inbounds i8, ptr %0, i64 164
  %13 = load i32, ptr %12, align 4, !tbaa !19
  %14 = zext i32 %13 to i64
  %15 = tail call ptr @CopyMem(ptr noundef %10, ptr noundef nonnull %.sink, i64 noundef %14) #3
  %16 = getelementptr inbounds i8, ptr %10, i64 32
  %17 = getelementptr inbounds i8, ptr %0, i64 164
  %18 = load i32, ptr %17, align 4, !tbaa !19
  %19 = zext i32 %18 to i64
  %20 = tail call ptr @CopyMem(ptr noundef nonnull %16, ptr noundef %5, i64 noundef %19) #3
  %21 = load i16, ptr %7, align 2, !tbaa !20
  %rev = tail call i16 @llvm.bswap.i16(i16 %21)
  %22 = getelementptr inbounds i8, ptr %10, i64 68
  store i16 %rev, ptr %22, align 1, !tbaa !21
  %23 = trunc i64 %4 to i32
  %24 = getelementptr inbounds i8, ptr %10, i64 64
  store i32 %23, ptr %24, align 1, !tbaa !23
  %25 = trunc i64 %2 to i16
  %26 = getelementptr inbounds i8, ptr %10, i64 70
  store i16 %25, ptr %26, align 1, !tbaa !24
  %27 = getelementptr inbounds i8, ptr %10, i64 72
  store i16 2, ptr %27, align 1, !tbaa !25
  %28 = getelementptr inbounds i8, ptr %10, i64 74
  store i16 0, ptr %28, align 1, !tbaa !26
  %29 = ptrtoint ptr %1 to i64
  %30 = getelementptr inbounds i8, ptr %10, i64 76
  store i64 %29, ptr %30, align 1, !tbaa !27
  %31 = trunc i64 %2 to i32
  %32 = getelementptr inbounds i8, ptr %10, i64 84
  store i32 %31, ptr %32, align 1, !tbaa !29
  %33 = ptrtoint ptr %3 to i64
  %34 = getelementptr inbounds i8, ptr %10, i64 92
  store i64 %33, ptr %34, align 1, !tbaa !27
  %35 = getelementptr inbounds i8, ptr %10, i64 100
  store i32 %23, ptr %35, align 1, !tbaa !29
  %36 = getelementptr inbounds i8, ptr %10, i64 104
  store i32 0, ptr %36, align 1, !tbaa !30
  %37 = getelementptr inbounds i8, ptr %10, i64 88
  store i32 0, ptr %37, align 1, !tbaa !30
  %38 = getelementptr inbounds i8, ptr %0, i64 898
  store i16 15, ptr %38, align 2, !tbaa !31
  %39 = getelementptr inbounds i8, ptr %0, i64 900
  store i16 1, ptr %39, align 2, !tbaa !32
  %40 = getelementptr inbounds i8, ptr %0, i64 904
  store i16 0, ptr %40, align 2, !tbaa !33
  %41 = getelementptr inbounds i8, ptr %0, i64 914
  store i64 0, ptr %41, align 2, !tbaa !34
  %42 = getelementptr inbounds i8, ptr %0, i64 902
  store i16 332, ptr %42, align 2, !tbaa !35
  %43 = ptrtoint ptr %10 to i64
  %44 = getelementptr inbounds i8, ptr %0, i64 906
  store i64 %43, ptr %44, align 2, !tbaa !36
  %45 = getelementptr inbounds i8, ptr %0, i64 922
  store i16 0, ptr %45, align 2, !tbaa !37
  %46 = getelementptr inbounds i8, ptr %0, i64 924
  store i16 0, ptr %46, align 2, !tbaa !38
  %47 = getelementptr inbounds i8, ptr %0, i64 842
  %48 = load i16, ptr %47, align 2, !tbaa !39
  %49 = getelementptr inbounds i8, ptr %0, i64 926
  store i16 %48, ptr %49, align 2, !tbaa !40
  %50 = getelementptr inbounds i8, ptr %0, i64 928
  store i16 0, ptr %50, align 2, !tbaa !41
  %51 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not50 = icmp eq i8 %51, 0
  br i1 %.not50, label %55, label %52

52:                                               ; preds = %8
  %53 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 16384) #3
  %.not51 = icmp eq i8 %53, 0
  br i1 %.not51, label %55, label %54

54:                                               ; preds = %52
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef nonnull @.str) #3
  br label %55

55:                                               ; preds = %52, %54, %8
  %56 = getelementptr inbounds i8, ptr %0, i64 832
  %57 = load ptr, ptr %56, align 8, !tbaa !42
  %58 = ptrtoint ptr %38 to i64
  %59 = tail call i64 %57(i64 noundef %58) #3
  %60 = load i16, ptr %45, align 2, !tbaa !37
  switch i16 %60, label %65 [
    i16 0, label %73
    i16 14, label %61
  ]

61:                                               ; preds = %55
  %62 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not52 = icmp eq i8 %62, 0
  br i1 %.not52, label %73, label %63

63:                                               ; preds = %61
  %64 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not53 = icmp eq i8 %64, 0
  br i1 %.not53, label %73, label %.sink.split

65:                                               ; preds = %55
  %66 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not54 = icmp eq i8 %66, 0
  br i1 %.not54, label %73, label %67

67:                                               ; preds = %65
  %68 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not55 = icmp eq i8 %68, 0
  br i1 %.not55, label %73, label %.sink.split

.sink.split:                                      ; preds = %67, %63
  %.0.ph = phi i64 [ -9223372036854775806, %63 ], [ -9223372036854775801, %67 ]
  %69 = load i16, ptr %46, align 2, !tbaa !38
  %70 = zext i16 %69 to i32
  %71 = load i16, ptr %45, align 2, !tbaa !37
  %72 = zext i16 %71 to i32
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.1, i32 noundef %70, i32 noundef %72) #3
  br label %73

73:                                               ; preds = %.sink.split, %65, %67, %61, %63, %55
  %.0 = phi i64 [ 0, %55 ], [ -9223372036854775806, %63 ], [ -9223372036854775806, %61 ], [ -9223372036854775801, %67 ], [ -9223372036854775801, %65 ], [ %.0.ph, %.sink.split ]
  ret i64 %.0
}

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

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.bswap.i16(i16) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !13, i64 936}
!6 = !{!"", !7, i64 0, !10, i64 8, !12, i64 32, !14, i64 160, !13, i64 816, !13, i64 824, !13, i64 832, !8, i64 840, !16, i64 842, !7, i64 844, !13, i64 848, !13, i64 856, !13, i64 864, !13, i64 872, !13, i64 880, !13, i64 888, !8, i64 896, !8, i64 897, !17, i64 898, !13, i64 936, !13, i64 944, !13, i64 952, !18, i64 960, !13, i64 1008, !8, i64 1016, !13, i64 2616, !8, i64 2624}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 8, !7, i64 16}
!11 = !{!"long long", !8, i64 0}
!12 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !11, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !15, i64 552, !15, i64 584, !15, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!15 = !{!"", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = !{!"s_pxe_cdb", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !11, i64 8, !11, i64 16, !16, i64 24, !16, i64 26, !16, i64 28, !16, i64 30}
!18 = !{!"s_pxe_db_get_init_info", !7, i64 0, !7, i64 4, !8, i64 8, !7, i64 24, !16, i64 28, !16, i64 30, !16, i64 32, !16, i64 34, !16, i64 36, !16, i64 38, !16, i64 40, !16, i64 42, !8, i64 44, !8, i64 45, !8, i64 46}
!19 = !{!6, !7, i64 164}
!20 = !{!16, !16, i64 0}
!21 = !{!22, !16, i64 68}
!22 = !{!"s_pxe_cpb_fill_header_fragmented", !8, i64 0, !8, i64 32, !7, i64 64, !16, i64 68, !16, i64 70, !16, i64 72, !16, i64 74, !8, i64 76}
!23 = !{!22, !7, i64 64}
!24 = !{!22, !16, i64 70}
!25 = !{!22, !16, i64 72}
!26 = !{!22, !16, i64 74}
!27 = !{!28, !11, i64 0}
!28 = !{!"", !11, i64 0, !7, i64 8, !7, i64 12}
!29 = !{!28, !7, i64 8}
!30 = !{!28, !7, i64 12}
!31 = !{!6, !16, i64 898}
!32 = !{!6, !16, i64 900}
!33 = !{!6, !16, i64 904}
!34 = !{!6, !11, i64 914}
!35 = !{!6, !16, i64 902}
!36 = !{!6, !11, i64 906}
!37 = !{!6, !16, i64 922}
!38 = !{!6, !16, i64 924}
!39 = !{!6, !16, i64 842}
!40 = !{!6, !16, i64 926}
!41 = !{!6, !16, i64 928}
!42 = !{!6, !13, i64 832}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass