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

; 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._RX_TX_PACKET = type <{ ptr, i16, i16, [2048 x i8] }>
%struct.ETHERNET_HEADER = type { [6 x i8], [6 x i8], i16 }
%struct._EFI_USB_IO_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.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.18 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [43 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 i64 @SN_Reset(ptr noundef, i8 noundef zeroext) #2

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

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

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

35:                                               ; preds = %30
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = icmp ne ptr null, %36
  br i1 %37, label %38, label %441

38:                                               ; preds = %35
  %39 = load i64, ptr %9, align 8, !tbaa !9
  %40 = icmp eq i64 %39, 0
  br i1 %40, label %47, label %41

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

44:                                               ; preds = %41
  %45 = load ptr, ptr %14, align 8, !tbaa !5
  %46 = icmp ne ptr null, %45
  br i1 %46, label %47, label %441

47:                                               ; preds = %44, %38
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %48, i32 0, i32 15
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  store ptr %50, ptr %16, align 8, !tbaa !5
  %51 = load i64, ptr %9, align 8, !tbaa !9
  %52 = icmp eq i64 %51, 0
  br i1 %52, label %60, label %53

53:                                               ; preds = %47
  %54 = load i64, ptr %9, align 8, !tbaa !9
  %55 = load ptr, ptr %16, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %55, i32 0, i32 2
  %57 = load i32, ptr %56, align 4, !tbaa !17
  %58 = zext i32 %57 to i64
  %59 = icmp eq i64 %54, %58
  br i1 %59, label %60, label %439

60:                                               ; preds = %53, %47
  %61 = load i64, ptr %10, align 8, !tbaa !9
  %62 = load ptr, ptr %16, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %62, i32 0, i32 2
  %64 = load i32, ptr %63, align 4, !tbaa !17
  %65 = zext i32 %64 to i64
  %66 = icmp uge i64 %61, %65
  br i1 %66, label %67, label %437

67:                                               ; preds = %60
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 4, !tbaa !20
  %71 = icmp eq i32 2, %70
  br i1 %71, label %72, label %428

72:                                               ; preds = %67
  %73 = call zeroext i8 @DebugAssertEnabled()
  %74 = zext i8 %73 to i32
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %86

76:                                               ; preds = %72
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = ptrtoint ptr %77 to i64
  %79 = sub i64 %78, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %80 = inttoptr i64 %79 to ptr
  %81 = getelementptr inbounds %struct.NIC_DEVICE, ptr %80, i32 0, i32 0
  %82 = load i64, ptr %81, align 8, !tbaa !21
  %83 = icmp ne i64 %82, 943216705
  br i1 %83, label %84, label %86

84:                                               ; preds = %76
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1531, ptr noundef @.str.1)
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  br label %91

86:                                               ; preds = %76, %72
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = ptrtoint ptr %87 to i64
  %89 = sub i64 %88, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %90 = inttoptr i64 %89 to ptr
  br label %91

91:                                               ; preds = %86, %84
  %92 = phi ptr [ %85, %84 ], [ %90, %86 ]
  store ptr %92, ptr %17, align 8, !tbaa !5
  %93 = load ptr, ptr %17, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.NIC_DEVICE, ptr %93, i32 0, i32 12
  %95 = load i8, ptr %94, align 1, !tbaa !24
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %96, i32 0, i32 18
  store i8 %95, ptr %97, align 4, !tbaa !25
  %98 = load ptr, ptr %16, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %98, i32 0, i32 18
  %100 = load i8, ptr %99, align 4, !tbaa !25
  %101 = zext i8 %100 to i32
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %426

103:                                              ; preds = %91
  %104 = load ptr, ptr %17, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.NIC_DEVICE, ptr %104, i32 0, i32 10
  %106 = load i8, ptr %105, align 1, !tbaa !26
  %107 = zext i8 %106 to i32
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %426

109:                                              ; preds = %103
  %110 = load ptr, ptr %17, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.NIC_DEVICE, ptr %110, i32 0, i32 17
  %112 = load ptr, ptr %111, align 8, !tbaa !27
  %113 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %112, i32 0, i32 3
  %114 = getelementptr inbounds [2048 x i8], ptr %113, i64 0, i64 0
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = load i64, ptr %10, align 8, !tbaa !9
  %117 = call ptr @CopyMem(ptr noundef %114, ptr noundef %115, i64 noundef %116)
  %118 = load i64, ptr %10, align 8, !tbaa !9
  %119 = trunc i64 %118 to i16
  %120 = load ptr, ptr %17, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.NIC_DEVICE, ptr %120, i32 0, i32 17
  %122 = load ptr, ptr %121, align 8, !tbaa !27
  %123 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %122, i32 0, i32 1
  store i16 %119, ptr %123, align 1, !tbaa !28
  %124 = load ptr, ptr %17, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.NIC_DEVICE, ptr %124, i32 0, i32 17
  %126 = load ptr, ptr %125, align 8, !tbaa !27
  %127 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %126, i32 0, i32 3
  %128 = getelementptr inbounds [2048 x i8], ptr %127, i64 0, i64 0
  store ptr %128, ptr %15, align 8, !tbaa !5
  %129 = load i64, ptr %9, align 8, !tbaa !9
  %130 = icmp ne i64 0, %129
  br i1 %130, label %131, label %179

131:                                              ; preds = %109
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = icmp ne ptr null, %132
  br i1 %133, label %134, label %139

134:                                              ; preds = %131
  %135 = load ptr, ptr %15, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ETHERNET_HEADER, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  %138 = call ptr @CopyMem(ptr noundef %136, ptr noundef %137, i64 noundef 6)
  br label %139

139:                                              ; preds = %134, %131
  %140 = load ptr, ptr %12, align 8, !tbaa !5
  %141 = icmp ne ptr null, %140
  br i1 %141, label %142, label %147

142:                                              ; preds = %139
  %143 = load ptr, ptr %15, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.ETHERNET_HEADER, ptr %143, i32 0, i32 1
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  %146 = call ptr @CopyMem(ptr noundef %144, ptr noundef %145, i64 noundef 6)
  br label %155

147:                                              ; preds = %139
  %148 = load ptr, ptr %15, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.ETHERNET_HEADER, ptr %148, i32 0, i32 1
  %150 = load ptr, ptr %16, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %150, i32 0, i32 11
  %152 = getelementptr inbounds %struct.EFI_MAC_ADDRESS, ptr %151, i32 0, i32 0
  %153 = getelementptr inbounds [32 x i8], ptr %152, i64 0, i64 0
  %154 = call ptr @CopyMem(ptr noundef %149, ptr noundef %153, i64 noundef 6)
  br label %155

155:                                              ; preds = %147, %142
  %156 = load ptr, ptr %14, align 8, !tbaa !5
  %157 = icmp ne ptr null, %156
  br i1 %157, label %158, label %161

158:                                              ; preds = %155
  %159 = load ptr, ptr %14, align 8, !tbaa !5
  %160 = load i16, ptr %159, align 2, !tbaa !30
  store i16 %160, ptr %22, align 2, !tbaa !30
  br label %167

161:                                              ; preds = %155
  %162 = load ptr, ptr %17, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.NIC_DEVICE, ptr %162, i32 0, i32 17
  %164 = load ptr, ptr %163, align 8, !tbaa !27
  %165 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %164, i32 0, i32 1
  %166 = load i16, ptr %165, align 1, !tbaa !28
  store i16 %166, ptr %22, align 2, !tbaa !30
  br label %167

167:                                              ; preds = %161, %158
  %168 = load i16, ptr %22, align 2, !tbaa !30
  %169 = zext i16 %168 to i32
  %170 = ashr i32 %169, 8
  %171 = load i16, ptr %22, align 2, !tbaa !30
  %172 = zext i16 %171 to i32
  %173 = shl i32 %172, 8
  %174 = or i32 %170, %173
  %175 = trunc i32 %174 to i16
  store i16 %175, ptr %22, align 2, !tbaa !30
  %176 = load i16, ptr %22, align 2, !tbaa !30
  %177 = load ptr, ptr %15, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.ETHERNET_HEADER, ptr %177, i32 0, i32 2
  store i16 %176, ptr %178, align 1, !tbaa !31
  br label %179

179:                                              ; preds = %167, %109
  %180 = load ptr, ptr %17, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.NIC_DEVICE, ptr %180, i32 0, i32 17
  %182 = load ptr, ptr %181, align 8, !tbaa !27
  %183 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %182, i32 0, i32 1
  %184 = load i16, ptr %183, align 1, !tbaa !28
  %185 = zext i16 %184 to i32
  %186 = icmp slt i32 %185, 60
  br i1 %186, label %187, label %207

187:                                              ; preds = %179
  %188 = load ptr, ptr %17, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.NIC_DEVICE, ptr %188, i32 0, i32 17
  %190 = load ptr, ptr %189, align 8, !tbaa !27
  %191 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %190, i32 0, i32 1
  store i16 60, ptr %191, align 1, !tbaa !28
  %192 = load ptr, ptr %17, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.NIC_DEVICE, ptr %192, i32 0, i32 17
  %194 = load ptr, ptr %193, align 8, !tbaa !27
  %195 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %194, i32 0, i32 3
  %196 = load i64, ptr %10, align 8, !tbaa !9
  %197 = getelementptr inbounds [2048 x i8], ptr %195, i64 0, i64 %196
  %198 = load ptr, ptr %17, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.NIC_DEVICE, ptr %198, i32 0, i32 17
  %200 = load ptr, ptr %199, align 8, !tbaa !27
  %201 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %200, i32 0, i32 1
  %202 = load i16, ptr %201, align 1, !tbaa !28
  %203 = zext i16 %202 to i64
  %204 = load i64, ptr %10, align 8, !tbaa !9
  %205 = sub i64 %203, %204
  %206 = call ptr @ZeroMem(ptr noundef %197, i64 noundef %205)
  br label %207

207:                                              ; preds = %187, %179
  br label %208

208:                                              ; preds = %207
  %209 = call zeroext i8 @DebugPrintEnabled()
  %210 = icmp ne i8 %209, 0
  br i1 %210, label %211, label %323

211:                                              ; preds = %208
  br label %212

212:                                              ; preds = %211
  %213 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %214 = icmp ne i8 %213, 0
  br i1 %214, label %215, label %320

215:                                              ; preds = %212
  %216 = load ptr, ptr %17, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.NIC_DEVICE, ptr %216, i32 0, i32 17
  %218 = load ptr, ptr %217, align 8, !tbaa !27
  %219 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %218, i32 0, i32 3
  %220 = getelementptr inbounds [2048 x i8], ptr %219, i64 0, i64 0
  %221 = load i8, ptr %220, align 1, !tbaa !33
  %222 = zext i8 %221 to i32
  %223 = load ptr, ptr %17, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.NIC_DEVICE, ptr %223, i32 0, i32 17
  %225 = load ptr, ptr %224, align 8, !tbaa !27
  %226 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %225, i32 0, i32 3
  %227 = getelementptr inbounds [2048 x i8], ptr %226, i64 0, i64 1
  %228 = load i8, ptr %227, align 1, !tbaa !33
  %229 = zext i8 %228 to i32
  %230 = load ptr, ptr %17, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.NIC_DEVICE, ptr %230, i32 0, i32 17
  %232 = load ptr, ptr %231, align 8, !tbaa !27
  %233 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %232, i32 0, i32 3
  %234 = getelementptr inbounds [2048 x i8], ptr %233, i64 0, i64 2
  %235 = load i8, ptr %234, align 1, !tbaa !33
  %236 = zext i8 %235 to i32
  %237 = load ptr, ptr %17, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.NIC_DEVICE, ptr %237, i32 0, i32 17
  %239 = load ptr, ptr %238, align 8, !tbaa !27
  %240 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %239, i32 0, i32 3
  %241 = getelementptr inbounds [2048 x i8], ptr %240, i64 0, i64 3
  %242 = load i8, ptr %241, align 1, !tbaa !33
  %243 = zext i8 %242 to i32
  %244 = load ptr, ptr %17, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.NIC_DEVICE, ptr %244, i32 0, i32 17
  %246 = load ptr, ptr %245, align 8, !tbaa !27
  %247 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %246, i32 0, i32 3
  %248 = getelementptr inbounds [2048 x i8], ptr %247, i64 0, i64 4
  %249 = load i8, ptr %248, align 1, !tbaa !33
  %250 = zext i8 %249 to i32
  %251 = load ptr, ptr %17, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.NIC_DEVICE, ptr %251, i32 0, i32 17
  %253 = load ptr, ptr %252, align 8, !tbaa !27
  %254 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %253, i32 0, i32 3
  %255 = getelementptr inbounds [2048 x i8], ptr %254, i64 0, i64 5
  %256 = load i8, ptr %255, align 1, !tbaa !33
  %257 = zext i8 %256 to i32
  %258 = load ptr, ptr %17, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.NIC_DEVICE, ptr %258, i32 0, i32 17
  %260 = load ptr, ptr %259, align 8, !tbaa !27
  %261 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %260, i32 0, i32 3
  %262 = getelementptr inbounds [2048 x i8], ptr %261, i64 0, i64 6
  %263 = load i8, ptr %262, align 1, !tbaa !33
  %264 = zext i8 %263 to i32
  %265 = load ptr, ptr %17, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.NIC_DEVICE, ptr %265, i32 0, i32 17
  %267 = load ptr, ptr %266, align 8, !tbaa !27
  %268 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %267, i32 0, i32 3
  %269 = getelementptr inbounds [2048 x i8], ptr %268, i64 0, i64 7
  %270 = load i8, ptr %269, align 1, !tbaa !33
  %271 = zext i8 %270 to i32
  %272 = load ptr, ptr %17, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.NIC_DEVICE, ptr %272, i32 0, i32 17
  %274 = load ptr, ptr %273, align 8, !tbaa !27
  %275 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %274, i32 0, i32 3
  %276 = getelementptr inbounds [2048 x i8], ptr %275, i64 0, i64 8
  %277 = load i8, ptr %276, align 1, !tbaa !33
  %278 = zext i8 %277 to i32
  %279 = load ptr, ptr %17, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.NIC_DEVICE, ptr %279, i32 0, i32 17
  %281 = load ptr, ptr %280, align 8, !tbaa !27
  %282 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %281, i32 0, i32 3
  %283 = getelementptr inbounds [2048 x i8], ptr %282, i64 0, i64 9
  %284 = load i8, ptr %283, align 1, !tbaa !33
  %285 = zext i8 %284 to i32
  %286 = load ptr, ptr %17, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.NIC_DEVICE, ptr %286, i32 0, i32 17
  %288 = load ptr, ptr %287, align 8, !tbaa !27
  %289 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %288, i32 0, i32 3
  %290 = getelementptr inbounds [2048 x i8], ptr %289, i64 0, i64 10
  %291 = load i8, ptr %290, align 1, !tbaa !33
  %292 = zext i8 %291 to i32
  %293 = load ptr, ptr %17, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.NIC_DEVICE, ptr %293, i32 0, i32 17
  %295 = load ptr, ptr %294, align 8, !tbaa !27
  %296 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %295, i32 0, i32 3
  %297 = getelementptr inbounds [2048 x i8], ptr %296, i64 0, i64 11
  %298 = load i8, ptr %297, align 1, !tbaa !33
  %299 = zext i8 %298 to i32
  %300 = load ptr, ptr %17, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.NIC_DEVICE, ptr %300, i32 0, i32 17
  %302 = load ptr, ptr %301, align 8, !tbaa !27
  %303 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %302, i32 0, i32 3
  %304 = getelementptr inbounds [2048 x i8], ptr %303, i64 0, i64 12
  %305 = load i8, ptr %304, align 1, !tbaa !33
  %306 = zext i8 %305 to i32
  %307 = load ptr, ptr %17, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.NIC_DEVICE, ptr %307, i32 0, i32 17
  %309 = load ptr, ptr %308, align 8, !tbaa !27
  %310 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %309, i32 0, i32 3
  %311 = getelementptr inbounds [2048 x i8], ptr %310, i64 0, i64 13
  %312 = load i8, ptr %311, align 1, !tbaa !33
  %313 = zext i8 %312 to i32
  %314 = load ptr, ptr %17, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.NIC_DEVICE, ptr %314, i32 0, i32 17
  %316 = load ptr, ptr %315, align 8, !tbaa !27
  %317 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %316, i32 0, i32 1
  %318 = load i16, ptr %317, align 1, !tbaa !28
  %319 = zext i16 %318 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.18, i32 noundef %222, i32 noundef %229, i32 noundef %236, i32 noundef %243, i32 noundef %250, i32 noundef %257, i32 noundef %264, i32 noundef %271, i32 noundef %278, i32 noundef %285, i32 noundef %292, i32 noundef %299, i32 noundef %306, i32 noundef %313, i32 noundef %319)
  br label %320

320:                                              ; preds = %215, %212
  br label %321

321:                                              ; preds = %320
  br label %322

322:                                              ; preds = %321
  br label %323

323:                                              ; preds = %322, %208
  br label %324

324:                                              ; preds = %323
  br label %325

325:                                              ; preds = %324
  %326 = load ptr, ptr %17, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.NIC_DEVICE, ptr %326, i32 0, i32 17
  %328 = load ptr, ptr %327, align 8, !tbaa !27
  %329 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %328, i32 0, i32 1
  %330 = load i16, ptr %329, align 1, !tbaa !28
  %331 = zext i16 %330 to i32
  %332 = xor i32 %331, -1
  %333 = trunc i32 %332 to i16
  %334 = load ptr, ptr %17, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.NIC_DEVICE, ptr %334, i32 0, i32 17
  %336 = load ptr, ptr %335, align 8, !tbaa !27
  %337 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %336, i32 0, i32 2
  store i16 %333, ptr %337, align 1, !tbaa !34
  %338 = load ptr, ptr %17, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.NIC_DEVICE, ptr %338, i32 0, i32 17
  %340 = load ptr, ptr %339, align 8, !tbaa !27
  %341 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %340, i32 0, i32 1
  %342 = load i16, ptr %341, align 1, !tbaa !28
  %343 = zext i16 %342 to i64
  %344 = add i64 4, %343
  store i64 %344, ptr %20, align 8, !tbaa !9
  %345 = load i64, ptr %20, align 8, !tbaa !9
  %346 = urem i64 %345, 512
  %347 = icmp eq i64 %346, 0
  br i1 %347, label %352, label %348

348:                                              ; preds = %325
  %349 = load i64, ptr %20, align 8, !tbaa !9
  %350 = urem i64 %349, 1024
  %351 = icmp eq i64 %350, 0
  br i1 %351, label %352, label %355

352:                                              ; preds = %348, %325
  %353 = load i64, ptr %20, align 8, !tbaa !9
  %354 = add i64 %353, 4
  store i64 %354, ptr %20, align 8, !tbaa !9
  br label %355

355:                                              ; preds = %352, %348
  %356 = load ptr, ptr %17, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct.NIC_DEVICE, ptr %356, i32 0, i32 2
  %358 = load ptr, ptr %357, align 8, !tbaa !35
  store ptr %358, ptr %18, align 8, !tbaa !5
  %359 = load ptr, ptr %18, align 8, !tbaa !5
  %360 = getelementptr inbounds %struct._EFI_USB_IO_PROTOCOL, ptr %359, i32 0, i32 1
  %361 = load ptr, ptr %360, align 8, !tbaa !36
  %362 = load ptr, ptr %18, align 8, !tbaa !5
  %363 = load ptr, ptr %17, align 8, !tbaa !5
  %364 = getelementptr inbounds %struct.NIC_DEVICE, ptr %363, i32 0, i32 17
  %365 = load ptr, ptr %364, align 8, !tbaa !27
  %366 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %365, i32 0, i32 1
  %367 = call i64 %361(ptr noundef %362, i8 noundef zeroext 3, ptr noundef %366, ptr noundef %20, i64 noundef 4294967294, ptr noundef %21)
  store i64 %367, ptr %19, align 8, !tbaa !9
  %368 = load i64, ptr %19, align 8, !tbaa !9
  %369 = icmp slt i64 %368, 0
  br i1 %369, label %373, label %370

370:                                              ; preds = %355
  %371 = load i32, ptr %21, align 4, !tbaa !38
  %372 = zext i32 %371 to i64
  store i64 %372, ptr %19, align 8, !tbaa !9
  br label %373

373:                                              ; preds = %370, %355
  %374 = load i64, ptr %19, align 8, !tbaa !9
  %375 = icmp slt i64 %374, 0
  br i1 %375, label %380, label %376

376:                                              ; preds = %373
  %377 = load ptr, ptr %11, align 8, !tbaa !5
  %378 = load ptr, ptr %17, align 8, !tbaa !5
  %379 = getelementptr inbounds %struct.NIC_DEVICE, ptr %378, i32 0, i32 7
  store ptr %377, ptr %379, align 8, !tbaa !39
  br label %425

380:                                              ; preds = %373
  %381 = load i64, ptr %20, align 8, !tbaa !9
  %382 = load ptr, ptr %17, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.NIC_DEVICE, ptr %382, i32 0, i32 17
  %384 = load ptr, ptr %383, align 8, !tbaa !27
  %385 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %384, i32 0, i32 1
  %386 = load i16, ptr %385, align 1, !tbaa !28
  %387 = zext i16 %386 to i32
  %388 = add nsw i32 %387, 4
  %389 = sext i32 %388 to i64
  %390 = icmp ne i64 %381, %389
  br i1 %390, label %391, label %418

391:                                              ; preds = %380
  %392 = load i64, ptr %20, align 8, !tbaa !9
  %393 = load ptr, ptr %17, align 8, !tbaa !5
  %394 = getelementptr inbounds %struct.NIC_DEVICE, ptr %393, i32 0, i32 17
  %395 = load ptr, ptr %394, align 8, !tbaa !27
  %396 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %395, i32 0, i32 1
  %397 = load i16, ptr %396, align 1, !tbaa !28
  %398 = zext i16 %397 to i32
  %399 = add nsw i32 %398, 4
  %400 = add nsw i32 %399, 4
  %401 = sext i32 %400 to i64
  %402 = icmp ne i64 %392, %401
  br i1 %402, label %403, label %418

403:                                              ; preds = %391
  br label %404

404:                                              ; preds = %403
  %405 = call zeroext i8 @DebugPrintEnabled()
  %406 = icmp ne i8 %405, 0
  br i1 %406, label %407, label %415

407:                                              ; preds = %404
  br label %408

408:                                              ; preds = %407
  %409 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64)
  %410 = icmp ne i8 %409, 0
  br i1 %410, label %411, label %412

411:                                              ; preds = %408
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef @.str.19)
  br label %412

412:                                              ; preds = %411, %408
  br label %413

413:                                              ; preds = %412
  br label %414

414:                                              ; preds = %413
  br label %415

415:                                              ; preds = %414, %404
  br label %416

416:                                              ; preds = %415
  br label %417

417:                                              ; preds = %416
  br label %418

418:                                              ; preds = %417, %391, %380
  %419 = load i64, ptr %19, align 8, !tbaa !9
  %420 = icmp eq i64 -9223372036854775801, %419
  br i1 %420, label %421, label %424

421:                                              ; preds = %418
  %422 = load ptr, ptr %8, align 8, !tbaa !5
  %423 = call i64 @SN_Reset(ptr noundef %422, i8 noundef zeroext 0)
  br label %424

424:                                              ; preds = %421, %418
  store i64 -9223372036854775802, ptr %19, align 8, !tbaa !9
  br label %425

425:                                              ; preds = %424, %376
  br label %427

426:                                              ; preds = %103, %91
  store i64 -9223372036854775802, ptr %19, align 8, !tbaa !9
  br label %427

427:                                              ; preds = %426, %425
  br label %436

428:                                              ; preds = %67
  %429 = load ptr, ptr %16, align 8, !tbaa !5
  %430 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %429, i32 0, i32 0
  %431 = load i32, ptr %430, align 4, !tbaa !20
  %432 = icmp eq i32 1, %431
  br i1 %432, label %433, label %434

433:                                              ; preds = %428
  store i64 -9223372036854775801, ptr %19, align 8, !tbaa !9
  br label %435

434:                                              ; preds = %428
  store i64 -9223372036854775789, ptr %19, align 8, !tbaa !9
  br label %435

435:                                              ; preds = %434, %433
  br label %436

436:                                              ; preds = %435, %427
  br label %438

437:                                              ; preds = %60
  store i64 -9223372036854775803, ptr %19, align 8, !tbaa !9
  br label %438

438:                                              ; preds = %437, %436
  br label %440

439:                                              ; preds = %53
  store i64 -9223372036854775806, ptr %19, align 8, !tbaa !9
  br label %440

440:                                              ; preds = %439, %438
  br label %442

441:                                              ; preds = %44, %41, %35, %30, %7
  store i64 -9223372036854775806, ptr %19, align 8, !tbaa !9
  br label %442

442:                                              ; preds = %441, %440
  %443 = load ptr, ptr @gBS, align 8, !tbaa !5
  %444 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %443, i32 0, i32 2
  %445 = load ptr, ptr %444, align 8, !tbaa !40
  %446 = load i64, ptr %23, align 8, !tbaa !9
  call void %445(i64 noundef %446)
  %447 = load i64, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, 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 %447
}

declare ptr @ZeroMem(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, !6, i64 24}
!12 = !{!"", !13, 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}
!13 = !{!"", !10, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !6, i64 120}
!16 = !{!"_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}
!17 = !{!18, !14, i64 8}
!18 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, 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 = !{!18, !14, i64 0}
!21 = !{!22, !10, i64 0}
!22 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !16, i64 24, !16, i64 152, !18, i64 280, !7, i64 936, !6, i64 944, !23, i64 952, !7, i64 954, !7, i64 955, !7, i64 956, !7, i64 957, !10, i64 960, !10, i64 968, !23, 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, !10, i64 1088, !6, i64 1096}
!23 = !{!"short", !7, i64 0}
!24 = !{!22, !7, i64 957}
!25 = !{!18, !7, i64 652}
!26 = !{!22, !7, i64 955}
!27 = !{!22, !6, i64 992}
!28 = !{!29, !23, i64 8}
!29 = !{!"_RX_TX_PACKET", !6, i64 0, !23, i64 8, !23, i64 10, !7, i64 12}
!30 = !{!23, !23, i64 0}
!31 = !{!32, !23, i64 12}
!32 = !{!"", !7, i64 0, !7, i64 6, !23, i64 12}
!33 = !{!7, !7, i64 0}
!34 = !{!29, !23, i64 10}
!35 = !{!22, !6, i64 16}
!36 = !{!37, !6, i64 8}
!37 = !{!"_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}
!38 = !{!14, !14, i64 0}
!39 = !{!22, !6, i64 944}
!40 = !{!12, !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.18 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [43 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 i64 @SN_Reset(ptr noundef, i8 noundef zeroext) 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 0, -9223372036854775788) i64 @SN_Transmit(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef readonly %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 %164, 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 %3, null
  %or.cond = and i1 %18, %17
  br i1 %or.cond, label %19, label %164

19:                                               ; preds = %14
  %20 = icmp eq i64 %1, 0
  br i1 %20, label %..thread_crit_edge, label %21

..thread_crit_edge:                               ; preds = %19
  %.phi.trans.insert = getelementptr inbounds i8, ptr %16, i64 8
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !16
  %.pre116 = zext i32 %.pre to i64
  br label %.thread

21:                                               ; preds = %19
  %22 = icmp ne ptr %5, null
  %23 = icmp ne ptr %6, null
  %or.cond3 = and i1 %22, %23
  br i1 %or.cond3, label %24, label %164

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %16, i64 8
  %26 = load i32, ptr %25, align 4, !tbaa !16
  %27 = zext i32 %26 to i64
  %28 = icmp eq i64 %27, %1
  br i1 %28, label %.thread, label %164

.thread:                                          ; preds = %..thread_crit_edge, %24
  %.pre-phi = phi i64 [ %.pre116, %..thread_crit_edge ], [ %27, %24 ]
  %.not94 = icmp ugt i64 %.pre-phi, %2
  br i1 %.not94, label %164, label %29

29:                                               ; preds = %.thread
  %30 = load i32, ptr %16, align 4, !tbaa !19
  switch i32 %30, label %163 [
    i32 2, label %31
    i32 1, label %164
  ]

31:                                               ; preds = %29
  %32 = tail call zeroext i8 @DebugAssertEnabled() #4
  %.not95 = icmp eq i8 %32, 0
  %.pre117 = ptrtoint ptr %0 to i64
  %.pre119 = add i64 %.pre117, -24
  %.pre121 = inttoptr i64 %.pre119 to ptr
  br i1 %.not95, label %._crit_edge, label %33

33:                                               ; preds = %31
  %34 = load i64, ptr %.pre121, align 8, !tbaa !20
  %.not96 = icmp eq i64 %34, 943216705
  br i1 %.not96, label %._crit_edge, label %35

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

._crit_edge:                                      ; preds = %31, %33, %35
  %36 = phi ptr [ %0, %35 ], [ %.pre121, %33 ], [ %.pre121, %31 ]
  %37 = getelementptr inbounds i8, ptr %36, i64 957
  %38 = load i8, ptr %37, align 1, !tbaa !23
  %39 = getelementptr inbounds i8, ptr %16, i64 652
  store i8 %38, ptr %39, align 4, !tbaa !24
  %.not97 = icmp eq i8 %38, 0
  br i1 %.not97, label %164, label %40

40:                                               ; preds = %._crit_edge
  %41 = getelementptr inbounds i8, ptr %36, i64 955
  %42 = load i8, ptr %41, align 1, !tbaa !25
  %.not98 = icmp eq i8 %42, 0
  br i1 %.not98, label %164, label %43

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %36, i64 992
  %45 = load ptr, ptr %44, align 8, !tbaa !26
  %46 = getelementptr inbounds i8, ptr %45, i64 12
  %47 = tail call ptr @CopyMem(ptr noundef nonnull %46, ptr noundef nonnull %3, i64 noundef %2) #4
  %48 = trunc i64 %2 to i16
  %49 = load ptr, ptr %44, align 8, !tbaa !26
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  store i16 %48, ptr %50, align 1, !tbaa !27
  %51 = getelementptr inbounds i8, ptr %49, i64 12
  br i1 %20, label %62, label %52

52:                                               ; preds = %43
  %.not100 = icmp eq ptr %5, null
  br i1 %.not100, label %55, label %53

53:                                               ; preds = %52
  %54 = tail call ptr @CopyMem(ptr noundef nonnull %51, ptr noundef nonnull %5, i64 noundef 6) #4
  br label %55

55:                                               ; preds = %53, %52
  %.not101 = icmp eq ptr %4, null
  %56 = getelementptr inbounds i8, ptr %49, i64 18
  %57 = getelementptr inbounds i8, ptr %16, i64 552
  %.sink = select i1 %.not101, ptr %57, ptr %4
  %58 = tail call ptr @CopyMem(ptr noundef nonnull %56, ptr noundef nonnull %.sink, i64 noundef 6) #4
  %.not102 = icmp eq ptr %6, null
  %.pre113.pre = load ptr, ptr %44, align 8, !tbaa !26
  %59 = getelementptr inbounds i8, ptr %.pre113.pre, i64 8
  %.083.in = select i1 %.not102, ptr %59, ptr %6
  %.083 = load i16, ptr %.083.in, align 1, !tbaa !29
  %60 = tail call i16 @llvm.bswap.i16(i16 %.083)
  %61 = getelementptr inbounds i8, ptr %49, i64 24
  store i16 %60, ptr %61, align 1, !tbaa !30
  %.phi.trans.insert114 = getelementptr inbounds i8, ptr %.pre113.pre, i64 8
  %.pre115 = load i16, ptr %.phi.trans.insert114, align 1, !tbaa !27
  br label %62

62:                                               ; preds = %55, %43
  %63 = phi i16 [ %.pre115, %55 ], [ %48, %43 ]
  %64 = phi ptr [ %.pre113.pre, %55 ], [ %49, %43 ]
  %65 = icmp ult i16 %63, 60
  br i1 %65, label %66, label %72

66:                                               ; preds = %62
  %67 = getelementptr inbounds i8, ptr %64, i64 8
  store i16 60, ptr %67, align 1, !tbaa !27
  %68 = getelementptr inbounds i8, ptr %64, i64 12
  %69 = getelementptr inbounds [2048 x i8], ptr %68, i64 0, i64 %2
  %70 = sub i64 60, %2
  %71 = tail call ptr @ZeroMem(ptr noundef nonnull %69, i64 noundef %70) #4
  br label %72

72:                                               ; preds = %62, %66
  %73 = tail call zeroext i8 @DebugPrintEnabled() #4
  %.not103 = icmp eq i8 %73, 0
  br i1 %.not103, label %123, label %74

74:                                               ; preds = %72
  %75 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #4
  %.not104 = icmp eq i8 %75, 0
  br i1 %.not104, label %123, label %76

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

123:                                              ; preds = %74, %76, %72
  %124 = load ptr, ptr %44, align 8, !tbaa !26
  %125 = getelementptr inbounds i8, ptr %124, i64 8
  %126 = load i16, ptr %125, align 1, !tbaa !27
  %127 = xor i16 %126, -1
  %128 = getelementptr inbounds i8, ptr %124, i64 10
  store i16 %127, ptr %128, align 1, !tbaa !33
  %129 = zext i16 %126 to i64
  %130 = add nuw nsw i64 %129, 4
  %131 = and i64 %130, 511
  %132 = icmp eq i64 %131, 0
  %133 = add nuw nsw i64 %129, 8
  %spec.select = select i1 %132, i64 %133, i64 %130
  store i64 %spec.select, ptr %8, align 8, !tbaa !34
  %134 = getelementptr inbounds i8, ptr %36, i64 16
  %135 = load ptr, ptr %134, align 8, !tbaa !35
  %136 = getelementptr inbounds i8, ptr %135, i64 8
  %137 = load ptr, ptr %136, align 8, !tbaa !36
  %138 = call i64 %137(ptr noundef %135, i8 noundef zeroext 3, ptr noundef nonnull %125, ptr noundef nonnull %8, i64 noundef 4294967294, ptr noundef nonnull %9) #4
  %139 = icmp slt i64 %138, 0
  br i1 %139, label %144, label %140

140:                                              ; preds = %123
  %141 = load i32, ptr %9, align 4
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %36, i64 944
  store ptr %3, ptr %143, align 8, !tbaa !38
  br label %164

144:                                              ; preds = %123
  %145 = load i64, ptr %8, align 8, !tbaa !34
  %146 = load ptr, ptr %44, align 8, !tbaa !26
  %147 = getelementptr inbounds i8, ptr %146, i64 8
  %148 = load i16, ptr %147, align 1, !tbaa !27
  %149 = zext i16 %148 to i32
  %150 = add nuw nsw i32 %149, 4
  %151 = zext nneg i32 %150 to i64
  %.not105 = icmp eq i64 %145, %151
  %152 = add nuw nsw i32 %149, 8
  %153 = zext nneg i32 %152 to i64
  %.not106 = icmp eq i64 %145, %153
  %or.cond112 = select i1 %.not105, i1 true, i1 %.not106
  br i1 %or.cond112, label %159, label %154

154:                                              ; preds = %144
  %155 = call zeroext i8 @DebugPrintEnabled() #4
  %.not107 = icmp eq i8 %155, 0
  br i1 %.not107, label %159, label %156

156:                                              ; preds = %154
  %157 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 64) #4
  %.not108 = icmp eq i8 %157, 0
  br i1 %.not108, label %159, label %158

158:                                              ; preds = %156
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 64, ptr noundef nonnull @.str.19) #4
  br label %159

159:                                              ; preds = %154, %158, %156, %144
  %160 = icmp eq i64 %138, -9223372036854775801
  br i1 %160, label %161, label %164

161:                                              ; preds = %159
  %162 = call i64 @SN_Reset(ptr noundef nonnull %0, i8 noundef zeroext 0)
  br label %164

163:                                              ; preds = %29
  br label %164

164:                                              ; preds = %7, %14, %21, %24, %.thread, %29, %._crit_edge, %40, %159, %161, %140, %163
  %.1 = phi i64 [ %142, %140 ], [ -9223372036854775789, %163 ], [ -9223372036854775802, %161 ], [ -9223372036854775802, %159 ], [ -9223372036854775802, %40 ], [ -9223372036854775802, %._crit_edge ], [ -9223372036854775801, %29 ], [ -9223372036854775803, %.thread ], [ -9223372036854775806, %24 ], [ -9223372036854775806, %21 ], [ -9223372036854775806, %14 ], [ -9223372036854775806, %7 ]
  %165 = load ptr, ptr @gBS, align 8, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %165, i64 32
  %167 = load ptr, ptr %166, align 8, !tbaa !39
  call void %167(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 @ZeroMem(ptr noundef, i64 noundef) 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 8}
!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 = !{!17, !13, i64 0}
!20 = !{!21, !12, i64 0}
!21 = !{!"", !12, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !15, i64 152, !17, 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, !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}
!22 = !{!"short", !7, i64 0}
!23 = !{!21, !7, i64 957}
!24 = !{!17, !7, i64 652}
!25 = !{!21, !7, i64 955}
!26 = !{!21, !6, i64 992}
!27 = !{!28, !22, i64 8}
!28 = !{!"_RX_TX_PACKET", !6, i64 0, !22, i64 8, !22, i64 10, !7, i64 12}
!29 = !{!22, !22, i64 0}
!30 = !{!31, !22, i64 12}
!31 = !{!"", !7, i64 0, !7, i64 6, !22, i64 12}
!32 = !{!7, !7, i64 0}
!33 = !{!28, !22, i64 10}
!34 = !{!12, !12, i64 0}
!35 = !{!21, !6, i64 16}
!36 = !{!37, !6, i64 8}
!37 = !{!"_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}
!38 = !{!21, !6, i64 944}
!39 = !{!10, !6, i64 32}


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