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

; 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.83" = 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.88" = type { %"class.std::_Function_base", ptr }
%class.anon.90 = type { ptr, ptr, ptr, ptr, ptr }
%"class.jet::Vector" = type { double, double, double }
%"class.jet::PicSolver3" = type { %"class.jet::GridFluidSolver3", %"class.jet::Array", %"class.jet::Array", %"class.jet::Array", i64, %"class.std::shared_ptr.18", %"class.std::shared_ptr.21" }
%"class.jet::GridFluidSolver3" = 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::Size3", %"class.std::vector" }
%"class.jet::Size3" = type { i64, 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 @_ZNK3jet10PicSolver319signedDistanceFieldEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.43") align 8, ptr noundef nonnull align 8 dereferenceable(384)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3jet10PicSolver324buildSignedDistanceFieldEv(ptr noundef nonnull align 8 dereferenceable(384) %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.83", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca %"class.std::shared_ptr.56", align 8
  %11 = alloca %"class.std::function.88", align 8
  %12 = alloca %class.anon.90, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #6
  call void @_ZNK3jet10PicSolver319signedDistanceFieldEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.43") align 8 %3, ptr noundef nonnull align 8 dereferenceable(384) %13)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #6
  %14 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  invoke void @_ZNK3jet11ScalarGrid312dataPositionEv(ptr dead_on_unwind writable sret(%"class.std::function.83") align 8 %4, ptr noundef nonnull align 8 dereferenceable(320) %14)
          to label %15 unwind label %61

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %16 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3jet5Grid311gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(128) %17)
          to label %19 unwind label %65

19:                                               ; preds = %15
  %20 = getelementptr inbounds %"class.jet::Vector", ptr %18, i32 0, i32 0
  %21 = load double, ptr %20, align 8, !tbaa !9
  %22 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3jet5Grid311gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(128) %23)
          to label %25 unwind label %65

25:                                               ; preds = %19
  %26 = getelementptr inbounds %"class.jet::Vector", ptr %24, i32 0, i32 1
  %27 = load double, ptr %26, align 8, !tbaa !12
  %28 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3jet5Grid311gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(128) %29)
          to label %31 unwind label %65

31:                                               ; preds = %25
  %32 = getelementptr inbounds %"class.jet::Vector", ptr %30, i32 0, i32 2
  %33 = load double, ptr %32, align 8, !tbaa !13
  %34 = invoke noundef double @_ZN3jet4max3IdEET_S1_S1_S1_(double noundef %21, double noundef %27, double noundef %33)
          to label %35 unwind label %65

35:                                               ; preds = %31
  store double %34, ptr %7, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %36 = load double, ptr %7, align 8, !tbaa !14
  %37 = fmul double 1.200000e+00, %36
  %38 = call double @sqrt(double noundef 2.000000e+00) #6
  %39 = fdiv double %37, %38
  store double %39, ptr %8, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %40 = load double, ptr %8, align 8, !tbaa !14
  %41 = fmul double 2.000000e+00, %40
  store double %41, ptr %9, align 8, !tbaa !14
  %42 = getelementptr inbounds %"class.jet::PicSolver3", ptr %13, i32 0, i32 5
  %43 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet19ParticleSystemData3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %42) #6
  %44 = load double, ptr %8, align 8, !tbaa !14
  %45 = fmul double 2.000000e+00, %44
  invoke void @_ZN3jet19ParticleSystemData321buildNeighborSearcherEd(ptr noundef nonnull align 8 dereferenceable(144) %43, double noundef %45)
          to label %46 unwind label %69

46:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %47 = getelementptr inbounds %"class.jet::PicSolver3", ptr %13, i32 0, i32 5
  %48 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet19ParticleSystemData3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %47) #6
  %49 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet19ParticleSystemData316neighborSearcherEv(ptr noundef nonnull align 8 dereferenceable(144) %48)
          to label %50 unwind label %73

50:                                               ; preds = %46
  call void @_ZNSt10shared_ptrIN3jet22PointNeighborSearcher3EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %49) #6
  %51 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #6
  %52 = getelementptr inbounds %class.anon.90, ptr %12, i32 0, i32 0
  store ptr %4, ptr %52, align 8, !tbaa !5
  %53 = getelementptr inbounds %class.anon.90, ptr %12, i32 0, i32 1
  store ptr %9, ptr %53, align 8, !tbaa !5
  %54 = getelementptr inbounds %class.anon.90, ptr %12, i32 0, i32 2
  store ptr %10, ptr %54, align 8, !tbaa !5
  %55 = getelementptr inbounds %class.anon.90, ptr %12, i32 0, i32 3
  store ptr %3, ptr %55, align 8, !tbaa !5
  %56 = getelementptr inbounds %class.anon.90, ptr %12, i32 0, i32 4
  store ptr %8, ptr %56, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFvmmmEEC2IZN3jet10PicSolver324buildSignedDistanceFieldEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(40) %12)
          to label %57 unwind label %77

57:                                               ; preds = %50
  invoke void @_ZNK3jet11ScalarGrid329parallelForEachDataPointIndexERKSt8functionIFvmmmEE(ptr noundef nonnull align 8 dereferenceable(320) %51, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %58 unwind label %81

58:                                               ; preds = %57
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  %59 = call noundef ptr @_ZNKSt12__shared_ptrIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  invoke void @_ZN3jet16GridFluidSolver323extrapolateIntoColliderEPNS_11ScalarGrid3E(ptr noundef nonnull align 8 dereferenceable(200) %13, ptr noundef %59)
          to label %60 unwind label %86

60:                                               ; preds = %58
  call void @_ZNSt12__shared_ptrIN3jet22PointNeighborSearcher3ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, 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_ptrIN3jet11ScalarGrid3ELN9__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

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

65:                                               ; preds = %31, %25, %19, %15
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %5, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %6, align 4
  br label %93

69:                                               ; preds = %35
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %5, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %6, align 4
  br label %92

73:                                               ; preds = %46
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %5, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %6, align 4
  br label %91

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

81:                                               ; preds = %57
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %5, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %6, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  br label %85

85:                                               ; preds = %81, %77
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  br label %90

86:                                               ; preds = %58
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %5, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %6, align 4
  br label %90

90:                                               ; preds = %86, %85
  call void @_ZNSt12__shared_ptrIN3jet22PointNeighborSearcher3ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  br label %91

91:                                               ; preds = %90, %73
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  br label %92

92:                                               ; preds = %91, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %93

93:                                               ; preds = %92, %65
  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 %94

94:                                               ; preds = %93, %61
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @_ZNSt12__shared_ptrIN3jet11ScalarGrid3ELN9__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 %95

95:                                               ; preds = %94
  %96 = load ptr, ptr %5, align 8
  %97 = load i32, ptr %6, align 4
  %98 = insertvalue { ptr, i32 } poison, ptr %96, 0
  %99 = insertvalue { ptr, i32 } %98, i32 %97, 1
  resume { ptr, i32 } %99
}

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3jet5Grid311gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(128)) #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3jet4max3IdEET_S1_S1_S1_(double noundef, double noundef, double noundef) #4

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

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

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

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

declare void @_ZNK3jet11ScalarGrid329parallelForEachDataPointIndexERKSt8functionIFvmmmEE(ptr noundef nonnull align 8 dereferenceable(320), ptr noundef nonnull align 8 dereferenceable(32)) #3

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

declare void @_ZN3jet16GridFluidSolver323extrapolateIntoColliderEPNS_11ScalarGrid3E(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt12__shared_ptrIN3jet11ScalarGrid3ELN9__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_ptrIN3jet22PointNeighborSearcher3ELN9__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, !11, i64 0}
!10 = !{!"_ZTSN3jet6VectorIdLm3EEE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !11, i64 16}
!14 = !{!11, !11, 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.83" = 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.88" = type { %"class.std::_Function_base", ptr }
%class.anon.90 = type { ptr, 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 @_ZNK3jet10PicSolver319signedDistanceFieldEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.43") align 8, ptr noundef nonnull align 8 dereferenceable(384)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet19ParticleSystemData3ELN9__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 @_ZN3jet10PicSolver324buildSignedDistanceFieldEv(ptr noundef nonnull align 8 dereferenceable(384) %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.83", align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca %"class.std::shared_ptr.56", align 8
  %7 = alloca %"class.std::function.88", align 8
  %8 = alloca %class.anon.90, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  call void @_ZNK3jet10PicSolver319signedDistanceFieldEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.43") align 8 %2, ptr noundef nonnull align 8 dereferenceable(384) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  %9 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  invoke void @_ZNK3jet11ScalarGrid312dataPositionEv(ptr dead_on_unwind nonnull writable sret(%"class.std::function.83") align 8 %3, ptr noundef nonnull align 8 dereferenceable(320) %9)
          to label %10 unwind label %47

10:                                               ; preds = %1
  %11 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  %12 = getelementptr inbounds i8, ptr %11, i64 8
  %13 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3jet5Grid311gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(128) %12)
          to label %14 unwind label %49

14:                                               ; preds = %10
  %15 = load double, ptr %13, align 8, !tbaa !5
  %16 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3jet5Grid311gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(128) %17)
          to label %19 unwind label %49

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %18, i64 8
  %21 = load double, ptr %20, align 8, !tbaa !10
  %22 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3jet5Grid311gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(128) %23)
          to label %25 unwind label %49

25:                                               ; preds = %19
  %26 = getelementptr inbounds i8, ptr %24, i64 16
  %27 = load double, ptr %26, align 8, !tbaa !11
  %28 = call noundef double @_ZN3jet4max3IdEET_S1_S1_S1_(double noundef %15, double noundef %21, double noundef %27)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %29 = fmul double %28, 1.200000e+00
  %30 = fdiv double %29, 0x3FF6A09E667F3BCD
  store double %30, ptr %4, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %31 = fmul double %30, 2.000000e+00
  store double %31, ptr %5, align 8, !tbaa !12
  %32 = getelementptr inbounds i8, ptr %0, i64 352
  %33 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet19ParticleSystemData3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %32) #5
  invoke void @_ZN3jet19ParticleSystemData321buildNeighborSearcherEd(ptr noundef nonnull align 8 dereferenceable(144) %33, double noundef %31)
          to label %34 unwind label %51

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %35 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet19ParticleSystemData3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %32) #5
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3jet19ParticleSystemData316neighborSearcherEv(ptr noundef nonnull align 8 dereferenceable(144) %35)
          to label %37 unwind label %53

37:                                               ; preds = %34
  call void @_ZNSt10shared_ptrIN3jet22PointNeighborSearcher3EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %36) #5
  %38 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #5
  store ptr %3, ptr %8, align 8, !tbaa !13
  %39 = getelementptr inbounds i8, ptr %8, i64 8
  store ptr %5, ptr %39, align 8, !tbaa !13
  %40 = getelementptr inbounds i8, ptr %8, i64 16
  store ptr %6, ptr %40, align 8, !tbaa !13
  %41 = getelementptr inbounds i8, ptr %8, i64 24
  store ptr %2, ptr %41, align 8, !tbaa !13
  %42 = getelementptr inbounds i8, ptr %8, i64 32
  store ptr %4, ptr %42, align 8, !tbaa !13
  invoke void @"_ZNSt8functionIFvmmmEEC2IZN3jet10PicSolver324buildSignedDistanceFieldEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(40) %8)
          to label %43 unwind label %55

43:                                               ; preds = %37
  invoke void @_ZNK3jet11ScalarGrid329parallelForEachDataPointIndexERKSt8functionIFvmmmEE(ptr noundef nonnull align 8 dereferenceable(320) %38, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %44 unwind label %57

44:                                               ; preds = %43
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  %45 = call noundef ptr @_ZNKSt12__shared_ptrIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  invoke void @_ZN3jet16GridFluidSolver323extrapolateIntoColliderEPNS_11ScalarGrid3E(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef %45)
          to label %46 unwind label %60

46:                                               ; preds = %44
  call void @_ZNSt12__shared_ptrIN3jet22PointNeighborSearcher3ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, 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_ptrIN3jet11ScalarGrid3ELN9__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

47:                                               ; preds = %1
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %66

49:                                               ; preds = %19, %14, %10
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %65

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

53:                                               ; preds = %34
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %63

55:                                               ; preds = %37
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %59

57:                                               ; preds = %43
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  br label %59

59:                                               ; preds = %57, %55
  %.pn = phi { ptr, i32 } [ %58, %57 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %62

60:                                               ; preds = %44
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %62

62:                                               ; preds = %60, %59
  %.pn10 = phi { ptr, i32 } [ %61, %60 ], [ %.pn, %59 ]
  call void @_ZNSt12__shared_ptrIN3jet22PointNeighborSearcher3ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  br label %63

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

64:                                               ; preds = %63, %51
  %.pn10.pn.pn = phi { ptr, i32 } [ %.pn10.pn, %63 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %65

65:                                               ; preds = %64, %49
  %.pn10.pn.pn.pn = phi { ptr, i32 } [ %.pn10.pn.pn, %64 ], [ %50, %49 ]
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  br label %66

66:                                               ; preds = %65, %47
  %.pn10.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn10.pn.pn.pn, %65 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @_ZNSt12__shared_ptrIN3jet11ScalarGrid3ELN9__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_ptrIN3jet11ScalarGrid3ELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3jet5Grid311gridSpacingEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3jet4max3IdEET_S1_S1_S1_(double noundef, double noundef, double noundef) local_unnamed_addr #4

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

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

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

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

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

declare void @_ZN3jet16GridFluidSolver323extrapolateIntoColliderEPNS_11ScalarGrid3E(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt12__shared_ptrIN3jet11ScalarGrid3ELN9__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_ptrIN3jet22PointNeighborSearcher3ELN9__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, !7, i64 0}
!6 = !{!"_ZTSN3jet6VectorIdLm3EEE", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 16}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !8, i64 0}


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