; LLVM IR from pms67/HadesFCS :: Firmware/F4/HadesF4Testbed/Core/Src (KalmanRollPitch)

; 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.KalmanRollPitch = type { float, float, [4 x float], [2 x float], [3 x float] }

; Function Attrs: nounwind uwtable
define dso_local void @KalmanRollPitch_Init(ptr noundef %0, float noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store float %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.KalmanRollPitch, ptr %9, i32 0, i32 0
  store float 0.000000e+00, ptr %10, align 4, !tbaa !11
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.KalmanRollPitch, ptr %11, i32 0, i32 1
  store float 0.000000e+00, ptr %12, align 4, !tbaa !13
  %13 = load float, ptr %6, align 4, !tbaa !9
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.KalmanRollPitch, ptr %14, i32 0, i32 2
  %16 = getelementptr inbounds [4 x float], ptr %15, i64 0, i64 0
  store float %13, ptr %16, align 4, !tbaa !9
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.KalmanRollPitch, ptr %17, i32 0, i32 2
  %19 = getelementptr inbounds [4 x float], ptr %18, i64 0, i64 1
  store float 0.000000e+00, ptr %19, align 4, !tbaa !9
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.KalmanRollPitch, ptr %20, i32 0, i32 2
  %22 = getelementptr inbounds [4 x float], ptr %21, i64 0, i64 2
  store float 0.000000e+00, ptr %22, align 4, !tbaa !9
  %23 = load float, ptr %6, align 4, !tbaa !9
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.KalmanRollPitch, ptr %24, i32 0, i32 2
  %26 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 3
  store float %23, ptr %26, align 4, !tbaa !9
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds float, ptr %27, i64 0
  %29 = load float, ptr %28, align 4, !tbaa !9
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.KalmanRollPitch, ptr %30, i32 0, i32 3
  %32 = getelementptr inbounds [2 x float], ptr %31, i64 0, i64 0
  store float %29, ptr %32, align 4, !tbaa !9
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds float, ptr %33, i64 1
  %35 = load float, ptr %34, align 4, !tbaa !9
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.KalmanRollPitch, ptr %36, i32 0, i32 3
  %38 = getelementptr inbounds [2 x float], ptr %37, i64 0, i64 1
  store float %35, ptr %38, align 4, !tbaa !9
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds float, ptr %39, i64 0
  %41 = load float, ptr %40, align 4, !tbaa !9
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.KalmanRollPitch, ptr %42, i32 0, i32 4
  %44 = getelementptr inbounds [3 x float], ptr %43, i64 0, i64 0
  store float %41, ptr %44, align 4, !tbaa !9
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds float, ptr %45, i64 1
  %47 = load float, ptr %46, align 4, !tbaa !9
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.KalmanRollPitch, ptr %48, i32 0, i32 4
  %50 = getelementptr inbounds [3 x float], ptr %49, i64 0, i64 1
  store float %47, ptr %50, align 4, !tbaa !9
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds float, ptr %51, i64 2
  %53 = load float, ptr %52, align 4, !tbaa !9
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.KalmanRollPitch, ptr %54, i32 0, i32 4
  %56 = getelementptr inbounds [3 x float], ptr %55, i64 0, i64 2
  store float %53, ptr %56, align 4, !tbaa !9
  ret void
}

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

!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 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 24, !7, i64 32}
!13 = !{!12, !10, i64 4}


; 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @KalmanRollPitch_Init(ptr nocapture noundef writeonly %0, float noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3) local_unnamed_addr #0 {
  store <2 x float> zeroinitializer, ptr %0, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  store float %1, ptr %5, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 12
  store <2 x float> zeroinitializer, ptr %6, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 20
  store float %1, ptr %7, align 4, !tbaa !5
  %8 = load float, ptr %2, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  store float %8, ptr %9, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %2, i64 4
  %11 = load float, ptr %10, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 28
  store float %11, ptr %12, align 4, !tbaa !5
  %13 = load float, ptr %3, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  store float %13, ptr %14, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %3, i64 4
  %16 = load float, ptr %15, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 36
  store float %16, ptr %17, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %3, i64 8
  %19 = load float, ptr %18, align 4, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %0, i64 40
  store float %19, ptr %20, align 4, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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" }

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass