; LLVM IR from lichen-community-systems/signaletic :: hosts/daisy/vendor/libDaisy/Drivers/STM32H7xx_HAL_Driver/Src (IRQHandler)

; 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, 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 %217

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 %218

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 %103

85:                                               ; preds = %77
  %86 = load i32, ptr %4, align 4, !tbaa !13
  %87 = zext i32 %86 to i64
  %88 = add i64 %87, 1088
  %89 = inttoptr i64 %88 to ptr
  %90 = load volatile i32, ptr %89, align 4, !tbaa !13
  %91 = zext i32 %90 to i64
  %92 = and i64 %91, -47
  %93 = trunc i64 %92 to i32
  store volatile i32 %93, ptr %89, align 4, !tbaa !13
  %94 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_HCD_Disconnect_Callback(ptr noundef %94)
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !9
  %98 = call i32 @USB_InitFSLSPClkSel(ptr noundef %97, i8 noundef zeroext 1)
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %101, i32 0, i32 5
  store volatile i32 536870912, ptr %102, align 4, !tbaa !14
  br label %103

103:                                              ; preds = %85, %77
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = call i32 @USB_ReadInterrupts(ptr noundef %106)
  %108 = zext i32 %107 to i64
  %109 = and i64 %108, 16777216
  %110 = icmp eq i64 %109, 16777216
  br i1 %110, label %111, label %113

111:                                              ; preds = %103
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HCD_Port_IRQHandler(ptr noundef %112)
  br label %113

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

121:                                              ; preds = %113
  %122 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_HCD_SOF_Callback(ptr noundef %122)
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %125, i32 0, i32 5
  store volatile i32 8, ptr %126, align 4, !tbaa !14
  br label %127

127:                                              ; preds = %121, %113
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  %131 = call i32 @USB_ReadInterrupts(ptr noundef %130)
  %132 = zext i32 %131 to i64
  %133 = and i64 %132, 33554432
  %134 = icmp eq i64 %133, 33554432
  br i1 %134, label %135, label %188

135:                                              ; preds = %127
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  %139 = call i32 @USB_HC_ReadInterrupt(ptr noundef %138)
  store i32 %139, ptr %6, align 4, !tbaa !13
  store i32 0, ptr %5, align 4, !tbaa !13
  br label %140

140:                                              ; preds = %180, %135
  %141 = load i32, ptr %5, align 4, !tbaa !13
  %142 = load ptr, ptr %2, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %142, i32 0, i32 1
  %144 = getelementptr inbounds %struct.USB_OTG_CfgTypeDef, ptr %143, i32 0, i32 1
  %145 = load i32, ptr %144, align 4, !tbaa !16
  %146 = icmp ult i32 %141, %145
  br i1 %146, label %147, label %183

147:                                              ; preds = %140
  %148 = load i32, ptr %6, align 4, !tbaa !13
  %149 = zext i32 %148 to i64
  %150 = load i32, ptr %5, align 4, !tbaa !13
  %151 = and i32 %150, 15
  %152 = zext i32 %151 to i64
  %153 = shl i64 1, %152
  %154 = and i64 %149, %153
  %155 = icmp ne i64 %154, 0
  br i1 %155, label %156, label %179

156:                                              ; preds = %147
  %157 = load i32, ptr %4, align 4, !tbaa !13
  %158 = zext i32 %157 to i64
  %159 = add i64 %158, 1280
  %160 = load i32, ptr %5, align 4, !tbaa !13
  %161 = zext i32 %160 to i64
  %162 = mul i64 %161, 32
  %163 = add i64 %159, %162
  %164 = inttoptr i64 %163 to ptr
  %165 = getelementptr inbounds %struct.USB_OTG_HostChannelTypeDef, ptr %164, i32 0, i32 0
  %166 = load volatile i32, ptr %165, align 4, !tbaa !17
  %167 = zext i32 %166 to i64
  %168 = and i64 %167, 32768
  %169 = icmp eq i64 %168, 32768
  br i1 %169, label %170, label %174

170:                                              ; preds = %156
  %171 = load ptr, ptr %2, align 8, !tbaa !5
  %172 = load i32, ptr %5, align 4, !tbaa !13
  %173 = trunc i32 %172 to i8
  call void @HCD_HC_IN_IRQHandler(ptr noundef %171, i8 noundef zeroext %173)
  br label %178

174:                                              ; preds = %156
  %175 = load ptr, ptr %2, align 8, !tbaa !5
  %176 = load i32, ptr %5, align 4, !tbaa !13
  %177 = trunc i32 %176 to i8
  call void @HCD_HC_OUT_IRQHandler(ptr noundef %175, i8 noundef zeroext %177)
  br label %178

178:                                              ; preds = %174, %170
  br label %179

179:                                              ; preds = %178, %147
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %5, align 4, !tbaa !13
  %182 = add i32 %181, 1
  store i32 %182, ptr %5, align 4, !tbaa !13
  br label %140, !llvm.loop !19

183:                                              ; preds = %140
  %184 = load ptr, ptr %2, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !9
  %187 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %186, i32 0, i32 5
  store volatile i32 33554432, ptr %187, align 4, !tbaa !14
  br label %188

188:                                              ; preds = %183, %127
  %189 = load ptr, ptr %2, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !9
  %192 = call i32 @USB_ReadInterrupts(ptr noundef %191)
  %193 = zext i32 %192 to i64
  %194 = and i64 %193, 16
  %195 = icmp eq i64 %194, 16
  %196 = zext i1 %195 to i32
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %216

198:                                              ; preds = %188
  %199 = load ptr, ptr %2, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %199, i32 0, i32 0
  %201 = load ptr, ptr %200, align 8, !tbaa !9
  %202 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %201, i32 0, i32 6
  %203 = load volatile i32, ptr %202, align 4, !tbaa !21
  %204 = zext i32 %203 to i64
  %205 = and i64 %204, -17
  %206 = trunc i64 %205 to i32
  store volatile i32 %206, ptr %202, align 4, !tbaa !21
  %207 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HCD_RXQLVL_IRQHandler(ptr noundef %207)
  %208 = load ptr, ptr %2, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.HCD_HandleTypeDef, ptr %208, i32 0, i32 0
  %210 = load ptr, ptr %209, align 8, !tbaa !9
  %211 = getelementptr inbounds %struct.USB_OTG_GlobalTypeDef, ptr %210, i32 0, i32 6
  %212 = load volatile i32, ptr %211, align 4, !tbaa !21
  %213 = zext i32 %212 to i64
  %214 = or i64 %213, 16
  %215 = trunc i64 %214 to i32
  store volatile i32 %215, ptr %211, align 4, !tbaa !21
  br label %216

216:                                              ; preds = %198, %188
  br label %217

217:                                              ; preds = %216, %1
  store i32 0, ptr %7, align 4
  br label %218

218:                                              ; preds = %217, %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
  %219 = load i32, ptr %7, align 4
  switch i32 %219, label %221 [
    i32 0, label %220
    i32 1, label %220
  ]

220:                                              ; preds = %218, %218
  ret void

221:                                              ; preds = %218
  unreachable
}

declare i32 @USB_GetMode(ptr noundef) #2

declare i32 @USB_ReadInterrupts(ptr noundef) #2

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

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

; 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

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

; Function Attrs: nounwind uwtable
declare hidden void @HCD_RXQLVL_IRQHandler(ptr noundef) #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 = !{!10, !12, i64 12}
!17 = !{!18, !12, i64 0}
!18 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !7, i64 24}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!15, !12, i64 24}


; 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 %99

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 %99, 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
  %.not39 = icmp eq i32 %18, 0
  %.pre52 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not39, label %21, label %19

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %.pre52, 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 %.pre52) #2
  %23 = and i32 %22, 67108864
  %.not40 = icmp eq i32 %23, 0
  %.pre53 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not40, label %26, label %24

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %.pre53, 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 %.pre53) #2
  %28 = and i32 %27, 2
  %.not41 = icmp eq i32 %28, 0
  %.pre54 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not41, label %31, label %29

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %.pre54, 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 %.pre54) #2
  %33 = and i32 %32, 536870912
  %.not42 = icmp eq i32 %33, 0
  br i1 %.not42, label %._crit_edge55, label %34

._crit_edge55:                                    ; preds = %31
  %.pre56 = load ptr, ptr %0, align 8, !tbaa !5
  br label %44

34:                                               ; preds = %31
  %35 = and i64 %3, 4294967295
  %36 = add nuw nsw i64 %35, 1088
  %37 = inttoptr i64 %36 to ptr
  %38 = load volatile i32, ptr %37, align 4, !tbaa !14
  %39 = and i32 %38, -47
  store volatile i32 %39, ptr %37, align 4, !tbaa !14
  tail call void @HAL_HCD_Disconnect_Callback(ptr noundef nonnull %0)
  %40 = load ptr, ptr %0, align 8, !tbaa !5
  %41 = tail call i32 @USB_InitFSLSPClkSel(ptr noundef %40, i8 noundef zeroext 1) #2
  %42 = load ptr, ptr %0, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 20
  store volatile i32 536870912, ptr %43, align 4, !tbaa !12
  br label %44

44:                                               ; preds = %._crit_edge55, %34
  %45 = phi ptr [ %.pre56, %._crit_edge55 ], [ %42, %34 ]
  %46 = tail call i32 @USB_ReadInterrupts(ptr noundef %45) #2
  %47 = and i32 %46, 16777216
  %.not43 = icmp eq i32 %47, 0
  br i1 %.not43, label %49, label %48

48:                                               ; preds = %44
  tail call void @HCD_Port_IRQHandler(ptr noundef nonnull %0)
  br label %49

49:                                               ; preds = %48, %44
  %50 = load ptr, ptr %0, align 8, !tbaa !5
  %51 = tail call i32 @USB_ReadInterrupts(ptr noundef %50) #2
  %52 = and i32 %51, 8
  %.not44 = icmp eq i32 %52, 0
  br i1 %.not44, label %._crit_edge57, label %53

._crit_edge57:                                    ; preds = %49
  %.pre58 = load ptr, ptr %0, align 8, !tbaa !5
  br label %56

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

56:                                               ; preds = %._crit_edge57, %53
  %57 = phi ptr [ %.pre58, %._crit_edge57 ], [ %54, %53 ]
  %58 = tail call i32 @USB_ReadInterrupts(ptr noundef %57) #2
  %59 = and i32 %58, 33554432
  %.not45 = icmp eq i32 %59, 0
  %.pre59 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not45, label %86, label %60

60:                                               ; preds = %56
  %61 = tail call i32 @USB_HC_ReadInterrupt(ptr noundef %.pre59) #2
  %62 = getelementptr inbounds i8, ptr %0, i64 12
  %63 = load i32, ptr %62, align 4, !tbaa !15
  %.not50 = icmp eq i32 %63, 0
  br i1 %.not50, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %60
  %64 = zext i32 %61 to i64
  %65 = and i64 %3, 4294967295
  %66 = add nuw nsw i64 %65, 1280
  br label %67

67:                                               ; preds = %.lr.ph, %80
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %80 ]
  %68 = and i64 %indvars.iv, 15
  %69 = shl nuw nsw i64 1, %68
  %70 = and i64 %69, %64
  %.not47 = icmp eq i64 %70, 0
  br i1 %.not47, label %80, label %71

71:                                               ; preds = %67
  %72 = shl nuw nsw i64 %indvars.iv, 5
  %73 = add nuw nsw i64 %66, %72
  %74 = inttoptr i64 %73 to ptr
  %75 = load volatile i32, ptr %74, align 4, !tbaa !16
  %76 = and i32 %75, 32768
  %.not48 = icmp eq i32 %76, 0
  %77 = trunc i64 %indvars.iv to i8
  br i1 %.not48, label %79, label %78

78:                                               ; preds = %71
  tail call void @HCD_HC_IN_IRQHandler(ptr noundef nonnull %0, i8 noundef zeroext %77)
  br label %80

79:                                               ; preds = %71
  tail call void @HCD_HC_OUT_IRQHandler(ptr noundef nonnull %0, i8 noundef zeroext %77)
  br label %80

80:                                               ; preds = %67, %79, %78
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %81 = load i32, ptr %62, align 4, !tbaa !15
  %82 = zext i32 %81 to i64
  %83 = icmp ult i64 %indvars.iv.next, %82
  br i1 %83, label %67, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %80, %60
  %84 = load ptr, ptr %0, align 8, !tbaa !5
  %85 = getelementptr inbounds i8, ptr %84, i64 20
  store volatile i32 33554432, ptr %85, align 4, !tbaa !12
  br label %86

86:                                               ; preds = %._crit_edge, %56
  %87 = phi ptr [ %84, %._crit_edge ], [ %.pre59, %56 ]
  %88 = tail call i32 @USB_ReadInterrupts(ptr noundef %87) #2
  %89 = and i32 %88, 16
  %.not46 = icmp eq i32 %89, 0
  br i1 %.not46, label %99, label %90

90:                                               ; preds = %86
  %91 = load ptr, ptr %0, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 24
  %93 = load volatile i32, ptr %92, align 4, !tbaa !20
  %94 = and i32 %93, -17
  store volatile i32 %94, ptr %92, align 4, !tbaa !20
  tail call void @HCD_RXQLVL_IRQHandler(ptr noundef nonnull %0)
  %95 = load ptr, ptr %0, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 24
  %97 = load volatile i32, ptr %96, align 4, !tbaa !20
  %98 = or i32 %97, 16
  store volatile i32 %98, ptr %96, align 4, !tbaa !20
  br label %99

99:                                               ; preds = %1, %90, %86, %6
  ret void
}

declare i32 @USB_GetMode(ptr noundef) local_unnamed_addr #1

declare i32 @USB_ReadInterrupts(ptr noundef) local_unnamed_addr #1

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

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

; 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

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

; Function Attrs: nounwind uwtable
declare hidden void @HCD_RXQLVL_IRQHandler(ptr noundef) 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 = !{!6, !11, i64 12}
!16 = !{!17, !11, i64 0}
!17 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !8, i64 24}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!13, !11, i64 24}


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