; 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._RX_TX_PACKET = type { ptr, i16, i16, [2044 x i8] }
%struct._EFI_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct.NIC_DEVICE = type { i64, ptr, ptr, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, i8, ptr, i16, i8, i8, i8, i8, i8, ptr, i64, ptr, ptr, ptr, [2 x i32], ptr }
%struct.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 [160 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@gBS = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [162 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 %struct._RX_TX_PACKET, align 1
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i16, align 2
  %25 = 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 2056, 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 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %24) #3
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = icmp ne ptr null, %26
  br i1 %27, label %28, label %339

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

33:                                               ; preds = %28
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._EFI_SIMPLE_NETWORK_PROTOCOL, ptr %34, i32 0, i32 15
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  store ptr %36, ptr %17, align 8, !tbaa !5
  %37 = load ptr, ptr %17, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 4, !tbaa !13
  %40 = icmp eq i32 2, %39
  br i1 %40, label %41, label %337

41:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %42 = load ptr, ptr @gBS, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  %45 = call i64 %44(i64 noundef 31)
  store i64 %45, ptr %25, align 8, !tbaa !9
  %46 = load ptr, ptr @gBS, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %46, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !20
  %49 = load i64, ptr %25, align 8, !tbaa !9
  call void %48(i64 noundef %49)
  %50 = load i64, ptr %25, align 8, !tbaa !9
  %51 = icmp ugt i64 %50, 8
  br i1 %51, label %52, label %79

52:                                               ; preds = %41
  br label %53

53:                                               ; preds = %52
  %54 = call zeroext i8 @DebugPrintEnabled()
  %55 = icmp ne i8 %54, 0
  br i1 %55, label %56, label %65

56:                                               ; preds = %53
  br label %57

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

60:                                               ; preds = %57
  %61 = load i64, ptr %25, align 8, !tbaa !9
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.2, i64 noundef %61, i32 noundef 8)
  br label %62

62:                                               ; preds = %60, %57
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64, %53
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  %69 = call zeroext i8 @DebugAssertEnabled()
  %70 = icmp ne i8 %69, 0
  br i1 %70, label %71, label %76

71:                                               ; preds = %68
  %72 = load i64, ptr %25, align 8, !tbaa !9
  %73 = icmp ule i64 %72, 8
  br i1 %73, label %75, label %74

74:                                               ; preds = %71
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1365, ptr noundef @.str.3)
  br label %75

75:                                               ; preds = %74, %71
  br label %76

76:                                               ; preds = %75, %68
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  %80 = load ptr, ptr @gBS, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %80, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !17
  %83 = call i64 %82(i64 noundef 8)
  store i64 %83, ptr %21, align 8, !tbaa !9
  %84 = call zeroext i8 @DebugAssertEnabled()
  %85 = zext i8 %84 to i32
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %97

87:                                               ; preds = %79
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = ptrtoint ptr %88 to i64
  %90 = sub i64 %89, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %91 = inttoptr i64 %90 to ptr
  %92 = getelementptr inbounds %struct.NIC_DEVICE, ptr %91, i32 0, i32 0
  %93 = load i64, ptr %92, align 8, !tbaa !21
  %94 = icmp ne i64 %93, 943216705
  br i1 %94, label %95, label %97

95:                                               ; preds = %87
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1371, ptr noundef @.str.1)
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  br label %102

97:                                               ; preds = %87, %79
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = ptrtoint ptr %98 to i64
  %100 = sub i64 %99, ptrtoint (ptr getelementptr inbounds (%struct.NIC_DEVICE, ptr null, i32 0, i32 3) to i64)
  %101 = inttoptr i64 %100 to ptr
  br label %102

102:                                              ; preds = %97, %95
  %103 = phi ptr [ %96, %95 ], [ %101, %97 ]
  store ptr %103, ptr %18, align 8, !tbaa !5
  %104 = load ptr, ptr %18, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.NIC_DEVICE, ptr %104, i32 0, i32 11
  %106 = load i8, ptr %105, align 1, !tbaa !24
  %107 = load ptr, ptr %17, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %107, i32 0, i32 18
  store i8 %106, ptr %108, align 4, !tbaa !25
  %109 = load ptr, ptr @gBS, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %109, i32 0, i32 2
  %111 = load ptr, ptr %110, align 8, !tbaa !20
  %112 = load i64, ptr %21, align 8, !tbaa !9
  call void %111(i64 noundef %112)
  %113 = load ptr, ptr %17, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %113, i32 0, i32 18
  %115 = load i8, ptr %114, align 4, !tbaa !25
  %116 = icmp ne i8 %115, 0
  br i1 %116, label %117, label %335

117:                                              ; preds = %102
  %118 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %119 = getelementptr inbounds [2044 x i8], ptr %118, i64 0, i64 0
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = load i64, ptr %10, align 8, !tbaa !9
  %122 = call ptr @CopyMem(ptr noundef %119, ptr noundef %120, i64 noundef %121)
  %123 = load i64, ptr %10, align 8, !tbaa !9
  %124 = trunc i64 %123 to i16
  %125 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  store i16 %124, ptr %125, align 1, !tbaa !26
  %126 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %127 = getelementptr inbounds [2044 x i8], ptr %126, i64 0, i64 0
  store ptr %127, ptr %16, align 8, !tbaa !5
  %128 = load i64, ptr %9, align 8, !tbaa !9
  %129 = icmp ne i64 0, %128
  br i1 %129, label %130, label %175

130:                                              ; preds = %117
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = icmp ne ptr null, %131
  br i1 %132, label %133, label %138

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

138:                                              ; preds = %133, %130
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = icmp ne ptr null, %139
  br i1 %140, label %141, label %146

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

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

154:                                              ; preds = %146, %141
  %155 = load ptr, ptr %14, align 8, !tbaa !5
  %156 = icmp ne ptr null, %155
  br i1 %156, label %157, label %160

157:                                              ; preds = %154
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = load i16, ptr %158, align 2, !tbaa !28
  store i16 %159, ptr %24, align 2, !tbaa !28
  br label %163

160:                                              ; preds = %154
  %161 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  %162 = load i16, ptr %161, align 1, !tbaa !26
  store i16 %162, ptr %24, align 2, !tbaa !28
  br label %163

163:                                              ; preds = %160, %157
  %164 = load i16, ptr %24, align 2, !tbaa !28
  %165 = zext i16 %164 to i32
  %166 = ashr i32 %165, 8
  %167 = load i16, ptr %24, align 2, !tbaa !28
  %168 = zext i16 %167 to i32
  %169 = shl i32 %168, 8
  %170 = or i32 %166, %169
  %171 = trunc i32 %170 to i16
  store i16 %171, ptr %24, align 2, !tbaa !28
  %172 = load i16, ptr %24, align 2, !tbaa !28
  %173 = load ptr, ptr %16, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.ETHERNET_HEADER, ptr %173, i32 0, i32 2
  store i16 %172, ptr %174, align 1, !tbaa !29
  br label %175

175:                                              ; preds = %163, %117
  %176 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  %177 = load i16, ptr %176, align 1, !tbaa !26
  %178 = zext i16 %177 to i32
  %179 = icmp slt i32 %178, 60
  br i1 %179, label %180, label %191

180:                                              ; preds = %175
  %181 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  store i16 60, ptr %181, align 1, !tbaa !26
  %182 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %183 = load i64, ptr %10, align 8, !tbaa !9
  %184 = getelementptr inbounds [2044 x i8], ptr %182, i64 0, i64 %183
  %185 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  %186 = load i16, ptr %185, align 1, !tbaa !26
  %187 = zext i16 %186 to i64
  %188 = load i64, ptr %10, align 8, !tbaa !9
  %189 = sub i64 %187, %188
  %190 = call ptr @ZeroMem(ptr noundef %184, i64 noundef %189)
  br label %191

191:                                              ; preds = %180, %175
  br label %192

192:                                              ; preds = %191
  %193 = call zeroext i8 @DebugPrintEnabled()
  %194 = icmp ne i8 %193, 0
  br i1 %194, label %195, label %262

195:                                              ; preds = %192
  br label %196

196:                                              ; preds = %195
  %197 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 33554496)
  %198 = icmp ne i8 %197, 0
  br i1 %198, label %199, label %259

199:                                              ; preds = %196
  %200 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %201 = getelementptr inbounds [2044 x i8], ptr %200, i64 0, i64 0
  %202 = load i8, ptr %201, align 1, !tbaa !31
  %203 = zext i8 %202 to i32
  %204 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %205 = getelementptr inbounds [2044 x i8], ptr %204, i64 0, i64 1
  %206 = load i8, ptr %205, align 1, !tbaa !31
  %207 = zext i8 %206 to i32
  %208 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %209 = getelementptr inbounds [2044 x i8], ptr %208, i64 0, i64 2
  %210 = load i8, ptr %209, align 1, !tbaa !31
  %211 = zext i8 %210 to i32
  %212 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %213 = getelementptr inbounds [2044 x i8], ptr %212, i64 0, i64 3
  %214 = load i8, ptr %213, align 1, !tbaa !31
  %215 = zext i8 %214 to i32
  %216 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %217 = getelementptr inbounds [2044 x i8], ptr %216, i64 0, i64 4
  %218 = load i8, ptr %217, align 1, !tbaa !31
  %219 = zext i8 %218 to i32
  %220 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %221 = getelementptr inbounds [2044 x i8], ptr %220, i64 0, i64 5
  %222 = load i8, ptr %221, align 1, !tbaa !31
  %223 = zext i8 %222 to i32
  %224 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %225 = getelementptr inbounds [2044 x i8], ptr %224, i64 0, i64 6
  %226 = load i8, ptr %225, align 1, !tbaa !31
  %227 = zext i8 %226 to i32
  %228 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %229 = getelementptr inbounds [2044 x i8], ptr %228, i64 0, i64 7
  %230 = load i8, ptr %229, align 1, !tbaa !31
  %231 = zext i8 %230 to i32
  %232 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %233 = getelementptr inbounds [2044 x i8], ptr %232, i64 0, i64 8
  %234 = load i8, ptr %233, align 1, !tbaa !31
  %235 = zext i8 %234 to i32
  %236 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %237 = getelementptr inbounds [2044 x i8], ptr %236, i64 0, i64 9
  %238 = load i8, ptr %237, align 1, !tbaa !31
  %239 = zext i8 %238 to i32
  %240 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %241 = getelementptr inbounds [2044 x i8], ptr %240, i64 0, i64 10
  %242 = load i8, ptr %241, align 1, !tbaa !31
  %243 = zext i8 %242 to i32
  %244 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %245 = getelementptr inbounds [2044 x i8], ptr %244, i64 0, i64 11
  %246 = load i8, ptr %245, align 1, !tbaa !31
  %247 = zext i8 %246 to i32
  %248 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %249 = getelementptr inbounds [2044 x i8], ptr %248, i64 0, i64 12
  %250 = load i8, ptr %249, align 1, !tbaa !31
  %251 = zext i8 %250 to i32
  %252 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 3
  %253 = getelementptr inbounds [2044 x i8], ptr %252, i64 0, i64 13
  %254 = load i8, ptr %253, align 1, !tbaa !31
  %255 = zext i8 %254 to i32
  %256 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  %257 = load i16, ptr %256, align 1, !tbaa !26
  %258 = zext i16 %257 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 33554496, ptr noundef @.str.6, i32 noundef %203, i32 noundef %207, i32 noundef %211, i32 noundef %215, i32 noundef %219, i32 noundef %223, i32 noundef %227, i32 noundef %231, i32 noundef %235, i32 noundef %239, i32 noundef %243, i32 noundef %247, i32 noundef %251, i32 noundef %255, i32 noundef %258)
  br label %259

259:                                              ; preds = %199, %196
  br label %260

260:                                              ; preds = %259
  br label %261

261:                                              ; preds = %260
  br label %262

262:                                              ; preds = %261, %192
  br label %263

263:                                              ; preds = %262
  br label %264

264:                                              ; preds = %263
  %265 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  %266 = load i16, ptr %265, align 1, !tbaa !26
  %267 = zext i16 %266 to i32
  %268 = xor i32 %267, -1
  %269 = trunc i32 %268 to i16
  %270 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 2
  store i16 %269, ptr %270, align 1, !tbaa !32
  %271 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  %272 = load i16, ptr %271, align 1, !tbaa !26
  %273 = zext i16 %272 to i64
  %274 = add i64 4, %273
  store i64 %274, ptr %22, align 8, !tbaa !9
  %275 = load ptr, ptr %18, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.NIC_DEVICE, ptr %275, i32 0, i32 2
  %277 = load ptr, ptr %276, align 8, !tbaa !33
  store ptr %277, ptr %19, align 8, !tbaa !5
  %278 = load ptr, ptr %19, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct._EFI_USB_IO_PROTOCOL, ptr %278, i32 0, i32 1
  %280 = load ptr, ptr %279, align 8, !tbaa !34
  %281 = load ptr, ptr %19, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  %283 = call i64 %280(ptr noundef %281, i8 noundef zeroext 3, ptr noundef %282, ptr noundef %22, i64 noundef 4294967294, ptr noundef %23)
  store i64 %283, ptr %20, align 8, !tbaa !9
  %284 = load i64, ptr %20, align 8, !tbaa !9
  %285 = icmp slt i64 %284, 0
  br i1 %285, label %289, label %286

286:                                              ; preds = %264
  %287 = load i32, ptr %23, align 4, !tbaa !36
  %288 = zext i32 %287 to i64
  store i64 %288, ptr %20, align 8, !tbaa !9
  br label %289

289:                                              ; preds = %286, %264
  %290 = load i64, ptr %20, align 8, !tbaa !9
  %291 = icmp slt i64 %290, 0
  br i1 %291, label %301, label %292

292:                                              ; preds = %289
  %293 = load i64, ptr %22, align 8, !tbaa !9
  %294 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  %295 = load i16, ptr %294, align 1, !tbaa !26
  %296 = zext i16 %295 to i32
  %297 = add nsw i32 %296, 4
  %298 = sext i32 %297 to i64
  %299 = icmp ne i64 %293, %298
  br i1 %299, label %300, label %301

300:                                              ; preds = %292
  store i64 3, ptr %20, align 8, !tbaa !9
  br label %301

301:                                              ; preds = %300, %292, %289
  %302 = load i64, ptr %20, align 8, !tbaa !9
  %303 = icmp eq i64 0, %302
  br i1 %303, label %304, label %308

304:                                              ; preds = %301
  %305 = load ptr, ptr %11, align 8, !tbaa !5
  %306 = load ptr, ptr %18, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.NIC_DEVICE, ptr %306, i32 0, i32 6
  store ptr %305, ptr %307, align 8, !tbaa !37
  br label %334

308:                                              ; preds = %301
  br label %309

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

312:                                              ; preds = %309
  br label %313

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

316:                                              ; preds = %313
  %317 = getelementptr inbounds %struct._RX_TX_PACKET, ptr %15, i32 0, i32 1
  %318 = load i16, ptr %317, align 1, !tbaa !26
  %319 = zext i16 %318 to i64
  %320 = add i64 2, %319
  %321 = load i64, ptr %20, align 8, !tbaa !9
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483712, ptr noundef @.str.7, i64 noundef %320, i64 noundef %321)
  br label %322

322:                                              ; preds = %316, %313
  br label %323

323:                                              ; preds = %322
  br label %324

324:                                              ; preds = %323
  br label %325

325:                                              ; preds = %324, %309
  br label %326

326:                                              ; preds = %325
  br label %327

327:                                              ; preds = %326
  %328 = load i64, ptr %20, align 8, !tbaa !9
  %329 = icmp eq i64 -9223372036854775801, %328
  br i1 %329, label %330, label %333

330:                                              ; preds = %327
  %331 = load ptr, ptr %8, align 8, !tbaa !5
  %332 = call i64 @SN_Reset(ptr noundef %331, i8 noundef zeroext 0)
  br label %333

333:                                              ; preds = %330, %327
  br label %334

334:                                              ; preds = %333, %304
  br label %336

335:                                              ; preds = %102
  store i64 -9223372036854775802, ptr %20, align 8, !tbaa !9
  br label %336

336:                                              ; preds = %335, %334
  br label %338

337:                                              ; preds = %33
  store i64 -9223372036854775789, ptr %20, align 8, !tbaa !9
  br label %338

338:                                              ; preds = %337, %336
  br label %360

339:                                              ; preds = %28, %7
  br label %340

340:                                              ; preds = %339
  %341 = call zeroext i8 @DebugPrintEnabled()
  %342 = icmp ne i8 %341, 0
  br i1 %342, label %343, label %357

343:                                              ; preds = %340
  br label %344

344:                                              ; preds = %343
  %345 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483712)
  %346 = icmp ne i8 %345, 0
  br i1 %346, label %347, label %354

347:                                              ; preds = %344
  %348 = load i64, ptr %9, align 8, !tbaa !9
  %349 = load i64, ptr %10, align 8, !tbaa !9
  %350 = load ptr, ptr %11, align 8, !tbaa !5
  %351 = load ptr, ptr %12, align 8, !tbaa !5
  %352 = load ptr, ptr %13, align 8, !tbaa !5
  %353 = load ptr, ptr %14, align 8, !tbaa !5
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483712, ptr noundef @.str.8, i64 noundef %348, i64 noundef %349, ptr noundef %350, ptr noundef %351, ptr noundef %352, ptr noundef %353)
  br label %354

354:                                              ; preds = %347, %344
  br label %355

355:                                              ; preds = %354
  br label %356

356:                                              ; preds = %355
  br label %357

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

358:                                              ; preds = %357
  br label %359

359:                                              ; preds = %358
  store i64 -9223372036854775806, ptr %20, align 8, !tbaa !9
  br label %360

360:                                              ; preds = %359, %338
  %361 = load i64, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, 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 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 2056, ptr %15) #3
  ret i64 %361
}

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 120}
!12 = !{!"_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}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !7, i64 40, !16, i64 552, !16, i64 584, !16, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!15 = !{!"int", !7, i64 0}
!16 = !{!"", !7, i64 0}
!17 = !{!18, !6, i64 24}
!18 = !{!"", !19, 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}
!19 = !{!"", !10, i64 0, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!20 = !{!18, !6, i64 32}
!21 = !{!22, !10, i64 0}
!22 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !14, i64 152, !7, i64 808, !6, i64 816, !23, i64 824, !7, i64 826, !7, i64 827, !7, i64 828, !7, i64 829, !7, i64 830, !6, i64 832, !10, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !7, i64 872, !6, i64 880}
!23 = !{!"short", !7, i64 0}
!24 = !{!22, !7, i64 829}
!25 = !{!14, !7, i64 652}
!26 = !{!27, !23, i64 8}
!27 = !{!"_RX_TX_PACKET", !6, i64 0, !23, i64 8, !23, i64 10, !7, i64 12}
!28 = !{!23, !23, i64 0}
!29 = !{!30, !23, i64 12}
!30 = !{!"", !7, i64 0, !7, i64 6, !23, i64 12}
!31 = !{!7, !7, i64 0}
!32 = !{!27, !23, i64 10}
!33 = !{!22, !6, i64 16}
!34 = !{!35, !6, i64 8}
!35 = !{!"_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}
!36 = !{!15, !15, i64 0}
!37 = !{!22, !6, i64 816}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._RX_TX_PACKET = type { ptr, i16, i16, [2044 x i8] }

@.str = external hidden unnamed_addr constant [160 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.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [162 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 -9223372036854775808, 4294967296) i64 @SN_Transmit(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #2 {
  %8 = alloca %struct._RX_TX_PACKET, align 1
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 2056, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %159, label %11

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %0, i64 120
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %.not61 = icmp eq ptr %13, null
  br i1 %.not61, label %159, label %14

14:                                               ; preds = %11
  %15 = load i32, ptr %13, align 4, !tbaa !11
  %16 = icmp eq i32 %15, 2
  br i1 %16, label %17, label %164

17:                                               ; preds = %14
  %18 = load ptr, ptr @gBS, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %18, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !16
  %21 = tail call i64 %20(i64 noundef 31) #4
  %22 = load ptr, ptr @gBS, align 8, !tbaa !15
  %23 = getelementptr inbounds i8, ptr %22, i64 32
  %24 = load ptr, ptr %23, align 8, !tbaa !19
  tail call void %24(i64 noundef %21) #4
  %25 = icmp ugt i64 %21, 8
  br i1 %25, label %26, label %35

26:                                               ; preds = %17
  %27 = tail call zeroext i8 @DebugPrintEnabled() #4
  %.not64 = icmp eq i8 %27, 0
  br i1 %.not64, label %31, label %28

28:                                               ; preds = %26
  %29 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #4
  %.not65 = icmp eq i8 %29, 0
  br i1 %.not65, label %31, label %30

30:                                               ; preds = %28
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.2, i64 noundef %21, i32 noundef 8) #4
  br label %31

31:                                               ; preds = %26, %30, %28
  %32 = tail call zeroext i8 @DebugAssertEnabled() #4
  %33 = icmp eq i8 %32, 0
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1365, ptr noundef nonnull @.str.3) #4
  br label %35

35:                                               ; preds = %31, %34, %17
  %36 = load ptr, ptr @gBS, align 8, !tbaa !15
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  %39 = tail call i64 %38(i64 noundef 8) #4
  %40 = tail call zeroext i8 @DebugAssertEnabled() #4
  %.not66 = icmp eq i8 %40, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre81 = add i64 %.pre, -24
  %.pre83 = inttoptr i64 %.pre81 to ptr
  br i1 %.not66, label %._crit_edge, label %41

41:                                               ; preds = %35
  %42 = load i64, ptr %.pre83, align 8, !tbaa !20
  %.not67 = icmp eq i64 %42, 943216705
  br i1 %.not67, label %._crit_edge, label %43

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

._crit_edge:                                      ; preds = %35, %41, %43
  %44 = phi ptr [ %0, %43 ], [ %.pre83, %41 ], [ %.pre83, %35 ]
  %45 = getelementptr inbounds i8, ptr %44, i64 829
  %46 = load i8, ptr %45, align 1, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %13, i64 652
  store i8 %46, ptr %47, align 4, !tbaa !24
  %48 = load ptr, ptr @gBS, align 8, !tbaa !15
  %49 = getelementptr inbounds i8, ptr %48, i64 32
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  tail call void %50(i64 noundef %39) #4
  %51 = load i8, ptr %47, align 4, !tbaa !24
  %.not68 = icmp eq i8 %51, 0
  br i1 %.not68, label %164, label %52

52:                                               ; preds = %._crit_edge
  %53 = getelementptr inbounds i8, ptr %8, i64 12
  %54 = call ptr @CopyMem(ptr noundef nonnull %53, ptr noundef %3, i64 noundef %2) #4
  %55 = trunc i64 %2 to i16
  %56 = getelementptr inbounds i8, ptr %8, i64 8
  store i16 %55, ptr %56, align 1, !tbaa !25
  %.not69 = icmp eq i64 %1, 0
  br i1 %.not69, label %71, label %57

57:                                               ; preds = %52
  %.not70 = icmp eq ptr %5, null
  br i1 %.not70, label %60, label %58

58:                                               ; preds = %57
  %59 = call ptr @CopyMem(ptr noundef nonnull %53, ptr noundef nonnull %5, i64 noundef 6) #4
  br label %60

60:                                               ; preds = %58, %57
  %.not71 = icmp eq ptr %4, null
  %61 = getelementptr inbounds i8, ptr %8, i64 18
  %62 = getelementptr inbounds i8, ptr %13, i64 552
  %.sink = select i1 %.not71, ptr %62, ptr %4
  %63 = call ptr @CopyMem(ptr noundef nonnull %61, ptr noundef nonnull %.sink, i64 noundef 6) #4
  %.not72 = icmp eq ptr %6, null
  br i1 %.not72, label %66, label %64

64:                                               ; preds = %60
  %65 = load i16, ptr %6, align 2, !tbaa !27
  %.pr.pre = load i16, ptr %56, align 1, !tbaa !25
  br label %68

66:                                               ; preds = %60
  %67 = load i16, ptr %56, align 1, !tbaa !25
  br label %68

68:                                               ; preds = %66, %64
  %.pr = phi i16 [ %.pr.pre, %64 ], [ %67, %66 ]
  %.053 = phi i16 [ %65, %64 ], [ %67, %66 ]
  %69 = call i16 @llvm.bswap.i16(i16 %.053)
  %70 = getelementptr inbounds i8, ptr %8, i64 24
  store i16 %69, ptr %70, align 1, !tbaa !28
  br label %71

71:                                               ; preds = %68, %52
  %72 = phi i16 [ %.pr, %68 ], [ %55, %52 ]
  %73 = icmp ult i16 %72, 60
  br i1 %73, label %74, label %78

74:                                               ; preds = %71
  store i16 60, ptr %56, align 1, !tbaa !25
  %75 = getelementptr inbounds [2044 x i8], ptr %53, i64 0, i64 %2
  %76 = sub i64 60, %2
  %77 = call ptr @ZeroMem(ptr noundef nonnull %75, i64 noundef %76) #4
  br label %78

78:                                               ; preds = %71, %74
  %79 = call zeroext i8 @DebugPrintEnabled() #4
  %.not73 = icmp eq i8 %79, 0
  br i1 %.not73, label %126, label %80

80:                                               ; preds = %78
  %81 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 33554496) #4
  %.not74 = icmp eq i8 %81, 0
  br i1 %.not74, label %126, label %82

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

126:                                              ; preds = %80, %82, %78
  %127 = load i16, ptr %56, align 1, !tbaa !25
  %128 = xor i16 %127, -1
  %129 = getelementptr inbounds i8, ptr %8, i64 10
  store i16 %128, ptr %129, align 1, !tbaa !31
  %130 = zext i16 %127 to i64
  %131 = add nuw nsw i64 %130, 4
  store i64 %131, ptr %9, align 8, !tbaa !32
  %132 = getelementptr inbounds i8, ptr %44, i64 16
  %133 = load ptr, ptr %132, align 8, !tbaa !33
  %134 = getelementptr inbounds i8, ptr %133, i64 8
  %135 = load ptr, ptr %134, align 8, !tbaa !34
  %136 = call i64 %135(ptr noundef %133, i8 noundef zeroext 3, ptr noundef nonnull %56, ptr noundef nonnull %9, i64 noundef 4294967294, ptr noundef nonnull %10) #4
  %137 = icmp slt i64 %136, 0
  br i1 %137, label %.thread, label %138

138:                                              ; preds = %126
  %139 = load i64, ptr %9, align 8, !tbaa !32
  %140 = load i16, ptr %56, align 1, !tbaa !25
  %141 = zext i16 %140 to i64
  %142 = add nuw nsw i64 %141, 4
  %.not75 = icmp eq i64 %139, %142
  br i1 %.not75, label %select.unfold, label %.thread

select.unfold:                                    ; preds = %138
  %143 = load i32, ptr %10, align 4
  %144 = zext i32 %143 to i64
  %145 = icmp eq i32 %143, 0
  br i1 %145, label %146, label %.thread

146:                                              ; preds = %select.unfold
  %147 = getelementptr inbounds i8, ptr %44, i64 816
  store ptr %3, ptr %147, align 8, !tbaa !36
  br label %164

.thread:                                          ; preds = %126, %138, %select.unfold
  %.179 = phi i64 [ %144, %select.unfold ], [ 3, %138 ], [ %136, %126 ]
  %148 = call zeroext i8 @DebugPrintEnabled() #4
  %.not76 = icmp eq i8 %148, 0
  br i1 %.not76, label %155, label %149

149:                                              ; preds = %.thread
  %150 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483712) #4
  %.not77 = icmp eq i8 %150, 0
  br i1 %.not77, label %155, label %151

151:                                              ; preds = %149
  %152 = load i16, ptr %56, align 1, !tbaa !25
  %153 = zext i16 %152 to i64
  %154 = add nuw nsw i64 %153, 2
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483712, ptr noundef nonnull @.str.7, i64 noundef %154, i64 noundef %.179) #4
  br label %155

155:                                              ; preds = %149, %151, %.thread
  %156 = icmp eq i64 %.179, -9223372036854775801
  br i1 %156, label %157, label %164

157:                                              ; preds = %155
  %158 = call i64 @SN_Reset(ptr noundef nonnull %0, i8 noundef zeroext 0)
  br label %164

159:                                              ; preds = %7, %11
  %160 = tail call zeroext i8 @DebugPrintEnabled() #4
  %.not62 = icmp eq i8 %160, 0
  br i1 %.not62, label %164, label %161

161:                                              ; preds = %159
  %162 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483712) #4
  %.not63 = icmp eq i8 %162, 0
  br i1 %.not63, label %164, label %163

163:                                              ; preds = %161
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483712, ptr noundef nonnull @.str.8, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #4
  br label %164

164:                                              ; preds = %159, %163, %161, %14, %._crit_edge, %146, %157, %155
  %.2 = phi i64 [ 0, %146 ], [ -9223372036854775801, %157 ], [ %.179, %155 ], [ -9223372036854775802, %._crit_edge ], [ -9223372036854775789, %14 ], [ -9223372036854775806, %161 ], [ -9223372036854775806, %163 ], [ -9223372036854775806, %159 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 2056, ptr nonnull %8) #4
  ret i64 %.2
}

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


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