; LLVM IR from reazon-research/OpenArm :: control/canfd_control/Drivers/STM32H7xx_HAL_Driver/Src (stm32h7xx_hal_ospi)

; 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.OSPI_HandleTypeDef = type { ptr, %struct.OSPI_InitTypeDef, ptr, i32, i32, ptr, i32, i32, i32 }
%struct.OSPI_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.OCTOSPI_TypeDef = type { i32, i32, i32, i32, i32, i32, [2 x i32], i32, i32, [6 x i32], i32, i32, i32, i32, i32, [11 x i32], i32, i32, i32, i32, i32, [27 x i32], i32, i32, i32, i32, i32, [3 x i32], i32, [3 x i32], i32, [3 x i32], i32, i32, i32, i32, i32, [3 x i32], i32, [7 x i32], i32, i32, i32, i32, i32, [3 x i32], i32, [23 x i32], i32, [122 x i32], i32, i32, i32, i32 }
%struct.__MDMA_HandleTypeDef = type { ptr, %struct.MDMA_InitTypeDef, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct.MDMA_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 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_OSPI_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
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %7, i32 0, i32 0
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %9, i32 0, i32 14
  store ptr %10, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %13, i32 0, i32 7
  %15 = load volatile i32, ptr %14, align 4, !tbaa !13
  store i32 %15, ptr %4, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %18, i32 0, i32 0
  %20 = load volatile i32, ptr %19, align 4, !tbaa !16
  store i32 %20, ptr %5, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %21, i32 0, i32 6
  %23 = load volatile i32, ptr %22, align 8, !tbaa !17
  store i32 %23, ptr %6, align 4, !tbaa !15
  %24 = load i32, ptr %4, align 4, !tbaa !15
  %25 = zext i32 %24 to i64
  %26 = and i64 %25, 4
  %27 = icmp ne i64 %26, 0
  br i1 %27, label %28, label %85

28:                                               ; preds = %1
  %29 = load i32, ptr %5, align 4, !tbaa !15
  %30 = zext i32 %29 to i64
  %31 = and i64 %30, 262144
  %32 = icmp ne i64 %31, 0
  br i1 %32, label %33, label %85

33:                                               ; preds = %28
  %34 = load i32, ptr %6, align 4, !tbaa !15
  %35 = icmp eq i32 %34, 24
  br i1 %35, label %36, label %50

36:                                               ; preds = %33
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %37, i32 0, i32 2
  %39 = load ptr, ptr %38, align 8, !tbaa !18
  %40 = load i8, ptr %39, align 1, !tbaa !19
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  store volatile i8 %40, ptr %41, align 1, !tbaa !19
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %42, i32 0, i32 2
  %44 = load ptr, ptr %43, align 8, !tbaa !18
  %45 = getelementptr inbounds i8, ptr %44, i32 1
  store ptr %45, ptr %43, align 8, !tbaa !18
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %46, i32 0, i32 4
  %48 = load volatile i32, ptr %47, align 4, !tbaa !20
  %49 = add i32 %48, -1
  store volatile i32 %49, ptr %47, align 4, !tbaa !20
  br label %69

50:                                               ; preds = %33
  %51 = load i32, ptr %6, align 4, !tbaa !15
  %52 = icmp eq i32 %51, 40
  br i1 %52, label %53, label %67

53:                                               ; preds = %50
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = load volatile i8, ptr %54, align 1, !tbaa !19
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  store i8 %55, ptr %58, align 1, !tbaa !19
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !18
  %62 = getelementptr inbounds i8, ptr %61, i32 1
  store ptr %62, ptr %60, align 8, !tbaa !18
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %63, i32 0, i32 4
  %65 = load volatile i32, ptr %64, align 4, !tbaa !20
  %66 = add i32 %65, -1
  store volatile i32 %66, ptr %64, align 4, !tbaa !20
  br label %68

67:                                               ; preds = %50
  br label %68

68:                                               ; preds = %67, %53
  br label %69

69:                                               ; preds = %68, %36
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %70, i32 0, i32 4
  %72 = load volatile i32, ptr %71, align 4, !tbaa !20
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %83

74:                                               ; preds = %69
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %77, i32 0, i32 0
  %79 = load volatile i32, ptr %78, align 4, !tbaa !16
  %80 = zext i32 %79 to i64
  %81 = and i64 %80, -262145
  %82 = trunc i64 %81 to i32
  store volatile i32 %82, ptr %78, align 4, !tbaa !16
  br label %83

83:                                               ; preds = %74, %69
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_FifoThresholdCallback(ptr noundef %84)
  br label %306

85:                                               ; preds = %28, %1
  %86 = load i32, ptr %4, align 4, !tbaa !15
  %87 = zext i32 %86 to i64
  %88 = and i64 %87, 2
  %89 = icmp ne i64 %88, 0
  br i1 %89, label %90, label %188

90:                                               ; preds = %85
  %91 = load i32, ptr %5, align 4, !tbaa !15
  %92 = zext i32 %91 to i64
  %93 = and i64 %92, 131072
  %94 = icmp ne i64 %93, 0
  br i1 %94, label %95, label %188

95:                                               ; preds = %90
  %96 = load i32, ptr %6, align 4, !tbaa !15
  %97 = icmp eq i32 %96, 40
  br i1 %97, label %98, label %146

98:                                               ; preds = %95
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %99, i32 0, i32 4
  %101 = load volatile i32, ptr %100, align 4, !tbaa !20
  %102 = icmp ugt i32 %101, 0
  br i1 %102, label %103, label %122

103:                                              ; preds = %98
  %104 = load i32, ptr %4, align 4, !tbaa !15
  %105 = zext i32 %104 to i64
  %106 = and i64 %105, 16128
  %107 = icmp ne i64 %106, 0
  br i1 %107, label %108, label %122

108:                                              ; preds = %103
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = load volatile i8, ptr %109, align 1, !tbaa !19
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %111, i32 0, i32 2
  %113 = load ptr, ptr %112, align 8, !tbaa !18
  store i8 %110, ptr %113, align 1, !tbaa !19
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %114, i32 0, i32 2
  %116 = load ptr, ptr %115, align 8, !tbaa !18
  %117 = getelementptr inbounds i8, ptr %116, i32 1
  store ptr %117, ptr %115, align 8, !tbaa !18
  %118 = load ptr, ptr %2, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %118, i32 0, i32 4
  %120 = load volatile i32, ptr %119, align 4, !tbaa !20
  %121 = add i32 %120, -1
  store volatile i32 %121, ptr %119, align 4, !tbaa !20
  br label %145

122:                                              ; preds = %103, %98
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %123, i32 0, i32 4
  %125 = load volatile i32, ptr %124, align 4, !tbaa !20
  %126 = icmp eq i32 %125, 0
  br i1 %126, label %127, label %143

127:                                              ; preds = %122
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  %131 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %130, i32 0, i32 8
  store volatile i32 2, ptr %131, align 4, !tbaa !21
  %132 = load ptr, ptr %2, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !9
  %135 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %134, i32 0, i32 0
  %136 = load volatile i32, ptr %135, align 4, !tbaa !16
  %137 = zext i32 %136 to i64
  %138 = and i64 %137, -458753
  %139 = trunc i64 %138 to i32
  store volatile i32 %139, ptr %135, align 4, !tbaa !16
  %140 = load ptr, ptr %2, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %140, i32 0, i32 6
  store volatile i32 2, ptr %141, align 8, !tbaa !17
  %142 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_RxCpltCallback(ptr noundef %142)
  br label %144

143:                                              ; preds = %122
  br label %144

144:                                              ; preds = %143, %127
  br label %145

145:                                              ; preds = %144, %108
  br label %187

146:                                              ; preds = %95
  %147 = load ptr, ptr %2, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !9
  %150 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %149, i32 0, i32 8
  store volatile i32 2, ptr %150, align 4, !tbaa !21
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %153, i32 0, i32 0
  %155 = load volatile i32, ptr %154, align 4, !tbaa !16
  %156 = zext i32 %155 to i64
  %157 = and i64 %156, -458753
  %158 = trunc i64 %157 to i32
  store volatile i32 %158, ptr %154, align 4, !tbaa !16
  %159 = load ptr, ptr %2, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %159, i32 0, i32 6
  store volatile i32 2, ptr %160, align 8, !tbaa !17
  %161 = load i32, ptr %6, align 4, !tbaa !15
  %162 = icmp eq i32 %161, 24
  br i1 %162, label %163, label %165

163:                                              ; preds = %146
  %164 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_TxCpltCallback(ptr noundef %164)
  br label %186

165:                                              ; preds = %146
  %166 = load i32, ptr %6, align 4, !tbaa !15
  %167 = icmp eq i32 %166, 8
  br i1 %167, label %168, label %170

168:                                              ; preds = %165
  %169 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_CmdCpltCallback(ptr noundef %169)
  br label %185

170:                                              ; preds = %165
  %171 = load i32, ptr %6, align 4, !tbaa !15
  %172 = icmp eq i32 %171, 256
  br i1 %172, label %173, label %183

173:                                              ; preds = %170
  %174 = load ptr, ptr %2, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %174, i32 0, i32 7
  %176 = load volatile i32, ptr %175, align 4, !tbaa !22
  %177 = icmp eq i32 %176, 0
  br i1 %177, label %178, label %180

178:                                              ; preds = %173
  %179 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_AbortCpltCallback(ptr noundef %179)
  br label %182

180:                                              ; preds = %173
  %181 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_ErrorCallback(ptr noundef %181)
  br label %182

182:                                              ; preds = %180, %178
  br label %184

183:                                              ; preds = %170
  br label %184

184:                                              ; preds = %183, %182
  br label %185

185:                                              ; preds = %184, %168
  br label %186

186:                                              ; preds = %185, %163
  br label %187

187:                                              ; preds = %186, %145
  br label %305

188:                                              ; preds = %90, %85
  %189 = load i32, ptr %4, align 4, !tbaa !15
  %190 = zext i32 %189 to i64
  %191 = and i64 %190, 8
  %192 = icmp ne i64 %191, 0
  br i1 %192, label %193, label %224

193:                                              ; preds = %188
  %194 = load i32, ptr %5, align 4, !tbaa !15
  %195 = zext i32 %194 to i64
  %196 = and i64 %195, 524288
  %197 = icmp ne i64 %196, 0
  br i1 %197, label %198, label %224

198:                                              ; preds = %193
  %199 = load ptr, ptr %2, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %199, i32 0, i32 0
  %201 = load ptr, ptr %200, align 8, !tbaa !9
  %202 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %201, i32 0, i32 8
  store volatile i32 8, ptr %202, align 4, !tbaa !21
  %203 = load ptr, ptr %2, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %203, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8, !tbaa !9
  %206 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %205, i32 0, i32 0
  %207 = load volatile i32, ptr %206, align 4, !tbaa !16
  %208 = zext i32 %207 to i64
  %209 = and i64 %208, 4194304
  %210 = icmp ne i64 %209, 0
  br i1 %210, label %211, label %222

211:                                              ; preds = %198
  %212 = load ptr, ptr %2, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %212, i32 0, i32 0
  %214 = load ptr, ptr %213, align 8, !tbaa !9
  %215 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %214, i32 0, i32 0
  %216 = load volatile i32, ptr %215, align 4, !tbaa !16
  %217 = zext i32 %216 to i64
  %218 = and i64 %217, -589825
  %219 = trunc i64 %218 to i32
  store volatile i32 %219, ptr %215, align 4, !tbaa !16
  %220 = load ptr, ptr %2, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %220, i32 0, i32 6
  store volatile i32 2, ptr %221, align 8, !tbaa !17
  br label %222

222:                                              ; preds = %211, %198
  %223 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_StatusMatchCallback(ptr noundef %223)
  br label %304

224:                                              ; preds = %193, %188
  %225 = load i32, ptr %4, align 4, !tbaa !15
  %226 = zext i32 %225 to i64
  %227 = and i64 %226, 1
  %228 = icmp ne i64 %227, 0
  br i1 %228, label %229, label %285

229:                                              ; preds = %224
  %230 = load i32, ptr %5, align 4, !tbaa !15
  %231 = zext i32 %230 to i64
  %232 = and i64 %231, 65536
  %233 = icmp ne i64 %232, 0
  br i1 %233, label %234, label %285

234:                                              ; preds = %229
  %235 = load ptr, ptr %2, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %235, i32 0, i32 0
  %237 = load ptr, ptr %236, align 8, !tbaa !9
  %238 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %237, i32 0, i32 8
  store volatile i32 1, ptr %238, align 4, !tbaa !21
  %239 = load ptr, ptr %2, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %239, i32 0, i32 0
  %241 = load ptr, ptr %240, align 8, !tbaa !9
  %242 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %241, i32 0, i32 0
  %243 = load volatile i32, ptr %242, align 4, !tbaa !16
  %244 = zext i32 %243 to i64
  %245 = and i64 %244, -2031617
  %246 = trunc i64 %245 to i32
  store volatile i32 %246, ptr %242, align 4, !tbaa !16
  %247 = load ptr, ptr %2, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %247, i32 0, i32 7
  store volatile i32 2, ptr %248, align 4, !tbaa !22
  %249 = load ptr, ptr %2, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %249, i32 0, i32 0
  %251 = load ptr, ptr %250, align 8, !tbaa !9
  %252 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %251, i32 0, i32 0
  %253 = load volatile i32, ptr %252, align 4, !tbaa !16
  %254 = zext i32 %253 to i64
  %255 = and i64 %254, 4
  %256 = icmp ne i64 %255, 0
  br i1 %256, label %257, label %280

257:                                              ; preds = %234
  %258 = load ptr, ptr %2, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %258, i32 0, i32 0
  %260 = load ptr, ptr %259, align 8, !tbaa !9
  %261 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %260, i32 0, i32 0
  %262 = load volatile i32, ptr %261, align 4, !tbaa !16
  %263 = zext i32 %262 to i64
  %264 = and i64 %263, -5
  %265 = trunc i64 %264 to i32
  store volatile i32 %265, ptr %261, align 4, !tbaa !16
  %266 = load ptr, ptr %2, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %266, i32 0, i32 5
  %268 = load ptr, ptr %267, align 8, !tbaa !23
  %269 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %268, i32 0, i32 10
  store ptr @OSPI_DMAAbortCplt, ptr %269, align 8, !tbaa !24
  %270 = load ptr, ptr %2, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %270, i32 0, i32 5
  %272 = load ptr, ptr %271, align 8, !tbaa !23
  %273 = call i32 @HAL_MDMA_Abort_IT(ptr noundef %272)
  %274 = icmp ne i32 %273, 0
  br i1 %274, label %275, label %279

275:                                              ; preds = %257
  %276 = load ptr, ptr %2, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %276, i32 0, i32 6
  store volatile i32 2, ptr %277, align 8, !tbaa !17
  %278 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_ErrorCallback(ptr noundef %278)
  br label %279

279:                                              ; preds = %275, %257
  br label %284

280:                                              ; preds = %234
  %281 = load ptr, ptr %2, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %281, i32 0, i32 6
  store volatile i32 2, ptr %282, align 8, !tbaa !17
  %283 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_ErrorCallback(ptr noundef %283)
  br label %284

284:                                              ; preds = %280, %279
  br label %303

285:                                              ; preds = %229, %224
  %286 = load i32, ptr %4, align 4, !tbaa !15
  %287 = zext i32 %286 to i64
  %288 = and i64 %287, 16
  %289 = icmp ne i64 %288, 0
  br i1 %289, label %290, label %301

290:                                              ; preds = %285
  %291 = load i32, ptr %5, align 4, !tbaa !15
  %292 = zext i32 %291 to i64
  %293 = and i64 %292, 1048576
  %294 = icmp ne i64 %293, 0
  br i1 %294, label %295, label %301

295:                                              ; preds = %290
  %296 = load ptr, ptr %2, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %296, i32 0, i32 0
  %298 = load ptr, ptr %297, align 8, !tbaa !9
  %299 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %298, i32 0, i32 8
  store volatile i32 16, ptr %299, align 4, !tbaa !21
  %300 = load ptr, ptr %2, align 8, !tbaa !5
  call void @HAL_OSPI_TimeOutCallback(ptr noundef %300)
  br label %302

301:                                              ; preds = %290, %285
  br label %302

302:                                              ; preds = %301, %295
  br label %303

303:                                              ; preds = %302, %284
  br label %304

304:                                              ; preds = %303, %222
  br label %305

305:                                              ; preds = %304, %187
  br label %306

306:                                              ; preds = %305, %83
  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
  ret void
}

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

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

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

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

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

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

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

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

declare i32 @HAL_MDMA_Abort_IT(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_OSPI_TimeOutCallback(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, !6, i64 72, !12, i64 80, !12, i64 84, !6, i64 88, !12, i64 96, !12, i64 100, !12, i64 104}
!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, i64 52, !12, i64 56}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 32}
!14 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !7, i64 24, !12, i64 32, !12, i64 36, !7, i64 40, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !7, i64 84, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !7, i64 148, !12, i64 256, !12, i64 260, !12, i64 264, !12, i64 268, !12, i64 272, !7, i64 276, !12, i64 288, !7, i64 292, !12, i64 304, !7, i64 308, !12, i64 320, !12, i64 324, !12, i64 328, !12, i64 332, !12, i64 336, !7, i64 340, !12, i64 352, !7, i64 356, !12, i64 384, !12, i64 388, !12, i64 392, !12, i64 396, !12, i64 400, !7, i64 404, !12, i64 416, !7, i64 420, !12, i64 512, !7, i64 516, !12, i64 1004, !12, i64 1008, !12, i64 1012, !12, i64 1016}
!15 = !{!12, !12, i64 0}
!16 = !{!14, !12, i64 0}
!17 = !{!10, !12, i64 96}
!18 = !{!10, !6, i64 72}
!19 = !{!7, !7, i64 0}
!20 = !{!10, !12, i64 84}
!21 = !{!14, !12, i64 36}
!22 = !{!10, !12, i64 100}
!23 = !{!10, !6, i64 88}
!24 = !{!25, !6, i64 120}
!25 = !{!"__MDMA_HandleTypeDef", !6, i64 0, !26, i64 8, !12, i64 64, !12, i64 68, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !12, i64 144, !12, i64 148}
!26 = !{!"", !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, i64 52}


; 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_OSPI_IRQHandler(ptr noundef %0) local_unnamed_addr #0 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %2, i64 80
  %4 = getelementptr inbounds i8, ptr %2, i64 32
  %5 = load volatile i32, ptr %4, align 4, !tbaa !12
  %6 = load volatile i32, ptr %2, align 4, !tbaa !14
  %7 = getelementptr inbounds i8, ptr %0, i64 96
  %8 = load volatile i32, ptr %7, align 8, !tbaa !15
  %9 = zext i32 %5 to i64
  %10 = and i64 %9, 4
  %.not = icmp eq i64 %10, 0
  %11 = and i32 %6, 262144
  %.not67 = icmp eq i32 %11, 0
  %or.cond = select i1 %.not, i1 true, i1 %.not67
  br i1 %or.cond, label %35, label %12

12:                                               ; preds = %1
  switch i32 %8, label %26 [
    i32 24, label %13
    i32 40, label %17
  ]

13:                                               ; preds = %12
  %14 = getelementptr inbounds i8, ptr %0, i64 72
  %15 = load ptr, ptr %14, align 8, !tbaa !16
  %16 = load i8, ptr %15, align 1, !tbaa !17
  store volatile i8 %16, ptr %3, align 1, !tbaa !17
  br label %.sink.split

17:                                               ; preds = %12
  %18 = load volatile i8, ptr %3, align 1, !tbaa !17
  %19 = getelementptr inbounds i8, ptr %0, i64 72
  %20 = load ptr, ptr %19, align 8, !tbaa !16
  store i8 %18, ptr %20, align 1, !tbaa !17
  br label %.sink.split

.sink.split:                                      ; preds = %13, %17
  %.sink = phi ptr [ %19, %17 ], [ %14, %13 ]
  %21 = load ptr, ptr %.sink, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %21, i64 1
  store ptr %22, ptr %.sink, align 8, !tbaa !16
  %23 = getelementptr inbounds i8, ptr %0, i64 84
  %24 = load volatile i32, ptr %23, align 4, !tbaa !18
  %25 = add i32 %24, -1
  store volatile i32 %25, ptr %23, align 4, !tbaa !18
  br label %26

26:                                               ; preds = %.sink.split, %12
  %27 = getelementptr inbounds i8, ptr %0, i64 84
  %28 = load volatile i32, ptr %27, align 4, !tbaa !18
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %34

30:                                               ; preds = %26
  %31 = load ptr, ptr %0, align 8, !tbaa !5
  %32 = load volatile i32, ptr %31, align 4, !tbaa !14
  %33 = and i32 %32, -262145
  store volatile i32 %33, ptr %31, align 4, !tbaa !14
  br label %34

34:                                               ; preds = %30, %26
  tail call void @HAL_OSPI_FifoThresholdCallback(ptr noundef nonnull %0)
  br label %106

35:                                               ; preds = %1
  %36 = and i64 %9, 2
  %.not68 = icmp eq i64 %36, 0
  %37 = and i32 %6, 131072
  %.not69 = icmp eq i32 %37, 0
  %or.cond81 = select i1 %.not68, i1 true, i1 %.not69
  br i1 %or.cond81, label %71, label %38

38:                                               ; preds = %35
  %39 = icmp eq i32 %8, 40
  br i1 %39, label %40, label %59

40:                                               ; preds = %38
  %41 = getelementptr inbounds i8, ptr %0, i64 84
  %42 = load volatile i32, ptr %41, align 4, !tbaa !18
  %.not79 = icmp eq i32 %42, 0
  %43 = and i64 %9, 16128
  %.not80 = icmp eq i64 %43, 0
  %or.cond82 = or i1 %.not80, %.not79
  br i1 %or.cond82, label %52, label %44

44:                                               ; preds = %40
  %45 = load volatile i8, ptr %3, align 1, !tbaa !17
  %46 = getelementptr inbounds i8, ptr %0, i64 72
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  store i8 %45, ptr %47, align 1, !tbaa !17
  %48 = load ptr, ptr %46, align 8, !tbaa !16
  %49 = getelementptr inbounds i8, ptr %48, i64 1
  store ptr %49, ptr %46, align 8, !tbaa !16
  %50 = load volatile i32, ptr %41, align 4, !tbaa !18
  %51 = add i32 %50, -1
  store volatile i32 %51, ptr %41, align 4, !tbaa !18
  br label %106

52:                                               ; preds = %40
  %53 = load volatile i32, ptr %41, align 4, !tbaa !18
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %106

55:                                               ; preds = %52
  %56 = getelementptr inbounds i8, ptr %2, i64 36
  store volatile i32 2, ptr %56, align 4, !tbaa !19
  %57 = load volatile i32, ptr %2, align 4, !tbaa !14
  %58 = and i32 %57, -458753
  store volatile i32 %58, ptr %2, align 4, !tbaa !14
  store volatile i32 2, ptr %7, align 8, !tbaa !15
  tail call void @HAL_OSPI_RxCpltCallback(ptr noundef nonnull %0)
  br label %106

59:                                               ; preds = %38
  %60 = getelementptr inbounds i8, ptr %2, i64 36
  store volatile i32 2, ptr %60, align 4, !tbaa !19
  %61 = load volatile i32, ptr %2, align 4, !tbaa !14
  %62 = and i32 %61, -458753
  store volatile i32 %62, ptr %2, align 4, !tbaa !14
  store volatile i32 2, ptr %7, align 8, !tbaa !15
  switch i32 %8, label %106 [
    i32 24, label %63
    i32 8, label %64
    i32 256, label %65
  ]

63:                                               ; preds = %59
  tail call void @HAL_OSPI_TxCpltCallback(ptr noundef nonnull %0)
  br label %106

64:                                               ; preds = %59
  tail call void @HAL_OSPI_CmdCpltCallback(ptr noundef nonnull %0)
  br label %106

65:                                               ; preds = %59
  %66 = getelementptr inbounds i8, ptr %0, i64 100
  %67 = load volatile i32, ptr %66, align 4, !tbaa !20
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %65
  tail call void @HAL_OSPI_AbortCpltCallback(ptr noundef nonnull %0)
  br label %106

70:                                               ; preds = %65
  tail call void @HAL_OSPI_ErrorCallback(ptr noundef nonnull %0)
  br label %106

71:                                               ; preds = %35
  %72 = and i64 %9, 8
  %.not70 = icmp eq i64 %72, 0
  %73 = and i32 %6, 524288
  %.not71 = icmp eq i32 %73, 0
  %or.cond83 = select i1 %.not70, i1 true, i1 %.not71
  br i1 %or.cond83, label %82, label %74

74:                                               ; preds = %71
  %75 = getelementptr inbounds i8, ptr %2, i64 36
  store volatile i32 8, ptr %75, align 4, !tbaa !19
  %76 = load volatile i32, ptr %2, align 4, !tbaa !14
  %77 = and i32 %76, 4194304
  %.not78 = icmp eq i32 %77, 0
  br i1 %.not78, label %81, label %78

78:                                               ; preds = %74
  %79 = load volatile i32, ptr %2, align 4, !tbaa !14
  %80 = and i32 %79, -589825
  store volatile i32 %80, ptr %2, align 4, !tbaa !14
  store volatile i32 2, ptr %7, align 8, !tbaa !15
  br label %81

81:                                               ; preds = %78, %74
  tail call void @HAL_OSPI_StatusMatchCallback(ptr noundef nonnull %0)
  br label %106

82:                                               ; preds = %71
  %83 = and i64 %9, 1
  %.not72 = icmp eq i64 %83, 0
  %84 = and i32 %6, 65536
  %.not73 = icmp eq i32 %84, 0
  %or.cond84 = select i1 %.not72, i1 true, i1 %.not73
  br i1 %or.cond84, label %101, label %85

85:                                               ; preds = %82
  %86 = getelementptr inbounds i8, ptr %2, i64 36
  store volatile i32 1, ptr %86, align 4, !tbaa !19
  %87 = load volatile i32, ptr %2, align 4, !tbaa !14
  %88 = and i32 %87, -2031617
  store volatile i32 %88, ptr %2, align 4, !tbaa !14
  %89 = getelementptr inbounds i8, ptr %0, i64 100
  store volatile i32 2, ptr %89, align 4, !tbaa !20
  %90 = load volatile i32, ptr %2, align 4, !tbaa !14
  %91 = and i32 %90, 4
  %.not76 = icmp eq i32 %91, 0
  br i1 %.not76, label %100, label %92

92:                                               ; preds = %85
  %93 = load volatile i32, ptr %2, align 4, !tbaa !14
  %94 = and i32 %93, -5
  store volatile i32 %94, ptr %2, align 4, !tbaa !14
  %95 = getelementptr inbounds i8, ptr %0, i64 88
  %96 = load ptr, ptr %95, align 8, !tbaa !21
  %97 = getelementptr inbounds i8, ptr %96, i64 120
  store ptr @OSPI_DMAAbortCplt, ptr %97, align 8, !tbaa !22
  %98 = tail call i32 @HAL_MDMA_Abort_IT(ptr noundef %96) #2
  %.not77 = icmp eq i32 %98, 0
  br i1 %.not77, label %106, label %99

99:                                               ; preds = %92
  store volatile i32 2, ptr %7, align 8, !tbaa !15
  tail call void @HAL_OSPI_ErrorCallback(ptr noundef nonnull %0)
  br label %106

100:                                              ; preds = %85
  store volatile i32 2, ptr %7, align 8, !tbaa !15
  tail call void @HAL_OSPI_ErrorCallback(ptr noundef nonnull %0)
  br label %106

101:                                              ; preds = %82
  %102 = and i64 %9, 16
  %.not74 = icmp eq i64 %102, 0
  %103 = and i32 %6, 1048576
  %.not75 = icmp eq i32 %103, 0
  %or.cond85 = select i1 %.not74, i1 true, i1 %.not75
  br i1 %or.cond85, label %106, label %104

104:                                              ; preds = %101
  %105 = getelementptr inbounds i8, ptr %2, i64 36
  store volatile i32 16, ptr %105, align 4, !tbaa !19
  tail call void @HAL_OSPI_TimeOutCallback(ptr noundef nonnull %0)
  br label %106

106:                                              ; preds = %59, %63, %70, %69, %64, %44, %52, %55, %92, %99, %100, %101, %104, %81, %34
  ret void
}

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

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

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

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

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

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

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

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

declare i32 @HAL_MDMA_Abort_IT(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_OSPI_TimeOutCallback(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, !7, i64 72, !11, i64 80, !11, i64 84, !7, i64 88, !11, i64 96, !11, i64 100, !11, i64 104}
!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, i64 52, !11, i64 56}
!11 = !{!"int", !8, i64 0}
!12 = !{!13, !11, i64 32}
!13 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !8, i64 24, !11, i64 32, !11, i64 36, !8, i64 40, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !8, i64 84, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !8, i64 148, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !8, i64 276, !11, i64 288, !8, i64 292, !11, i64 304, !8, i64 308, !11, i64 320, !11, i64 324, !11, i64 328, !11, i64 332, !11, i64 336, !8, i64 340, !11, i64 352, !8, i64 356, !11, i64 384, !11, i64 388, !11, i64 392, !11, i64 396, !11, i64 400, !8, i64 404, !11, i64 416, !8, i64 420, !11, i64 512, !8, i64 516, !11, i64 1004, !11, i64 1008, !11, i64 1012, !11, i64 1016}
!14 = !{!13, !11, i64 0}
!15 = !{!6, !11, i64 96}
!16 = !{!6, !7, i64 72}
!17 = !{!8, !8, i64 0}
!18 = !{!6, !11, i64 84}
!19 = !{!13, !11, i64 36}
!20 = !{!6, !11, i64 100}
!21 = !{!6, !7, i64 88}
!22 = !{!23, !7, i64 120}
!23 = !{!"__MDMA_HandleTypeDef", !7, i64 0, !24, i64 8, !11, i64 64, !11, i64 68, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !11, i64 144, !11, i64 148}
!24 = !{!"", !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, i64 52}


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