; LLVM IR from doyubkim/fluid-engine-dev :: src/jet/sph_system_data2.ll (ZN3jet14SphSystemData2C2Em)

; 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.jet::SphSystemData2" = type { %"class.jet::ParticleSystemData2", double, double, double, double, i64, i64 }
%"class.jet::ParticleSystemData2" = type { %"class.jet::Serializable", double, double, i64, i64, i64, i64, %"class.std::vector", %"class.std::vector.0", %"class.std::shared_ptr", %"class.std::vector.5" }
%"class.jet::Serializable" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<jet::Array<double, 1>, std::allocator<jet::Array<double, 1>>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::Array<double, 1>, std::allocator<jet::Array<double, 1>>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::Array<double, 1>, std::allocator<jet::Array<double, 1>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::Array<double, 1>, std::allocator<jet::Array<double, 1>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<jet::Array<jet::Vector<double, 2>, 1>, std::allocator<jet::Array<jet::Vector<double, 2>, 1>>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::Array<jet::Vector<double, 2>, 1>, std::allocator<jet::Array<jet::Vector<double, 2>, 1>>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::Array<jet::Vector<double, 2>, 1>, std::allocator<jet::Array<jet::Vector<double, 2>, 1>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::Array<jet::Vector<double, 2>, 1>, std::allocator<jet::Array<jet::Vector<double, 2>, 1>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZTVN3jet14SphSystemData2E = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3jet14SphSystemData2C2Em(ptr noundef nonnull align 8 dereferenceable(192) %0, i64 noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %7 = load ptr, ptr %3, align 8
  %8 = load i64, ptr %4, align 8, !tbaa !9
  call void @_ZN3jet19ParticleSystemData2C2Em(ptr noundef nonnull align 8 dereferenceable(144) %7, i64 noundef %8)
  store ptr getelementptr inbounds inrange(-16, 48) ({ [8 x ptr] }, ptr @_ZTVN3jet14SphSystemData2E, i32 0, i32 0, i32 2), ptr %7, align 8, !tbaa !11
  %9 = getelementptr inbounds %"class.jet::SphSystemData2", ptr %7, i32 0, i32 1
  store double 1.000000e+03, ptr %9, align 8, !tbaa !13
  %10 = getelementptr inbounds %"class.jet::SphSystemData2", ptr %7, i32 0, i32 2
  store double 1.000000e-01, ptr %10, align 8, !tbaa !33
  %11 = getelementptr inbounds %"class.jet::SphSystemData2", ptr %7, i32 0, i32 3
  store double 1.800000e+00, ptr %11, align 8, !tbaa !34
  %12 = invoke noundef i64 @_ZN3jet19ParticleSystemData213addScalarDataEd(ptr noundef nonnull align 8 dereferenceable(144) %7, double noundef 0.000000e+00)
          to label %13 unwind label %21

13:                                               ; preds = %2
  %14 = getelementptr inbounds %"class.jet::SphSystemData2", ptr %7, i32 0, i32 6
  store i64 %12, ptr %14, align 8, !tbaa !35
  %15 = invoke noundef i64 @_ZN3jet19ParticleSystemData213addScalarDataEd(ptr noundef nonnull align 8 dereferenceable(144) %7, double noundef 0.000000e+00)
          to label %16 unwind label %21

16:                                               ; preds = %13
  %17 = getelementptr inbounds %"class.jet::SphSystemData2", ptr %7, i32 0, i32 5
  store i64 %15, ptr %17, align 8, !tbaa !36
  %18 = getelementptr inbounds %"class.jet::SphSystemData2", ptr %7, i32 0, i32 2
  %19 = load double, ptr %18, align 8, !tbaa !33
  invoke void @_ZN3jet14SphSystemData216setTargetSpacingEd(ptr noundef nonnull align 8 dereferenceable(192) %7, double noundef %19)
          to label %20 unwind label %21

20:                                               ; preds = %16
  ret void

21:                                               ; preds = %16, %13, %2
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %5, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %6, align 4
  call void @_ZN3jet19ParticleSystemData2D2Ev(ptr noundef nonnull align 8 dereferenceable(144) %7) #3
  br label %25

25:                                               ; preds = %21
  %26 = load ptr, ptr %5, align 8
  %27 = load i32, ptr %6, align 4
  %28 = insertvalue { ptr, i32 } poison, ptr %26, 0
  %29 = insertvalue { ptr, i32 } %28, i32 %27, 1
  resume { ptr, i32 } %29
}

declare void @_ZN3jet19ParticleSystemData2C2Em(ptr noundef nonnull align 8 dereferenceable(144), i64 noundef) unnamed_addr #1

declare noundef i64 @_ZN3jet19ParticleSystemData213addScalarDataEd(ptr noundef nonnull align 8 dereferenceable(144), double noundef) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3jet14SphSystemData216setTargetSpacingEd(ptr noundef nonnull align 8 dereferenceable(192), double noundef) #0 align 2

; Function Attrs: nounwind
declare void @_ZN3jet19ParticleSystemData2D2Ev(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #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 = { nounwind "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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !17, i64 144}
!14 = !{!"_ZTSN3jet14SphSystemData2E", !15, i64 0, !17, i64 144, !17, i64 152, !17, i64 160, !17, i64 168, !10, i64 176, !10, i64 184}
!15 = !{!"_ZTSN3jet19ParticleSystemData2E", !16, i64 0, !17, i64 8, !17, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !18, i64 56, !22, i64 80, !26, i64 104, !29, i64 120}
!16 = !{!"_ZTSN3jet12SerializableE"}
!17 = !{!"double", !7, i64 0}
!18 = !{!"_ZTSSt6vectorIN3jet5ArrayIdLm1EEESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN3jet5ArrayIdLm1EEESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN3jet5ArrayIdLm1EEESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN3jet5ArrayIdLm1EEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSSt6vectorIN3jet5ArrayINS0_6VectorIdLm2EEELm1EEESaIS4_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIN3jet5ArrayINS0_6VectorIdLm2EEELm1EEESaIS4_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN3jet5ArrayINS0_6VectorIdLm2EEELm1EEESaIS4_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN3jet5ArrayINS0_6VectorIdLm2EEELm1EEESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!"_ZTSSt10shared_ptrIN3jet22PointNeighborSearcher2EE", !27, i64 0}
!27 = !{!"_ZTSSt12__shared_ptrIN3jet22PointNeighborSearcher2ELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !28, i64 8}
!28 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!29 = !{!"_ZTSSt6vectorIS_ImSaImEESaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseISt6vectorImSaImEESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseISt6vectorImSaImEESaIS2_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseISt6vectorImSaImEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!14, !17, i64 152}
!34 = !{!14, !17, i64 160}
!35 = !{!14, !10, i64 184}
!36 = !{!14, !10, i64 176}


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

@_ZTVN3jet14SphSystemData2E = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3jet14SphSystemData2C2Em(ptr noundef nonnull align 8 dereferenceable(192) %0, i64 noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN3jet19ParticleSystemData2C2Em(ptr noundef nonnull align 8 dereferenceable(144) %0, i64 noundef %1)
  store ptr getelementptr inbounds inrange(-16, 48) (i8, ptr @_ZTVN3jet14SphSystemData2E, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 144
  %4 = getelementptr inbounds i8, ptr %0, i64 152
  store <2 x double> <double 1.000000e+03, double 1.000000e-01>, ptr %3, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %0, i64 160
  store double 1.800000e+00, ptr %5, align 8, !tbaa !11
  %6 = invoke noundef i64 @_ZN3jet19ParticleSystemData213addScalarDataEd(ptr noundef nonnull align 8 dereferenceable(144) %0, double noundef 0.000000e+00)
          to label %7 unwind label %14

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 184
  store i64 %6, ptr %8, align 8, !tbaa !32
  %9 = invoke noundef i64 @_ZN3jet19ParticleSystemData213addScalarDataEd(ptr noundef nonnull align 8 dereferenceable(144) %0, double noundef 0.000000e+00)
          to label %10 unwind label %14

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 176
  store i64 %9, ptr %11, align 8, !tbaa !33
  %12 = load double, ptr %4, align 8, !tbaa !34
  invoke void @_ZN3jet14SphSystemData216setTargetSpacingEd(ptr noundef nonnull align 8 dereferenceable(192) %0, double noundef %12)
          to label %13 unwind label %14

13:                                               ; preds = %10
  ret void

14:                                               ; preds = %10, %7, %2
  %15 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3jet19ParticleSystemData2D2Ev(ptr noundef nonnull align 8 dereferenceable(144) %0) #3
  resume { ptr, i32 } %15
}

declare void @_ZN3jet19ParticleSystemData2C2Em(ptr noundef nonnull align 8 dereferenceable(144), i64 noundef) unnamed_addr #1

declare noundef i64 @_ZN3jet19ParticleSystemData213addScalarDataEd(ptr noundef nonnull align 8 dereferenceable(144), double noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3jet14SphSystemData216setTargetSpacingEd(ptr noundef nonnull align 8 dereferenceable(192), double noundef) local_unnamed_addr #0 align 2

; Function Attrs: nounwind
declare void @_ZN3jet19ParticleSystemData2D2Ev(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #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 = { nounwind "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 160}
!12 = !{!"_ZTSN3jet14SphSystemData2E", !13, i64 0, !9, i64 144, !9, i64 152, !9, i64 160, !9, i64 168, !15, i64 176, !15, i64 184}
!13 = !{!"_ZTSN3jet19ParticleSystemData2E", !14, i64 0, !9, i64 8, !9, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !16, i64 56, !21, i64 80, !25, i64 104, !28, i64 120}
!14 = !{!"_ZTSN3jet12SerializableE"}
!15 = !{!"long", !10, i64 0}
!16 = !{!"_ZTSSt6vectorIN3jet5ArrayIdLm1EEESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN3jet5ArrayIdLm1EEESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN3jet5ArrayIdLm1EEESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN3jet5ArrayIdLm1EEESaIS2_EE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!20 = !{!"any pointer", !10, i64 0}
!21 = !{!"_ZTSSt6vectorIN3jet5ArrayINS0_6VectorIdLm2EEELm1EEESaIS4_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN3jet5ArrayINS0_6VectorIdLm2EEELm1EEESaIS4_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN3jet5ArrayINS0_6VectorIdLm2EEELm1EEESaIS4_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN3jet5ArrayINS0_6VectorIdLm2EEELm1EEESaIS4_EE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!25 = !{!"_ZTSSt10shared_ptrIN3jet22PointNeighborSearcher2EE", !26, i64 0}
!26 = !{!"_ZTSSt12__shared_ptrIN3jet22PointNeighborSearcher2ELN9__gnu_cxx12_Lock_policyE2EE", !20, i64 0, !27, i64 8}
!27 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !20, i64 0}
!28 = !{!"_ZTSSt6vectorIS_ImSaImEESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseISt6vectorImSaImEESaIS2_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseISt6vectorImSaImEESaIS2_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseISt6vectorImSaImEESaIS2_EE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!32 = !{!12, !15, i64 184}
!33 = !{!12, !15, i64 176}
!34 = !{!12, !9, i64 152}


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