; LLVM IR from PetoiCamp/OpenCatEsp32 :: src/icm42670 (inv_imu_apex)

; 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.inv_imu_apex_parameters_t = type { i32, i8, i8, i32, i32, i32, 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 i32 @inv_imu_apex_init_parameters_struct(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = 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) #2
  store i32 0, ptr %5, align 4, !tbaa !9
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %7, i32 0, i32 0
  store i32 128, ptr %8, align 4, !tbaa !11
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %9, i32 0, i32 1
  store i8 5, ptr %10, align 4, !tbaa !13
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %11, i32 0, i32 2
  store i8 2, ptr %12, align 1, !tbaa !14
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %13, i32 0, i32 3
  store i32 16, ptr %14, align 4, !tbaa !15
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %15, i32 0, i32 4
  store i32 1, ptr %16, align 4, !tbaa !16
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %17, i32 0, i32 5
  store i32 128, ptr %18, align 4, !tbaa !17
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %19, i32 0, i32 6
  store i32 2, ptr %20, align 4, !tbaa !18
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %21, i32 0, i32 7
  store i32 8, ptr %22, align 4, !tbaa !19
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %23, i32 0, i32 8
  store i32 0, ptr %24, align 4, !tbaa !20
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %25, i32 0, i32 9
  store i32 160, ptr %26, align 4, !tbaa !21
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %27, i32 0, i32 10
  store i32 0, ptr %28, align 4, !tbaa !22
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %29, i32 0, i32 11
  store i32 112, ptr %30, align 4, !tbaa !23
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %31, i32 0, i32 12
  store i32 80, ptr %32, align 4, !tbaa !24
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %33, i32 0, i32 13
  store i32 0, ptr %34, align 4, !tbaa !25
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %35, i32 0, i32 14
  store i32 136, ptr %36, align 4, !tbaa !26
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %37, i32 0, i32 15
  store i32 32, ptr %38, align 4, !tbaa !27
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %39, i32 0, i32 16
  store i32 0, ptr %40, align 4, !tbaa !28
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %41, i32 0, i32 17
  store i32 72, ptr %42, align 4, !tbaa !29
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %43, i32 0, i32 18
  store i32 4, ptr %44, align 4, !tbaa !30
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.inv_imu_apex_parameters_t, ptr %45, i32 0, i32 19
  store i32 0, ptr %46, align 4, !tbaa !31
  %47 = load i32, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  ret i32 %47
}

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 = { 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, !10, i64 0}
!12 = !{!"", !10, i64 0, !7, i64 4, !7, i64 5, !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, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72}
!13 = !{!12, !7, i64 4}
!14 = !{!12, !7, i64 5}
!15 = !{!12, !10, i64 8}
!16 = !{!12, !10, i64 12}
!17 = !{!12, !10, i64 16}
!18 = !{!12, !10, i64 20}
!19 = !{!12, !10, i64 24}
!20 = !{!12, !10, i64 28}
!21 = !{!12, !10, i64 32}
!22 = !{!12, !10, i64 36}
!23 = !{!12, !10, i64 40}
!24 = !{!12, !10, i64 44}
!25 = !{!12, !10, i64 48}
!26 = !{!12, !10, i64 52}
!27 = !{!12, !10, i64 56}
!28 = !{!12, !10, i64 60}
!29 = !{!12, !10, i64 64}
!30 = !{!12, !10, i64 68}
!31 = !{!12, !10, i64 72}


; 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: write) uwtable
define dso_local noundef i32 @inv_imu_apex_init_parameters_struct(ptr nocapture noundef readnone %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #0 {
  store i32 128, ptr %1, align 4, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %1, i64 4
  store i8 5, ptr %3, align 4, !tbaa !10
  %4 = getelementptr inbounds i8, ptr %1, i64 5
  store i8 2, ptr %4, align 1, !tbaa !11
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  store <4 x i32> <i32 16, i32 1, i32 128, i32 2>, ptr %5, align 4, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %1, i64 24
  store <4 x i32> <i32 8, i32 0, i32 160, i32 0>, ptr %6, align 4, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %1, i64 40
  store <4 x i32> <i32 112, i32 80, i32 0, i32 136>, ptr %7, align 4, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %1, i64 56
  store <4 x i32> <i32 32, i32 0, i32 72, i32 4>, ptr %8, align 4, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %1, i64 72
  store i32 0, ptr %9, align 4, !tbaa !13
  ret i32 0
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !8, i64 4, !8, i64 5, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !8, i64 4}
!11 = !{!6, !8, i64 5}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !7, i64 72}


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