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

; 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.std::shared_ptr.9" = type { %"class.std::__shared_ptr.10" }
%"class.std::__shared_ptr.10" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.jet::ArrayAccessor" = type { i64, ptr }
%"class.jet::SphSolver2" = type { %"class.jet::ParticleSystemSolver2", double, double, double, double, double, double }
%"class.jet::ParticleSystemSolver2" = type { %"class.jet::PhysicsAnimation", double, double, %"class.jet::Vector", %"class.std::shared_ptr", %"class.jet::Array", %"class.jet::Array", %"class.std::shared_ptr.0", %"class.std::shared_ptr.3", %"class.std::shared_ptr.6" }
%"class.jet::PhysicsAnimation" = type { %"class.jet::Animation", %"struct.jet::Frame", i8, i32, double }
%"class.jet::Animation" = type { ptr }
%"struct.jet::Frame" = type { i32, double }
%"class.jet::Vector" = type { double, double }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.jet::Array" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<jet::Vector<double, 2>, std::allocator<jet::Vector<double, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::Vector<double, 2>, std::allocator<jet::Vector<double, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::Vector<double, 2>, std::allocator<jet::Vector<double, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::Vector<double, 2>, std::allocator<jet::Vector<double, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.3" = type { %"class.std::__shared_ptr.4" }
%"class.std::__shared_ptr.4" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.6" = type { %"class.std::__shared_ptr.7" }
%"class.std::__shared_ptr.7" = type { ptr, %"class.std::__shared_count" }

@_ZL27kTimeStepLimitBySpeedFactor = external hidden global double, align 8
@_ZL27kTimeStepLimitByForceFactor = external hidden global double, align 8

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3jet10SphSolver213sphSystemDataEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.9") align 8, ptr noundef nonnull align 8 dereferenceable(232)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3jet10SphSolver220numberOfSubTimeStepsEd(ptr noundef nonnull align 8 dereferenceable(232) %0, double noundef %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca %"class.std::shared_ptr.9", align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.jet::ArrayAccessor", align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i64, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #7
  call void @_ZNK3jet10SphSolver213sphSystemDataEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.9") align 8 %5, ptr noundef nonnull align 8 dereferenceable(232) %18)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %19 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  %20 = invoke noundef i64 @_ZNK3jet19ParticleSystemData217numberOfParticlesEv(ptr noundef nonnull align 8 dereferenceable(144) %19)
          to label %21 unwind label %35

21:                                               ; preds = %2
  store i64 %20, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  %22 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZN3jet19ParticleSystemData26forcesEv(ptr dead_on_unwind writable sret(%"class.jet::ArrayAccessor") align 8 %9, ptr noundef nonnull align 8 dereferenceable(144) %22)
          to label %23 unwind label %39

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %24 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  %25 = invoke noundef double @_ZNK3jet14SphSystemData212kernelRadiusEv(ptr noundef nonnull align 8 dereferenceable(192) %24)
          to label %26 unwind label %43

26:                                               ; preds = %23
  store double %25, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %27 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  %28 = invoke noundef double @_ZNK3jet19ParticleSystemData24massEv(ptr noundef nonnull align 8 dereferenceable(144) %27)
          to label %29 unwind label %47

29:                                               ; preds = %26
  store double %28, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store double 0.000000e+00, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !11
  br label %30

30:                                               ; preds = %60, %29
  %31 = load i64, ptr %13, align 8, !tbaa !11
  %32 = load i64, ptr %6, align 8, !tbaa !11
  %33 = icmp ult i64 %31, %32
  br i1 %33, label %51, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %67

35:                                               ; preds = %2
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %7, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %8, align 4
  br label %101

39:                                               ; preds = %21
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %7, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %8, align 4
  br label %100

43:                                               ; preds = %23
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %7, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %8, align 4
  br label %99

47:                                               ; preds = %26
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %7, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %8, align 4
  br label %98

51:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %52 = load i64, ptr %13, align 8, !tbaa !11
  %53 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN3jet13ArrayAccessorINS_6VectorIdLm2EEELm1EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %52)
          to label %54 unwind label %63

54:                                               ; preds = %51
  %55 = invoke noundef double @_ZNK3jet6VectorIdLm2EE6lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %53)
          to label %56 unwind label %63

56:                                               ; preds = %54
  store double %55, ptr %14, align 8, !tbaa !9
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %58 unwind label %63

58:                                               ; preds = %56
  %59 = load double, ptr %57, align 8, !tbaa !9
  store double %59, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %60

60:                                               ; preds = %58
  %61 = load i64, ptr %13, align 8, !tbaa !11
  %62 = add i64 %61, 1
  store i64 %62, ptr %13, align 8, !tbaa !11
  br label %30, !llvm.loop !13

63:                                               ; preds = %56, %54, %51
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %7, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %97

67:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %68 = load double, ptr @_ZL27kTimeStepLimitBySpeedFactor, align 8, !tbaa !9
  %69 = load double, ptr %10, align 8, !tbaa !9
  %70 = fmul double %68, %69
  %71 = getelementptr inbounds %"class.jet::SphSolver2", ptr %18, i32 0, i32 5
  %72 = load double, ptr %71, align 8, !tbaa !15
  %73 = fdiv double %70, %72
  store double %73, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %74 = load double, ptr @_ZL27kTimeStepLimitByForceFactor, align 8, !tbaa !9
  %75 = load double, ptr %10, align 8, !tbaa !9
  %76 = load double, ptr %11, align 8, !tbaa !9
  %77 = fmul double %75, %76
  %78 = load double, ptr %12, align 8, !tbaa !9
  %79 = fdiv double %77, %78
  %80 = call double @sqrt(double noundef %79) #7
  %81 = fmul double %74, %80
  store double %81, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %82 = getelementptr inbounds %"class.jet::SphSolver2", ptr %18, i32 0, i32 6
  %83 = load double, ptr %82, align 8, !tbaa !38
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %85 unwind label %93

85:                                               ; preds = %67
  %86 = load double, ptr %84, align 8, !tbaa !9
  %87 = fmul double %83, %86
  store double %87, ptr %17, align 8, !tbaa !9
  %88 = load double, ptr %4, align 8, !tbaa !9
  %89 = load double, ptr %17, align 8, !tbaa !9
  %90 = fdiv double %88, %89
  %91 = call double @llvm.ceil.f64(double %90)
  %92 = fptoui double %91 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @_ZNSt12__shared_ptrIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #7
  ret i32 %92

93:                                               ; preds = %67
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %7, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %97

97:                                               ; preds = %93, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %98

98:                                               ; preds = %97, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %99

99:                                               ; preds = %98, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %100

100:                                              ; preds = %99, %39
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  br label %101

101:                                              ; preds = %100, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @_ZNSt12__shared_ptrIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #7
  br label %102

102:                                              ; preds = %101
  %103 = load ptr, ptr %7, align 8
  %104 = load i32, ptr %8, align 4
  %105 = insertvalue { ptr, i32 } poison, ptr %103, 0
  %106 = insertvalue { ptr, i32 } %105, i32 %104, 1
  resume { ptr, i32 } %106
}

declare noundef i64 @_ZNK3jet19ParticleSystemData217numberOfParticlesEv(ptr noundef nonnull align 8 dereferenceable(144)) #4

declare void @_ZN3jet19ParticleSystemData26forcesEv(ptr dead_on_unwind writable sret(%"class.jet::ArrayAccessor") align 8, ptr noundef nonnull align 8 dereferenceable(144)) #4

declare noundef double @_ZNK3jet14SphSystemData212kernelRadiusEv(ptr noundef nonnull align 8 dereferenceable(192)) #4

declare noundef double @_ZNK3jet19ParticleSystemData24massEv(ptr noundef nonnull align 8 dereferenceable(144)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN3jet13ArrayAccessorINS_6VectorIdLm2EEELm1EEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK3jet6VectorIdLm2EE6lengthEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: nounwind
declare double @sqrt(double noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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 #4 = { "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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !10, i64 216}
!16 = !{!"_ZTSN3jet10SphSolver2E", !17, i64 0, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224}
!17 = !{!"_ZTSN3jet21ParticleSystemSolver2E", !18, i64 0, !10, i64 40, !10, i64 48, !23, i64 56, !24, i64 72, !27, i64 88, !27, i64 112, !32, i64 136, !34, i64 152, !36, i64 168}
!18 = !{!"_ZTSN3jet16PhysicsAnimationE", !19, i64 0, !20, i64 8, !22, i64 24, !21, i64 28, !10, i64 32}
!19 = !{!"_ZTSN3jet9AnimationE"}
!20 = !{!"_ZTSN3jet5FrameE", !21, i64 0, !10, i64 8}
!21 = !{!"int", !7, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSN3jet6VectorIdLm2EEE", !10, i64 0, !10, i64 8}
!24 = !{!"_ZTSSt10shared_ptrIN3jet19ParticleSystemData2EE", !25, i64 0}
!25 = !{!"_ZTSSt12__shared_ptrIN3jet19ParticleSystemData2ELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !26, i64 8}
!26 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!27 = !{!"_ZTSN3jet5ArrayINS_6VectorIdLm2EEELm1EEE", !28, i64 0}
!28 = !{!"_ZTSSt6vectorIN3jet6VectorIdLm2EEESaIS2_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIN3jet6VectorIdLm2EEESaIS2_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN3jet6VectorIdLm2EEESaIS2_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN3jet6VectorIdLm2EEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!"_ZTSSt10shared_ptrIN3jet9Collider2EE", !33, i64 0}
!33 = !{!"_ZTSSt12__shared_ptrIN3jet9Collider2ELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !26, i64 8}
!34 = !{!"_ZTSSt10shared_ptrIN3jet16ParticleEmitter2EE", !35, i64 0}
!35 = !{!"_ZTSSt12__shared_ptrIN3jet16ParticleEmitter2ELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !26, i64 8}
!36 = !{!"_ZTSSt10shared_ptrIN3jet12VectorField2EE", !37, i64 0}
!37 = !{!"_ZTSSt12__shared_ptrIN3jet12VectorField2ELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !26, i64 8}
!38 = !{!16, !10, i64 224}


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

%"class.std::shared_ptr.9" = type { %"class.std::__shared_ptr.10" }
%"class.std::__shared_ptr.10" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.jet::ArrayAccessor" = type { i64, ptr }

@_ZL27kTimeStepLimitBySpeedFactor = external hidden local_unnamed_addr global double, align 8
@_ZL27kTimeStepLimitByForceFactor = external hidden local_unnamed_addr global double, align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3jet10SphSolver213sphSystemDataEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.9") align 8, ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3jet10SphSolver220numberOfSubTimeStepsEd(ptr noundef nonnull align 8 dereferenceable(232) %0, double noundef %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::shared_ptr.9", align 8
  %4 = alloca %"class.jet::ArrayAccessor", align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @_ZNK3jet10SphSolver213sphSystemDataEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.9") align 8 %3, ptr noundef nonnull align 8 dereferenceable(232) %0)
  %9 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  %10 = invoke noundef i64 @_ZNK3jet19ParticleSystemData217numberOfParticlesEv(ptr noundef nonnull align 8 dereferenceable(144) %9)
          to label %11 unwind label %39

11:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %12 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZN3jet19ParticleSystemData26forcesEv(ptr dead_on_unwind nonnull writable sret(%"class.jet::ArrayAccessor") align 8 %4, ptr noundef nonnull align 8 dereferenceable(144) %12)
          to label %13 unwind label %41

13:                                               ; preds = %11
  %14 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  %15 = invoke noundef double @_ZNK3jet14SphSystemData212kernelRadiusEv(ptr noundef nonnull align 8 dereferenceable(192) %14)
          to label %16 unwind label %43

16:                                               ; preds = %13
  %17 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  %18 = invoke noundef double @_ZNK3jet19ParticleSystemData24massEv(ptr noundef nonnull align 8 dereferenceable(144) %17)
          to label %19 unwind label %45

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store double 0.000000e+00, ptr %5, align 8, !tbaa !5
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %19
  %20 = phi double [ 0.000000e+00, %19 ], [ %50, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %21 = load double, ptr @_ZL27kTimeStepLimitBySpeedFactor, align 8, !tbaa !5
  %22 = fmul double %15, %21
  %23 = getelementptr inbounds i8, ptr %0, i64 216
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = fdiv double %22, %24
  store double %25, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %26 = load double, ptr @_ZL27kTimeStepLimitByForceFactor, align 8, !tbaa !5
  %27 = fmul double %15, %18
  %28 = fdiv double %27, %20
  %29 = call double @sqrt(double noundef %28) #7
  %30 = fmul double %26, %29
  store double %30, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %0, i64 224
  %32 = load double, ptr %31, align 8, !tbaa !33
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %34 = load double, ptr %33, align 8, !tbaa !5
  %35 = fmul double %32, %34
  %36 = fdiv double %1, %35
  %37 = call double @llvm.ceil.f64(double %36)
  %38 = fptoui double %37 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  call void @_ZNSt12__shared_ptrIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  ret i32 %38

39:                                               ; preds = %2
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %53

41:                                               ; preds = %11
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %52

43:                                               ; preds = %13
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %52

45:                                               ; preds = %16
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %52

.lr.ph:                                           ; preds = %19, %.lr.ph
  %.01118 = phi i64 [ %51, %.lr.ph ], [ 0, %19 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3jet13ArrayAccessorINS_6VectorIdLm2EEELm1EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %.01118)
  %48 = call noundef double @_ZNK3jet6VectorIdLm2EE6lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %47)
  store double %48, ptr %6, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %50 = load double, ptr %49, align 8, !tbaa !5
  store double %50, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %51 = add nuw i64 %.01118, 1
  %exitcond.not = icmp eq i64 %51, %10
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !34

52:                                               ; preds = %43, %45, %41
  %.pn.pn = phi { ptr, i32 } [ %42, %41 ], [ %46, %45 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  br label %53

53:                                               ; preds = %52, %39
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %52 ], [ %40, %39 ]
  call void @_ZNSt12__shared_ptrIN3jet14SphSystemData2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn.pn.pn
}

declare noundef i64 @_ZNK3jet19ParticleSystemData217numberOfParticlesEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #4

declare void @_ZN3jet19ParticleSystemData26forcesEv(ptr dead_on_unwind writable sret(%"class.jet::ArrayAccessor") align 8, ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #4

declare noundef double @_ZNK3jet14SphSystemData212kernelRadiusEv(ptr noundef nonnull align 8 dereferenceable(192)) local_unnamed_addr #4

declare noundef double @_ZNK3jet19ParticleSystemData24massEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN3jet13ArrayAccessorINS_6VectorIdLm2EEELm1EEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK3jet6VectorIdLm2EE6lengthEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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 #4 = { "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 #5 = { mustprogress nofree nounwind willreturn memory(write) "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 #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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"}
!9 = !{!10, !6, i64 216}
!10 = !{!"_ZTSN3jet10SphSolver2E", !11, i64 0, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224}
!11 = !{!"_ZTSN3jet21ParticleSystemSolver2E", !12, i64 0, !6, i64 40, !6, i64 48, !17, i64 56, !18, i64 72, !22, i64 88, !22, i64 112, !27, i64 136, !29, i64 152, !31, i64 168}
!12 = !{!"_ZTSN3jet16PhysicsAnimationE", !13, i64 0, !14, i64 8, !16, i64 24, !15, i64 28, !6, i64 32}
!13 = !{!"_ZTSN3jet9AnimationE"}
!14 = !{!"_ZTSN3jet5FrameE", !15, i64 0, !6, i64 8}
!15 = !{!"int", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSN3jet6VectorIdLm2EEE", !6, i64 0, !6, i64 8}
!18 = !{!"_ZTSSt10shared_ptrIN3jet19ParticleSystemData2EE", !19, i64 0}
!19 = !{!"_ZTSSt12__shared_ptrIN3jet19ParticleSystemData2ELN9__gnu_cxx12_Lock_policyE2EE", !20, i64 0, !21, i64 8}
!20 = !{!"any pointer", !7, i64 0}
!21 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !20, i64 0}
!22 = !{!"_ZTSN3jet5ArrayINS_6VectorIdLm2EEELm1EEE", !23, i64 0}
!23 = !{!"_ZTSSt6vectorIN3jet6VectorIdLm2EEESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN3jet6VectorIdLm2EEESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN3jet6VectorIdLm2EEESaIS2_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN3jet6VectorIdLm2EEESaIS2_EE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!27 = !{!"_ZTSSt10shared_ptrIN3jet9Collider2EE", !28, i64 0}
!28 = !{!"_ZTSSt12__shared_ptrIN3jet9Collider2ELN9__gnu_cxx12_Lock_policyE2EE", !20, i64 0, !21, i64 8}
!29 = !{!"_ZTSSt10shared_ptrIN3jet16ParticleEmitter2EE", !30, i64 0}
!30 = !{!"_ZTSSt12__shared_ptrIN3jet16ParticleEmitter2ELN9__gnu_cxx12_Lock_policyE2EE", !20, i64 0, !21, i64 8}
!31 = !{!"_ZTSSt10shared_ptrIN3jet12VectorField2EE", !32, i64 0}
!32 = !{!"_ZTSSt12__shared_ptrIN3jet12VectorField2ELN9__gnu_cxx12_Lock_policyE2EE", !20, i64 0, !21, i64 8}
!33 = !{!10, !6, i64 224}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass