; LLVM IR from artvns/SimpleFvm :: simplefvm/src/FVMSolver/CoeffsPartsVelocity/SourceTerm (MovingWallSource)

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

%"class.fvmsolver::MovingWallSource" = type { %"class.fvmsolver::AbstractSource", %"class.std::unique_ptr", ptr, double, double, double, double, i32, i32, i32, i32 }
%"class.fvmsolver::AbstractSource" = type { ptr, double, double }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN9fvmsolver16MovingWallSource17calculateForUMeshEv(ptr noundef nonnull align 8 dereferenceable(88) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"class.fvmsolver::MovingWallSource", ptr %3, i32 0, i32 3
  %5 = load double, ptr %4, align 8, !tbaa !9
  %6 = fmul double 2.000000e+00, %5
  %7 = getelementptr inbounds %"class.fvmsolver::MovingWallSource", ptr %3, i32 0, i32 6
  %8 = load double, ptr %7, align 8, !tbaa !20
  %9 = fmul double %6, %8
  %10 = getelementptr inbounds %"class.fvmsolver::MovingWallSource", ptr %3, i32 0, i32 5
  %11 = load double, ptr %10, align 8, !tbaa !21
  %12 = fdiv double %9, %11
  %13 = getelementptr inbounds %"class.fvmsolver::AbstractSource", ptr %3, i32 0, i32 1
  store double %12, ptr %13, align 8, !tbaa !22
  %14 = getelementptr inbounds %"class.fvmsolver::MovingWallSource", ptr %3, i32 0, i32 3
  %15 = load double, ptr %14, align 8, !tbaa !9
  %16 = fmul double 2.000000e+00, %15
  %17 = getelementptr inbounds %"class.fvmsolver::MovingWallSource", ptr %3, i32 0, i32 4
  %18 = load double, ptr %17, align 8, !tbaa !23
  %19 = fmul double %16, %18
  %20 = getelementptr inbounds %"class.fvmsolver::MovingWallSource", ptr %3, i32 0, i32 6
  %21 = load double, ptr %20, align 8, !tbaa !20
  %22 = fmul double %19, %21
  %23 = getelementptr inbounds %"class.fvmsolver::MovingWallSource", ptr %3, i32 0, i32 5
  %24 = load double, ptr %23, align 8, !tbaa !21
  %25 = fdiv double %22, %24
  %26 = getelementptr inbounds %"class.fvmsolver::AbstractSource", ptr %3, i32 0, i32 2
  store double %25, ptr %26, align 8, !tbaa !24
  ret void
}

attributes #0 = { 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" }

!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, !12, i64 40}
!10 = !{!"_ZTSN9fvmsolver16MovingWallSourceE", !11, i64 0, !13, i64 24, !6, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !19, i64 72, !19, i64 76, !19, i64 80, !19, i64 84}
!11 = !{!"_ZTSN9fvmsolver14AbstractSourceE", !12, i64 8, !12, i64 16}
!12 = !{!"double", !7, i64 0}
!13 = !{!"_ZTSSt10unique_ptrIN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_dataIN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_ELb1ELb1EE", !15, i64 0}
!15 = !{!"_ZTSSt15__uniq_ptr_implIN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt5tupleIJPN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_EEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJPN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_Head_baseILm0EPN9fvmsolver18AbstractSourcePortELb0EE", !6, i64 0}
!19 = !{!"_ZTSN9fvmsolver21EnumAdjacentCellTypesE", !7, i64 0}
!20 = !{!10, !12, i64 64}
!21 = !{!10, !12, i64 56}
!22 = !{!11, !12, i64 8}
!23 = !{!10, !12, i64 48}
!24 = !{!11, !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"

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_ZN9fvmsolver16MovingWallSource17calculateForUMeshEv(ptr nocapture noundef nonnull align 8 dereferenceable(88) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 40
  %3 = load double, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 64
  %5 = load <2 x double>, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 56
  %7 = load <2 x double>, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = load double, ptr %9, align 8, !tbaa !19
  %11 = fmul double %3, 2.000000e+00
  %12 = fmul double %11, %10
  %13 = insertelement <2 x double> poison, double %11, i64 0
  %14 = insertelement <2 x double> %13, double %12, i64 1
  %15 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
  %16 = fmul <2 x double> %14, %15
  %17 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer
  %18 = fdiv <2 x double> %16, %17
  store <2 x double> %18, ptr %8, align 8, !tbaa !20
  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, !8, i64 40}
!6 = !{!"_ZTSN9fvmsolver16MovingWallSourceE", !7, i64 0, !11, i64 24, !17, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !18, i64 72, !18, i64 76, !18, i64 80, !18, i64 84}
!7 = !{!"_ZTSN9fvmsolver14AbstractSourceE", !8, i64 8, !8, i64 16}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSSt10unique_ptrIN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt15__uniq_ptr_dataIN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_ELb1ELb1EE", !13, i64 0}
!13 = !{!"_ZTSSt15__uniq_ptr_implIN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt5tupleIJPN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_EEE", !15, i64 0}
!15 = !{!"_ZTSSt11_Tuple_implILm0EJPN9fvmsolver18AbstractSourcePortESt14default_deleteIS1_EEE", !16, i64 0}
!16 = !{!"_ZTSSt10_Head_baseILm0EPN9fvmsolver18AbstractSourcePortELb0EE", !17, i64 0}
!17 = !{!"any pointer", !9, i64 0}
!18 = !{!"_ZTSN9fvmsolver21EnumAdjacentCellTypesE", !9, i64 0}
!19 = !{!6, !8, i64 48}
!20 = !{!8, !8, i64 0}


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