; LLVM IR from reazon-research/OpenArm :: control/canfd_control/Core/Src (octospi)

; 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.GPIO_InitTypeDef = type { i32, i32, i32, i32, i32 }
%struct.RCC_PeriphCLKInitTypeDef = type { i64, %struct.RCC_PLL2InitTypeDef, %struct.RCC_PLL3InitTypeDef, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PLL2InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PLL3InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%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.RCC_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [9 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare void @Error_Handler() #2

; 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_MspInit(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.GPIO_InitTypeDef, align 4
  %4 = alloca %struct.RCC_PeriphCLKInitTypeDef, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %3) #4
  call void @llvm.memset.p0.i64(ptr align 4 %3, i8 0, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 184, ptr %4) #4
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 184, i1 false)
  %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 = icmp eq ptr %13, inttoptr (i64 1375752192 to ptr)
  br i1 %14, label %15, label %124

15:                                               ; preds = %1
  %16 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %4, i32 0, i32 0
  store i64 33554432, ptr %16, align 8, !tbaa !13
  %17 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %4, i32 0, i32 4
  store i32 0, ptr %17, align 4, !tbaa !17
  %18 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef %4)
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %15
  call void @Error_Handler()
  br label %21

21:                                               ; preds = %20, %15
  br label %22

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %23 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 45), align 4, !tbaa !18
  %24 = zext i32 %23 to i64
  %25 = or i64 %24, 2097152
  %26 = trunc i64 %25 to i32
  store volatile i32 %26, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 45), align 4, !tbaa !18
  %27 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 45), align 4, !tbaa !18
  %28 = zext i32 %27 to i64
  %29 = and i64 %28, 2097152
  %30 = trunc i64 %29 to i32
  store volatile i32 %30, ptr %5, align 4, !tbaa !20
  %31 = load volatile i32, ptr %5, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %32

32:                                               ; preds = %22
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %35 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 45), align 4, !tbaa !18
  %36 = zext i32 %35 to i64
  %37 = or i64 %36, 16384
  %38 = trunc i64 %37 to i32
  store volatile i32 %38, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 45), align 4, !tbaa !18
  %39 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 45), align 4, !tbaa !18
  %40 = zext i32 %39 to i64
  %41 = and i64 %40, 16384
  %42 = trunc i64 %41 to i32
  store volatile i32 %42, ptr %6, align 4, !tbaa !20
  %43 = load volatile i32, ptr %6, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %44

44:                                               ; preds = %34
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %47 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %48 = zext i32 %47 to i64
  %49 = or i64 %48, 1
  %50 = trunc i64 %49 to i32
  store volatile i32 %50, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %51 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %52 = zext i32 %51 to i64
  %53 = and i64 %52, 1
  %54 = trunc i64 %53 to i32
  store volatile i32 %54, ptr %7, align 4, !tbaa !20
  %55 = load volatile i32, ptr %7, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %56

56:                                               ; preds = %46
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %59 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %60 = zext i32 %59 to i64
  %61 = or i64 %60, 2
  %62 = trunc i64 %61 to i32
  store volatile i32 %62, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %63 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %64 = zext i32 %63 to i64
  %65 = and i64 %64, 2
  %66 = trunc i64 %65 to i32
  store volatile i32 %66, ptr %8, align 4, !tbaa !20
  %67 = load volatile i32, ptr %8, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %68

68:                                               ; preds = %58
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %71 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %72 = zext i32 %71 to i64
  %73 = or i64 %72, 16
  %74 = trunc i64 %73 to i32
  store volatile i32 %74, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %75 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %76 = zext i32 %75 to i64
  %77 = and i64 %76, 16
  %78 = trunc i64 %77 to i32
  store volatile i32 %78, ptr %9, align 4, !tbaa !20
  %79 = load volatile i32, ptr %9, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %80

80:                                               ; preds = %70
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %83 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %84 = zext i32 %83 to i64
  %85 = or i64 %84, 8
  %86 = trunc i64 %85 to i32
  store volatile i32 %86, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %87 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !21
  %88 = zext i32 %87 to i64
  %89 = and i64 %88, 8
  %90 = trunc i64 %89 to i32
  store volatile i32 %90, ptr %10, align 4, !tbaa !20
  %91 = load volatile i32, ptr %10, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %92

92:                                               ; preds = %82
  br label %93

93:                                               ; preds = %92
  %94 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 0
  store i32 2, ptr %94, align 4, !tbaa !22
  %95 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 1
  store i32 2, ptr %95, align 4, !tbaa !24
  %96 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 2
  store i32 0, ptr %96, align 4, !tbaa !25
  %97 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 3
  store i32 3, ptr %97, align 4, !tbaa !26
  %98 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 4
  store i32 9, ptr %98, align 4, !tbaa !27
  call void @HAL_GPIO_Init(ptr noundef inttoptr (i64 1476526080 to ptr), ptr noundef %3)
  %99 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 0
  store i32 8, ptr %99, align 4, !tbaa !22
  %100 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 1
  store i32 2, ptr %100, align 4, !tbaa !24
  %101 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 2
  store i32 0, ptr %101, align 4, !tbaa !25
  %102 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 3
  store i32 3, ptr %102, align 4, !tbaa !26
  %103 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 4
  store i32 6, ptr %103, align 4, !tbaa !27
  call void @HAL_GPIO_Init(ptr noundef inttoptr (i64 1476526080 to ptr), ptr noundef %3)
  %104 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 0
  store i32 1, ptr %104, align 4, !tbaa !22
  %105 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 1
  store i32 2, ptr %105, align 4, !tbaa !24
  %106 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 2
  store i32 0, ptr %106, align 4, !tbaa !25
  %107 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 3
  store i32 3, ptr %107, align 4, !tbaa !26
  %108 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 4
  store i32 4, ptr %108, align 4, !tbaa !27
  call void @HAL_GPIO_Init(ptr noundef inttoptr (i64 1476527104 to ptr), ptr noundef %3)
  %109 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 0
  store i32 4, ptr %109, align 4, !tbaa !22
  %110 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 1
  store i32 2, ptr %110, align 4, !tbaa !24
  %111 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 2
  store i32 0, ptr %111, align 4, !tbaa !25
  %112 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 3
  store i32 3, ptr %112, align 4, !tbaa !26
  %113 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 4
  store i32 9, ptr %113, align 4, !tbaa !27
  call void @HAL_GPIO_Init(ptr noundef inttoptr (i64 1476527104 to ptr), ptr noundef %3)
  %114 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 0
  store i32 2048, ptr %114, align 4, !tbaa !22
  %115 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 1
  store i32 2, ptr %115, align 4, !tbaa !24
  %116 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 2
  store i32 0, ptr %116, align 4, !tbaa !25
  %117 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 3
  store i32 3, ptr %117, align 4, !tbaa !26
  %118 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 4
  store i32 11, ptr %118, align 4, !tbaa !27
  call void @HAL_GPIO_Init(ptr noundef inttoptr (i64 1476530176 to ptr), ptr noundef %3)
  %119 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 0
  store i32 2048, ptr %119, align 4, !tbaa !22
  %120 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 1
  store i32 2, ptr %120, align 4, !tbaa !24
  %121 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 2
  store i32 0, ptr %121, align 4, !tbaa !25
  %122 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 3
  store i32 3, ptr %122, align 4, !tbaa !26
  %123 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 4
  store i32 9, ptr %123, align 4, !tbaa !27
  call void @HAL_GPIO_Init(ptr noundef inttoptr (i64 1476529152 to ptr), ptr noundef %3)
  br label %124

124:                                              ; preds = %93, %1
  call void @llvm.lifetime.end.p0(i64 184, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %3) #4
  ret void
}

declare i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef) #2

declare void @HAL_GPIO_Init(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 #4 = { 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, !15, i64 0}
!14 = !{!"", !15, i64 0, !16, i64 8, !16, i64 40, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180}
!15 = !{!"long", !7, i64 0}
!16 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!17 = !{!14, !12, i64 76}
!18 = !{!19, !12, i64 212}
!19 = !{!"", !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, 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, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !7, i64 172, !12, i64 208, !12, i64 212, !12, i64 216, !12, i64 220, !12, i64 224, !12, i64 228, !12, i64 232, !12, i64 236, !12, i64 240, !12, i64 244, !12, i64 248, !12, i64 252, !12, i64 256, !12, i64 260, !12, i64 264, !12, i64 268, !12, i64 272, !12, i64 276, !12, i64 280, !12, i64 284, !7, i64 288}
!20 = !{!12, !12, i64 0}
!21 = !{!19, !12, i64 224}
!22 = !{!23, !12, i64 0}
!23 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!24 = !{!23, !12, i64 4}
!25 = !{!23, !12, i64 8}
!26 = !{!23, !12, i64 12}
!27 = !{!23, !12, i64 16}


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

%struct.GPIO_InitTypeDef = type { i32, i32, i32, i32, i32 }
%struct.RCC_PeriphCLKInitTypeDef = type { i64, %struct.RCC_PLL2InitTypeDef, %struct.RCC_PLL3InitTypeDef, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PLL2InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PLL3InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare void @Error_Handler() local_unnamed_addr #2

; Function Attrs: mustprogress 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_MspInit(ptr nocapture noundef readonly %0) local_unnamed_addr #3 {
  %2 = alloca %struct.GPIO_InitTypeDef, align 16
  %3 = alloca %struct.RCC_PeriphCLKInitTypeDef, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %2) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %2, i8 0, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 184, ptr nonnull %3) #4
  %10 = getelementptr inbounds i8, ptr %3, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(184) %10, i8 0, i64 176, i1 false)
  %11 = load ptr, ptr %0, align 8, !tbaa !5
  %12 = icmp eq ptr %11, inttoptr (i64 1375752192 to ptr)
  br i1 %12, label %13, label %42

13:                                               ; preds = %1
  store i64 33554432, ptr %3, align 8, !tbaa !12
  %14 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef nonnull %3) #4
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %16, label %15

15:                                               ; preds = %13
  call void @Error_Handler() #4
  br label %16

16:                                               ; preds = %13, %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4)
  %17 = load volatile i32, ptr inttoptr (i64 1476543700 to ptr), align 4, !tbaa !16
  %18 = or i32 %17, 2097152
  store volatile i32 %18, ptr inttoptr (i64 1476543700 to ptr), align 4, !tbaa !16
  %19 = load volatile i32, ptr inttoptr (i64 1476543700 to ptr), align 4, !tbaa !16
  %20 = and i32 %19, 2097152
  store volatile i32 %20, ptr %4, align 4, !tbaa !18
  %.0..0..0..0.5 = load volatile i32, ptr %4, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5)
  %21 = load volatile i32, ptr inttoptr (i64 1476543700 to ptr), align 4, !tbaa !16
  %22 = or i32 %21, 16384
  store volatile i32 %22, ptr inttoptr (i64 1476543700 to ptr), align 4, !tbaa !16
  %23 = load volatile i32, ptr inttoptr (i64 1476543700 to ptr), align 4, !tbaa !16
  %24 = and i32 %23, 16384
  store volatile i32 %24, ptr %5, align 4, !tbaa !18
  %.0..0..0..0.4 = load volatile i32, ptr %5, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6)
  %25 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %26 = or i32 %25, 1
  store volatile i32 %26, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %27 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %28 = and i32 %27, 1
  store volatile i32 %28, ptr %6, align 4, !tbaa !18
  %.0..0..0..0.3 = load volatile i32, ptr %6, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7)
  %29 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %30 = or i32 %29, 2
  store volatile i32 %30, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %31 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %32 = and i32 %31, 2
  store volatile i32 %32, ptr %7, align 4, !tbaa !18
  %.0..0..0..0.2 = load volatile i32, ptr %7, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8)
  %33 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %34 = or i32 %33, 16
  store volatile i32 %34, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %35 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %36 = and i32 %35, 16
  store volatile i32 %36, ptr %8, align 4, !tbaa !18
  %.0..0..0..0.1 = load volatile i32, ptr %8, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9)
  %37 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %38 = or i32 %37, 8
  store volatile i32 %38, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %39 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !19
  %40 = and i32 %39, 8
  store volatile i32 %40, ptr %9, align 4, !tbaa !18
  %.0..0..0..0. = load volatile i32, ptr %9, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9)
  store <4 x i32> <i32 2, i32 2, i32 0, i32 3>, ptr %2, align 16, !tbaa !18
  %41 = getelementptr inbounds i8, ptr %2, i64 16
  store i32 9, ptr %41, align 16, !tbaa !20
  call void @HAL_GPIO_Init(ptr noundef nonnull inttoptr (i64 1476526080 to ptr), ptr noundef nonnull %2) #4
  store <4 x i32> <i32 8, i32 2, i32 0, i32 3>, ptr %2, align 16, !tbaa !18
  store i32 6, ptr %41, align 16, !tbaa !20
  call void @HAL_GPIO_Init(ptr noundef nonnull inttoptr (i64 1476526080 to ptr), ptr noundef nonnull %2) #4
  store <4 x i32> <i32 1, i32 2, i32 0, i32 3>, ptr %2, align 16, !tbaa !18
  store i32 4, ptr %41, align 16, !tbaa !20
  call void @HAL_GPIO_Init(ptr noundef nonnull inttoptr (i64 1476527104 to ptr), ptr noundef nonnull %2) #4
  store <4 x i32> <i32 4, i32 2, i32 0, i32 3>, ptr %2, align 16, !tbaa !18
  store i32 9, ptr %41, align 16, !tbaa !20
  call void @HAL_GPIO_Init(ptr noundef nonnull inttoptr (i64 1476527104 to ptr), ptr noundef nonnull %2) #4
  store <4 x i32> <i32 2048, i32 2, i32 0, i32 3>, ptr %2, align 16, !tbaa !18
  store i32 11, ptr %41, align 16, !tbaa !20
  call void @HAL_GPIO_Init(ptr noundef nonnull inttoptr (i64 1476530176 to ptr), ptr noundef nonnull %2) #4
  store <4 x i32> <i32 2048, i32 2, i32 0, i32 3>, ptr %2, align 16, !tbaa !18
  store i32 9, ptr %41, align 16, !tbaa !20
  call void @HAL_GPIO_Init(ptr noundef nonnull inttoptr (i64 1476529152 to ptr), ptr noundef nonnull %2) #4
  br label %42

42:                                               ; preds = %16, %1
  call void @llvm.lifetime.end.p0(i64 184, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #4
  ret void
}

declare i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef) local_unnamed_addr #2

declare void @HAL_GPIO_Init(ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 #4 = { 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, !14, i64 0}
!13 = !{!"", !14, i64 0, !15, i64 8, !15, i64 40, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180}
!14 = !{!"long", !8, i64 0}
!15 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!16 = !{!17, !11, i64 212}
!17 = !{!"", !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, 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, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !8, i64 172, !11, i64 208, !11, i64 212, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !11, i64 232, !11, i64 236, !11, i64 240, !11, i64 244, !11, i64 248, !11, i64 252, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !11, i64 284, !8, i64 288}
!18 = !{!11, !11, i64 0}
!19 = !{!17, !11, i64 224}
!20 = !{!21, !11, i64 16}
!21 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass