; LLVM IR from lichen-community-systems/signaletic :: hosts/daisy/vendor/libDaisy/Middlewares/ST/STM32_USB_Host_Library/Class/MSC_ (Process)

; 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._USBH_HandleTypeDef = type { i32, i32, i32, %struct.USBH_CtrlTypeDef, %struct.USBH_DeviceTypeDef, [1 x ptr], ptr, i32, [16 x i32], i32, i32, i8, ptr, ptr }
%struct.USBH_CtrlTypeDef = type { i8, i8, i8, ptr, i16, i16, %union._USB_Setup, i32, i8 }
%union._USB_Setup = type { [2 x i32] }
%struct.USBH_DeviceTypeDef = type { [256 x i8], [512 x i8], i8, i8, i8, i8, i8, i8, i8, i8, i8, %struct._DeviceDescriptor, %struct._ConfigurationDescriptor }
%struct._DeviceDescriptor = type { i8, i8, i16, i8, i8, i8, i8, i16, i16, i16, i8, i8, i8, i8 }
%struct._ConfigurationDescriptor = type { i8, i8, i16, i8, i8, i8, i8, i8, [2 x %struct._InterfaceDescriptor] }
%struct._InterfaceDescriptor = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, [2 x %struct._EndpointDescriptor] }
%struct._EndpointDescriptor = type { i8, i8, i8, i8, i16, i8 }
%struct.USBH_ClassTypeDef = type { ptr, i8, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._MSC_Process = type { i8, [3 x i8], i8, i8, i8, i8, i16, i16, i32, i32, i32, i32, %struct.BOT_HandleTypeDef, [2 x %struct.MSC_LUNTypeDef], i16, i16, i32 }
%struct.BOT_HandleTypeDef = type { [16 x i32], i32, i32, i32, %union.BOT_CBWTypeDef, i8, %union.BOT_CSWTypeDef, [3 x i8], ptr }
%union.BOT_CBWTypeDef = type { %struct.__CBW }
%struct.__CBW = type { i32, i32, i32, i8, i8, i8, [16 x i8] }
%union.BOT_CSWTypeDef = type { %struct.__CSW }
%struct.__CSW = type { i32, i32, i32, i8 }
%struct.MSC_LUNTypeDef = type { i32, i32, i32, %struct.SCSI_CapacityTypeDef, %struct.SCSI_SenseTypeDef, %struct.SCSI_StdInquiryDataTypeDef, i8 }
%struct.SCSI_CapacityTypeDef = type { i32, i16 }
%struct.SCSI_SenseTypeDef = type { i8, i8, i8 }
%struct.SCSI_StdInquiryDataTypeDef = type { i8, i8, i8, [9 x i8], [17 x i8], [5 x i8] }

; Function Attrs: nounwind uwtable
declare dso_local i32 @USBH_MSC_BOT_REQ_Reset(ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @USBH_MSC_BOT_Process(ptr noundef %0, i8 noundef zeroext %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i8 %1, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 1, ptr %5, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 1, ptr %6, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 1, ptr %7, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct._USBH_HandleTypeDef, ptr %11, i32 0, i32 6
  %13 = load ptr, ptr %12, align 8, !tbaa !12
  %14 = getelementptr inbounds %struct.USBH_ClassTypeDef, ptr %13, i32 0, i32 7
  %15 = load ptr, ptr %14, align 8, !tbaa !19
  store ptr %15, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  store i8 0, ptr %10, align 1, !tbaa !9
  %16 = load ptr, ptr %9, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct._MSC_Process, ptr %16, i32 0, i32 12
  %18 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 8, !tbaa !21
  switch i32 %19, label %406 [
    i32 1, label %20
    i32 2, label %38
    i32 3, label %93
    i32 4, label %109
    i32 5, label %189
    i32 6, label %205
    i32 7, label %293
    i32 8, label %306
    i32 9, label %338
    i32 10, label %358
    i32 11, label %396
  ]

20:                                               ; preds = %2
  %21 = load i8, ptr %4, align 1, !tbaa !9
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._MSC_Process, ptr %22, i32 0, i32 12
  %24 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %23, i32 0, i32 4
  %25 = getelementptr inbounds %struct.__CBW, ptr %24, i32 0, i32 4
  store i8 %21, ptr %25, align 1, !tbaa !9
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._MSC_Process, ptr %26, i32 0, i32 12
  %28 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %27, i32 0, i32 1
  store i32 2, ptr %28, align 8, !tbaa !21
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._MSC_Process, ptr %30, i32 0, i32 12
  %32 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %31, i32 0, i32 4
  %33 = getelementptr inbounds [31 x i8], ptr %32, i64 0, i64 0
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._MSC_Process, ptr %34, i32 0, i32 3
  %36 = load i8, ptr %35, align 1, !tbaa !24
  %37 = call i32 @USBH_BulkSendData(ptr noundef %29, ptr noundef %33, i16 noundef zeroext 31, i8 noundef zeroext %36, i8 noundef zeroext 1)
  br label %407

38:                                               ; preds = %2
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._MSC_Process, ptr %40, i32 0, i32 3
  %42 = load i8, ptr %41, align 1, !tbaa !24
  %43 = call i32 @USBH_LL_GetURBState(ptr noundef %39, i8 noundef zeroext %42)
  store i32 %43, ptr %8, align 4, !tbaa !10
  %44 = load i32, ptr %8, align 4, !tbaa !10
  %45 = icmp eq i32 %44, 1
  br i1 %45, label %46, label %76

46:                                               ; preds = %38
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._MSC_Process, ptr %47, i32 0, i32 12
  %49 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %48, i32 0, i32 4
  %50 = getelementptr inbounds %struct.__CBW, ptr %49, i32 0, i32 2
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %71

53:                                               ; preds = %46
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._MSC_Process, ptr %54, i32 0, i32 12
  %56 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %55, i32 0, i32 4
  %57 = getelementptr inbounds %struct.__CBW, ptr %56, i32 0, i32 3
  %58 = load i8, ptr %57, align 4, !tbaa !9
  %59 = zext i8 %58 to i32
  %60 = and i32 %59, 128
  %61 = icmp eq i32 %60, 128
  br i1 %61, label %62, label %66

62:                                               ; preds = %53
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._MSC_Process, ptr %63, i32 0, i32 12
  %65 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %64, i32 0, i32 1
  store i32 3, ptr %65, align 8, !tbaa !21
  br label %70

66:                                               ; preds = %53
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._MSC_Process, ptr %67, i32 0, i32 12
  %69 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %68, i32 0, i32 1
  store i32 5, ptr %69, align 8, !tbaa !21
  br label %70

70:                                               ; preds = %66, %62
  br label %75

71:                                               ; preds = %46
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._MSC_Process, ptr %72, i32 0, i32 12
  %74 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %73, i32 0, i32 1
  store i32 7, ptr %74, align 8, !tbaa !21
  br label %75

75:                                               ; preds = %71, %70
  br label %92

76:                                               ; preds = %38
  %77 = load i32, ptr %8, align 4, !tbaa !10
  %78 = icmp eq i32 %77, 2
  br i1 %78, label %79, label %83

79:                                               ; preds = %76
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._MSC_Process, ptr %80, i32 0, i32 12
  %82 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %81, i32 0, i32 1
  store i32 1, ptr %82, align 8, !tbaa !21
  br label %91

83:                                               ; preds = %76
  %84 = load i32, ptr %8, align 4, !tbaa !10
  %85 = icmp eq i32 %84, 5
  br i1 %85, label %86, label %90

86:                                               ; preds = %83
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._MSC_Process, ptr %87, i32 0, i32 12
  %89 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %88, i32 0, i32 1
  store i32 10, ptr %89, align 8, !tbaa !21
  br label %90

90:                                               ; preds = %86, %83
  br label %91

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

92:                                               ; preds = %91, %75
  br label %407

93:                                               ; preds = %2
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._MSC_Process, ptr %95, i32 0, i32 12
  %97 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %96, i32 0, i32 8
  %98 = load ptr, ptr %97, align 8, !tbaa !25
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._MSC_Process, ptr %99, i32 0, i32 7
  %101 = load i16, ptr %100, align 2, !tbaa !26
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._MSC_Process, ptr %102, i32 0, i32 2
  %104 = load i8, ptr %103, align 4, !tbaa !27
  %105 = call i32 @USBH_BulkReceiveData(ptr noundef %94, ptr noundef %98, i16 noundef zeroext %101, i8 noundef zeroext %104)
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._MSC_Process, ptr %106, i32 0, i32 12
  %108 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %107, i32 0, i32 1
  store i32 4, ptr %108, align 8, !tbaa !21
  br label %407

109:                                              ; preds = %2
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._MSC_Process, ptr %111, i32 0, i32 2
  %113 = load i8, ptr %112, align 4, !tbaa !27
  %114 = call i32 @USBH_LL_GetURBState(ptr noundef %110, i8 noundef zeroext %113)
  store i32 %114, ptr %8, align 4, !tbaa !10
  %115 = load i32, ptr %8, align 4, !tbaa !10
  %116 = icmp eq i32 %115, 1
  br i1 %116, label %117, label %179

117:                                              ; preds = %109
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._MSC_Process, ptr %118, i32 0, i32 12
  %120 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %119, i32 0, i32 4
  %121 = getelementptr inbounds %struct.__CBW, ptr %120, i32 0, i32 2
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._MSC_Process, ptr %123, i32 0, i32 7
  %125 = load i16, ptr %124, align 2, !tbaa !26
  %126 = zext i16 %125 to i32
  %127 = icmp ugt i32 %122, %126
  br i1 %127, label %128, label %149

128:                                              ; preds = %117
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._MSC_Process, ptr %129, i32 0, i32 7
  %131 = load i16, ptr %130, align 2, !tbaa !26
  %132 = zext i16 %131 to i32
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._MSC_Process, ptr %133, i32 0, i32 12
  %135 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %134, i32 0, i32 8
  %136 = load ptr, ptr %135, align 8, !tbaa !25
  %137 = sext i32 %132 to i64
  %138 = getelementptr inbounds i8, ptr %136, i64 %137
  store ptr %138, ptr %135, align 8, !tbaa !25
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._MSC_Process, ptr %139, i32 0, i32 7
  %141 = load i16, ptr %140, align 2, !tbaa !26
  %142 = zext i16 %141 to i32
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._MSC_Process, ptr %143, i32 0, i32 12
  %145 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %144, i32 0, i32 4
  %146 = getelementptr inbounds %struct.__CBW, ptr %145, i32 0, i32 2
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %148 = sub i32 %147, %142
  store i32 %148, ptr %146, align 4, !tbaa !9
  br label %154

149:                                              ; preds = %117
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._MSC_Process, ptr %150, i32 0, i32 12
  %152 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %151, i32 0, i32 4
  %153 = getelementptr inbounds %struct.__CBW, ptr %152, i32 0, i32 2
  store i32 0, ptr %153, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %149, %128
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._MSC_Process, ptr %155, i32 0, i32 12
  %157 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %156, i32 0, i32 4
  %158 = getelementptr inbounds %struct.__CBW, ptr %157, i32 0, i32 2
  %159 = load i32, ptr %158, align 4, !tbaa !9
  %160 = icmp ugt i32 %159, 0
  br i1 %160, label %161, label %174

161:                                              ; preds = %154
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._MSC_Process, ptr %163, i32 0, i32 12
  %165 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %164, i32 0, i32 8
  %166 = load ptr, ptr %165, align 8, !tbaa !25
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct._MSC_Process, ptr %167, i32 0, i32 7
  %169 = load i16, ptr %168, align 2, !tbaa !26
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct._MSC_Process, ptr %170, i32 0, i32 2
  %172 = load i8, ptr %171, align 4, !tbaa !27
  %173 = call i32 @USBH_BulkReceiveData(ptr noundef %162, ptr noundef %166, i16 noundef zeroext %169, i8 noundef zeroext %172)
  br label %178

174:                                              ; preds = %154
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._MSC_Process, ptr %175, i32 0, i32 12
  %177 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %176, i32 0, i32 1
  store i32 7, ptr %177, align 8, !tbaa !21
  br label %178

178:                                              ; preds = %174, %161
  br label %188

179:                                              ; preds = %109
  %180 = load i32, ptr %8, align 4, !tbaa !10
  %181 = icmp eq i32 %180, 5
  br i1 %181, label %182, label %186

182:                                              ; preds = %179
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._MSC_Process, ptr %183, i32 0, i32 12
  %185 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %184, i32 0, i32 1
  store i32 9, ptr %185, align 8, !tbaa !21
  br label %187

186:                                              ; preds = %179
  br label %187

187:                                              ; preds = %186, %182
  br label %188

188:                                              ; preds = %187, %178
  br label %407

189:                                              ; preds = %2
  %190 = load ptr, ptr %3, align 8, !tbaa !5
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._MSC_Process, ptr %191, i32 0, i32 12
  %193 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %192, i32 0, i32 8
  %194 = load ptr, ptr %193, align 8, !tbaa !25
  %195 = load ptr, ptr %9, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct._MSC_Process, ptr %195, i32 0, i32 6
  %197 = load i16, ptr %196, align 8, !tbaa !28
  %198 = load ptr, ptr %9, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._MSC_Process, ptr %198, i32 0, i32 3
  %200 = load i8, ptr %199, align 1, !tbaa !24
  %201 = call i32 @USBH_BulkSendData(ptr noundef %190, ptr noundef %194, i16 noundef zeroext %197, i8 noundef zeroext %200, i8 noundef zeroext 1)
  %202 = load ptr, ptr %9, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct._MSC_Process, ptr %202, i32 0, i32 12
  %204 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %203, i32 0, i32 1
  store i32 6, ptr %204, align 8, !tbaa !21
  br label %407

205:                                              ; preds = %2
  %206 = load ptr, ptr %3, align 8, !tbaa !5
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._MSC_Process, ptr %207, i32 0, i32 3
  %209 = load i8, ptr %208, align 1, !tbaa !24
  %210 = call i32 @USBH_LL_GetURBState(ptr noundef %206, i8 noundef zeroext %209)
  store i32 %210, ptr %8, align 4, !tbaa !10
  %211 = load i32, ptr %8, align 4, !tbaa !10
  %212 = icmp eq i32 %211, 1
  br i1 %212, label %213, label %275

213:                                              ; preds = %205
  %214 = load ptr, ptr %9, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct._MSC_Process, ptr %214, i32 0, i32 12
  %216 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %215, i32 0, i32 4
  %217 = getelementptr inbounds %struct.__CBW, ptr %216, i32 0, i32 2
  %218 = load i32, ptr %217, align 4, !tbaa !9
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct._MSC_Process, ptr %219, i32 0, i32 6
  %221 = load i16, ptr %220, align 8, !tbaa !28
  %222 = zext i16 %221 to i32
  %223 = icmp ugt i32 %218, %222
  br i1 %223, label %224, label %245

224:                                              ; preds = %213
  %225 = load ptr, ptr %9, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct._MSC_Process, ptr %225, i32 0, i32 6
  %227 = load i16, ptr %226, align 8, !tbaa !28
  %228 = zext i16 %227 to i32
  %229 = load ptr, ptr %9, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct._MSC_Process, ptr %229, i32 0, i32 12
  %231 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %230, i32 0, i32 8
  %232 = load ptr, ptr %231, align 8, !tbaa !25
  %233 = sext i32 %228 to i64
  %234 = getelementptr inbounds i8, ptr %232, i64 %233
  store ptr %234, ptr %231, align 8, !tbaa !25
  %235 = load ptr, ptr %9, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct._MSC_Process, ptr %235, i32 0, i32 6
  %237 = load i16, ptr %236, align 8, !tbaa !28
  %238 = zext i16 %237 to i32
  %239 = load ptr, ptr %9, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct._MSC_Process, ptr %239, i32 0, i32 12
  %241 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %240, i32 0, i32 4
  %242 = getelementptr inbounds %struct.__CBW, ptr %241, i32 0, i32 2
  %243 = load i32, ptr %242, align 4, !tbaa !9
  %244 = sub i32 %243, %238
  store i32 %244, ptr %242, align 4, !tbaa !9
  br label %250

245:                                              ; preds = %213
  %246 = load ptr, ptr %9, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct._MSC_Process, ptr %246, i32 0, i32 12
  %248 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %247, i32 0, i32 4
  %249 = getelementptr inbounds %struct.__CBW, ptr %248, i32 0, i32 2
  store i32 0, ptr %249, align 4, !tbaa !9
  br label %250

250:                                              ; preds = %245, %224
  %251 = load ptr, ptr %9, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct._MSC_Process, ptr %251, i32 0, i32 12
  %253 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %252, i32 0, i32 4
  %254 = getelementptr inbounds %struct.__CBW, ptr %253, i32 0, i32 2
  %255 = load i32, ptr %254, align 4, !tbaa !9
  %256 = icmp ugt i32 %255, 0
  br i1 %256, label %257, label %270

257:                                              ; preds = %250
  %258 = load ptr, ptr %3, align 8, !tbaa !5
  %259 = load ptr, ptr %9, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct._MSC_Process, ptr %259, i32 0, i32 12
  %261 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %260, i32 0, i32 8
  %262 = load ptr, ptr %261, align 8, !tbaa !25
  %263 = load ptr, ptr %9, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct._MSC_Process, ptr %263, i32 0, i32 6
  %265 = load i16, ptr %264, align 8, !tbaa !28
  %266 = load ptr, ptr %9, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct._MSC_Process, ptr %266, i32 0, i32 3
  %268 = load i8, ptr %267, align 1, !tbaa !24
  %269 = call i32 @USBH_BulkSendData(ptr noundef %258, ptr noundef %262, i16 noundef zeroext %265, i8 noundef zeroext %268, i8 noundef zeroext 1)
  br label %274

270:                                              ; preds = %250
  %271 = load ptr, ptr %9, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct._MSC_Process, ptr %271, i32 0, i32 12
  %273 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %272, i32 0, i32 1
  store i32 7, ptr %273, align 8, !tbaa !21
  br label %274

274:                                              ; preds = %270, %257
  br label %292

275:                                              ; preds = %205
  %276 = load i32, ptr %8, align 4, !tbaa !10
  %277 = icmp eq i32 %276, 2
  br i1 %277, label %278, label %282

278:                                              ; preds = %275
  %279 = load ptr, ptr %9, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct._MSC_Process, ptr %279, i32 0, i32 12
  %281 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %280, i32 0, i32 1
  store i32 5, ptr %281, align 8, !tbaa !21
  br label %291

282:                                              ; preds = %275
  %283 = load i32, ptr %8, align 4, !tbaa !10
  %284 = icmp eq i32 %283, 5
  br i1 %284, label %285, label %289

285:                                              ; preds = %282
  %286 = load ptr, ptr %9, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct._MSC_Process, ptr %286, i32 0, i32 12
  %288 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %287, i32 0, i32 1
  store i32 10, ptr %288, align 8, !tbaa !21
  br label %290

289:                                              ; preds = %282
  br label %290

290:                                              ; preds = %289, %285
  br label %291

291:                                              ; preds = %290, %278
  br label %292

292:                                              ; preds = %291, %274
  br label %407

293:                                              ; preds = %2
  %294 = load ptr, ptr %3, align 8, !tbaa !5
  %295 = load ptr, ptr %9, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct._MSC_Process, ptr %295, i32 0, i32 12
  %297 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %296, i32 0, i32 6
  %298 = getelementptr inbounds [13 x i8], ptr %297, i64 0, i64 0
  %299 = load ptr, ptr %9, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct._MSC_Process, ptr %299, i32 0, i32 2
  %301 = load i8, ptr %300, align 4, !tbaa !27
  %302 = call i32 @USBH_BulkReceiveData(ptr noundef %294, ptr noundef %298, i16 noundef zeroext 13, i8 noundef zeroext %301)
  %303 = load ptr, ptr %9, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct._MSC_Process, ptr %303, i32 0, i32 12
  %305 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %304, i32 0, i32 1
  store i32 8, ptr %305, align 8, !tbaa !21
  br label %407

306:                                              ; preds = %2
  %307 = load ptr, ptr %3, align 8, !tbaa !5
  %308 = load ptr, ptr %9, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct._MSC_Process, ptr %308, i32 0, i32 2
  %310 = load i8, ptr %309, align 4, !tbaa !27
  %311 = call i32 @USBH_LL_GetURBState(ptr noundef %307, i8 noundef zeroext %310)
  store i32 %311, ptr %8, align 4, !tbaa !10
  %312 = load i32, ptr %8, align 4, !tbaa !10
  %313 = icmp eq i32 %312, 1
  br i1 %313, label %314, label %328

314:                                              ; preds = %306
  %315 = load ptr, ptr %9, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct._MSC_Process, ptr %315, i32 0, i32 12
  %317 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %316, i32 0, i32 1
  store i32 1, ptr %317, align 8, !tbaa !21
  %318 = load ptr, ptr %9, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct._MSC_Process, ptr %318, i32 0, i32 12
  %320 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %319, i32 0, i32 3
  store i32 1, ptr %320, align 8, !tbaa !29
  %321 = load ptr, ptr %3, align 8, !tbaa !5
  %322 = call i32 @USBH_MSC_DecodeCSW(ptr noundef %321)
  store i32 %322, ptr %7, align 4, !tbaa !10
  %323 = load i32, ptr %7, align 4, !tbaa !10
  %324 = icmp eq i32 %323, 0
  br i1 %324, label %325, label %326

325:                                              ; preds = %314
  store i32 0, ptr %5, align 4, !tbaa !10
  br label %327

326:                                              ; preds = %314
  store i32 2, ptr %5, align 4, !tbaa !10
  br label %327

327:                                              ; preds = %326, %325
  br label %337

328:                                              ; preds = %306
  %329 = load i32, ptr %8, align 4, !tbaa !10
  %330 = icmp eq i32 %329, 5
  br i1 %330, label %331, label %335

331:                                              ; preds = %328
  %332 = load ptr, ptr %9, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct._MSC_Process, ptr %332, i32 0, i32 12
  %334 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %333, i32 0, i32 1
  store i32 9, ptr %334, align 8, !tbaa !21
  br label %336

335:                                              ; preds = %328
  br label %336

336:                                              ; preds = %335, %331
  br label %337

337:                                              ; preds = %336, %327
  br label %407

338:                                              ; preds = %2
  %339 = load ptr, ptr %3, align 8, !tbaa !5
  %340 = load i8, ptr %4, align 1, !tbaa !9
  %341 = call i32 @USBH_MSC_BOT_Abort(ptr noundef %339, i8 noundef zeroext %340, i8 noundef zeroext 0)
  store i32 %341, ptr %6, align 4, !tbaa !10
  %342 = load i32, ptr %6, align 4, !tbaa !10
  %343 = icmp eq i32 %342, 0
  br i1 %343, label %344, label %348

344:                                              ; preds = %338
  %345 = load ptr, ptr %9, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct._MSC_Process, ptr %345, i32 0, i32 12
  %347 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %346, i32 0, i32 1
  store i32 7, ptr %347, align 8, !tbaa !21
  br label %357

348:                                              ; preds = %338
  %349 = load i32, ptr %6, align 4, !tbaa !10
  %350 = icmp eq i32 %349, 4
  br i1 %350, label %351, label %355

351:                                              ; preds = %348
  %352 = load ptr, ptr %9, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct._MSC_Process, ptr %352, i32 0, i32 12
  %354 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %353, i32 0, i32 1
  store i32 11, ptr %354, align 8, !tbaa !21
  br label %356

355:                                              ; preds = %348
  br label %356

356:                                              ; preds = %355, %351
  br label %357

357:                                              ; preds = %356, %344
  br label %407

358:                                              ; preds = %2
  %359 = load ptr, ptr %3, align 8, !tbaa !5
  %360 = load i8, ptr %4, align 1, !tbaa !9
  %361 = call i32 @USBH_MSC_BOT_Abort(ptr noundef %359, i8 noundef zeroext %360, i8 noundef zeroext 1)
  store i32 %361, ptr %6, align 4, !tbaa !10
  %362 = load i32, ptr %6, align 4, !tbaa !10
  %363 = icmp eq i32 %362, 0
  br i1 %363, label %364, label %387

364:                                              ; preds = %358
  %365 = load ptr, ptr %3, align 8, !tbaa !5
  %366 = load ptr, ptr %9, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct._MSC_Process, ptr %366, i32 0, i32 3
  %368 = load i8, ptr %367, align 1, !tbaa !24
  %369 = call zeroext i8 @USBH_LL_GetToggle(ptr noundef %365, i8 noundef zeroext %368)
  store i8 %369, ptr %10, align 1, !tbaa !9
  %370 = load ptr, ptr %3, align 8, !tbaa !5
  %371 = load ptr, ptr %9, align 8, !tbaa !5
  %372 = getelementptr inbounds %struct._MSC_Process, ptr %371, i32 0, i32 3
  %373 = load i8, ptr %372, align 1, !tbaa !24
  %374 = load i8, ptr %10, align 1, !tbaa !9
  %375 = zext i8 %374 to i32
  %376 = sub i32 1, %375
  %377 = trunc i32 %376 to i8
  %378 = call i32 @USBH_LL_SetToggle(ptr noundef %370, i8 noundef zeroext %373, i8 noundef zeroext %377)
  %379 = load ptr, ptr %3, align 8, !tbaa !5
  %380 = load ptr, ptr %9, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct._MSC_Process, ptr %380, i32 0, i32 2
  %382 = load i8, ptr %381, align 4, !tbaa !27
  %383 = call i32 @USBH_LL_SetToggle(ptr noundef %379, i8 noundef zeroext %382, i8 noundef zeroext 0)
  %384 = load ptr, ptr %9, align 8, !tbaa !5
  %385 = getelementptr inbounds %struct._MSC_Process, ptr %384, i32 0, i32 12
  %386 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %385, i32 0, i32 1
  store i32 9, ptr %386, align 8, !tbaa !21
  br label %395

387:                                              ; preds = %358
  %388 = load i32, ptr %6, align 4, !tbaa !10
  %389 = icmp eq i32 %388, 4
  br i1 %389, label %390, label %394

390:                                              ; preds = %387
  %391 = load ptr, ptr %9, align 8, !tbaa !5
  %392 = getelementptr inbounds %struct._MSC_Process, ptr %391, i32 0, i32 12
  %393 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %392, i32 0, i32 1
  store i32 11, ptr %393, align 8, !tbaa !21
  br label %394

394:                                              ; preds = %390, %387
  br label %395

395:                                              ; preds = %394, %364
  br label %407

396:                                              ; preds = %2
  %397 = load ptr, ptr %3, align 8, !tbaa !5
  %398 = call i32 @USBH_MSC_BOT_REQ_Reset(ptr noundef %397)
  store i32 %398, ptr %5, align 4, !tbaa !10
  %399 = load i32, ptr %5, align 4, !tbaa !10
  %400 = icmp eq i32 %399, 0
  br i1 %400, label %401, label %405

401:                                              ; preds = %396
  %402 = load ptr, ptr %9, align 8, !tbaa !5
  %403 = getelementptr inbounds %struct._MSC_Process, ptr %402, i32 0, i32 12
  %404 = getelementptr inbounds %struct.BOT_HandleTypeDef, ptr %403, i32 0, i32 1
  store i32 1, ptr %404, align 8, !tbaa !21
  br label %405

405:                                              ; preds = %401, %396
  br label %407

406:                                              ; preds = %2
  br label %407

407:                                              ; preds = %406, %405, %395, %357, %337, %293, %292, %189, %188, %93, %92, %20
  %408 = load i32, ptr %5, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret i32 %408
}

declare i32 @USBH_BulkSendData(ptr noundef, ptr noundef, i16 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #2

declare i32 @USBH_LL_GetURBState(ptr noundef, i8 noundef zeroext) #2

declare i32 @USBH_BulkReceiveData(ptr noundef, ptr noundef, i16 noundef zeroext, i8 noundef zeroext) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @USBH_MSC_DecodeCSW(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @USBH_MSC_BOT_Abort(ptr noundef, i8 noundef zeroext, i8 noundef zeroext) #0

declare zeroext i8 @USBH_LL_GetToggle(ptr noundef, i8 noundef zeroext) #2

declare i32 @USBH_LL_SetToggle(ptr noundef, i8 noundef zeroext, i8 noundef zeroext) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 928}
!13 = !{!"_USBH_HandleTypeDef", !11, i64 0, !11, i64 4, !11, i64 8, !14, i64 16, !16, i64 56, !7, i64 920, !6, i64 928, !11, i64 936, !7, i64 940, !11, i64 1004, !11, i64 1008, !7, i64 1012, !6, i64 1016, !6, i64 1024}
!14 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !6, i64 8, !15, i64 16, !15, i64 18, !7, i64 20, !11, i64 28, !7, i64 32}
!15 = !{!"short", !7, i64 0}
!16 = !{!"", !7, i64 0, !7, i64 256, !7, i64 768, !7, i64 769, !7, i64 770, !7, i64 771, !7, i64 772, !7, i64 773, !7, i64 774, !7, i64 775, !7, i64 776, !17, i64 778, !18, i64 796}
!17 = !{!"_DeviceDescriptor", !7, i64 0, !7, i64 1, !15, i64 2, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !15, i64 8, !15, i64 10, !15, i64 12, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17}
!18 = !{!"_ConfigurationDescriptor", !7, i64 0, !7, i64 1, !15, i64 2, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 10}
!19 = !{!20, !6, i64 56}
!20 = !{!"", !6, i64 0, !7, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!21 = !{!22, !11, i64 96}
!22 = !{!"_MSC_Process", !7, i64 0, !7, i64 1, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !15, i64 8, !15, i64 10, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !23, i64 32, !7, i64 176, !15, i64 296, !15, i64 298, !11, i64 300}
!23 = !{!"", !7, i64 0, !11, i64 64, !11, i64 68, !11, i64 72, !7, i64 76, !7, i64 108, !7, i64 112, !7, i64 128, !6, i64 136}
!24 = !{!22, !7, i64 5}
!25 = !{!22, !6, i64 168}
!26 = !{!22, !15, i64 10}
!27 = !{!22, !7, i64 4}
!28 = !{!22, !15, i64 8}
!29 = !{!22, !11, i64 104}


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

; Function Attrs: nounwind uwtable
declare dso_local i32 @USBH_MSC_BOT_REQ_Reset(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @USBH_MSC_BOT_Process(ptr noundef %0, i8 noundef zeroext %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 928
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 56
  %6 = load ptr, ptr %5, align 8, !tbaa !16
  %7 = getelementptr inbounds i8, ptr %6, i64 96
  %8 = load i32, ptr %7, align 8, !tbaa !18
  switch i32 %8, label %122 [
    i32 1, label %9
    i32 2, label %15
    i32 3, label %30
    i32 4, label %38
    i32 5, label %58
    i32 6, label %66
    i32 7, label %87
    i32 8, label %92
    i32 9, label %101
    i32 10, label %105
    i32 11, label %118
  ]

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %6, i64 108
  %11 = getelementptr inbounds i8, ptr %6, i64 121
  store i8 %1, ptr %11, align 1, !tbaa !21
  store i32 2, ptr %7, align 8, !tbaa !18
  %12 = getelementptr inbounds i8, ptr %6, i64 5
  %13 = load i8, ptr %12, align 1, !tbaa !22
  %14 = tail call i32 @USBH_BulkSendData(ptr noundef nonnull %0, ptr noundef nonnull %10, i16 noundef zeroext 31, i8 noundef zeroext %13, i8 noundef zeroext 1) #2
  br label %122

15:                                               ; preds = %2
  %16 = getelementptr inbounds i8, ptr %6, i64 5
  %17 = load i8, ptr %16, align 1, !tbaa !22
  %18 = tail call i32 @USBH_LL_GetURBState(ptr noundef nonnull %0, i8 noundef zeroext %17) #2
  switch i32 %18, label %122 [
    i32 1, label %19
    i32 2, label %28
    i32 5, label %29
  ]

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %6, i64 116
  %21 = load i32, ptr %20, align 4, !tbaa !21
  %.not114 = icmp eq i32 %21, 0
  br i1 %.not114, label %27, label %22

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %6, i64 120
  %24 = load i8, ptr %23, align 4, !tbaa !21
  %.not115 = icmp sgt i8 %24, -1
  br i1 %.not115, label %26, label %25

25:                                               ; preds = %22
  store i32 3, ptr %7, align 8, !tbaa !18
  br label %122

26:                                               ; preds = %22
  store i32 5, ptr %7, align 8, !tbaa !18
  br label %122

27:                                               ; preds = %19
  store i32 7, ptr %7, align 8, !tbaa !18
  br label %122

28:                                               ; preds = %15
  store i32 1, ptr %7, align 8, !tbaa !18
  br label %122

29:                                               ; preds = %15
  store i32 10, ptr %7, align 8, !tbaa !18
  br label %122

30:                                               ; preds = %2
  %31 = getelementptr inbounds i8, ptr %6, i64 168
  %32 = load ptr, ptr %31, align 8, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %6, i64 10
  %34 = load i16, ptr %33, align 2, !tbaa !24
  %35 = getelementptr inbounds i8, ptr %6, i64 4
  %36 = load i8, ptr %35, align 4, !tbaa !25
  %37 = tail call i32 @USBH_BulkReceiveData(ptr noundef nonnull %0, ptr noundef %32, i16 noundef zeroext %34, i8 noundef zeroext %36) #2
  store i32 4, ptr %7, align 8, !tbaa !18
  br label %122

38:                                               ; preds = %2
  %39 = getelementptr inbounds i8, ptr %6, i64 4
  %40 = load i8, ptr %39, align 4, !tbaa !25
  %41 = tail call i32 @USBH_LL_GetURBState(ptr noundef nonnull %0, i8 noundef zeroext %40) #2
  switch i32 %41, label %122 [
    i32 1, label %42
    i32 5, label %57
  ]

42:                                               ; preds = %38
  %43 = getelementptr inbounds i8, ptr %6, i64 116
  %44 = load i32, ptr %43, align 4, !tbaa !21
  %45 = getelementptr inbounds i8, ptr %6, i64 10
  %46 = load i16, ptr %45, align 2, !tbaa !24
  %47 = zext i16 %46 to i32
  %48 = icmp ugt i32 %44, %47
  br i1 %48, label %49, label %.thread

.thread:                                          ; preds = %42
  store i32 0, ptr %43, align 4, !tbaa !21
  store i32 7, ptr %7, align 8, !tbaa !18
  br label %122

49:                                               ; preds = %42
  %50 = getelementptr inbounds i8, ptr %6, i64 168
  %51 = load ptr, ptr %50, align 8, !tbaa !23
  %52 = zext i16 %46 to i64
  %53 = getelementptr inbounds i8, ptr %51, i64 %52
  store ptr %53, ptr %50, align 8, !tbaa !23
  %54 = sub i32 %44, %47
  store i32 %54, ptr %43, align 4, !tbaa !21
  %55 = load i8, ptr %39, align 4, !tbaa !25
  %56 = tail call i32 @USBH_BulkReceiveData(ptr noundef nonnull %0, ptr noundef %53, i16 noundef zeroext %46, i8 noundef zeroext %55) #2
  br label %122

57:                                               ; preds = %38
  store i32 9, ptr %7, align 8, !tbaa !18
  br label %122

58:                                               ; preds = %2
  %59 = getelementptr inbounds i8, ptr %6, i64 168
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  %61 = getelementptr inbounds i8, ptr %6, i64 8
  %62 = load i16, ptr %61, align 8, !tbaa !26
  %63 = getelementptr inbounds i8, ptr %6, i64 5
  %64 = load i8, ptr %63, align 1, !tbaa !22
  %65 = tail call i32 @USBH_BulkSendData(ptr noundef nonnull %0, ptr noundef %60, i16 noundef zeroext %62, i8 noundef zeroext %64, i8 noundef zeroext 1) #2
  store i32 6, ptr %7, align 8, !tbaa !18
  br label %122

66:                                               ; preds = %2
  %67 = getelementptr inbounds i8, ptr %6, i64 5
  %68 = load i8, ptr %67, align 1, !tbaa !22
  %69 = tail call i32 @USBH_LL_GetURBState(ptr noundef nonnull %0, i8 noundef zeroext %68) #2
  switch i32 %69, label %122 [
    i32 1, label %70
    i32 2, label %85
    i32 5, label %86
  ]

70:                                               ; preds = %66
  %71 = getelementptr inbounds i8, ptr %6, i64 116
  %72 = load i32, ptr %71, align 4, !tbaa !21
  %73 = getelementptr inbounds i8, ptr %6, i64 8
  %74 = load i16, ptr %73, align 8, !tbaa !26
  %75 = zext i16 %74 to i32
  %76 = icmp ugt i32 %72, %75
  br i1 %76, label %77, label %.thread118

.thread118:                                       ; preds = %70
  store i32 0, ptr %71, align 4, !tbaa !21
  store i32 7, ptr %7, align 8, !tbaa !18
  br label %122

77:                                               ; preds = %70
  %78 = getelementptr inbounds i8, ptr %6, i64 168
  %79 = load ptr, ptr %78, align 8, !tbaa !23
  %80 = zext i16 %74 to i64
  %81 = getelementptr inbounds i8, ptr %79, i64 %80
  store ptr %81, ptr %78, align 8, !tbaa !23
  %82 = sub i32 %72, %75
  store i32 %82, ptr %71, align 4, !tbaa !21
  %83 = load i8, ptr %67, align 1, !tbaa !22
  %84 = tail call i32 @USBH_BulkSendData(ptr noundef nonnull %0, ptr noundef %81, i16 noundef zeroext %74, i8 noundef zeroext %83, i8 noundef zeroext 1) #2
  br label %122

85:                                               ; preds = %66
  store i32 5, ptr %7, align 8, !tbaa !18
  br label %122

86:                                               ; preds = %66
  store i32 10, ptr %7, align 8, !tbaa !18
  br label %122

87:                                               ; preds = %2
  %88 = getelementptr inbounds i8, ptr %6, i64 144
  %89 = getelementptr inbounds i8, ptr %6, i64 4
  %90 = load i8, ptr %89, align 4, !tbaa !25
  %91 = tail call i32 @USBH_BulkReceiveData(ptr noundef nonnull %0, ptr noundef nonnull %88, i16 noundef zeroext 13, i8 noundef zeroext %90) #2
  store i32 8, ptr %7, align 8, !tbaa !18
  br label %122

92:                                               ; preds = %2
  %93 = getelementptr inbounds i8, ptr %6, i64 4
  %94 = load i8, ptr %93, align 4, !tbaa !25
  %95 = tail call i32 @USBH_LL_GetURBState(ptr noundef nonnull %0, i8 noundef zeroext %94) #2
  switch i32 %95, label %122 [
    i32 1, label %96
    i32 5, label %100
  ]

96:                                               ; preds = %92
  store i32 1, ptr %7, align 8, !tbaa !18
  %97 = getelementptr inbounds i8, ptr %6, i64 104
  store i32 1, ptr %97, align 8, !tbaa !27
  %98 = tail call i32 @USBH_MSC_DecodeCSW(ptr noundef nonnull %0)
  %99 = icmp eq i32 %98, 0
  %. = select i1 %99, i32 0, i32 2
  br label %122

100:                                              ; preds = %92
  store i32 9, ptr %7, align 8, !tbaa !18
  br label %122

101:                                              ; preds = %2
  %102 = tail call i32 @USBH_MSC_BOT_Abort(ptr noundef nonnull %0, i8 noundef zeroext %1, i8 noundef zeroext 0)
  switch i32 %102, label %122 [
    i32 0, label %103
    i32 4, label %104
  ]

103:                                              ; preds = %101
  store i32 7, ptr %7, align 8, !tbaa !18
  br label %122

104:                                              ; preds = %101
  store i32 11, ptr %7, align 8, !tbaa !18
  br label %122

105:                                              ; preds = %2
  %106 = tail call i32 @USBH_MSC_BOT_Abort(ptr noundef nonnull %0, i8 noundef zeroext %1, i8 noundef zeroext 1)
  switch i32 %106, label %122 [
    i32 0, label %107
    i32 4, label %117
  ]

107:                                              ; preds = %105
  %108 = getelementptr inbounds i8, ptr %6, i64 5
  %109 = load i8, ptr %108, align 1, !tbaa !22
  %110 = tail call zeroext i8 @USBH_LL_GetToggle(ptr noundef nonnull %0, i8 noundef zeroext %109) #2
  %111 = load i8, ptr %108, align 1, !tbaa !22
  %112 = sub i8 1, %110
  %113 = tail call i32 @USBH_LL_SetToggle(ptr noundef nonnull %0, i8 noundef zeroext %111, i8 noundef zeroext %112) #2
  %114 = getelementptr inbounds i8, ptr %6, i64 4
  %115 = load i8, ptr %114, align 4, !tbaa !25
  %116 = tail call i32 @USBH_LL_SetToggle(ptr noundef nonnull %0, i8 noundef zeroext %115, i8 noundef zeroext 0) #2
  store i32 9, ptr %7, align 8, !tbaa !18
  br label %122

117:                                              ; preds = %105
  store i32 11, ptr %7, align 8, !tbaa !18
  br label %122

118:                                              ; preds = %2
  %119 = tail call i32 @USBH_MSC_BOT_REQ_Reset(ptr noundef nonnull %0)
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %121, label %122

121:                                              ; preds = %118
  store i32 1, ptr %7, align 8, !tbaa !18
  br label %122

122:                                              ; preds = %105, %101, %92, %96, %66, %38, %15, %2, %118, %121, %107, %117, %103, %104, %100, %.thread118, %77, %86, %85, %.thread, %49, %57, %25, %26, %27, %29, %28, %87, %58, %30, %9
  %.0 = phi i32 [ 1, %2 ], [ 0, %121 ], [ %119, %118 ], [ 1, %107 ], [ 1, %117 ], [ 1, %103 ], [ 1, %104 ], [ 1, %100 ], [ 1, %87 ], [ 1, %77 ], [ 1, %.thread118 ], [ 1, %85 ], [ 1, %86 ], [ 1, %58 ], [ 1, %49 ], [ 1, %.thread ], [ 1, %57 ], [ 1, %30 ], [ 1, %25 ], [ 1, %26 ], [ 1, %27 ], [ 1, %28 ], [ 1, %29 ], [ 1, %9 ], [ 1, %15 ], [ 1, %38 ], [ 1, %66 ], [ %., %96 ], [ 1, %92 ], [ 1, %101 ], [ 1, %105 ]
  ret i32 %.0
}

declare i32 @USBH_BulkSendData(ptr noundef, ptr noundef, i16 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

declare i32 @USBH_LL_GetURBState(ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

declare i32 @USBH_BulkReceiveData(ptr noundef, ptr noundef, i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @USBH_MSC_DecodeCSW(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @USBH_MSC_BOT_Abort(ptr noundef, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #0

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

declare i32 @USBH_LL_SetToggle(ptr noundef, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

attributes #0 = { 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 #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 }

!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, !11, i64 928}
!6 = !{!"_USBH_HandleTypeDef", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !13, i64 56, !8, i64 920, !11, i64 928, !7, i64 936, !8, i64 940, !7, i64 1004, !7, i64 1008, !8, i64 1012, !11, i64 1016, !11, i64 1024}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !11, i64 8, !12, i64 16, !12, i64 18, !8, i64 20, !7, i64 28, !8, i64 32}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"", !8, i64 0, !8, i64 256, !8, i64 768, !8, i64 769, !8, i64 770, !8, i64 771, !8, i64 772, !8, i64 773, !8, i64 774, !8, i64 775, !8, i64 776, !14, i64 778, !15, i64 796}
!14 = !{!"_DeviceDescriptor", !8, i64 0, !8, i64 1, !12, i64 2, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !12, i64 8, !12, i64 10, !12, i64 12, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17}
!15 = !{!"_ConfigurationDescriptor", !8, i64 0, !8, i64 1, !12, i64 2, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !8, i64 10}
!16 = !{!17, !11, i64 56}
!17 = !{!"", !11, i64 0, !8, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!18 = !{!19, !7, i64 96}
!19 = !{!"_MSC_Process", !8, i64 0, !8, i64 1, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !12, i64 8, !12, i64 10, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !20, i64 32, !8, i64 176, !12, i64 296, !12, i64 298, !7, i64 300}
!20 = !{!"", !8, i64 0, !7, i64 64, !7, i64 68, !7, i64 72, !8, i64 76, !8, i64 108, !8, i64 112, !8, i64 128, !11, i64 136}
!21 = !{!8, !8, i64 0}
!22 = !{!19, !8, i64 5}
!23 = !{!19, !11, i64 168}
!24 = !{!19, !12, i64 10}
!25 = !{!19, !8, i64 4}
!26 = !{!19, !12, i64 8}
!27 = !{!19, !7, i64 104}


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