; LLVM IR from chrxh/alien :: source/Base/Math.ll (ZmlRKSt5arrayIS_IfLm2EELm2EERK12RealVector2D)

; 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.RealVector2D = type { float, float }
%"class.std::initializer_list" = type { ptr, i64 }

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

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

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

declare void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8), ptr, i64) unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZmlRKSt5arrayIS_IfLm2EELm2EERK12RealVector2D(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(8) %1) #3 {
  %3 = alloca %struct.RealVector2D, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::initializer_list", align 8
  %7 = alloca [2 x float], align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %8, i64 noundef 0) #5
  %10 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8) %9, i64 noundef 0) #5
  %11 = load float, ptr %10, align 4, !tbaa !9
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.RealVector2D, ptr %12, i32 0, i32 0
  %14 = load float, ptr %13, align 4, !tbaa !11
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %15, i64 noundef 0) #5
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8) %16, i64 noundef 1) #5
  %18 = load float, ptr %17, align 4, !tbaa !9
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.RealVector2D, ptr %19, i32 0, i32 1
  %21 = load float, ptr %20, align 4, !tbaa !13
  %22 = fmul float %18, %21
  %23 = call float @llvm.fmuladd.f32(float %11, float %14, float %22)
  store float %23, ptr %7, align 4, !tbaa !9
  %24 = getelementptr inbounds float, ptr %7, i64 1
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %25, i64 noundef 1) #5
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8) %26, i64 noundef 0) #5
  %28 = load float, ptr %27, align 4, !tbaa !9
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.RealVector2D, ptr %29, i32 0, i32 0
  %31 = load float, ptr %30, align 4, !tbaa !11
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %32, i64 noundef 1) #5
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8) %33, i64 noundef 1) #5
  %35 = load float, ptr %34, align 4, !tbaa !9
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.RealVector2D, ptr %36, i32 0, i32 1
  %38 = load float, ptr %37, align 4, !tbaa !13
  %39 = fmul float %35, %38
  %40 = call float @llvm.fmuladd.f32(float %28, float %31, float %39)
  store float %40, ptr %24, align 4, !tbaa !9
  %41 = getelementptr inbounds %"class.std::initializer_list", ptr %6, i32 0, i32 0
  store ptr %7, ptr %41, align 8, !tbaa !14
  %42 = getelementptr inbounds %"class.std::initializer_list", ptr %6, i32 0, i32 1
  store i64 2, ptr %42, align 8, !tbaa !17
  %43 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8
  %45 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 1
  %46 = load i64, ptr %45, align 8
  call void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr %44, i64 %46)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %47 = load <2 x float>, ptr %3, align 4
  ret <2 x float> %47
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16), i64 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8), i64 noundef) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { mustprogress 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 #5 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS12RealVector2D", !10, i64 0, !10, i64 4}
!13 = !{!12, !10, i64 4}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt16initializer_listIfE", !6, i64 0, !16, i64 8}
!16 = !{!"long", !7, i64 0}
!17 = !{!15, !16, i64 8}


; 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.RealVector2D = type { float, float }

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

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

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

declare void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8), ptr, i64) unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZmlRKSt5arrayIS_IfLm2EELm2EERK12RealVector2D(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %1) local_unnamed_addr #3 {
  %3 = alloca %struct.RealVector2D, align 8
  %4 = alloca [2 x float], align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %5 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %0, i64 noundef 0) #5
  %6 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8) %5, i64 noundef 0) #5
  %7 = load float, ptr %6, align 4, !tbaa !5
  %8 = load float, ptr %1, align 4, !tbaa !9
  %9 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %0, i64 noundef 0) #5
  %10 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8) %9, i64 noundef 1) #5
  %11 = load float, ptr %10, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %1, i64 4
  %13 = load float, ptr %12, align 4, !tbaa !11
  %14 = fmul float %11, %13
  %15 = tail call float @llvm.fmuladd.f32(float %7, float %8, float %14)
  store float %15, ptr %4, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %4, i64 4
  %17 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %0, i64 noundef 1) #5
  %18 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8) %17, i64 noundef 0) #5
  %19 = load float, ptr %18, align 4, !tbaa !5
  %20 = load float, ptr %1, align 4, !tbaa !9
  %21 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %0, i64 noundef 1) #5
  %22 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8) %21, i64 noundef 1) #5
  %23 = load float, ptr %22, align 4, !tbaa !5
  %24 = load float, ptr %12, align 4, !tbaa !11
  %25 = fmul float %23, %24
  %26 = tail call float @llvm.fmuladd.f32(float %19, float %20, float %25)
  store float %26, ptr %16, align 4, !tbaa !5
  call void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr nonnull %4, i64 2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %27 = load <2 x float>, ptr %3, align 8
  ret <2 x float> %27
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt5arrayIS_IfLm2EELm2EEixEm(ptr noundef nonnull align 4 dereferenceable(16), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIfLm2EEixEm(ptr noundef nonnull align 4 dereferenceable(8), i64 noundef) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { mustprogress 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 #5 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS12RealVector2D", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}


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