; LLVM IR from ctlst-tech/catpilot :: bsp/mcu/core/stm32/h753/hal/src (stm32h7xx_hal_hcd)

; 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.HCD_HandleTypeDef = type { ptr, %struct.USB_OTG_CfgTypeDef, [16 x %struct.USB_OTG_HCTypeDef], i32, i32, i32, ptr }
%struct.USB_OTG_CfgTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.USB_OTG_HCTypeDef = type { i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, ptr, i32, i32, i32, i8, i8, i32, i32, i32, i32 }
%struct.USB_OTG_GlobalTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [39 x i32], i32, [15 x i32] }
%struct.USB_OTG_HostChannelTypeDef = type { i32, i32, i32, i32, i32, i32, [2 x i32] }

; 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
define dso_local void @HAL_HCD_IRQHandler(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %8, i32 0, i32 0
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %10, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = ptrtoint ptr %11 to i32
  store i32 %12, ptr %4, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %13, i32 0, i32 0
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = call i32 @USB_GetMode(ptr noundef %15)
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %223

18:                                               ; preds = %1
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = call i32 @USB_ReadInterrupts(ptr noundef %21)
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %18
  store i32 1, ptr %7, align 4
  br label %224

25:                                               ; preds = %18
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call i32 @USB_ReadInterrupts(ptr noundef %28)
  %30 = zext i32 %29 to i64
  %31 = and i64 %30, 2097152
  %32 = icmp eq i64 %31, 2097152
  br i1 %32, label %33, label %38

33:                                               ; preds = %25
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %36, i32 0, i32 5
  store volatile i32 2097152, ptr %37, align 4, !tbaa !14
  br label %38

38:                                               ; preds = %33, %25
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = call i32 @USB_ReadInterrupts(ptr noundef %41)
  %43 = zext i32 %42 to i64
  %44 = and i64 %43, 1048576
  %45 = icmp eq i64 %44, 1048576
  br i1 %45, label %46, label %51

46:                                               ; preds = %38
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %49, i32 0, i32 5
  store volatile i32 1048576, ptr %50, align 4, !tbaa !14
  br label %51

51:                                               ; preds = %46, %38
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = call i32 @USB_ReadInterrupts(ptr noundef %54)
  %56 = zext i32 %55 to i64
  %57 = and i64 %56, 67108864
  %58 = icmp eq i64 %57, 67108864
  br i1 %58, label %59, label %64

59:                                               ; preds = %51
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %62, i32 0, i32 5
  store volatile i32 67108864, ptr %63, align 4, !tbaa !14
  br label %64

64:                                               ; preds = %59, %51
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = call i32 @USB_ReadInterrupts(ptr noundef %67)
  %69 = zext i32 %68 to i64
  %70 = and i64 %69, 2
  %71 = icmp eq i64 %70, 2
  br i1 %71, label %72, label %77

72:                                               ; preds = %64
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %75, i32 0, i32 5
  store volatile i32 2, ptr %76, align 4, !tbaa !14
  br label %77

77:                                               ; preds = %72, %64
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %78, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = call i32 @USB_ReadInterrupts(ptr noundef %80)
  %82 = zext i32 %81 to i64
  %83 = and i64 %82, 536870912
  %84 = icmp eq i64 %83, 536870912
  br i1 %84, label %85, label %109

85:                                               ; preds = %77
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %88, i32 0, i32 5
  store volatile i32 536870912, ptr %89, align 4, !tbaa !14
  %90 = load i32, ptr %4, align 4, !tbaa !13
  %91 = zext i32 %90 to i64
  %92 = add i64 %91, 1088
  %93 = inttoptr i64 %92 to ptr
  %94 = load volatile i32, ptr %93, align 4, !tbaa !13
  %95 = zext i32 %94 to i64
  %96 = and i64 %95, 1
  %97 = icmp eq i64 %96, 0
  br i1 %97, label %98, label %108

98:                                               ; preds = %85
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = call i32 @USB_FlushTxFifo(ptr noundef %99, i32 noundef 16)
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = call i32 @USB_FlushRxFifo(ptr noundef %101)
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = call i32 @USB_InitFSLSPClkSel(ptr noundef %105, i8 noundef zeroext 1)
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_HCD_Disconnect_Callback(ptr noundef %107)
  br label %108

108:                                              ; preds = %98, %85
  br label %109

109:                                              ; preds = %108, %77
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !9
  %113 = call i32 @USB_ReadInterrupts(ptr noundef %112)
  %114 = zext i32 %113 to i64
  %115 = and i64 %114, 16777216
  %116 = icmp eq i64 %115, 16777216
  br i1 %116, label %117, label %119

117:                                              ; preds = %109
  %118 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HCD_Port_IRQHandler(ptr noundef %118)
  br label %119

119:                                              ; preds = %117, %109
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !9
  %123 = call i32 @USB_ReadInterrupts(ptr noundef %122)
  %124 = zext i32 %123 to i64
  %125 = and i64 %124, 8
  %126 = icmp eq i64 %125, 8
  br i1 %126, label %127, label %133

127:                                              ; preds = %119
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_HCD_SOF_Callback(ptr noundef %128)
  %129 = load ptr, ptr %2, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %131, i32 0, i32 5
  store volatile i32 8, ptr %132, align 4, !tbaa !14
  br label %133

133:                                              ; preds = %127, %119
  %134 = load ptr, ptr %2, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !9
  %137 = call i32 @USB_ReadInterrupts(ptr noundef %136)
  %138 = zext i32 %137 to i64
  %139 = and i64 %138, 16
  %140 = icmp eq i64 %139, 16
  %141 = zext i1 %140 to i32
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %161

143:                                              ; preds = %133
  %144 = load ptr, ptr %2, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %144, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !9
  %147 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %146, i32 0, i32 6
  %148 = load volatile i32, ptr %147, align 4, !tbaa !16
  %149 = zext i32 %148 to i64
  %150 = and i64 %149, -17
  %151 = trunc i64 %150 to i32
  store volatile i32 %151, ptr %147, align 4, !tbaa !16
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HCD_RXQLVL_IRQHandler(ptr noundef %152)
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !9
  %156 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %155, i32 0, i32 6
  %157 = load volatile i32, ptr %156, align 4, !tbaa !16
  %158 = zext i32 %157 to i64
  %159 = or i64 %158, 16
  %160 = trunc i64 %159 to i32
  store volatile i32 %160, ptr %156, align 4, !tbaa !16
  br label %161

161:                                              ; preds = %143, %133
  %162 = load ptr, ptr %2, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %162, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8, !tbaa !9
  %165 = call i32 @USB_ReadInterrupts(ptr noundef %164)
  %166 = zext i32 %165 to i64
  %167 = and i64 %166, 33554432
  %168 = icmp eq i64 %167, 33554432
  br i1 %168, label %169, label %222

169:                                              ; preds = %161
  %170 = load ptr, ptr %2, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %170, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8, !tbaa !9
  %173 = call i32 @USB_HC_ReadInterrupt(ptr noundef %172)
  store i32 %173, ptr %6, align 4, !tbaa !13
  store i32 0, ptr %5, align 4, !tbaa !13
  br label %174

174:                                              ; preds = %214, %169
  %175 = load i32, ptr %5, align 4, !tbaa !13
  %176 = load ptr, ptr %2, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %176, i32 0, i32 1
  %178 = getelementptr inbounds %struct.USB_OTG_CfgTypeDef, ptr %177, i32 0, i32 1
  %179 = load i32, ptr %178, align 4, !tbaa !17
  %180 = icmp ult i32 %175, %179
  br i1 %180, label %181, label %217

181:                                              ; preds = %174
  %182 = load i32, ptr %6, align 4, !tbaa !13
  %183 = zext i32 %182 to i64
  %184 = load i32, ptr %5, align 4, !tbaa !13
  %185 = and i32 %184, 15
  %186 = zext i32 %185 to i64
  %187 = shl i64 1, %186
  %188 = and i64 %183, %187
  %189 = icmp ne i64 %188, 0
  br i1 %189, label %190, label %213

190:                                              ; preds = %181
  %191 = load i32, ptr %4, align 4, !tbaa !13
  %192 = zext i32 %191 to i64
  %193 = add i64 %192, 1280
  %194 = load i32, ptr %5, align 4, !tbaa !13
  %195 = zext i32 %194 to i64
  %196 = mul i64 %195, 32
  %197 = add i64 %193, %196
  %198 = inttoptr i64 %197 to ptr
  %199 = getelementptr inbounds %struct.USB_OTG_HostChannelTypeDef, ptr %198, i32 0, i32 0
  %200 = load volatile i32, ptr %199, align 4, !tbaa !18
  %201 = zext i32 %200 to i64
  %202 = and i64 %201, 32768
  %203 = icmp eq i64 %202, 32768
  br i1 %203, label %204, label %208

204:                                              ; preds = %190
  %205 = load ptr, ptr %2, align 8, !tbaa !5
  %206 = load i32, ptr %5, align 4, !tbaa !13
  %207 = trunc i32 %206 to i8
  call void @HCD_HC_IN_IRQHandler(ptr noundef %205, i8 noundef zeroext %207)
  br label %212

208:                                              ; preds = %190
  %209 = load ptr, ptr %2, align 8, !tbaa !5
  %210 = load i32, ptr %5, align 4, !tbaa !13
  %211 = trunc i32 %210 to i8
  call void @HCD_HC_OUT_IRQHandler(ptr noundef %209, i8 noundef zeroext %211)
  br label %212

212:                                              ; preds = %208, %204
  br label %213

213:                                              ; preds = %212, %181
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %5, align 4, !tbaa !13
  %216 = add i32 %215, 1
  store i32 %216, ptr %5, align 4, !tbaa !13
  br label %174, !llvm.loop !20

217:                                              ; preds = %174
  %218 = load ptr, ptr %2, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %218, i32 0, i32 0
  %220 = load ptr, ptr %219, align 8, !tbaa !9
  %221 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %220, i32 0, i32 5
  store volatile i32 33554432, ptr %221, align 4, !tbaa !14
  br label %222

222:                                              ; preds = %217, %161
  br label %223

223:                                              ; preds = %222, %1
  store i32 0, ptr %7, align 4
  br label %224

224:                                              ; preds = %223, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %225 = load i32, ptr %7, align 4
  switch i32 %225, label %227 [
    i32 0, label %226
    i32 1, label %226
  ]

226:                                              ; preds = %224, %224
  ret void

227:                                              ; preds = %224
  unreachable
}

declare i32 @USB_GetMode(ptr noundef) #2

declare i32 @USB_ReadInterrupts(ptr noundef) #2

declare i32 @USB_FlushTxFifo(ptr noundef, i32 noundef) #2

declare i32 @USB_FlushRxFifo(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_HCD_Disconnect_Callback(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @HCD_Port_IRQHandler(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_HCD_SOF_Callback(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @HCD_RXQLVL_IRQHandler(ptr noundef) #1

declare i32 @USB_HC_ReadInterrupt(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @HCD_HC_IN_IRQHandler(ptr noundef, i8 noundef zeroext) #1

; Function Attrs: nounwind uwtable
declare hidden void @HCD_HC_OUT_IRQHandler(ptr noundef, i8 noundef zeroext) #1

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, !6, i64 0}
!10 = !{!"", !6, i64 0, !11, i64 8, !7, i64 64, !12, i64 960, !12, i64 964, !12, i64 968, !6, i64 976}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!15, !12, i64 20}
!15 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !7, i64 48, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !7, i64 100, !12, i64 256, !7, i64 260}
!16 = !{!15, !12, i64 24}
!17 = !{!10, !12, i64 12}
!18 = !{!19, !12, i64 0}
!19 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !7, i64 24}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


; 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
define dso_local void @HAL_HCD_IRQHandler(ptr noundef %0) local_unnamed_addr #0 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %3 = ptrtoint ptr %2 to i64
  %4 = tail call i32 @USB_GetMode(ptr noundef %2) #2
  %5 = icmp eq i32 %4, 1
  br i1 %5, label %6, label %102

6:                                                ; preds = %1
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  %8 = tail call i32 @USB_ReadInterrupts(ptr noundef %7) #2
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %102, label %10

10:                                               ; preds = %6
  %11 = load ptr, ptr %0, align 8, !tbaa !5
  %12 = tail call i32 @USB_ReadInterrupts(ptr noundef %11) #2
  %13 = and i32 %12, 2097152
  %.not = icmp eq i32 %13, 0
  %.pre = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not, label %16, label %14

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %.pre, i64 20
  store volatile i32 2097152, ptr %15, align 4, !tbaa !12
  br label %16

16:                                               ; preds = %14, %10
  %17 = tail call i32 @USB_ReadInterrupts(ptr noundef %.pre) #2
  %18 = and i32 %17, 1048576
  %.not41 = icmp eq i32 %18, 0
  %.pre54 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not41, label %21, label %19

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %.pre54, i64 20
  store volatile i32 1048576, ptr %20, align 4, !tbaa !12
  br label %21

21:                                               ; preds = %19, %16
  %22 = tail call i32 @USB_ReadInterrupts(ptr noundef %.pre54) #2
  %23 = and i32 %22, 67108864
  %.not42 = icmp eq i32 %23, 0
  %.pre55 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not42, label %26, label %24

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %.pre55, i64 20
  store volatile i32 67108864, ptr %25, align 4, !tbaa !12
  br label %26

26:                                               ; preds = %24, %21
  %27 = tail call i32 @USB_ReadInterrupts(ptr noundef %.pre55) #2
  %28 = and i32 %27, 2
  %.not43 = icmp eq i32 %28, 0
  %.pre56 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not43, label %31, label %29

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %.pre56, i64 20
  store volatile i32 2, ptr %30, align 4, !tbaa !12
  br label %31

31:                                               ; preds = %29, %26
  %32 = tail call i32 @USB_ReadInterrupts(ptr noundef %.pre56) #2
  %33 = and i32 %32, 536870912
  %.not44 = icmp eq i32 %33, 0
  %.pre58 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not44, label %47, label %34

34:                                               ; preds = %31
  %35 = getelementptr inbounds i8, ptr %.pre58, i64 20
  store volatile i32 536870912, ptr %35, align 4, !tbaa !12
  %36 = and i64 %3, 4294967295
  %37 = add nuw nsw i64 %36, 1088
  %38 = inttoptr i64 %37 to ptr
  %39 = load volatile i32, ptr %38, align 4, !tbaa !14
  %40 = and i32 %39, 1
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %47

42:                                               ; preds = %34
  %43 = tail call i32 @USB_FlushTxFifo(ptr noundef %2, i32 noundef 16) #2
  %44 = tail call i32 @USB_FlushRxFifo(ptr noundef %2) #2
  %45 = load ptr, ptr %0, align 8, !tbaa !5
  %46 = tail call i32 @USB_InitFSLSPClkSel(ptr noundef %45, i8 noundef zeroext 1) #2
  tail call void @HAL_HCD_Disconnect_Callback(ptr noundef nonnull %0)
  %.pre57 = load ptr, ptr %0, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %34, %42, %31
  %48 = phi ptr [ %.pre58, %34 ], [ %.pre57, %42 ], [ %.pre58, %31 ]
  %49 = tail call i32 @USB_ReadInterrupts(ptr noundef %48) #2
  %50 = and i32 %49, 16777216
  %.not45 = icmp eq i32 %50, 0
  br i1 %.not45, label %52, label %51

51:                                               ; preds = %47
  tail call void @HCD_Port_IRQHandler(ptr noundef nonnull %0)
  br label %52

52:                                               ; preds = %51, %47
  %53 = load ptr, ptr %0, align 8, !tbaa !5
  %54 = tail call i32 @USB_ReadInterrupts(ptr noundef %53) #2
  %55 = and i32 %54, 8
  %.not46 = icmp eq i32 %55, 0
  br i1 %.not46, label %._crit_edge59, label %56

._crit_edge59:                                    ; preds = %52
  %.pre60 = load ptr, ptr %0, align 8, !tbaa !5
  br label %59

56:                                               ; preds = %52
  tail call void @HAL_HCD_SOF_Callback(ptr noundef nonnull %0)
  %57 = load ptr, ptr %0, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 20
  store volatile i32 8, ptr %58, align 4, !tbaa !12
  br label %59

59:                                               ; preds = %._crit_edge59, %56
  %60 = phi ptr [ %.pre60, %._crit_edge59 ], [ %57, %56 ]
  %61 = tail call i32 @USB_ReadInterrupts(ptr noundef %60) #2
  %62 = and i32 %61, 16
  %.not47 = icmp eq i32 %62, 0
  %.pre61 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not47, label %71, label %63

63:                                               ; preds = %59
  %64 = getelementptr inbounds i8, ptr %.pre61, i64 24
  %65 = load volatile i32, ptr %64, align 4, !tbaa !15
  %66 = and i32 %65, -17
  store volatile i32 %66, ptr %64, align 4, !tbaa !15
  tail call void @HCD_RXQLVL_IRQHandler(ptr noundef nonnull %0)
  %67 = load ptr, ptr %0, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 24
  %69 = load volatile i32, ptr %68, align 4, !tbaa !15
  %70 = or i32 %69, 16
  store volatile i32 %70, ptr %68, align 4, !tbaa !15
  br label %71

71:                                               ; preds = %63, %59
  %72 = phi ptr [ %67, %63 ], [ %.pre61, %59 ]
  %73 = tail call i32 @USB_ReadInterrupts(ptr noundef %72) #2
  %74 = and i32 %73, 33554432
  %.not48 = icmp eq i32 %74, 0
  br i1 %.not48, label %102, label %75

75:                                               ; preds = %71
  %76 = load ptr, ptr %0, align 8, !tbaa !5
  %77 = tail call i32 @USB_HC_ReadInterrupt(ptr noundef %76) #2
  %78 = getelementptr inbounds i8, ptr %0, i64 12
  %79 = load i32, ptr %78, align 4, !tbaa !16
  %.not52 = icmp eq i32 %79, 0
  br i1 %.not52, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %75
  %80 = zext i32 %77 to i64
  %81 = and i64 %3, 4294967295
  %82 = add nuw nsw i64 %81, 1280
  br label %83

83:                                               ; preds = %.lr.ph, %96
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %96 ]
  %84 = and i64 %indvars.iv, 15
  %85 = shl nuw nsw i64 1, %84
  %86 = and i64 %85, %80
  %.not49 = icmp eq i64 %86, 0
  br i1 %.not49, label %96, label %87

87:                                               ; preds = %83
  %88 = shl nuw nsw i64 %indvars.iv, 5
  %89 = add nuw nsw i64 %82, %88
  %90 = inttoptr i64 %89 to ptr
  %91 = load volatile i32, ptr %90, align 4, !tbaa !17
  %92 = and i32 %91, 32768
  %.not50 = icmp eq i32 %92, 0
  %93 = trunc i64 %indvars.iv to i8
  br i1 %.not50, label %95, label %94

94:                                               ; preds = %87
  tail call void @HCD_HC_IN_IRQHandler(ptr noundef nonnull %0, i8 noundef zeroext %93)
  br label %96

95:                                               ; preds = %87
  tail call void @HCD_HC_OUT_IRQHandler(ptr noundef nonnull %0, i8 noundef zeroext %93)
  br label %96

96:                                               ; preds = %83, %95, %94
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %97 = load i32, ptr %78, align 4, !tbaa !16
  %98 = zext i32 %97 to i64
  %99 = icmp ult i64 %indvars.iv.next, %98
  br i1 %99, label %83, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %96, %75
  %100 = load ptr, ptr %0, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 20
  store volatile i32 33554432, ptr %101, align 4, !tbaa !12
  br label %102

102:                                              ; preds = %1, %._crit_edge, %71, %6
  ret void
}

declare i32 @USB_GetMode(ptr noundef) local_unnamed_addr #1

declare i32 @USB_ReadInterrupts(ptr noundef) local_unnamed_addr #1

declare i32 @USB_FlushTxFifo(ptr noundef, i32 noundef) local_unnamed_addr #1

declare i32 @USB_FlushRxFifo(ptr noundef) local_unnamed_addr #1

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

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

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

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

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

declare i32 @USB_HC_ReadInterrupt(ptr noundef) local_unnamed_addr #1

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

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

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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8, !8, i64 64, !11, i64 960, !11, i64 964, !11, i64 968, !7, i64 976}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48}
!11 = !{!"int", !8, i64 0}
!12 = !{!13, !11, i64 20}
!13 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !8, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !8, i64 100, !11, i64 256, !8, i64 260}
!14 = !{!11, !11, i64 0}
!15 = !{!13, !11, i64 24}
!16 = !{!6, !11, i64 12}
!17 = !{!18, !11, i64 0}
!18 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !8, i64 24}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass