; LLVM IR from jianboqi/CSF :: src/CSF.ll (ZN3CSFC2Ev)

; 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.CSF = type <{ %"class.csf::PointCloud", %struct.Params, i32, [4 x i8] }>
%"class.csf::PointCloud" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<csf::Point, std::allocator<csf::Point>>::_Vector_impl" }
%"struct.std::_Vector_base<csf::Point, std::allocator<csf::Point>>::_Vector_impl" = type { %"struct.std::_Vector_base<csf::Point, std::allocator<csf::Point>>::_Vector_impl_data" }
%"struct.std::_Vector_base<csf::Point, std::allocator<csf::Point>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Params = type { i8, double, double, double, i32, i32 }

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3CSFC2Ev(ptr noundef nonnull align 8 dereferenceable(68) %0) unnamed_addr #1 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.CSF, ptr %3, i32 0, i32 0
  call void @_ZN3csf10PointCloudC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  %5 = getelementptr inbounds %class.CSF, ptr %3, i32 0, i32 1
  %6 = getelementptr inbounds %class.CSF, ptr %3, i32 0, i32 1
  %7 = getelementptr inbounds %struct.Params, ptr %6, i32 0, i32 0
  store i8 1, ptr %7, align 8, !tbaa !9
  %8 = getelementptr inbounds %class.CSF, ptr %3, i32 0, i32 1
  %9 = getelementptr inbounds %struct.Params, ptr %8, i32 0, i32 1
  store double 6.500000e-01, ptr %9, align 8, !tbaa !20
  %10 = getelementptr inbounds %class.CSF, ptr %3, i32 0, i32 1
  %11 = getelementptr inbounds %struct.Params, ptr %10, i32 0, i32 2
  store double 5.000000e-01, ptr %11, align 8, !tbaa !21
  %12 = getelementptr inbounds %class.CSF, ptr %3, i32 0, i32 1
  %13 = getelementptr inbounds %struct.Params, ptr %12, i32 0, i32 3
  store double 1.000000e+00, ptr %13, align 8, !tbaa !22
  %14 = getelementptr inbounds %class.CSF, ptr %3, i32 0, i32 1
  %15 = getelementptr inbounds %struct.Params, ptr %14, i32 0, i32 4
  store i32 3, ptr %15, align 8, !tbaa !23
  %16 = getelementptr inbounds %class.CSF, ptr %3, i32 0, i32 1
  %17 = getelementptr inbounds %struct.Params, ptr %16, i32 0, i32 5
  store i32 500, ptr %17, align 4, !tbaa !24
  %18 = getelementptr inbounds %class.CSF, ptr %3, i32 0, i32 2
  store i32 0, ptr %18, align 8, !tbaa !25
  ret void
}

attributes #0 = { inlinehint 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 #1 = { 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 #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++ TBAA"}
!9 = !{!10, !17, i64 24}
!10 = !{!"_ZTS3CSF", !11, i64 0, !16, i64 24, !19, i64 64}
!11 = !{!"_ZTSN3csf10PointCloudE", !12, i64 0}
!12 = !{!"_ZTSSt6vectorIN3csf5PointESaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIN3csf5PointESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN3csf5PointESaIS1_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN3csf5PointESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTS6Params", !17, i64 0, !18, i64 8, !18, i64 16, !18, i64 24, !19, i64 32, !19, i64 36}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!10, !18, i64 32}
!21 = !{!10, !18, i64 40}
!22 = !{!10, !18, i64 48}
!23 = !{!10, !19, i64 56}
!24 = !{!10, !19, i64 60}
!25 = !{!10, !19, i64 64}


; 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3csf10PointCloudC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3CSFC2Ev(ptr noundef nonnull align 8 dereferenceable(68) %0) unnamed_addr #1 align 2 {
  tail call void @_ZN3csf10PointCloudC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #2
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  store i8 1, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  store <2 x double> <double 6.500000e-01, double 5.000000e-01>, ptr %3, align 8, !tbaa !19
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  store double 1.000000e+00, ptr %4, align 8, !tbaa !20
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 3, ptr %5, align 8, !tbaa !21
  %6 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 500, ptr %6, align 4, !tbaa !22
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  store i32 0, ptr %7, align 8, !tbaa !23
  ret void
}

attributes #0 = { inlinehint 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 #1 = { 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 #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, !16, i64 24}
!6 = !{!"_ZTS3CSF", !7, i64 0, !15, i64 24, !18, i64 64}
!7 = !{!"_ZTSN3csf10PointCloudE", !8, i64 0}
!8 = !{!"_ZTSSt6vectorIN3csf5PointESaIS1_EE", !9, i64 0}
!9 = !{!"_ZTSSt12_Vector_baseIN3csf5PointESaIS1_EE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIN3csf5PointESaIS1_EE12_Vector_implE", !11, i64 0}
!11 = !{!"_ZTSNSt12_Vector_baseIN3csf5PointESaIS1_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"_ZTS6Params", !16, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !18, i64 32, !18, i64 36}
!16 = !{!"bool", !13, i64 0}
!17 = !{!"double", !13, i64 0}
!18 = !{!"int", !13, i64 0}
!19 = !{!17, !17, i64 0}
!20 = !{!6, !17, i64 48}
!21 = !{!6, !18, i64 56}
!22 = !{!6, !18, i64 60}
!23 = !{!6, !18, i64 64}


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