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

; 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.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._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.NIC_DEVICE = type { i64, ptr, ptr, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, i8, ptr, i16, i8, i8, i8, i8, i64, i64, i16, ptr, ptr, [8 x i8], %struct.EFI_MAC_ADDRESS, i8, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct._EFI_USB_IO_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._RX_PKT = type <{ ptr, i8, i16, [2048 x i8] }>
%struct.ETHERNET_HEADER = type { [6 x i8], [6 x i8], i16 }

@.str = external hidden unnamed_addr constant [161 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() #1

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

; 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
declare dso_local void @FillPkt2Queue(ptr noundef, i64 noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @SN_Receive(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca 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 i16, align 2
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %25 = load ptr, ptr @gBS, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %25, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = call i64 %27(i64 noundef 8)
  store i64 %28, ptr %18, align 8, !tbaa !14
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = icmp ne ptr null, %29
  br i1 %30, label %31, label %360

31:                                               ; preds = %7
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %32, i32 0, i32 15
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  %35 = icmp ne ptr null, %34
  br i1 %35, label %36, label %360

36:                                               ; preds = %31
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = icmp ne ptr null, %37
  br i1 %38, label %39, label %360

39:                                               ; preds = %36
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = icmp ne ptr null, %40
  br i1 %41, label %42, label %360

42:                                               ; preds = %39
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %43, i32 0, i32 15
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  store ptr %45, ptr %15, align 8, !tbaa !5
  %46 = load ptr, ptr %15, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !17
  %49 = icmp eq i32 2, %48
  br i1 %49, label %50, label %351

50:                                               ; preds = %42
  %51 = call zeroext i8 @DebugAssertEnabled()
  %52 = zext i8 %51 to i32
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %64

54:                                               ; preds = %50
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = ptrtoint ptr %55 to i64
  %57 = sub i64 %56, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %58 = inttoptr i64 %57 to ptr
  %59 = getelementptr inbounds %struct.NIC_DEVICE, ptr %58, i32 0, i32 0
  %60 = load i64, ptr %59, align 8, !tbaa !20
  %61 = icmp ne i64 %60, 943216705
  br i1 %61, label %62, label %64

62:                                               ; preds = %54
  call void @DebugAssert(ptr noundef @.str, i64 noundef 500, ptr noundef @.str.1)
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  br label %69

64:                                               ; preds = %54, %50
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = ptrtoint ptr %65 to i64
  %67 = sub i64 %66, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %68 = inttoptr i64 %67 to ptr
  br label %69

69:                                               ; preds = %64, %62
  %70 = phi ptr [ %63, %62 ], [ %68, %64 ]
  store ptr %70, ptr %16, align 8, !tbaa !5
  %71 = load ptr, ptr %16, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.NIC_DEVICE, ptr %71, i32 0, i32 13
  %73 = load i64, ptr %72, align 8, !tbaa !23
  %74 = add i64 %73, 1
  store i64 %74, ptr %72, align 8, !tbaa !23
  %75 = load ptr, ptr %16, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.NIC_DEVICE, ptr %75, i32 0, i32 12
  %77 = load i8, ptr %76, align 1, !tbaa !24
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %78, i32 0, i32 18
  store i8 %77, ptr %79, align 4, !tbaa !25
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %80, i32 0, i32 18
  %82 = load i8, ptr %81, align 4, !tbaa !25
  %83 = zext i8 %82 to i32
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %345

85:                                               ; preds = %69
  %86 = load ptr, ptr %16, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.NIC_DEVICE, ptr %86, i32 0, i32 10
  %88 = load i8, ptr %87, align 1, !tbaa !26
  %89 = zext i8 %88 to i32
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %345

91:                                               ; preds = %85
  %92 = load ptr, ptr %16, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.NIC_DEVICE, ptr %92, i32 0, i32 26
  %94 = load i64, ptr %93, align 8, !tbaa !27
  %95 = icmp ne i64 %94, 0
  br i1 %95, label %96, label %114

96:                                               ; preds = %91
  br label %97

97:                                               ; preds = %96
  %98 = call zeroext i8 @DebugPrintEnabled()
  %99 = icmp ne i8 %98, 0
  br i1 %99, label %100, label %111

100:                                              ; preds = %97
  br label %101

101:                                              ; preds = %100
  %102 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %103 = icmp ne i8 %102, 0
  br i1 %103, label %104, label %108

104:                                              ; preds = %101
  %105 = load ptr, ptr %16, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.NIC_DEVICE, ptr %105, i32 0, i32 26
  %107 = load i64, ptr %106, align 8, !tbaa !27
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.10, i64 noundef %107)
  br label %108

108:                                              ; preds = %104, %101
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110, %97
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113, %91
  store i64 16384, ptr %21, align 8, !tbaa !14
  %115 = load ptr, ptr %16, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.NIC_DEVICE, ptr %115, i32 0, i32 26
  %117 = load i64, ptr %116, align 8, !tbaa !27
  %118 = icmp eq i64 %117, 0
  br i1 %118, label %119, label %150

119:                                              ; preds = %114
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.NIC_DEVICE, ptr %120, i32 0, i32 27
  %122 = load ptr, ptr %121, align 8, !tbaa !28
  %123 = getelementptr inbounds i8, ptr %122, i64 0
  %124 = call ptr @SetMem(ptr noundef %123, i64 noundef 4, i8 noundef zeroext 0)
  %125 = load ptr, ptr %16, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.NIC_DEVICE, ptr %125, i32 0, i32 2
  %127 = load ptr, ptr %126, align 8, !tbaa !29
  store ptr %127, ptr %20, align 8, !tbaa !5
  %128 = load ptr, ptr %20, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._EFI_USB_IO_PROTOCOL, ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !30
  %131 = load ptr, ptr %20, align 8, !tbaa !5
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.NIC_DEVICE, ptr %132, i32 0, i32 27
  %134 = load ptr, ptr %133, align 8, !tbaa !28
  %135 = getelementptr inbounds i8, ptr %134, i64 0
  %136 = call i64 %130(ptr noundef %131, i8 noundef zeroext -126, ptr noundef %135, ptr noundef %21, i64 noundef 20, ptr noundef %22)
  store i64 %136, ptr %17, align 8, !tbaa !14
  %137 = load i64, ptr %21, align 8, !tbaa !14
  %138 = icmp ne i64 %137, 0
  br i1 %138, label %139, label %149

139:                                              ; preds = %119
  %140 = load i64, ptr %17, align 8, !tbaa !14
  %141 = icmp slt i64 %140, 0
  br i1 %141, label %149, label %142

142:                                              ; preds = %139
  %143 = load i32, ptr %22, align 4, !tbaa !32
  %144 = zext i32 %143 to i64
  %145 = icmp slt i64 %144, 0
  br i1 %145, label %149, label %146

146:                                              ; preds = %142
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = load i64, ptr %21, align 8, !tbaa !14
  call void @FillPkt2Queue(ptr noundef %147, i64 noundef %148)
  br label %149

149:                                              ; preds = %146, %142, %139, %119
  br label %150

150:                                              ; preds = %149, %114
  %151 = load ptr, ptr %16, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.NIC_DEVICE, ptr %151, i32 0, i32 25
  %153 = load ptr, ptr %152, align 8, !tbaa !33
  store ptr %153, ptr %23, align 8, !tbaa !5
  %154 = load ptr, ptr %23, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._RX_PKT, ptr %154, i32 0, i32 1
  %156 = load i8, ptr %155, align 1, !tbaa !34
  %157 = zext i8 %156 to i32
  %158 = icmp eq i32 1, %157
  br i1 %158, label %159, label %339

159:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %160 = load ptr, ptr %16, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.NIC_DEVICE, ptr %160, i32 0, i32 13
  store i64 0, ptr %161, align 8, !tbaa !23
  %162 = load ptr, ptr %11, align 8, !tbaa !5
  %163 = load ptr, ptr %23, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._RX_PKT, ptr %163, i32 0, i32 3
  %165 = getelementptr inbounds [2048 x i8], ptr %164, i64 0, i64 0
  %166 = load ptr, ptr %23, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct._RX_PKT, ptr %166, i32 0, i32 2
  %168 = load i16, ptr %167, align 1, !tbaa !36
  %169 = zext i16 %168 to i64
  %170 = call ptr @CopyMem(ptr noundef %162, ptr noundef %165, i64 noundef %169)
  %171 = load ptr, ptr %23, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._RX_PKT, ptr %171, i32 0, i32 3
  %173 = getelementptr inbounds [2048 x i8], ptr %172, i64 0, i64 0
  store ptr %173, ptr %24, align 8, !tbaa !5
  br label %174

174:                                              ; preds = %159
  %175 = call zeroext i8 @DebugPrintEnabled()
  %176 = icmp ne i8 %175, 0
  br i1 %176, label %177, label %259

177:                                              ; preds = %174
  br label %178

178:                                              ; preds = %177
  %179 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %180 = icmp ne i8 %179, 0
  br i1 %180, label %181, label %256

181:                                              ; preds = %178
  %182 = load ptr, ptr %23, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct._RX_PKT, ptr %182, i32 0, i32 3
  %184 = getelementptr inbounds [2048 x i8], ptr %183, i64 0, i64 0
  %185 = load i8, ptr %184, align 1, !tbaa !37
  %186 = zext i8 %185 to i32
  %187 = load ptr, ptr %23, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._RX_PKT, ptr %187, i32 0, i32 3
  %189 = getelementptr inbounds [2048 x i8], ptr %188, i64 0, i64 1
  %190 = load i8, ptr %189, align 1, !tbaa !37
  %191 = zext i8 %190 to i32
  %192 = load ptr, ptr %23, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._RX_PKT, ptr %192, i32 0, i32 3
  %194 = getelementptr inbounds [2048 x i8], ptr %193, i64 0, i64 2
  %195 = load i8, ptr %194, align 1, !tbaa !37
  %196 = zext i8 %195 to i32
  %197 = load ptr, ptr %23, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct._RX_PKT, ptr %197, i32 0, i32 3
  %199 = getelementptr inbounds [2048 x i8], ptr %198, i64 0, i64 3
  %200 = load i8, ptr %199, align 1, !tbaa !37
  %201 = zext i8 %200 to i32
  %202 = load ptr, ptr %23, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct._RX_PKT, ptr %202, i32 0, i32 3
  %204 = getelementptr inbounds [2048 x i8], ptr %203, i64 0, i64 4
  %205 = load i8, ptr %204, align 1, !tbaa !37
  %206 = zext i8 %205 to i32
  %207 = load ptr, ptr %23, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._RX_PKT, ptr %207, i32 0, i32 3
  %209 = getelementptr inbounds [2048 x i8], ptr %208, i64 0, i64 5
  %210 = load i8, ptr %209, align 1, !tbaa !37
  %211 = zext i8 %210 to i32
  %212 = load ptr, ptr %23, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct._RX_PKT, ptr %212, i32 0, i32 3
  %214 = getelementptr inbounds [2048 x i8], ptr %213, i64 0, i64 6
  %215 = load i8, ptr %214, align 1, !tbaa !37
  %216 = zext i8 %215 to i32
  %217 = load ptr, ptr %23, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._RX_PKT, ptr %217, i32 0, i32 3
  %219 = getelementptr inbounds [2048 x i8], ptr %218, i64 0, i64 7
  %220 = load i8, ptr %219, align 1, !tbaa !37
  %221 = zext i8 %220 to i32
  %222 = load ptr, ptr %23, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._RX_PKT, ptr %222, i32 0, i32 3
  %224 = getelementptr inbounds [2048 x i8], ptr %223, i64 0, i64 8
  %225 = load i8, ptr %224, align 1, !tbaa !37
  %226 = zext i8 %225 to i32
  %227 = load ptr, ptr %23, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct._RX_PKT, ptr %227, i32 0, i32 3
  %229 = getelementptr inbounds [2048 x i8], ptr %228, i64 0, i64 9
  %230 = load i8, ptr %229, align 1, !tbaa !37
  %231 = zext i8 %230 to i32
  %232 = load ptr, ptr %23, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct._RX_PKT, ptr %232, i32 0, i32 3
  %234 = getelementptr inbounds [2048 x i8], ptr %233, i64 0, i64 10
  %235 = load i8, ptr %234, align 1, !tbaa !37
  %236 = zext i8 %235 to i32
  %237 = load ptr, ptr %23, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct._RX_PKT, ptr %237, i32 0, i32 3
  %239 = getelementptr inbounds [2048 x i8], ptr %238, i64 0, i64 11
  %240 = load i8, ptr %239, align 1, !tbaa !37
  %241 = zext i8 %240 to i32
  %242 = load ptr, ptr %23, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct._RX_PKT, ptr %242, i32 0, i32 3
  %244 = getelementptr inbounds [2048 x i8], ptr %243, i64 0, i64 12
  %245 = load i8, ptr %244, align 1, !tbaa !37
  %246 = zext i8 %245 to i32
  %247 = load ptr, ptr %23, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct._RX_PKT, ptr %247, i32 0, i32 3
  %249 = getelementptr inbounds [2048 x i8], ptr %248, i64 0, i64 13
  %250 = load i8, ptr %249, align 1, !tbaa !37
  %251 = zext i8 %250 to i32
  %252 = load ptr, ptr %23, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct._RX_PKT, ptr %252, i32 0, i32 2
  %254 = load i16, ptr %253, align 1, !tbaa !36
  %255 = zext i16 %254 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.11, i32 noundef %186, i32 noundef %191, i32 noundef %196, i32 noundef %201, i32 noundef %206, i32 noundef %211, i32 noundef %216, i32 noundef %221, i32 noundef %226, i32 noundef %231, i32 noundef %236, i32 noundef %241, i32 noundef %246, i32 noundef %251, i32 noundef %255)
  br label %256

256:                                              ; preds = %181, %178
  br label %257

257:                                              ; preds = %256
  br label %258

258:                                              ; preds = %257
  br label %259

259:                                              ; preds = %258, %174
  br label %260

260:                                              ; preds = %259
  br label %261

261:                                              ; preds = %260
  %262 = load ptr, ptr %9, align 8, !tbaa !5
  %263 = icmp ne ptr null, %262
  br i1 %263, label %264, label %266

264:                                              ; preds = %261
  %265 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 14, ptr %265, align 8, !tbaa !14
  br label %266

266:                                              ; preds = %264, %261
  %267 = load ptr, ptr %13, align 8, !tbaa !5
  %268 = icmp ne ptr null, %267
  br i1 %268, label %269, label %274

269:                                              ; preds = %266
  %270 = load ptr, ptr %13, align 8, !tbaa !5
  %271 = load ptr, ptr %24, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.ETHERNET_HEADER, ptr %271, i32 0, i32 0
  %273 = call ptr @CopyMem(ptr noundef %270, ptr noundef %272, i64 noundef 6)
  br label %274

274:                                              ; preds = %269, %266
  %275 = load ptr, ptr %12, align 8, !tbaa !5
  %276 = icmp ne ptr null, %275
  br i1 %276, label %277, label %282

277:                                              ; preds = %274
  %278 = load ptr, ptr %12, align 8, !tbaa !5
  %279 = load ptr, ptr %24, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.ETHERNET_HEADER, ptr %279, i32 0, i32 1
  %281 = call ptr @CopyMem(ptr noundef %278, ptr noundef %280, i64 noundef 6)
  br label %282

282:                                              ; preds = %277, %274
  %283 = load ptr, ptr %14, align 8, !tbaa !5
  %284 = icmp ne ptr null, %283
  br i1 %284, label %285, label %299

285:                                              ; preds = %282
  %286 = load ptr, ptr %24, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.ETHERNET_HEADER, ptr %286, i32 0, i32 2
  %288 = load i16, ptr %287, align 1, !tbaa !38
  store i16 %288, ptr %19, align 2, !tbaa !40
  %289 = load i16, ptr %19, align 2, !tbaa !40
  %290 = zext i16 %289 to i32
  %291 = ashr i32 %290, 8
  %292 = load i16, ptr %19, align 2, !tbaa !40
  %293 = zext i16 %292 to i32
  %294 = shl i32 %293, 8
  %295 = or i32 %291, %294
  %296 = trunc i32 %295 to i16
  store i16 %296, ptr %19, align 2, !tbaa !40
  %297 = load i16, ptr %19, align 2, !tbaa !40
  %298 = load ptr, ptr %14, align 8, !tbaa !5
  store i16 %297, ptr %298, align 2, !tbaa !40
  br label %299

299:                                              ; preds = %285, %282
  store i64 0, ptr %17, align 8, !tbaa !14
  %300 = load ptr, ptr %10, align 8, !tbaa !5
  %301 = load i64, ptr %300, align 8, !tbaa !14
  %302 = load ptr, ptr %23, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct._RX_PKT, ptr %302, i32 0, i32 2
  %304 = load i16, ptr %303, align 1, !tbaa !36
  %305 = zext i16 %304 to i64
  %306 = icmp ult i64 %301, %305
  br i1 %306, label %307, label %322

307:                                              ; preds = %299
  br label %308

308:                                              ; preds = %307
  %309 = call zeroext i8 @DebugPrintEnabled()
  %310 = icmp ne i8 %309, 0
  br i1 %310, label %311, label %319

311:                                              ; preds = %308
  br label %312

312:                                              ; preds = %311
  %313 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %314 = icmp ne i8 %313, 0
  br i1 %314, label %315, label %316

315:                                              ; preds = %312
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.12)
  br label %316

316:                                              ; preds = %315, %312
  br label %317

317:                                              ; preds = %316
  br label %318

318:                                              ; preds = %317
  br label %319

319:                                              ; preds = %318, %308
  br label %320

320:                                              ; preds = %319
  br label %321

321:                                              ; preds = %320
  store i64 -9223372036854775803, ptr %17, align 8, !tbaa !14
  br label %322

322:                                              ; preds = %321, %299
  %323 = load ptr, ptr %23, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct._RX_PKT, ptr %323, i32 0, i32 2
  %325 = load i16, ptr %324, align 1, !tbaa !36
  %326 = zext i16 %325 to i64
  %327 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 %326, ptr %327, align 8, !tbaa !14
  %328 = load ptr, ptr %23, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct._RX_PKT, ptr %328, i32 0, i32 1
  store i8 0, ptr %329, align 1, !tbaa !34
  %330 = load ptr, ptr %23, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct._RX_PKT, ptr %330, i32 0, i32 0
  %332 = load ptr, ptr %331, align 1, !tbaa !41
  %333 = load ptr, ptr %16, align 8, !tbaa !5
  %334 = getelementptr inbounds %struct.NIC_DEVICE, ptr %333, i32 0, i32 25
  store ptr %332, ptr %334, align 8, !tbaa !33
  %335 = load ptr, ptr %16, align 8, !tbaa !5
  %336 = getelementptr inbounds %struct.NIC_DEVICE, ptr %335, i32 0, i32 26
  %337 = load i64, ptr %336, align 8, !tbaa !27
  %338 = add i64 %337, -1
  store i64 %338, ptr %336, align 8, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  br label %344

339:                                              ; preds = %150
  %340 = load ptr, ptr %16, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.NIC_DEVICE, ptr %340, i32 0, i32 13
  %342 = load i64, ptr %341, align 8, !tbaa !23
  %343 = add i64 %342, 1
  store i64 %343, ptr %341, align 8, !tbaa !23
  store i64 -9223372036854775802, ptr %17, align 8, !tbaa !14
  br label %344

344:                                              ; preds = %339, %322
  br label %350

345:                                              ; preds = %85, %69
  %346 = load ptr, ptr %16, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct.NIC_DEVICE, ptr %346, i32 0, i32 13
  %348 = load i64, ptr %347, align 8, !tbaa !23
  %349 = add i64 %348, 1
  store i64 %349, ptr %347, align 8, !tbaa !23
  store i64 -9223372036854775802, ptr %17, align 8, !tbaa !14
  br label %350

350:                                              ; preds = %345, %344
  br label %359

351:                                              ; preds = %42
  %352 = load ptr, ptr %15, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %352, i32 0, i32 0
  %354 = load i32, ptr %353, align 4, !tbaa !17
  %355 = icmp eq i32 1, %354
  br i1 %355, label %356, label %357

356:                                              ; preds = %351
  store i64 -9223372036854775801, ptr %17, align 8, !tbaa !14
  br label %358

357:                                              ; preds = %351
  store i64 -9223372036854775789, ptr %17, align 8, !tbaa !14
  br label %358

358:                                              ; preds = %357, %356
  br label %359

359:                                              ; preds = %358, %350
  br label %361

360:                                              ; preds = %39, %36, %31, %7
  store i64 -9223372036854775806, ptr %17, align 8, !tbaa !14
  br label %361

361:                                              ; preds = %360, %359
  %362 = load ptr, ptr @gBS, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %362, i32 0, i32 2
  %364 = load ptr, ptr %363, align 8, !tbaa !42
  %365 = load i64, ptr %18, align 8, !tbaa !14
  call void %364(i64 noundef %365)
  %366 = load i64, ptr %17, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  ret i64 %366
}

declare ptr @SetMem(ptr noundef, i64 noundef, i8 noundef zeroext) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"", !11, 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}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !12, i64 0}
!15 = !{!16, !6, i64 120}
!16 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !12, 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}
!17 = !{!18, !13, i64 0}
!18 = !{!"", !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, !19, i64 552, !19, i64 584, !19, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!19 = !{!"", !7, i64 0}
!20 = !{!21, !12, i64 0}
!21 = !{!"", !12, i64 0, !6, i64 8, !6, i64 16, !16, i64 24, !16, i64 152, !18, i64 280, !7, i64 936, !6, i64 944, !22, i64 952, !7, i64 954, !7, i64 955, !7, i64 956, !7, i64 957, !12, i64 960, !12, i64 968, !22, i64 976, !6, i64 984, !6, i64 992, !7, i64 1000, !19, i64 1008, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !12, i64 1088, !6, i64 1096}
!22 = !{!"short", !7, i64 0}
!23 = !{!21, !12, i64 960}
!24 = !{!21, !7, i64 957}
!25 = !{!18, !7, i64 652}
!26 = !{!21, !7, i64 955}
!27 = !{!21, !12, i64 1088}
!28 = !{!21, !6, i64 1096}
!29 = !{!21, !6, i64 16}
!30 = !{!31, !6, i64 8}
!31 = !{!"_EFI_USB_IO_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!32 = !{!13, !13, i64 0}
!33 = !{!21, !6, i64 1080}
!34 = !{!35, !7, i64 8}
!35 = !{!"_RX_PKT", !6, i64 0, !7, i64 8, !22, i64 9, !7, i64 11}
!36 = !{!35, !22, i64 9}
!37 = !{!7, !7, i64 0}
!38 = !{!39, !22, i64 12}
!39 = !{!"", !7, i64 0, !7, i64 6, !22, i64 12}
!40 = !{!22, !22, i64 0}
!41 = !{!35, !6, i64 0}
!42 = !{!10, !6, i64 32}


; 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 [161 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external local_unnamed_addr global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

; 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
declare dso_local void @FillPkt2Queue(ptr noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @SN_Receive(ptr noundef %0, ptr noundef writeonly %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef writeonly %6) local_unnamed_addr #2 {
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %10 = load ptr, ptr @gBS, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = tail call i64 %12(i64 noundef 8) #4
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %157, label %14

14:                                               ; preds = %7
  %15 = getelementptr inbounds i8, ptr %0, i64 120
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = icmp ne ptr %16, null
  %18 = icmp ne ptr %2, null
  %or.cond = and i1 %18, %17
  %19 = icmp ne ptr %3, null
  %or.cond3 = and i1 %19, %or.cond
  br i1 %or.cond3, label %20, label %157

20:                                               ; preds = %14
  %21 = load i32, ptr %16, align 4, !tbaa !16
  switch i32 %21, label %156 [
    i32 2, label %22
    i32 1, label %157
  ]

22:                                               ; preds = %20
  %23 = tail call zeroext i8 @DebugAssertEnabled() #4
  %.not90 = icmp eq i8 %23, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre105 = add i64 %.pre, -24
  %.pre107 = inttoptr i64 %.pre105 to ptr
  br i1 %.not90, label %._crit_edge, label %24

24:                                               ; preds = %22
  %25 = load i64, ptr %.pre107, align 8, !tbaa !19
  %.not91 = icmp eq i64 %25, 943216705
  br i1 %.not91, label %._crit_edge, label %26

26:                                               ; preds = %24
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 500, ptr noundef nonnull @.str.1) #4
  br label %._crit_edge

._crit_edge:                                      ; preds = %22, %24, %26
  %27 = phi ptr [ %0, %26 ], [ %.pre107, %24 ], [ %.pre107, %22 ]
  %28 = getelementptr inbounds i8, ptr %27, i64 960
  %29 = load i64, ptr %28, align 8, !tbaa !22
  %30 = add i64 %29, 1
  store i64 %30, ptr %28, align 8, !tbaa !22
  %31 = getelementptr inbounds i8, ptr %27, i64 957
  %32 = load i8, ptr %31, align 1, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %16, i64 652
  store i8 %32, ptr %33, align 4, !tbaa !24
  %.not92 = icmp eq i8 %32, 0
  br i1 %.not92, label %154, label %34

34:                                               ; preds = %._crit_edge
  %35 = getelementptr inbounds i8, ptr %27, i64 955
  %36 = load i8, ptr %35, align 1, !tbaa !25
  %.not93 = icmp eq i8 %36, 0
  br i1 %.not93, label %154, label %37

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %27, i64 1088
  %39 = load i64, ptr %38, align 8, !tbaa !26
  %.not94 = icmp eq i64 %39, 0
  br i1 %.not94, label %.thread, label %40

.thread:                                          ; preds = %37
  store i64 16384, ptr %8, align 8, !tbaa !27
  br label %48

40:                                               ; preds = %37
  %41 = tail call zeroext i8 @DebugPrintEnabled() #4
  %.not95 = icmp eq i8 %41, 0
  br i1 %.not95, label %46, label %42

42:                                               ; preds = %40
  %43 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #4
  %.not96 = icmp eq i8 %43, 0
  br i1 %.not96, label %46, label %44

44:                                               ; preds = %42
  %45 = load i64, ptr %38, align 8, !tbaa !26
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef nonnull @.str.10, i64 noundef %45) #4
  br label %46

46:                                               ; preds = %40, %44, %42
  %.pr = load i64, ptr %38, align 8, !tbaa !26
  store i64 16384, ptr %8, align 8, !tbaa !27
  %47 = icmp eq i64 %.pr, 0
  br i1 %47, label %48, label %62

48:                                               ; preds = %.thread, %46
  %49 = getelementptr inbounds i8, ptr %27, i64 1096
  %50 = load ptr, ptr %49, align 8, !tbaa !28
  %51 = tail call ptr @SetMem(ptr noundef %50, i64 noundef 4, i8 noundef zeroext 0) #4
  %52 = getelementptr inbounds i8, ptr %27, i64 16
  %53 = load ptr, ptr %52, align 8, !tbaa !29
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  %55 = load ptr, ptr %54, align 8, !tbaa !30
  %56 = load ptr, ptr %49, align 8, !tbaa !28
  %57 = call i64 %55(ptr noundef %53, i8 noundef zeroext -126, ptr noundef %56, ptr noundef nonnull %8, i64 noundef 20, ptr noundef nonnull %9) #4
  %58 = load i64, ptr %8, align 8, !tbaa !27
  %59 = icmp eq i64 %58, 0
  %60 = icmp slt i64 %57, 0
  %or.cond5 = select i1 %59, i1 true, i1 %60
  br i1 %or.cond5, label %62, label %61

61:                                               ; preds = %48
  call void @FillPkt2Queue(ptr noundef nonnull %0, i64 noundef %58)
  br label %62

62:                                               ; preds = %48, %61, %46
  %63 = getelementptr inbounds i8, ptr %27, i64 1080
  %64 = load ptr, ptr %63, align 8, !tbaa !32
  %65 = getelementptr inbounds i8, ptr %64, i64 8
  %66 = load i8, ptr %65, align 1, !tbaa !33
  %67 = icmp eq i8 %66, 1
  br i1 %67, label %68, label %151

68:                                               ; preds = %62
  store i64 0, ptr %28, align 8, !tbaa !22
  %69 = getelementptr inbounds i8, ptr %64, i64 11
  %70 = getelementptr inbounds i8, ptr %64, i64 9
  %71 = load i16, ptr %70, align 1, !tbaa !35
  %72 = zext i16 %71 to i64
  %73 = call ptr @CopyMem(ptr noundef nonnull %3, ptr noundef nonnull %69, i64 noundef %72) #4
  %74 = call zeroext i8 @DebugPrintEnabled() #4
  %.not97 = icmp eq i8 %74, 0
  br i1 %.not97, label %121, label %75

75:                                               ; preds = %68
  %76 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #4
  %.not98 = icmp eq i8 %76, 0
  br i1 %.not98, label %121, label %77

77:                                               ; preds = %75
  %78 = load i8, ptr %69, align 1, !tbaa !36
  %79 = zext i8 %78 to i32
  %80 = getelementptr inbounds i8, ptr %64, i64 12
  %81 = load i8, ptr %80, align 1, !tbaa !36
  %82 = zext i8 %81 to i32
  %83 = getelementptr inbounds i8, ptr %64, i64 13
  %84 = load i8, ptr %83, align 1, !tbaa !36
  %85 = zext i8 %84 to i32
  %86 = getelementptr inbounds i8, ptr %64, i64 14
  %87 = load i8, ptr %86, align 1, !tbaa !36
  %88 = zext i8 %87 to i32
  %89 = getelementptr inbounds i8, ptr %64, i64 15
  %90 = load i8, ptr %89, align 1, !tbaa !36
  %91 = zext i8 %90 to i32
  %92 = getelementptr inbounds i8, ptr %64, i64 16
  %93 = load i8, ptr %92, align 1, !tbaa !36
  %94 = zext i8 %93 to i32
  %95 = getelementptr inbounds i8, ptr %64, i64 17
  %96 = load i8, ptr %95, align 1, !tbaa !36
  %97 = zext i8 %96 to i32
  %98 = getelementptr inbounds i8, ptr %64, i64 18
  %99 = load i8, ptr %98, align 1, !tbaa !36
  %100 = zext i8 %99 to i32
  %101 = getelementptr inbounds i8, ptr %64, i64 19
  %102 = load i8, ptr %101, align 1, !tbaa !36
  %103 = zext i8 %102 to i32
  %104 = getelementptr inbounds i8, ptr %64, i64 20
  %105 = load i8, ptr %104, align 1, !tbaa !36
  %106 = zext i8 %105 to i32
  %107 = getelementptr inbounds i8, ptr %64, i64 21
  %108 = load i8, ptr %107, align 1, !tbaa !36
  %109 = zext i8 %108 to i32
  %110 = getelementptr inbounds i8, ptr %64, i64 22
  %111 = load i8, ptr %110, align 1, !tbaa !36
  %112 = zext i8 %111 to i32
  %113 = getelementptr inbounds i8, ptr %64, i64 23
  %114 = load i8, ptr %113, align 1, !tbaa !36
  %115 = zext i8 %114 to i32
  %116 = getelementptr inbounds i8, ptr %64, i64 24
  %117 = load i8, ptr %116, align 1, !tbaa !36
  %118 = zext i8 %117 to i32
  %119 = load i16, ptr %70, align 1, !tbaa !35
  %120 = zext i16 %119 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef nonnull @.str.11, i32 noundef %79, i32 noundef %82, i32 noundef %85, i32 noundef %88, i32 noundef %91, i32 noundef %94, i32 noundef %97, i32 noundef %100, i32 noundef %103, i32 noundef %106, i32 noundef %109, i32 noundef %112, i32 noundef %115, i32 noundef %118, i32 noundef %120) #4
  br label %121

121:                                              ; preds = %75, %77, %68
  %.not99 = icmp eq ptr %1, null
  br i1 %.not99, label %123, label %122

122:                                              ; preds = %121
  store i64 14, ptr %1, align 8, !tbaa !27
  br label %123

123:                                              ; preds = %122, %121
  %.not100 = icmp eq ptr %5, null
  br i1 %.not100, label %126, label %124

124:                                              ; preds = %123
  %125 = call ptr @CopyMem(ptr noundef nonnull %5, ptr noundef nonnull %69, i64 noundef 6) #4
  br label %126

126:                                              ; preds = %124, %123
  %.not101 = icmp eq ptr %4, null
  br i1 %.not101, label %130, label %127

127:                                              ; preds = %126
  %128 = getelementptr inbounds i8, ptr %64, i64 17
  %129 = call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %128, i64 noundef 6) #4
  br label %130

130:                                              ; preds = %127, %126
  %.not102 = icmp eq ptr %6, null
  br i1 %.not102, label %135, label %131

131:                                              ; preds = %130
  %132 = getelementptr inbounds i8, ptr %64, i64 23
  %133 = load i16, ptr %132, align 1, !tbaa !37
  %134 = call i16 @llvm.bswap.i16(i16 %133)
  store i16 %134, ptr %6, align 2, !tbaa !39
  br label %135

135:                                              ; preds = %131, %130
  %136 = load i64, ptr %2, align 8, !tbaa !27
  %137 = load i16, ptr %70, align 1, !tbaa !35
  %138 = zext i16 %137 to i64
  %139 = icmp ult i64 %136, %138
  br i1 %139, label %140, label %145

140:                                              ; preds = %135
  %141 = call zeroext i8 @DebugPrintEnabled() #4
  %.not103 = icmp eq i8 %141, 0
  br i1 %.not103, label %145, label %142

142:                                              ; preds = %140
  %143 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #4
  %.not104 = icmp eq i8 %143, 0
  br i1 %.not104, label %145, label %144

144:                                              ; preds = %142
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.12) #4
  br label %145

145:                                              ; preds = %140, %144, %142, %135
  %.0 = phi i64 [ 0, %135 ], [ -9223372036854775803, %142 ], [ -9223372036854775803, %144 ], [ -9223372036854775803, %140 ]
  %146 = load i16, ptr %70, align 1, !tbaa !35
  %147 = zext i16 %146 to i64
  store i64 %147, ptr %2, align 8, !tbaa !27
  store i8 0, ptr %65, align 1, !tbaa !33
  %148 = load ptr, ptr %64, align 1, !tbaa !40
  store ptr %148, ptr %63, align 8, !tbaa !32
  %149 = load i64, ptr %38, align 8, !tbaa !26
  %150 = add i64 %149, -1
  store i64 %150, ptr %38, align 8, !tbaa !26
  br label %157

151:                                              ; preds = %62
  %152 = load i64, ptr %28, align 8, !tbaa !22
  %153 = add i64 %152, 1
  store i64 %153, ptr %28, align 8, !tbaa !22
  br label %157

154:                                              ; preds = %34, %._crit_edge
  %155 = add i64 %29, 2
  store i64 %155, ptr %28, align 8, !tbaa !22
  br label %157

156:                                              ; preds = %20
  br label %157

157:                                              ; preds = %7, %14, %20, %145, %151, %154, %156
  %.1 = phi i64 [ %.0, %145 ], [ -9223372036854775802, %151 ], [ -9223372036854775802, %154 ], [ -9223372036854775789, %156 ], [ -9223372036854775801, %20 ], [ -9223372036854775806, %14 ], [ -9223372036854775806, %7 ]
  %158 = load ptr, ptr @gBS, align 8, !tbaa !5
  %159 = getelementptr inbounds i8, ptr %158, i64 32
  %160 = load ptr, ptr %159, align 8, !tbaa !41
  call void %160(i64 noundef %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  ret i64 %.1
}

declare ptr @SetMem(ptr noundef, i64 noundef, i8 noundef zeroext) local_unnamed_addr #1

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !6, i64 24}
!10 = !{!"", !11, 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}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 120}
!15 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !12, 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 = !{!17, !13, i64 0}
!17 = !{!"", !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, !18, i64 552, !18, i64 584, !18, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!18 = !{!"", !7, i64 0}
!19 = !{!20, !12, i64 0}
!20 = !{!"", !12, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !15, i64 152, !17, i64 280, !7, i64 936, !6, i64 944, !21, i64 952, !7, i64 954, !7, i64 955, !7, i64 956, !7, i64 957, !12, i64 960, !12, i64 968, !21, i64 976, !6, i64 984, !6, i64 992, !7, i64 1000, !18, i64 1008, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !12, i64 1088, !6, i64 1096}
!21 = !{!"short", !7, i64 0}
!22 = !{!20, !12, i64 960}
!23 = !{!20, !7, i64 957}
!24 = !{!17, !7, i64 652}
!25 = !{!20, !7, i64 955}
!26 = !{!20, !12, i64 1088}
!27 = !{!12, !12, i64 0}
!28 = !{!20, !6, i64 1096}
!29 = !{!20, !6, i64 16}
!30 = !{!31, !6, i64 8}
!31 = !{!"_EFI_USB_IO_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!32 = !{!20, !6, i64 1080}
!33 = !{!34, !7, i64 8}
!34 = !{!"_RX_PKT", !6, i64 0, !7, i64 8, !21, i64 9, !7, i64 11}
!35 = !{!34, !21, i64 9}
!36 = !{!7, !7, i64 0}
!37 = !{!38, !21, i64 12}
!38 = !{!"", !7, i64 0, !7, i64 6, !21, i64 12}
!39 = !{!21, !21, i64 0}
!40 = !{!34, !6, i64 0}
!41 = !{!10, !6, i64 32}


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