; 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 }
%struct.MDMA_Channel_TypeDef = 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
declare hidden void @OSPI_DMACplt(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_OSPI_Receive_DMA(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %9, i32 0, i32 0
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %11, i32 0, i32 10
  %13 = load volatile i32, ptr %12, align 4, !tbaa !14
  %14 = add i32 %13, 1
  store i32 %14, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %15, i32 0, i32 0
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %17, i32 0, i32 12
  %19 = load volatile i32, ptr %18, align 4, !tbaa !16
  store i32 %19, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %22, i32 0, i32 26
  %24 = load volatile i32, ptr %23, align 4, !tbaa !17
  store i32 %24, ptr %8, align 4, !tbaa !9
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %30

27:                                               ; preds = %2
  store i32 1, ptr %5, align 4, !tbaa !9
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %28, i32 0, i32 7
  store volatile i32 8, ptr %29, align 4, !tbaa !18
  br label %248

30:                                               ; preds = %2
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %31, i32 0, i32 6
  %33 = load volatile i32, ptr %32, align 8, !tbaa !19
  %34 = icmp eq i32 %33, 4
  br i1 %34, label %35, label %244

35:                                               ; preds = %30
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %37, i32 0, i32 4
  store volatile i32 %36, ptr %38, align 4, !tbaa !20
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %39, i32 0, i32 4
  %41 = load volatile i32, ptr %40, align 4, !tbaa !20
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %42, i32 0, i32 3
  store volatile i32 %41, ptr %43, align 8, !tbaa !21
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %45, i32 0, i32 2
  store ptr %44, ptr %46, align 8, !tbaa !22
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %49, i32 0, i32 0
  %51 = load volatile i32, ptr %50, align 4, !tbaa !23
  %52 = zext i32 %51 to i64
  %53 = and i64 %52, -805306369
  %54 = or i64 %53, 268435456
  %55 = trunc i64 %54 to i32
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %58, i32 0, i32 0
  store volatile i32 %55, ptr %59, align 4, !tbaa !23
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !11
  %63 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %62, i32 0, i32 8
  store volatile i32 3, ptr %63, align 4, !tbaa !24
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %64, i32 0, i32 6
  store volatile i32 40, ptr %65, align 8, !tbaa !19
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %66, i32 0, i32 5
  %68 = load ptr, ptr %67, align 8, !tbaa !25
  %69 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %68, i32 0, i32 5
  store ptr @OSPI_DMACplt, ptr %69, align 8, !tbaa !26
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %70, i32 0, i32 5
  %72 = load ptr, ptr %71, align 8, !tbaa !25
  %73 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %72, i32 0, i32 9
  store ptr @OSPI_DMAError, ptr %73, align 8, !tbaa !29
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %74, i32 0, i32 5
  %76 = load ptr, ptr %75, align 8, !tbaa !25
  %77 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %76, i32 0, i32 10
  store ptr null, ptr %77, align 8, !tbaa !30
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %78, i32 0, i32 5
  %80 = load ptr, ptr %79, align 8, !tbaa !25
  %81 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !31
  %83 = getelementptr inbounds %struct.MDMA_Channel_TypeDef, ptr %82, i32 0, i32 4
  %84 = load volatile i32, ptr %83, align 4, !tbaa !32
  %85 = zext i32 %84 to i64
  %86 = and i64 %85, -772
  %87 = or i64 %86, 0
  %88 = trunc i64 %87 to i32
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %89, i32 0, i32 5
  %91 = load ptr, ptr %90, align 8, !tbaa !25
  %92 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !31
  %94 = getelementptr inbounds %struct.MDMA_Channel_TypeDef, ptr %93, i32 0, i32 4
  store volatile i32 %88, ptr %94, align 4, !tbaa !32
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %95, i32 0, i32 5
  %97 = load ptr, ptr %96, align 8, !tbaa !25
  %98 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %97, i32 0, i32 1
  %99 = getelementptr inbounds %struct.MDMA_InitTypeDef, ptr %98, i32 0, i32 7
  %100 = load i32, ptr %99, align 4, !tbaa !33
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %120

102:                                              ; preds = %35
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %103, i32 0, i32 5
  %105 = load ptr, ptr %104, align 8, !tbaa !25
  %106 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !31
  %108 = getelementptr inbounds %struct.MDMA_Channel_TypeDef, ptr %107, i32 0, i32 4
  %109 = load volatile i32, ptr %108, align 4, !tbaa !32
  %110 = zext i32 %109 to i64
  %111 = and i64 %110, -3085
  %112 = or i64 %111, 8
  %113 = trunc i64 %112 to i32
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %114, i32 0, i32 5
  %116 = load ptr, ptr %115, align 8, !tbaa !25
  %117 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !31
  %119 = getelementptr inbounds %struct.MDMA_Channel_TypeDef, ptr %118, i32 0, i32 4
  store volatile i32 %113, ptr %119, align 4, !tbaa !32
  br label %179

120:                                              ; preds = %35
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %121, i32 0, i32 5
  %123 = load ptr, ptr %122, align 8, !tbaa !25
  %124 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %123, i32 0, i32 1
  %125 = getelementptr inbounds %struct.MDMA_InitTypeDef, ptr %124, i32 0, i32 7
  %126 = load i32, ptr %125, align 4, !tbaa !33
  %127 = icmp eq i32 %126, 64
  br i1 %127, label %128, label %146

128:                                              ; preds = %120
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %129, i32 0, i32 5
  %131 = load ptr, ptr %130, align 8, !tbaa !25
  %132 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !31
  %134 = getelementptr inbounds %struct.MDMA_Channel_TypeDef, ptr %133, i32 0, i32 4
  %135 = load volatile i32, ptr %134, align 4, !tbaa !32
  %136 = zext i32 %135 to i64
  %137 = and i64 %136, -3085
  %138 = or i64 %137, 1032
  %139 = trunc i64 %138 to i32
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %140, i32 0, i32 5
  %142 = load ptr, ptr %141, align 8, !tbaa !25
  %143 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !31
  %145 = getelementptr inbounds %struct.MDMA_Channel_TypeDef, ptr %144, i32 0, i32 4
  store volatile i32 %139, ptr %145, align 4, !tbaa !32
  br label %178

146:                                              ; preds = %120
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %147, i32 0, i32 5
  %149 = load ptr, ptr %148, align 8, !tbaa !25
  %150 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %149, i32 0, i32 1
  %151 = getelementptr inbounds %struct.MDMA_InitTypeDef, ptr %150, i32 0, i32 7
  %152 = load i32, ptr %151, align 4, !tbaa !33
  %153 = icmp eq i32 %152, 128
  br i1 %153, label %154, label %172

154:                                              ; preds = %146
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %155, i32 0, i32 5
  %157 = load ptr, ptr %156, align 8, !tbaa !25
  %158 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %157, i32 0, i32 0
  %159 = load ptr, ptr %158, align 8, !tbaa !31
  %160 = getelementptr inbounds %struct.MDMA_Channel_TypeDef, ptr %159, i32 0, i32 4
  %161 = load volatile i32, ptr %160, align 4, !tbaa !32
  %162 = zext i32 %161 to i64
  %163 = and i64 %162, -3085
  %164 = or i64 %163, 2056
  %165 = trunc i64 %164 to i32
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %166, i32 0, i32 5
  %168 = load ptr, ptr %167, align 8, !tbaa !25
  %169 = getelementptr inbounds %struct.__MDMA_HandleTypeDef, ptr %168, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8, !tbaa !31
  %171 = getelementptr inbounds %struct.MDMA_Channel_TypeDef, ptr %170, i32 0, i32 4
  store volatile i32 %165, ptr %171, align 4, !tbaa !32
  br label %177

172:                                              ; preds = %146
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %173, i32 0, i32 7
  %175 = load volatile i32, ptr %174, align 4, !tbaa !18
  %176 = or i32 %175, 4
  store volatile i32 %176, ptr %174, align 4, !tbaa !18
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %177

177:                                              ; preds = %172, %154
  br label %178

178:                                              ; preds = %177, %128
  br label %179

179:                                              ; preds = %178, %102
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %180, i32 0, i32 5
  %182 = load ptr, ptr %181, align 8, !tbaa !25
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %183, i32 0, i32 0
  %185 = load ptr, ptr %184, align 8, !tbaa !11
  %186 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %185, i32 0, i32 14
  %187 = ptrtoint ptr %186 to i32
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  %189 = ptrtoint ptr %188 to i32
  %190 = load ptr, ptr %3, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %190, i32 0, i32 3
  %192 = load volatile i32, ptr %191, align 8, !tbaa !21
  %193 = call i32 @HAL_MDMA_Start_IT(ptr noundef %182, i32 noundef %187, i32 noundef %189, i32 noundef %192, i32 noundef 1)
  %194 = icmp eq i32 %193, 0
  br i1 %194, label %195, label %238

195:                                              ; preds = %179
  %196 = load ptr, ptr %3, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8, !tbaa !11
  %199 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %198, i32 0, i32 0
  %200 = load volatile i32, ptr %199, align 4, !tbaa !23
  %201 = zext i32 %200 to i64
  %202 = or i64 %201, 65536
  %203 = trunc i64 %202 to i32
  store volatile i32 %203, ptr %199, align 4, !tbaa !23
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %204, i32 0, i32 1
  %206 = getelementptr inbounds %struct.OSPI_InitTypeDef, ptr %205, i32 0, i32 2
  %207 = load i32, ptr %206, align 8, !tbaa !34
  %208 = icmp eq i32 %207, 67108864
  br i1 %208, label %209, label %215

209:                                              ; preds = %195
  %210 = load i32, ptr %7, align 4, !tbaa !9
  %211 = load ptr, ptr %3, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %211, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8, !tbaa !11
  %214 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %213, i32 0, i32 12
  store volatile i32 %210, ptr %214, align 4, !tbaa !16
  br label %237

215:                                              ; preds = %195
  %216 = load ptr, ptr %3, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %216, i32 0, i32 0
  %218 = load ptr, ptr %217, align 8, !tbaa !11
  %219 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %218, i32 0, i32 22
  %220 = load volatile i32, ptr %219, align 4, !tbaa !35
  %221 = zext i32 %220 to i64
  %222 = and i64 %221, 1792
  %223 = icmp ne i64 %222, 0
  br i1 %223, label %224, label %230

224:                                              ; preds = %215
  %225 = load i32, ptr %7, align 4, !tbaa !9
  %226 = load ptr, ptr %3, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %226, i32 0, i32 0
  %228 = load ptr, ptr %227, align 8, !tbaa !11
  %229 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %228, i32 0, i32 12
  store volatile i32 %225, ptr %229, align 4, !tbaa !16
  br label %236

230:                                              ; preds = %215
  %231 = load i32, ptr %8, align 4, !tbaa !9
  %232 = load ptr, ptr %3, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %232, i32 0, i32 0
  %234 = load ptr, ptr %233, align 8, !tbaa !11
  %235 = getelementptr inbounds %struct.OCTOSPI_TypeDef, ptr %234, i32 0, i32 26
  store volatile i32 %231, ptr %235, align 4, !tbaa !17
  br label %236

236:                                              ; preds = %230, %224
  br label %237

237:                                              ; preds = %236, %209
  br label %243

238:                                              ; preds = %179
  store i32 1, ptr %5, align 4, !tbaa !9
  %239 = load ptr, ptr %3, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %239, i32 0, i32 7
  store volatile i32 4, ptr %240, align 4, !tbaa !18
  %241 = load ptr, ptr %3, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %241, i32 0, i32 6
  store volatile i32 2, ptr %242, align 8, !tbaa !19
  br label %243

243:                                              ; preds = %238, %237
  br label %247

244:                                              ; preds = %30
  store i32 1, ptr %5, align 4, !tbaa !9
  %245 = load ptr, ptr %3, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.OSPI_HandleTypeDef, ptr %245, i32 0, i32 7
  store volatile i32 16, ptr %246, align 4, !tbaa !18
  br label %247

247:                                              ; preds = %244, %243
  br label %248

248:                                              ; preds = %247, %27
  %249 = load i32, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret i32 %249
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !6, i64 0, !13, i64 8, !6, i64 72, !10, i64 80, !10, i64 84, !6, i64 88, !10, i64 96, !10, i64 100, !10, i64 104}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56}
!14 = !{!15, !10, i64 64}
!15 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !7, i64 24, !10, i64 32, !10, i64 36, !7, i64 40, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !7, i64 84, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !7, i64 148, !10, i64 256, !10, i64 260, !10, i64 264, !10, i64 268, !10, i64 272, !7, i64 276, !10, i64 288, !7, i64 292, !10, i64 304, !7, i64 308, !10, i64 320, !10, i64 324, !10, i64 328, !10, i64 332, !10, i64 336, !7, i64 340, !10, i64 352, !7, i64 356, !10, i64 384, !10, i64 388, !10, i64 392, !10, i64 396, !10, i64 400, !7, i64 404, !10, i64 416, !7, i64 420, !10, i64 512, !7, i64 516, !10, i64 1004, !10, i64 1008, !10, i64 1012, !10, i64 1016}
!16 = !{!15, !10, i64 72}
!17 = !{!15, !10, i64 272}
!18 = !{!12, !10, i64 100}
!19 = !{!12, !10, i64 96}
!20 = !{!12, !10, i64 84}
!21 = !{!12, !10, i64 80}
!22 = !{!12, !6, i64 72}
!23 = !{!15, !10, i64 0}
!24 = !{!15, !10, i64 36}
!25 = !{!12, !6, i64 88}
!26 = !{!27, !6, i64 80}
!27 = !{!"__MDMA_HandleTypeDef", !6, i64 0, !28, i64 8, !10, i64 64, !10, 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, !10, i64 144, !10, i64 148}
!28 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!29 = !{!27, !6, i64 112}
!30 = !{!27, !6, i64 120}
!31 = !{!27, !6, i64 0}
!32 = !{!28, !10, i64 16}
!33 = !{!27, !10, i64 36}
!34 = !{!12, !10, i64 16}
!35 = !{!15, !10, i64 256}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @HAL_OSPI_Receive_DMA(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 64
  %5 = load volatile i32, ptr %4, align 4, !tbaa !12
  %6 = add i32 %5, 1
  %7 = getelementptr inbounds i8, ptr %3, i64 72
  %8 = load volatile i32, ptr %7, align 4, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %3, i64 272
  %10 = load volatile i32, ptr %9, align 4, !tbaa !15
  %11 = icmp eq ptr %1, null
  br i1 %11, label %12, label %14

12:                                               ; preds = %2
  %13 = getelementptr inbounds i8, ptr %0, i64 100
  store volatile i32 8, ptr %13, align 4, !tbaa !16
  br label %84

14:                                               ; preds = %2
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  %16 = load volatile i32, ptr %15, align 8, !tbaa !17
  %17 = icmp eq i32 %16, 4
  br i1 %17, label %18, label %82

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 84
  store volatile i32 %6, ptr %19, align 4, !tbaa !18
  %20 = load volatile i32, ptr %19, align 4, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %0, i64 80
  store volatile i32 %20, ptr %21, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %0, i64 72
  store ptr %1, ptr %22, align 8, !tbaa !20
  %23 = load volatile i32, ptr %3, align 4, !tbaa !21
  %24 = and i32 %23, -805306369
  %25 = or disjoint i32 %24, 268435456
  store volatile i32 %25, ptr %3, align 4, !tbaa !21
  %26 = getelementptr inbounds i8, ptr %3, i64 36
  store volatile i32 3, ptr %26, align 4, !tbaa !22
  store volatile i32 40, ptr %15, align 8, !tbaa !17
  %27 = getelementptr inbounds i8, ptr %0, i64 88
  %28 = load ptr, ptr %27, align 8, !tbaa !23
  %29 = getelementptr inbounds i8, ptr %28, i64 80
  store ptr @OSPI_DMACplt, ptr %29, align 8, !tbaa !24
  %30 = getelementptr inbounds i8, ptr %28, i64 112
  store ptr @OSPI_DMAError, ptr %30, align 8, !tbaa !27
  %31 = getelementptr inbounds i8, ptr %28, i64 120
  store ptr null, ptr %31, align 8, !tbaa !28
  %32 = load ptr, ptr %28, align 8, !tbaa !29
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %34 = load volatile i32, ptr %33, align 4, !tbaa !30
  %35 = and i32 %34, -772
  store volatile i32 %35, ptr %33, align 4, !tbaa !30
  %36 = getelementptr inbounds i8, ptr %28, i64 36
  %37 = load i32, ptr %36, align 4, !tbaa !31
  switch i32 %37, label %50 [
    i32 0, label %38
    i32 64, label %42
    i32 128, label %46
  ]

38:                                               ; preds = %18
  %39 = load volatile i32, ptr %33, align 4, !tbaa !30
  %40 = and i32 %39, -3085
  %41 = or disjoint i32 %40, 8
  store volatile i32 %41, ptr %33, align 4, !tbaa !30
  br label %54

42:                                               ; preds = %18
  %43 = load volatile i32, ptr %33, align 4, !tbaa !30
  %44 = and i32 %43, -3085
  %45 = or disjoint i32 %44, 1032
  store volatile i32 %45, ptr %33, align 4, !tbaa !30
  br label %54

46:                                               ; preds = %18
  %47 = load volatile i32, ptr %33, align 4, !tbaa !30
  %48 = and i32 %47, -3085
  %49 = or disjoint i32 %48, 2056
  store volatile i32 %49, ptr %33, align 4, !tbaa !30
  br label %54

50:                                               ; preds = %18
  %51 = getelementptr inbounds i8, ptr %0, i64 100
  %52 = load volatile i32, ptr %51, align 4, !tbaa !16
  %53 = or i32 %52, 4
  store volatile i32 %53, ptr %51, align 4, !tbaa !16
  br label %54

54:                                               ; preds = %42, %50, %46, %38
  %.0 = phi i32 [ 0, %38 ], [ 0, %42 ], [ 0, %46 ], [ 1, %50 ]
  %55 = getelementptr inbounds i8, ptr %3, i64 80
  %56 = ptrtoint ptr %55 to i64
  %57 = trunc i64 %56 to i32
  %58 = ptrtoint ptr %1 to i64
  %59 = trunc i64 %58 to i32
  %60 = load volatile i32, ptr %21, align 8, !tbaa !19
  %61 = tail call i32 @HAL_MDMA_Start_IT(ptr noundef nonnull %28, i32 noundef %57, i32 noundef %59, i32 noundef %60, i32 noundef 1) #2
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %80

63:                                               ; preds = %54
  %64 = load ptr, ptr %0, align 8, !tbaa !5
  %65 = load volatile i32, ptr %64, align 4, !tbaa !21
  %66 = or i32 %65, 65536
  store volatile i32 %66, ptr %64, align 4, !tbaa !21
  %67 = getelementptr inbounds i8, ptr %0, i64 16
  %68 = load i32, ptr %67, align 8, !tbaa !32
  %69 = icmp eq i32 %68, 67108864
  br i1 %69, label %70, label %72

70:                                               ; preds = %63
  %71 = getelementptr inbounds i8, ptr %64, i64 72
  store volatile i32 %8, ptr %71, align 4, !tbaa !14
  br label %84

72:                                               ; preds = %63
  %73 = getelementptr inbounds i8, ptr %64, i64 256
  %74 = load volatile i32, ptr %73, align 4, !tbaa !33
  %75 = and i32 %74, 1792
  %.not = icmp eq i32 %75, 0
  br i1 %.not, label %78, label %76

76:                                               ; preds = %72
  %77 = getelementptr inbounds i8, ptr %64, i64 72
  store volatile i32 %8, ptr %77, align 4, !tbaa !14
  br label %84

78:                                               ; preds = %72
  %79 = getelementptr inbounds i8, ptr %64, i64 272
  store volatile i32 %10, ptr %79, align 4, !tbaa !15
  br label %84

80:                                               ; preds = %54
  %81 = getelementptr inbounds i8, ptr %0, i64 100
  store volatile i32 4, ptr %81, align 4, !tbaa !16
  store volatile i32 2, ptr %15, align 8, !tbaa !17
  br label %84

82:                                               ; preds = %14
  %83 = getelementptr inbounds i8, ptr %0, i64 100
  store volatile i32 16, ptr %83, align 4, !tbaa !16
  br label %84

84:                                               ; preds = %82, %70, %78, %76, %80, %12
  %.1 = phi i32 [ 1, %12 ], [ %.0, %70 ], [ %.0, %76 ], [ %.0, %78 ], [ 1, %80 ], [ 1, %82 ]
  ret i32 %.1
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 64}
!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 72}
!15 = !{!13, !11, i64 272}
!16 = !{!6, !11, i64 100}
!17 = !{!6, !11, i64 96}
!18 = !{!6, !11, i64 84}
!19 = !{!6, !11, i64 80}
!20 = !{!6, !7, i64 72}
!21 = !{!13, !11, i64 0}
!22 = !{!13, !11, i64 36}
!23 = !{!6, !7, i64 88}
!24 = !{!25, !7, i64 80}
!25 = !{!"__MDMA_HandleTypeDef", !7, i64 0, !26, 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}
!26 = !{!"", !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}
!27 = !{!25, !7, i64 112}
!28 = !{!25, !7, i64 120}
!29 = !{!25, !7, i64 0}
!30 = !{!26, !11, i64 16}
!31 = !{!25, !11, i64 36}
!32 = !{!6, !11, i64 16}
!33 = !{!13, !11, i64 256}


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