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

; 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.USB_DEVICE_REQUEST = type { i8, i8, i16, i16, i16 }
%struct.USB_DEVICE_DESCRIPTOR = type { i8, i8, i16, i8, i8, i8, i8, i16, i16, i16, i8, i8, i8, i8 }
%struct.NIC_DEVICE = type { i64, ptr, ptr, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, i8, ptr, i16, i8, i8, i8, i8, i64, i64, i16, ptr, ptr, [8 x i8], %struct.EFI_MAC_ADDRESS, i8, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct._EFI_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_USB_IO_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [53 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ax88772UsbCommand(ptr noundef, ptr noundef, ptr noundef) #1

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

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

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

23:                                               ; preds = %2
  br label %24

24:                                               ; preds = %23
  %25 = call zeroext i8 @DebugPrintEnabled()
  %26 = icmp ne i8 %25, 0
  br i1 %26, label %27, label %35

27:                                               ; preds = %24
  br label %28

28:                                               ; preds = %27
  %29 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %30 = icmp ne i8 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.3)
  br label %32

32:                                               ; preds = %31, %28
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34, %24
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = load i64, ptr %9, align 8, !tbaa !20
  store i64 %38, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %224

39:                                               ; preds = %2
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = icmp ne i32 0, %40
  br i1 %41, label %42, label %137

42:                                               ; preds = %39
  %43 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 0
  store i8 -64, ptr %43, align 1, !tbaa !21
  %44 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 1
  store i8 26, ptr %44, align 1, !tbaa !23
  %45 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 2
  store i16 0, ptr %45, align 1, !tbaa !24
  %46 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 3
  store i16 0, ptr %46, align 1, !tbaa !25
  %47 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 4
  store i16 2, ptr %47, align 1, !tbaa !26
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = call i64 @Ax88772UsbCommand(ptr noundef %48, ptr noundef %8, ptr noundef %6)
  store i64 %49, ptr %9, align 8, !tbaa !20
  %50 = load i64, ptr %9, align 8, !tbaa !20
  %51 = icmp slt i64 %50, 0
  br i1 %51, label %120, label %52

52:                                               ; preds = %42
  %53 = load i16, ptr %6, align 2, !tbaa !27
  %54 = zext i16 %53 to i32
  %55 = and i32 %54, 256
  %56 = icmp eq i32 0, %55
  br i1 %56, label %57, label %119

57:                                               ; preds = %52
  %58 = load i16, ptr %6, align 2, !tbaa !27
  %59 = zext i16 %58 to i32
  %60 = or i32 %59, 260
  %61 = trunc i32 %60 to i16
  store i16 %61, ptr %6, align 2, !tbaa !27
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.NIC_DEVICE, ptr %62, i32 0, i32 11
  %64 = load i8, ptr %63, align 4, !tbaa !28
  %65 = icmp ne i8 %64, 0
  br i1 %65, label %66, label %71

66:                                               ; preds = %57
  %67 = load i16, ptr %6, align 2, !tbaa !27
  %68 = zext i16 %67 to i32
  %69 = or i32 %68, 50
  %70 = trunc i32 %69 to i16
  store i16 %70, ptr %6, align 2, !tbaa !27
  br label %76

71:                                               ; preds = %57
  %72 = load i16, ptr %6, align 2, !tbaa !27
  %73 = zext i16 %72 to i32
  %74 = and i32 %73, -51
  %75 = trunc i32 %74 to i16
  store i16 %75, ptr %6, align 2, !tbaa !27
  br label %76

76:                                               ; preds = %71, %66
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.NIC_DEVICE, ptr %77, i32 0, i32 9
  %79 = load i8, ptr %78, align 2, !tbaa !29
  %80 = icmp ne i8 %79, 0
  br i1 %80, label %81, label %86

81:                                               ; preds = %76
  %82 = load i16, ptr %6, align 2, !tbaa !27
  %83 = zext i16 %82 to i32
  %84 = or i32 %83, 512
  %85 = trunc i32 %84 to i16
  store i16 %85, ptr %6, align 2, !tbaa !27
  br label %91

86:                                               ; preds = %76
  %87 = load i16, ptr %6, align 2, !tbaa !27
  %88 = zext i16 %87 to i32
  %89 = and i32 %88, -513
  %90 = trunc i32 %89 to i16
  store i16 %90, ptr %6, align 2, !tbaa !27
  br label %91

91:                                               ; preds = %86, %81
  %92 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 0
  store i8 64, ptr %92, align 1, !tbaa !21
  %93 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 1
  store i8 27, ptr %93, align 1, !tbaa !23
  %94 = load i16, ptr %6, align 2, !tbaa !27
  %95 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 2
  store i16 %94, ptr %95, align 1, !tbaa !24
  %96 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 3
  store i16 0, ptr %96, align 1, !tbaa !25
  %97 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 4
  store i16 0, ptr %97, align 1, !tbaa !26
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = call i64 @Ax88772UsbCommand(ptr noundef %98, ptr noundef %8, ptr noundef null)
  store i64 %99, ptr %9, align 8, !tbaa !20
  %100 = load i64, ptr %9, align 8, !tbaa !20
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %102, label %118

102:                                              ; preds = %91
  br label %103

103:                                              ; preds = %102
  %104 = call zeroext i8 @DebugPrintEnabled()
  %105 = icmp ne i8 %104, 0
  br i1 %105, label %106, label %115

106:                                              ; preds = %103
  br label %107

107:                                              ; preds = %106
  %108 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %109 = icmp ne i8 %108, 0
  br i1 %109, label %110, label %112

110:                                              ; preds = %107
  %111 = load i64, ptr %9, align 8, !tbaa !20
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.4, i64 noundef %111)
  br label %112

112:                                              ; preds = %110, %107
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114, %103
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117, %91
  br label %119

119:                                              ; preds = %118, %52
  br label %136

120:                                              ; preds = %42
  br label %121

121:                                              ; preds = %120
  %122 = call zeroext i8 @DebugPrintEnabled()
  %123 = icmp ne i8 %122, 0
  br i1 %123, label %124, label %133

124:                                              ; preds = %121
  br label %125

125:                                              ; preds = %124
  %126 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %127 = icmp ne i8 %126, 0
  br i1 %127, label %128, label %130

128:                                              ; preds = %125
  %129 = load i64, ptr %9, align 8, !tbaa !20
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.5, i64 noundef %129)
  br label %130

130:                                              ; preds = %128, %125
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132, %121
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135, %119
  br label %137

137:                                              ; preds = %136, %39
  store i16 384, ptr %7, align 2, !tbaa !27
  %138 = load i32, ptr %5, align 4, !tbaa !9
  %139 = and i32 %138, 2
  %140 = icmp ne i32 0, %139
  br i1 %140, label %141, label %155

141:                                              ; preds = %137
  %142 = load i16, ptr %7, align 2, !tbaa !27
  %143 = zext i16 %142 to i32
  %144 = or i32 %143, 16
  %145 = trunc i32 %144 to i16
  store i16 %145, ptr %7, align 2, !tbaa !27
  %146 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 0
  store i8 64, ptr %146, align 1, !tbaa !21
  %147 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 1
  store i8 22, ptr %147, align 1, !tbaa !23
  %148 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 2
  store i16 0, ptr %148, align 1, !tbaa !24
  %149 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 3
  store i16 0, ptr %149, align 1, !tbaa !25
  %150 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 4
  store i16 8, ptr %150, align 1, !tbaa !26
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.NIC_DEVICE, ptr %152, i32 0, i32 18
  %154 = call i64 @Ax88772UsbCommand(ptr noundef %151, ptr noundef %8, ptr noundef %153)
  store i64 %154, ptr %9, align 8, !tbaa !20
  br label %155

155:                                              ; preds = %141, %137
  %156 = load i32, ptr %5, align 4, !tbaa !9
  %157 = and i32 %156, 16
  %158 = icmp ne i32 0, %157
  br i1 %158, label %159, label %164

159:                                              ; preds = %155
  %160 = load i16, ptr %7, align 2, !tbaa !27
  %161 = zext i16 %160 to i32
  %162 = or i32 %161, 2
  %163 = trunc i32 %162 to i16
  store i16 %163, ptr %7, align 2, !tbaa !27
  br label %164

164:                                              ; preds = %159, %155
  %165 = load i32, ptr %5, align 4, !tbaa !9
  %166 = and i32 %165, 4
  %167 = icmp ne i32 0, %166
  br i1 %167, label %168, label %173

168:                                              ; preds = %164
  %169 = load i16, ptr %7, align 2, !tbaa !27
  %170 = zext i16 %169 to i32
  %171 = or i32 %170, 8
  %172 = trunc i32 %171 to i16
  store i16 %172, ptr %7, align 2, !tbaa !27
  br label %173

173:                                              ; preds = %168, %164
  %174 = load i32, ptr %5, align 4, !tbaa !9
  %175 = and i32 %174, 8
  %176 = icmp ne i32 0, %175
  br i1 %176, label %177, label %182

177:                                              ; preds = %173
  %178 = load i16, ptr %7, align 2, !tbaa !27
  %179 = zext i16 %178 to i32
  %180 = or i32 %179, 1
  %181 = trunc i32 %180 to i16
  store i16 %181, ptr %7, align 2, !tbaa !27
  br label %182

182:                                              ; preds = %177, %173
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.NIC_DEVICE, ptr %183, i32 0, i32 15
  %185 = load i16, ptr %184, align 8, !tbaa !30
  %186 = zext i16 %185 to i32
  %187 = load i16, ptr %7, align 2, !tbaa !27
  %188 = zext i16 %187 to i32
  %189 = icmp ne i32 %186, %188
  br i1 %189, label %190, label %222

190:                                              ; preds = %182
  %191 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 0
  store i8 64, ptr %191, align 1, !tbaa !21
  %192 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 1
  store i8 16, ptr %192, align 1, !tbaa !23
  %193 = load i16, ptr %7, align 2, !tbaa !27
  %194 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 2
  store i16 %193, ptr %194, align 1, !tbaa !24
  %195 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 3
  store i16 0, ptr %195, align 1, !tbaa !25
  %196 = getelementptr inbounds %struct.USB_DEVICE_REQUEST, ptr %8, i32 0, i32 4
  store i16 0, ptr %196, align 1, !tbaa !26
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = call i64 @Ax88772UsbCommand(ptr noundef %197, ptr noundef %8, ptr noundef null)
  store i64 %198, ptr %9, align 8, !tbaa !20
  %199 = load i64, ptr %9, align 8, !tbaa !20
  %200 = icmp slt i64 %199, 0
  br i1 %200, label %205, label %201

201:                                              ; preds = %190
  %202 = load i16, ptr %7, align 2, !tbaa !27
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.NIC_DEVICE, ptr %203, i32 0, i32 15
  store i16 %202, ptr %204, align 8, !tbaa !30
  br label %221

205:                                              ; preds = %190
  br label %206

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

209:                                              ; preds = %206
  br label %210

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

213:                                              ; preds = %210
  %214 = load i64, ptr %9, align 8, !tbaa !20
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.6, i64 noundef %214)
  br label %215

215:                                              ; preds = %213, %210
  br label %216

216:                                              ; preds = %215
  br label %217

217:                                              ; preds = %216
  br label %218

218:                                              ; preds = %217, %206
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  br label %221

221:                                              ; preds = %220, %201
  br label %222

222:                                              ; preds = %221, %182
  %223 = load i64, ptr %9, align 8, !tbaa !20
  store i64 %223, ptr %3, align 8
  store i32 1, ptr %12, align 4
  br label %224

224:                                              ; preds = %222, %37
  call void @llvm.lifetime.end.p0(i64 18, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #3
  %225 = load i64, ptr %3, align 8
  ret i64 %225
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"", !13, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !14, i64 152, !15, i64 280, !7, i64 936, !6, i64 944, !17, i64 952, !7, i64 954, !7, i64 955, !7, i64 956, !7, i64 957, !13, i64 960, !13, i64 968, !17, i64 976, !6, i64 984, !6, i64 992, !7, i64 1000, !16, i64 1008, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !13, i64 1088, !6, i64 1096}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !13, 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}
!15 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, 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}
!16 = !{!"", !7, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !6, i64 48}
!19 = !{!"_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}
!20 = !{!13, !13, i64 0}
!21 = !{!22, !7, i64 0}
!22 = !{!"", !7, i64 0, !7, i64 1, !17, i64 2, !17, i64 4, !17, i64 6}
!23 = !{!22, !7, i64 1}
!24 = !{!22, !17, i64 2}
!25 = !{!22, !17, i64 4}
!26 = !{!22, !17, i64 6}
!27 = !{!17, !17, i64 0}
!28 = !{!12, !7, i64 956}
!29 = !{!12, !7, i64 954}
!30 = !{!12, !17, i64 976}


; 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.USB_DEVICE_REQUEST = type { i8, i8, i16, i16, i16 }
%struct.USB_DEVICE_DESCRIPTOR = type { i8, i8, i16, i8, i8, i8, i8, i16, i16, i16, i8, i8, i8, i8 }

@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [53 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ax88772UsbCommand(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Ax88772RxControl(ptr noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = alloca i16, align 2
  %4 = alloca %struct.USB_DEVICE_REQUEST, align 1
  %5 = alloca %struct.USB_DEVICE_DESCRIPTOR, align 1
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 18, ptr nonnull %5) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 48
  %9 = load ptr, ptr %8, align 8, !tbaa !16
  %10 = call i64 %9(ptr noundef %7, ptr noundef nonnull %5) #3
  %11 = icmp slt i64 %10, 0
  br i1 %11, label %12, label %17

12:                                               ; preds = %2
  %13 = call zeroext i8 @DebugPrintEnabled() #3
  %.not59 = icmp eq i8 %13, 0
  br i1 %.not59, label %75, label %14

14:                                               ; preds = %12
  %15 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not60 = icmp eq i8 %15, 0
  br i1 %.not60, label %75, label %16

16:                                               ; preds = %14
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.3) #3
  br label %75

17:                                               ; preds = %2
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %.thread, label %18

18:                                               ; preds = %17
  store i8 -64, ptr %4, align 1, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %4, i64 1
  store i8 26, ptr %19, align 1, !tbaa !20
  %20 = getelementptr inbounds i8, ptr %4, i64 2
  store i16 0, ptr %20, align 1, !tbaa !21
  %21 = getelementptr inbounds i8, ptr %4, i64 4
  store i16 0, ptr %21, align 1, !tbaa !22
  %22 = getelementptr inbounds i8, ptr %4, i64 6
  store i16 2, ptr %22, align 1, !tbaa !23
  %23 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef nonnull %3)
  %24 = icmp slt i64 %23, 0
  br i1 %24, label %45, label %25

25:                                               ; preds = %18
  %26 = load i16, ptr %3, align 2, !tbaa !24
  %27 = and i16 %26, 256
  %28 = icmp eq i16 %27, 0
  br i1 %28, label %29, label %50

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %0, i64 956
  %31 = load i8, ptr %30, align 4, !tbaa !25
  %.not45 = icmp eq i8 %31, 0
  %32 = and i16 %26, -823
  %33 = or disjoint i16 %32, 260
  %34 = or i16 %26, 310
  %storemerge = select i1 %.not45, i16 %33, i16 %34
  %35 = getelementptr inbounds i8, ptr %0, i64 954
  %36 = load i8, ptr %35, align 2, !tbaa !26
  %.not46 = icmp eq i8 %36, 0
  %37 = and i16 %storemerge, -513
  %masksel = select i1 %.not46, i16 0, i16 512
  %storemerge47 = or disjoint i16 %masksel, %37
  store i16 %storemerge47, ptr %3, align 2, !tbaa !24
  store i8 64, ptr %4, align 1, !tbaa !18
  store i8 27, ptr %19, align 1, !tbaa !20
  store i16 %storemerge47, ptr %20, align 1, !tbaa !21
  store i16 0, ptr %21, align 1, !tbaa !22
  store i16 0, ptr %22, align 1, !tbaa !23
  %38 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef null)
  %39 = icmp slt i64 %38, 0
  br i1 %39, label %40, label %50

40:                                               ; preds = %29
  %41 = call zeroext i8 @DebugPrintEnabled() #3
  %.not48 = icmp eq i8 %41, 0
  br i1 %.not48, label %50, label %42

42:                                               ; preds = %40
  %43 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not49 = icmp eq i8 %43, 0
  br i1 %.not49, label %50, label %44

44:                                               ; preds = %42
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.4, i64 noundef %38) #3
  br label %50

45:                                               ; preds = %18
  %46 = call zeroext i8 @DebugPrintEnabled() #3
  %.not50 = icmp eq i8 %46, 0
  br i1 %.not50, label %50, label %47

47:                                               ; preds = %45
  %48 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not51 = icmp eq i8 %48, 0
  br i1 %.not51, label %50, label %49

49:                                               ; preds = %47
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.5, i64 noundef %23) #3
  br label %50

50:                                               ; preds = %29, %42, %44, %40, %25, %47, %49, %45
  %.033 = phi i64 [ %23, %49 ], [ %23, %47 ], [ %23, %45 ], [ %38, %44 ], [ %38, %42 ], [ %38, %40 ], [ %38, %29 ], [ %23, %25 ]
  %51 = and i32 %1, 2
  %.not52 = icmp eq i32 %51, 0
  br i1 %.not52, label %.thread, label %52

52:                                               ; preds = %50
  store i8 64, ptr %4, align 1, !tbaa !18
  store i8 22, ptr %19, align 1, !tbaa !20
  store i16 0, ptr %20, align 1, !tbaa !21
  store i16 0, ptr %21, align 1, !tbaa !22
  store i16 8, ptr %22, align 1, !tbaa !23
  %53 = getelementptr inbounds i8, ptr %0, i64 1000
  %54 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef nonnull %53)
  br label %.thread

.thread:                                          ; preds = %17, %52, %50
  %.034 = phi i16 [ 400, %52 ], [ 384, %50 ], [ 384, %17 ]
  %.1 = phi i64 [ %54, %52 ], [ %.033, %50 ], [ %10, %17 ]
  %55 = trunc i32 %1 to i16
  %56 = lshr i16 %55, 3
  %57 = shl i16 %55, 1
  %58 = and i16 %57, 8
  %59 = and i16 %56, 3
  %.236 = or disjoint i16 %58, %59
  %.3 = or disjoint i16 %.236, %.034
  %60 = getelementptr inbounds i8, ptr %0, i64 976
  %61 = load i16, ptr %60, align 8, !tbaa !27
  %.not56 = icmp eq i16 %61, %.3
  br i1 %.not56, label %75, label %62

62:                                               ; preds = %.thread
  store i8 64, ptr %4, align 1, !tbaa !18
  %63 = getelementptr inbounds i8, ptr %4, i64 1
  store i8 16, ptr %63, align 1, !tbaa !20
  %64 = getelementptr inbounds i8, ptr %4, i64 2
  store i16 %.3, ptr %64, align 1, !tbaa !21
  %65 = getelementptr inbounds i8, ptr %4, i64 4
  store i16 0, ptr %65, align 1, !tbaa !22
  %66 = getelementptr inbounds i8, ptr %4, i64 6
  store i16 0, ptr %66, align 1, !tbaa !23
  %67 = call i64 @Ax88772UsbCommand(ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef null)
  %68 = icmp slt i64 %67, 0
  br i1 %68, label %70, label %69

69:                                               ; preds = %62
  store i16 %.3, ptr %60, align 8, !tbaa !27
  br label %75

70:                                               ; preds = %62
  %71 = call zeroext i8 @DebugPrintEnabled() #3
  %.not57 = icmp eq i8 %71, 0
  br i1 %.not57, label %75, label %72

72:                                               ; preds = %70
  %73 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not58 = icmp eq i8 %73, 0
  br i1 %.not58, label %75, label %74

74:                                               ; preds = %72
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.6, i64 noundef %67) #3
  br label %75

75:                                               ; preds = %.thread, %70, %74, %72, %69, %12, %16, %14
  %.0 = phi i64 [ %10, %14 ], [ %10, %16 ], [ %10, %12 ], [ %67, %74 ], [ %67, %72 ], [ %67, %70 ], [ %67, %69 ], [ %.1, %.thread ]
  call void @llvm.lifetime.end.p0(i64 18, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %3) #3
  ret i64 %.0
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

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


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