; LLVM IR from kylechampley/XrayPhysics :: src/xscatter.ll (ZN8xscatterC2Ev)

; 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.xscatter = type { %class.xsec, %"class.std::vector.3", double, double, double, double }
%class.xsec = type { [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector", [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector", [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector", [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector", [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float *, std::allocator<float *>>::_Vector_impl" }
%"struct.std::_Vector_base<float *, std::allocator<float *>>::_Vector_impl" = type { %"struct.std::_Vector_base<float *, std::allocator<float *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float *, std::allocator<float *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<xscatter::IncoherentAndCoherentScatterFunctions_elem_s, std::allocator<xscatter::IncoherentAndCoherentScatterFunctions_elem_s>>::_Vector_impl" }
%"struct.std::_Vector_base<xscatter::IncoherentAndCoherentScatterFunctions_elem_s, std::allocator<xscatter::IncoherentAndCoherentScatterFunctions_elem_s>>::_Vector_impl" = type { %"struct.std::_Vector_base<xscatter::IncoherentAndCoherentScatterFunctions_elem_s, std::allocator<xscatter::IncoherentAndCoherentScatterFunctions_elem_s>>::_Vector_impl_data" }
%"struct.std::_Vector_base<xscatter::IncoherentAndCoherentScatterFunctions_elem_s, std::allocator<xscatter::IncoherentAndCoherentScatterFunctions_elem_s>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8xscatterC2Ev(ptr noundef nonnull align 8 dereferenceable(2456) %0) unnamed_addr #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.xscatter, ptr %3, i32 0, i32 0
  call void @_ZN4xsecC1Ev(ptr noundef nonnull align 8 dereferenceable(2400) %4)
  %5 = getelementptr inbounds %class.xscatter, ptr %3, i32 0, i32 1
  call void @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  %6 = getelementptr inbounds %class.xscatter, ptr %3, i32 0, i32 2
  store double 0x3FA87BEF454DDF85, ptr %6, align 8, !tbaa !9
  %7 = getelementptr inbounds %class.xscatter, ptr %3, i32 0, i32 2
  %8 = load double, ptr %7, align 8, !tbaa !9
  %9 = fmul double 0x401921FB54442D18, %8
  %10 = getelementptr inbounds %class.xscatter, ptr %3, i32 0, i32 3
  store double %9, ptr %10, align 8, !tbaa !21
  %11 = getelementptr inbounds %class.xscatter, ptr %3, i32 0, i32 4
  store double 0x3FD208E9D6A1A386, ptr %11, align 8, !tbaa !22
  %12 = getelementptr inbounds %class.xscatter, ptr %3, i32 0, i32 4
  %13 = load double, ptr %12, align 8, !tbaa !22
  %14 = getelementptr inbounds %class.xscatter, ptr %3, i32 0, i32 4
  %15 = load double, ptr %14, align 8, !tbaa !22
  %16 = fmul double %13, %15
  %17 = getelementptr inbounds %class.xscatter, ptr %3, i32 0, i32 5
  store double %16, ptr %17, align 8, !tbaa !23
  %18 = getelementptr inbounds %class.xscatter, ptr %3, i32 0, i32 1
  call void @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  ret void
}

declare void @_ZN4xsecC1Ev(ptr noundef nonnull align 8 dereferenceable(2400)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

attributes #0 = { mustprogress 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 #1 = { "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 = { 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 #3 = { 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, !20, i64 2424}
!10 = !{!"_ZTS8xscatter", !11, i64 0, !16, i64 2400, !20, i64 2424, !20, i64 2432, !20, i64 2440, !20, i64 2448}
!11 = !{!"_ZTS4xsec", !7, i64 0, !12, i64 408, !12, i64 432, !12, i64 456, !7, i64 480, !12, i64 888, !12, i64 912, !12, i64 936, !7, i64 960, !12, i64 1368, !12, i64 1392, !12, i64 1416, !7, i64 1440, !12, i64 1848, !12, i64 1872, !12, i64 1896, !7, i64 1920, !12, i64 2328, !12, i64 2352, !12, i64 2376}
!12 = !{!"_ZTSSt6vectorIPfSaIS0_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIPfSaIS0_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPfSaIS0_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPfSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTSSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"double", !7, i64 0}
!21 = !{!10, !20, i64 2432}
!22 = !{!10, !20, i64 2440}
!23 = !{!10, !20, i64 2448}


; 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 uwtable
define dso_local void @_ZN8xscatterC2Ev(ptr noundef nonnull align 8 dereferenceable(2456) %0) unnamed_addr #0 align 2 {
  tail call void @_ZN4xsecC1Ev(ptr noundef nonnull align 8 dereferenceable(2400) %0)
  %2 = getelementptr inbounds i8, ptr %0, i64 2400
  tail call void @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %3 = getelementptr inbounds i8, ptr %0, i64 2424
  store <2 x double> <double 0x3FA87BEF454DDF85, double 0x3FD33AD3097A947C>, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 2440
  store <2 x double> <double 0x3FD208E9D6A1A386, double 0x3FB454131A1BD7F4>, ptr %4, align 8, !tbaa !5
  tail call void @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  ret void
}

declare void @_ZN4xsecC1Ev(ptr noundef nonnull align 8 dereferenceable(2400)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress 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 #1 = { "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 = { 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 #3 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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