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

; 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.43" = type { %"class.std::__shared_ptr.44" }
%"class.std::__shared_ptr.44" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::function.82" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::shared_ptr.56" = type { %"class.std::__shared_ptr.57" }
%"class.std::__shared_ptr.57" = type { ptr, %"class.std::__shared_count" }
%"class.std::function.87" = type { %"class.std::_Function_base", ptr }
%class.anon.90 = type { ptr, ptr, ptr, ptr }
%"class.jet::Vector" = type { double, double }
%"class.jet::PicSolver2" = type { %"class.jet::GridFluidSolver2", %"class.jet::Array", %"class.jet::Array", i64, %"class.std::shared_ptr.18", %"class.std::shared_ptr.21" }
%"class.jet::GridFluidSolver2" = type { %"class.jet::PhysicsAnimation", %"class.jet::Vector", double, double, i8, i32, %"class.std::shared_ptr", %"class.std::shared_ptr.0", %"class.std::shared_ptr.3", %"class.std::shared_ptr.6", %"class.std::shared_ptr.9", %"class.std::shared_ptr.12", %"class.std::shared_ptr.15" }
%"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.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"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" }
%"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_ptr.12" = type { %"class.std::__shared_ptr.13" }
%"class.std::__shared_ptr.13" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.15" = type { %"class.std::__shared_ptr.16" }
%"class.std::__shared_ptr.16" = type { ptr, %"class.std::__shared_count" }
%"class.jet::Array" = type { %"class.jet::Size2", %"class.std::vector" }
%"class.jet::Size2" = type { i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr.18" = type { %"class.std::__shared_ptr.19" }
%"class.std::__shared_ptr.19" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.21" = type { %"class.std::__shared_ptr.22" }
%"class.std::__shared_ptr.22" = type { ptr, %"class.std::__shared_count" }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3jet10PicSolver219signedDistanceFieldEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.43") align 8, ptr noundef nonnull align 8 dereferenceable(312)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3jet10PicSolver224buildSignedDistanceFieldEv(ptr noundef nonnull align 8 dereferenceable(312) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::shared_ptr.43", align 8
  %4 = alloca %"class.std::function.82", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.std::shared_ptr.56", align 8
  %10 = alloca %"class.std::function.87", align 8
  %11 = alloca %class.anon.90, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #6
  call void @_ZNK3jet10PicSolver219signedDistanceFieldEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.43") align 8 %3, ptr noundef nonnull align 8 dereferenceable(312) %12)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #6
  %13 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  invoke void @_ZNK3jet11ScalarGrid212dataPositionEv(ptr dead_on_unwind writable sret(%"class.std::function.82") align 8 %4, ptr noundef nonnull align 8 dereferenceable(240) %13)
          to label %14 unwind label %50

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %15 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  %17 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet5Grid211gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(88) %16)
          to label %18 unwind label %54

18:                                               ; preds = %14
  %19 = getelementptr inbounds %"class.jet::Vector", ptr %17, i32 0, i32 0
  %20 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet5Grid211gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(88) %21)
          to label %23 unwind label %54

23:                                               ; preds = %18
  %24 = getelementptr inbounds %"class.jet::Vector", ptr %22, i32 0, i32 1
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %26 unwind label %54

26:                                               ; preds = %23
  %27 = load double, ptr %25, align 8, !tbaa !9
  store double %27, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %28 = load double, ptr %7, align 8, !tbaa !9
  %29 = fmul double 1.200000e+00, %28
  %30 = call double @sqrt(double noundef 2.000000e+00) #6
  %31 = fdiv double %29, %30
  store double %31, ptr %8, align 8, !tbaa !9
  %32 = getelementptr inbounds %"class.jet::PicSolver2", ptr %12, i32 0, i32 4
  %33 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet19ParticleSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %32) #6
  %34 = load double, ptr %8, align 8, !tbaa !9
  %35 = fmul double 2.000000e+00, %34
  invoke void @_ZN3jet19ParticleSystemData221buildNeighborSearcherEd(ptr noundef nonnull align 8 dereferenceable(144) %33, double noundef %35)
          to label %36 unwind label %58

36:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %37 = getelementptr inbounds %"class.jet::PicSolver2", ptr %12, i32 0, i32 4
  %38 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet19ParticleSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %37) #6
  %39 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet19ParticleSystemData216neighborSearcherEv(ptr noundef nonnull align 8 dereferenceable(144) %38)
          to label %40 unwind label %62

40:                                               ; preds = %36
  call void @_ZNSt10shared_ptrIN3jet22PointNeighborSearcher2EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %39) #6
  %41 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  %42 = getelementptr inbounds %class.anon.90, ptr %11, i32 0, i32 0
  store ptr %4, ptr %42, align 8, !tbaa !5
  %43 = getelementptr inbounds %class.anon.90, ptr %11, i32 0, i32 1
  store ptr %8, ptr %43, align 8, !tbaa !5
  %44 = getelementptr inbounds %class.anon.90, ptr %11, i32 0, i32 2
  store ptr %9, ptr %44, align 8, !tbaa !5
  %45 = getelementptr inbounds %class.anon.90, ptr %11, i32 0, i32 3
  store ptr %3, ptr %45, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFvmmEEC2IZN3jet10PicSolver224buildSignedDistanceFieldEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %46 unwind label %66

46:                                               ; preds = %40
  invoke void @_ZNK3jet11ScalarGrid229parallelForEachDataPointIndexERKSt8functionIFvmmEE(ptr noundef nonnull align 8 dereferenceable(240) %41, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %47 unwind label %70

47:                                               ; preds = %46
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  %48 = call noundef ptr @_ZNKSt12__shared_ptrIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  invoke void @_ZN3jet16GridFluidSolver223extrapolateIntoColliderEPNS_11ScalarGrid2E(ptr noundef nonnull align 8 dereferenceable(192) %12, ptr noundef %48)
          to label %49 unwind label %75

49:                                               ; preds = %47
  call void @_ZNSt12__shared_ptrIN3jet22PointNeighborSearcher2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @_ZNSt12__shared_ptrIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  ret void

50:                                               ; preds = %1
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %5, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %6, align 4
  br label %83

54:                                               ; preds = %23, %18, %14
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %5, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %6, align 4
  br label %82

58:                                               ; preds = %26
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %5, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %6, align 4
  br label %81

62:                                               ; preds = %36
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %5, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %6, align 4
  br label %80

66:                                               ; preds = %40
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %5, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %6, align 4
  br label %74

70:                                               ; preds = %46
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %5, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %6, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  br label %74

74:                                               ; preds = %70, %66
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  br label %79

75:                                               ; preds = %47
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %5, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %6, align 4
  br label %79

79:                                               ; preds = %75, %74
  call void @_ZNSt12__shared_ptrIN3jet22PointNeighborSearcher2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  br label %80

80:                                               ; preds = %79, %62
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br label %81

81:                                               ; preds = %80, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %82

82:                                               ; preds = %81, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  br label %83

83:                                               ; preds = %82, %50
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @_ZNSt12__shared_ptrIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %5, align 8
  %86 = load i32, ptr %6, align 4
  %87 = insertvalue { ptr, i32 } poison, ptr %85, 0
  %88 = insertvalue { ptr, i32 } %87, i32 %86, 1
  resume { ptr, i32 } %88
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet5Grid211gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(88)) #3

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

declare void @_ZNK3jet11ScalarGrid212dataPositionEv(ptr dead_on_unwind writable sret(%"class.std::function.82") align 8, ptr noundef nonnull align 8 dereferenceable(240)) #3

; 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)) #4

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

declare void @_ZN3jet19ParticleSystemData221buildNeighborSearcherEd(ptr noundef nonnull align 8 dereferenceable(144), double noundef) #3

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet19ParticleSystemData216neighborSearcherEv(ptr noundef nonnull align 8 dereferenceable(144)) #3

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

declare void @_ZNK3jet11ScalarGrid229parallelForEachDataPointIndexERKSt8functionIFvmmEE(ptr noundef nonnull align 8 dereferenceable(240), ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvmmEEC2IZN3jet10PicSolver224buildSignedDistanceFieldEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare void @_ZN3jet16GridFluidSolver223extrapolateIntoColliderEPNS_11ScalarGrid2E(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef) #3

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 = { 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 #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 = { 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}


; 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.43" = type { %"class.std::__shared_ptr.44" }
%"class.std::__shared_ptr.44" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::function.82" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::shared_ptr.56" = type { %"class.std::__shared_ptr.57" }
%"class.std::__shared_ptr.57" = type { ptr, %"class.std::__shared_count" }
%"class.std::function.87" = type { %"class.std::_Function_base", ptr }
%class.anon.90 = type { ptr, ptr, ptr, ptr }

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3jet10PicSolver224buildSignedDistanceFieldEv(ptr noundef nonnull align 8 dereferenceable(312) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::shared_ptr.43", align 8
  %3 = alloca %"class.std::function.82", align 8
  %4 = alloca double, align 8
  %5 = alloca %"class.std::shared_ptr.56", align 8
  %6 = alloca %"class.std::function.87", align 8
  %7 = alloca %class.anon.90, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  call void @_ZNK3jet10PicSolver219signedDistanceFieldEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.43") align 8 %2, ptr noundef nonnull align 8 dereferenceable(312) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  %8 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  invoke void @_ZNK3jet11ScalarGrid212dataPositionEv(ptr dead_on_unwind nonnull writable sret(%"class.std::function.82") align 8 %3, ptr noundef nonnull align 8 dereferenceable(240) %8)
          to label %9 unwind label %38

9:                                                ; preds = %1
  %10 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet5Grid211gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(88) %11)
          to label %13 unwind label %40

13:                                               ; preds = %9
  %14 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet5Grid211gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(88) %15)
          to label %17 unwind label %40

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %16, i64 8
  %19 = call 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) %18)
  %20 = load double, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %21 = fmul double %20, 1.200000e+00
  %22 = fdiv double %21, 0x3FF6A09E667F3BCD
  store double %22, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 280
  %24 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet19ParticleSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  %25 = fmul double %22, 2.000000e+00
  invoke void @_ZN3jet19ParticleSystemData221buildNeighborSearcherEd(ptr noundef nonnull align 8 dereferenceable(144) %24, double noundef %25)
          to label %26 unwind label %42

26:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %27 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet19ParticleSystemData2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  %28 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet19ParticleSystemData216neighborSearcherEv(ptr noundef nonnull align 8 dereferenceable(144) %27)
          to label %29 unwind label %44

29:                                               ; preds = %26
  call void @_ZNSt10shared_ptrIN3jet22PointNeighborSearcher2EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %28) #5
  %30 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  store ptr %3, ptr %7, align 8, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %4, ptr %31, align 8, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %7, i64 16
  store ptr %5, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %7, i64 24
  store ptr %2, ptr %33, align 8, !tbaa !9
  invoke void @"_ZNSt8functionIFvmmEEC2IZN3jet10PicSolver224buildSignedDistanceFieldEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %34 unwind label %46

34:                                               ; preds = %29
  invoke void @_ZNK3jet11ScalarGrid229parallelForEachDataPointIndexERKSt8functionIFvmmEE(ptr noundef nonnull align 8 dereferenceable(240) %30, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %35 unwind label %48

35:                                               ; preds = %34
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  %36 = call noundef ptr @_ZNKSt12__shared_ptrIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  invoke void @_ZN3jet16GridFluidSolver223extrapolateIntoColliderEPNS_11ScalarGrid2E(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %36)
          to label %37 unwind label %51

37:                                               ; preds = %35
  call void @_ZNSt12__shared_ptrIN3jet22PointNeighborSearcher2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @_ZNSt12__shared_ptrIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  ret void

38:                                               ; preds = %1
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %57

40:                                               ; preds = %13, %9
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %56

42:                                               ; preds = %17
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %55

44:                                               ; preds = %26
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %54

46:                                               ; preds = %29
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %50

48:                                               ; preds = %34
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %50

50:                                               ; preds = %48, %46
  %.pn = phi { ptr, i32 } [ %49, %48 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %53

51:                                               ; preds = %35
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %53

53:                                               ; preds = %51, %50
  %.pn10 = phi { ptr, i32 } [ %52, %51 ], [ %.pn, %50 ]
  call void @_ZNSt12__shared_ptrIN3jet22PointNeighborSearcher2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  br label %54

54:                                               ; preds = %53, %44
  %.pn10.pn = phi { ptr, i32 } [ %.pn10, %53 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %55

55:                                               ; preds = %54, %42
  %.pn10.pn.pn = phi { ptr, i32 } [ %.pn10.pn, %54 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %56

56:                                               ; preds = %55, %40
  %.pn10.pn.pn.pn = phi { ptr, i32 } [ %.pn10.pn.pn, %55 ], [ %41, %40 ]
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  br label %57

57:                                               ; preds = %56, %38
  %.pn10.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn10.pn.pn.pn, %56 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @_ZNSt12__shared_ptrIN3jet11ScalarGrid2ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn10.pn.pn.pn.pn
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet5Grid211gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #3

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

declare void @_ZNK3jet11ScalarGrid212dataPositionEv(ptr dead_on_unwind writable sret(%"class.std::function.82") align 8, ptr noundef nonnull align 8 dereferenceable(240)) local_unnamed_addr #3

; 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 #4

declare void @_ZN3jet19ParticleSystemData221buildNeighborSearcherEd(ptr noundef nonnull align 8 dereferenceable(144), double noundef) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet19ParticleSystemData216neighborSearcherEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #3

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

declare void @_ZNK3jet11ScalarGrid229parallelForEachDataPointIndexERKSt8functionIFvmmEE(ptr noundef nonnull align 8 dereferenceable(240), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvmmEEC2IZN3jet10PicSolver224buildSignedDistanceFieldEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare void @_ZN3jet16GridFluidSolver223extrapolateIntoColliderEPNS_11ScalarGrid2E(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef) local_unnamed_addr #3

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 = { 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 #5 = { 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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass