; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/OptionRomPkg/Bus/Usb (FillPkt2Queue)

; 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.NIC_DEVICE = type { i64, ptr, ptr, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, i8, ptr, i16, i8, i8, i8, i8, i8, ptr, i64, ptr, ptr, ptr, [2 x i32], ptr }
%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.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 }
%struct._RX_TX_PACKET = type { ptr, i16, i16, [2044 x i8] }

@gBS = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [34 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

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

declare zeroext i8 @DebugPrintEnabled() #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #1

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

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

13:                                               ; preds = %143, %2
  %14 = load i32, ptr %8, align 4, !tbaa !11
  %15 = zext i32 %14 to i64
  %16 = load i64, ptr %4, align 8, !tbaa !9
  %17 = icmp ult i64 %15, %16
  br i1 %17, label %18, label %153

18:                                               ; preds = %13
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.NIC_DEVICE, ptr %19, i32 0, i32 19
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %22 = load i32, ptr %8, align 4, !tbaa !11
  %23 = zext i32 %22 to i64
  %24 = getelementptr inbounds i8, ptr %21, i64 %23
  store ptr %24, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.NIC_DEVICE, ptr %25, i32 0, i32 19
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = load i32, ptr %8, align 4, !tbaa !11
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds i8, ptr %27, i64 %29
  %31 = getelementptr inbounds i8, ptr %30, i64 2
  store ptr %31, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = load i16, ptr %32, align 2, !tbaa !19
  %34 = zext i16 %33 to i32
  %35 = and i32 %34, 2047
  %36 = trunc i32 %35 to i16
  store i16 %36, ptr %32, align 2, !tbaa !19
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = load i16, ptr %37, align 2, !tbaa !19
  %39 = zext i16 %38 to i32
  %40 = and i32 %39, 2047
  %41 = trunc i32 %40 to i16
  store i16 %41, ptr %37, align 2, !tbaa !19
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load i16, ptr %42, align 2, !tbaa !19
  %44 = zext i16 %43 to i32
  %45 = or i32 %44, 63488
  %46 = trunc i32 %45 to i16
  store i16 %46, ptr %42, align 2, !tbaa !19
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = load i16, ptr %47, align 2, !tbaa !19
  %49 = zext i16 %48 to i32
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load i16, ptr %50, align 2, !tbaa !19
  %52 = zext i16 %51 to i32
  %53 = xor i32 %49, %52
  %54 = icmp ne i32 %53, 65535
  br i1 %54, label %55, label %71

55:                                               ; preds = %18
  br label %56

56:                                               ; preds = %55
  %57 = call zeroext i8 @DebugPrintEnabled()
  %58 = icmp ne i8 %57, 0
  br i1 %58, label %59, label %68

59:                                               ; preds = %56
  br label %60

60:                                               ; preds = %59
  %61 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %62 = icmp ne i8 %61, 0
  br i1 %62, label %63, label %65

63:                                               ; preds = %60
  %64 = load i64, ptr %4, align 8, !tbaa !9
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.4, i64 noundef %64)
  br label %65

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

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67, %56
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  store i32 1, ptr %12, align 4
  br label %154

71:                                               ; preds = %18
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.NIC_DEVICE, ptr %72, i32 0, i32 17
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  store ptr %74, ptr %9, align 8, !tbaa !5
  store i64 2048, ptr %10, align 8, !tbaa !9
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = icmp eq ptr null, %75
  br i1 %76, label %77, label %92

77:                                               ; preds = %71
  %78 = load ptr, ptr @gBS, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %78, i32 0, i32 6
  %80 = load ptr, ptr %79, align 8, !tbaa !21
  %81 = call i64 %80(i32 noundef 6, i64 noundef 2056, ptr noundef %9)
  store i64 %81, ptr %11, align 8, !tbaa !9
  %82 = load i64, ptr %11, align 8, !tbaa !9
  %83 = icmp slt i64 %82, 0
  br i1 %83, label %90, label %84

84:                                               ; preds = %77
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.NIC_DEVICE, ptr %86, i32 0, i32 17
  store ptr %85, ptr %87, align 8, !tbaa !20
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %88, i32 0, i32 0
  store ptr null, ptr %89, align 1, !tbaa !24
  br label %91

90:                                               ; preds = %77
  br label %91

91:                                               ; preds = %90, %84
  br label %92

92:                                               ; preds = %91, %71
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.NIC_DEVICE, ptr %93, i32 0, i32 19
  %95 = load ptr, ptr %94, align 8, !tbaa !13
  %96 = load i32, ptr %8, align 4, !tbaa !11
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %95, i64 %97
  %99 = getelementptr inbounds i8, ptr %98, i64 4
  store ptr %99, ptr %7, align 8, !tbaa !5
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = load i16, ptr %100, align 2, !tbaa !19
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %102, i32 0, i32 1
  store i16 %101, ptr %103, align 1, !tbaa !26
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.NIC_DEVICE, ptr %104, i32 0, i32 19
  %106 = load ptr, ptr %105, align 8, !tbaa !13
  %107 = load i32, ptr %8, align 4, !tbaa !11
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds i8, ptr %106, i64 %108
  %110 = getelementptr inbounds i8, ptr %109, i64 2
  %111 = load i16, ptr %110, align 2, !tbaa !19
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %112, i32 0, i32 2
  store i16 %111, ptr %113, align 1, !tbaa !27
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %114, i32 0, i32 3
  %116 = getelementptr inbounds [2044 x i8], ptr %115, i64 0, i64 0
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = load i16, ptr %118, align 2, !tbaa !19
  %120 = zext i16 %119 to i64
  %121 = call ptr @CopyMem(ptr noundef %116, ptr noundef %117, i64 noundef %120)
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 1, !tbaa !24
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.NIC_DEVICE, ptr %125, i32 0, i32 17
  store ptr %124, ptr %126, align 8, !tbaa !20
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %127, i32 0, i32 0
  store ptr null, ptr %128, align 1, !tbaa !24
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.NIC_DEVICE, ptr %129, i32 0, i32 16
  %131 = load ptr, ptr %130, align 8, !tbaa !28
  %132 = icmp eq ptr null, %131
  br i1 %132, label %133, label %137

133:                                              ; preds = %92
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.NIC_DEVICE, ptr %135, i32 0, i32 15
  store ptr %134, ptr %136, align 8, !tbaa !29
  br label %143

137:                                              ; preds = %92
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.NIC_DEVICE, ptr %139, i32 0, i32 16
  %141 = load ptr, ptr %140, align 8, !tbaa !28
  %142 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %141, i32 0, i32 0
  store ptr %138, ptr %142, align 1, !tbaa !24
  br label %143

143:                                              ; preds = %137, %133
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.NIC_DEVICE, ptr %145, i32 0, i32 16
  store ptr %144, ptr %146, align 8, !tbaa !28
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = load i16, ptr %147, align 2, !tbaa !19
  %149 = zext i16 %148 to i32
  %150 = add nsw i32 %149, 4
  %151 = load i32, ptr %8, align 4, !tbaa !11
  %152 = add i32 %151, %150
  store i32 %152, ptr %8, align 4, !tbaa !11
  br label %13, !llvm.loop !30

153:                                              ; preds = %13
  store i32 0, ptr %12, align 4
  br label %154

154:                                              ; preds = %153, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %155 = load i32, ptr %12, align 4
  switch i32 %155, label %157 [
    i32 0, label %156
    i32 1, label %156
  ]

156:                                              ; preds = %154, %154
  ret void

157:                                              ; preds = %154
  unreachable
}

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 880}
!14 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !16, i64 152, !7, i64 808, !6, i64 816, !18, i64 824, !7, i64 826, !7, i64 827, !7, i64 828, !7, i64 829, !7, i64 830, !6, i64 832, !10, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !7, i64 872, !6, i64 880}
!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 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, 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 = !{!18, !18, i64 0}
!20 = !{!14, !6, i64 864}
!21 = !{!22, !6, i64 64}
!22 = !{!"", !23, 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}
!23 = !{!"", !10, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!24 = !{!25, !6, i64 0}
!25 = !{!"_RX_TX_PACKET", !6, i64 0, !18, i64 8, !18, i64 10, !7, i64 12}
!26 = !{!25, !18, i64 8}
!27 = !{!25, !18, i64 10}
!28 = !{!14, !6, i64 856}
!29 = !{!14, !6, i64 848}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


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

@gBS = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [34 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

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

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: nounwind uwtable
define dso_local void @FillPkt2Queue(ptr nocapture noundef %0, i64 noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %.not34 = icmp eq i64 %1, 0
  br i1 %.not34, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 880
  %5 = getelementptr inbounds i8, ptr %0, i64 864
  %6 = getelementptr inbounds i8, ptr %0, i64 856
  %7 = getelementptr inbounds i8, ptr %0, i64 848
  br label %8

8:                                                ; preds = %.lr.ph, %54
  %9 = phi i64 [ 0, %.lr.ph ], [ %60, %54 ]
  %.033 = phi i32 [ 0, %.lr.ph ], [ %59, %54 ]
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 %9
  %12 = getelementptr inbounds i8, ptr %11, i64 2
  %13 = load i16, ptr %11, align 2, !tbaa !16
  %14 = and i16 %13, 2047
  store i16 %14, ptr %11, align 2, !tbaa !16
  %15 = load i16, ptr %12, align 2, !tbaa !16
  %16 = or i16 %15, -2048
  store i16 %16, ptr %12, align 2, !tbaa !16
  %17 = xor i16 %16, %14
  %.not = icmp eq i16 %17, -1
  br i1 %.not, label %23, label %18

18:                                               ; preds = %8
  %19 = call zeroext i8 @DebugPrintEnabled() #3
  %.not31 = icmp eq i8 %19, 0
  br i1 %.not31, label %.loopexit, label %20

20:                                               ; preds = %18
  %21 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not32 = icmp eq i8 %21, 0
  br i1 %.not32, label %.loopexit, label %22

22:                                               ; preds = %20
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.4, i64 noundef %1) #3
  br label %.loopexit

23:                                               ; preds = %8
  %24 = load ptr, ptr %5, align 8, !tbaa !17
  store ptr %24, ptr %3, align 8, !tbaa !18
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %33

26:                                               ; preds = %23
  %27 = load ptr, ptr @gBS, align 8, !tbaa !18
  %28 = getelementptr inbounds i8, ptr %27, i64 64
  %29 = load ptr, ptr %28, align 8, !tbaa !19
  %30 = call i64 %29(i32 noundef 6, i64 noundef 2056, ptr noundef nonnull %3) #3
  %31 = icmp slt i64 %30, 0
  %.pre35 = load ptr, ptr %3, align 8, !tbaa !18
  br i1 %31, label %33, label %32

32:                                               ; preds = %26
  store ptr %.pre35, ptr %5, align 8, !tbaa !17
  store ptr null, ptr %.pre35, align 1, !tbaa !22
  %.pre = load ptr, ptr %3, align 8, !tbaa !18
  br label %33

33:                                               ; preds = %32, %26, %23
  %34 = phi ptr [ %.pre, %32 ], [ %.pre35, %26 ], [ %24, %23 ]
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 %9
  %37 = getelementptr inbounds i8, ptr %36, i64 4
  %38 = load i16, ptr %11, align 2, !tbaa !16
  %39 = getelementptr inbounds i8, ptr %34, i64 8
  store i16 %38, ptr %39, align 1, !tbaa !24
  %40 = getelementptr inbounds i8, ptr %36, i64 2
  %41 = load i16, ptr %40, align 2, !tbaa !16
  %42 = getelementptr inbounds i8, ptr %34, i64 10
  store i16 %41, ptr %42, align 1, !tbaa !25
  %43 = getelementptr inbounds i8, ptr %34, i64 12
  %44 = load i16, ptr %11, align 2, !tbaa !16
  %45 = zext i16 %44 to i64
  %46 = call ptr @CopyMem(ptr noundef nonnull %43, ptr noundef nonnull %37, i64 noundef %45) #3
  %47 = load ptr, ptr %3, align 8, !tbaa !18
  %48 = load ptr, ptr %47, align 1, !tbaa !22
  store ptr %48, ptr %5, align 8, !tbaa !17
  store ptr null, ptr %47, align 1, !tbaa !22
  %49 = load ptr, ptr %6, align 8, !tbaa !26
  %50 = icmp eq ptr %49, null
  %51 = load ptr, ptr %3, align 8, !tbaa !18
  br i1 %50, label %52, label %53

52:                                               ; preds = %33
  store ptr %51, ptr %7, align 8, !tbaa !27
  br label %54

53:                                               ; preds = %33
  store ptr %51, ptr %49, align 1, !tbaa !22
  %.pre36 = load ptr, ptr %3, align 8, !tbaa !18
  br label %54

54:                                               ; preds = %53, %52
  %55 = phi ptr [ %.pre36, %53 ], [ %51, %52 ]
  store ptr %55, ptr %6, align 8, !tbaa !26
  %56 = load i16, ptr %11, align 2, !tbaa !16
  %57 = zext i16 %56 to i32
  %58 = add i32 %.033, 4
  %59 = add i32 %58, %57
  %60 = zext i32 %59 to i64
  %61 = icmp ult i64 %60, %1
  br i1 %61, label %8, label %.loopexit, !llvm.loop !28

.loopexit:                                        ; preds = %54, %2, %18, %22, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret void
}

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 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, !10, i64 880}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 152, !8, i64 808, !10, i64 816, !15, i64 824, !8, i64 826, !8, i64 827, !8, i64 828, !8, i64 829, !8, i64 830, !10, i64 832, !7, i64 840, !10, i64 848, !10, i64 856, !10, i64 864, !8, i64 872, !10, i64 880}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120}
!12 = !{!"", !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, !8, i64 40, !14, i64 552, !14, i64 584, !14, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!13 = !{!"int", !8, i64 0}
!14 = !{!"", !8, i64 0}
!15 = !{!"short", !8, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!6, !10, i64 864}
!18 = !{!10, !10, i64 0}
!19 = !{!20, !10, i64 64}
!20 = !{!"", !21, i64 0, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368}
!21 = !{!"", !7, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!22 = !{!23, !10, i64 0}
!23 = !{!"_RX_TX_PACKET", !10, i64 0, !15, i64 8, !15, i64 10, !8, i64 12}
!24 = !{!23, !15, i64 8}
!25 = !{!23, !15, i64 10}
!26 = !{!6, !10, i64 856}
!27 = !{!6, !10, i64 848}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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