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

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

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

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" }
attributes #1 = { 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !19, i64 24}
!12 = !{!"_ZTS3CSF", !13, i64 0, !18, i64 24, !10, i64 64}
!13 = !{!"_ZTSN3csf10PointCloudE", !14, i64 0}
!14 = !{!"_ZTSSt6vectorIN3csf5PointESaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIN3csf5PointESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN3csf5PointESaIS1_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN3csf5PointESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTS6Params", !19, i64 0, !20, i64 8, !20, i64 16, !20, i64 24, !10, i64 32, !10, i64 36}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = !{!12, !20, i64 32}
!22 = !{!12, !20, i64 40}
!23 = !{!12, !20, i64 48}
!24 = !{!12, !10, i64 56}
!25 = !{!12, !10, i64 60}
!26 = !{!12, !10, 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: mustprogress nounwind uwtable
define dso_local void @_ZN3CSFC2Ei(ptr noundef nonnull align 8 dereferenceable(68) %0, i32 noundef %1) unnamed_addr #0 align 2 {
  tail call void @_ZN3csf10PointCloudC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #2
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  store i8 1, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  store <2 x double> <double 6.500000e-01, double 5.000000e-01>, ptr %4, align 8, !tbaa !19
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  store double 1.000000e+00, ptr %5, align 8, !tbaa !20
  %6 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 3, ptr %6, align 8, !tbaa !21
  %7 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 500, ptr %7, align 4, !tbaa !22
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  store i32 %1, ptr %8, align 8, !tbaa !23
  ret void
}

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

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