; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/SoftBody (SoftBodyMotionProperties)

; 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.JPH::Vec3" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }
%"class.JPH::SoftBodyUpdateContext" = type <{ ptr, ptr, ptr, ptr, %"class.JPH::Mat44", %"class.JPH::Vec3", %"class.JPH::Vec3", float, float, %"struct.std::atomic.49", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", [8 x i8], %"class.JPH::Vec3", i32, [12 x i8] }>
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"struct.std::atomic.49" = type { i32 }
%"struct.std::atomic.11" = type { %"struct.std::__atomic_base.12" }
%"struct.std::__atomic_base.12" = type { i32 }
%"class.JPH::SoftBodyMotionProperties" = type <{ %"class.JPH::MotionProperties.base", [2 x i8], %"class.JPH::RefConst", %"class.JPH::Array", %"class.JPH::Array.1", %"class.JPH::Array.4", %"class.JPH::Array.7", %"class.JPH::AABox", %"class.JPH::AABox", i32, i32, float, float, i8, %"struct.std::atomic", i8, i8, [12 x i8] }>
%"class.JPH::MotionProperties.base" = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Float3", %"class.JPH::Float3", float, float, float, float, float, float, i32, i32, i8, i8, i8, i8, i8, [3 x i8], [3 x %"class.JPH::Sphere"], float, i8, i8 }>
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::Sphere" = type { %"class.JPH::Float3", float }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.1" = type { i64, i64, ptr }
%"class.JPH::Array.4" = type { i64, i64, ptr }
%"class.JPH::Array.7" = type { i64, i64, ptr }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.JPH::SoftBodyVertex" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Plane", i32, i8, float, float }
%"class.JPH::Plane" = type { %"class.JPH::Vec4" }

; 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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH24SoftBodyMotionProperties18IntegratePositionsERKNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1) #5 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %24, i32 0, i32 8
  %26 = load float, ptr %25, align 4, !tbaa !9
  store float %26, ptr %5, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store float 0.000000e+00, ptr %7, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %27 = call noundef float @_ZNK3JPH16MotionProperties16GetLinearDampingEv(ptr noundef nonnull align 16 dereferenceable(182) %23)
  %28 = load float, ptr %5, align 4, !tbaa !20
  %29 = fneg float %27
  %30 = call float @llvm.fmuladd.f32(float %29, float %28, float 1.000000e+00)
  store float %30, ptr %8, align 4, !tbaa !20
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %32 = load float, ptr %31, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  store float %32, ptr %6, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #8
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %33, i32 0, i32 5
  %35 = load float, ptr %5, align 4, !tbaa !20
  %36 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %34, float noundef %35)
  %37 = getelementptr inbounds %"class.JPH::Vec3", ptr %9, i32 0, i32 0
  %38 = getelementptr inbounds %union.anon.0, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 0
  %40 = extractvalue { double, double } %36, 0
  store double %40, ptr %39, align 16
  %41 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 1
  %42 = extractvalue { double, double } %36, 1
  store double %42, ptr %41, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  %43 = call { double, double } @_ZNK3JPH16MotionProperties19GetAccumulatedForceEv(ptr noundef nonnull align 16 dereferenceable(182) %23)
  %44 = getelementptr inbounds %"class.JPH::Vec3", ptr %12, i32 0, i32 0
  %45 = getelementptr inbounds %union.anon.0, ptr %44, i32 0, i32 0
  %46 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 0
  %47 = extractvalue { double, double } %43, 0
  store double %47, ptr %46, align 16
  %48 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 1
  %49 = extractvalue { double, double } %43, 1
  store double %49, ptr %48, align 8
  %50 = load float, ptr %5, align 4, !tbaa !20
  %51 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %12, float noundef %50)
  %52 = getelementptr inbounds %"class.JPH::Vec3", ptr %11, i32 0, i32 0
  %53 = getelementptr inbounds %union.anon.0, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds { double, double }, ptr %53, i32 0, i32 0
  %55 = extractvalue { double, double } %51, 0
  store double %55, ptr %54, align 16
  %56 = getelementptr inbounds { double, double }, ptr %53, i32 0, i32 1
  %57 = extractvalue { double, double } %51, 1
  store double %57, ptr %56, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %58 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %23, i32 0, i32 3
  %59 = call noundef i64 @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %58)
  %60 = uitofp i64 %59 to float
  store float %60, ptr %13, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store float 1.000000e+00, ptr %14, align 4, !tbaa !20
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %62 = load float, ptr %61, align 4, !tbaa !20
  %63 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %11, float noundef %62)
  %64 = getelementptr inbounds %"class.JPH::Vec3", ptr %10, i32 0, i32 0
  %65 = getelementptr inbounds %union.anon.0, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 0
  %67 = extractvalue { double, double } %63, 0
  store double %67, ptr %66, align 16
  %68 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 1
  %69 = extractvalue { double, double } %63, 1
  store double %69, ptr %68, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %70 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %23, i32 0, i32 3
  store ptr %70, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = call noundef ptr @_ZN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %71)
  store ptr %72, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  %74 = call noundef ptr @_ZN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %73)
  store ptr %74, ptr %17, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %163, %2
  %76 = load ptr, ptr %16, align 8, !tbaa !5
  %77 = load ptr, ptr %17, align 8, !tbaa !5
  %78 = icmp ne ptr %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %166

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %81 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %81, ptr %18, align 8, !tbaa !5
  %82 = load ptr, ptr %18, align 8, !tbaa !5
  %83 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %82, i32 0, i32 7
  %84 = load float, ptr %83, align 4, !tbaa !21
  %85 = fcmp ogt float %84, 0.000000e+00
  br i1 %85, label %86, label %140

86:                                               ; preds = %80
  %87 = load ptr, ptr %18, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %87, i32 0, i32 7
  %89 = load float, ptr %88, align 4, !tbaa !21
  %90 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %10, float noundef %89)
  %91 = getelementptr inbounds %"class.JPH::Vec3", ptr %20, i32 0, i32 0
  %92 = getelementptr inbounds %union.anon.0, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 0
  %94 = extractvalue { double, double } %90, 0
  store double %94, ptr %93, align 16
  %95 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 1
  %96 = extractvalue { double, double } %90, 1
  store double %96, ptr %95, align 8
  %97 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %98 = load double, ptr %97, align 16
  %99 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %100 = load double, ptr %99, align 8
  %101 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %9, double %98, double %100)
  %102 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %103 = getelementptr inbounds %union.anon.0, ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds { double, double }, ptr %103, i32 0, i32 0
  %105 = extractvalue { double, double } %101, 0
  store double %105, ptr %104, align 16
  %106 = getelementptr inbounds { double, double }, ptr %103, i32 0, i32 1
  %107 = extractvalue { double, double } %101, 1
  store double %107, ptr %106, align 8
  %108 = load ptr, ptr %18, align 8, !tbaa !5
  %109 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %108, i32 0, i32 2
  %110 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %111 = load double, ptr %110, align 16
  %112 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %113 = load double, ptr %112, align 8
  %114 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %109, double %111, double %113)
  %115 = load float, ptr %6, align 4, !tbaa !20
  %116 = load ptr, ptr %18, align 8, !tbaa !5
  %117 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %116, i32 0, i32 2
  %118 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3mLEf(ptr noundef nonnull align 16 dereferenceable(16) %117, float noundef %115)
  %119 = load ptr, ptr %18, align 8, !tbaa !5
  %120 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %119, i32 0, i32 1
  %121 = load ptr, ptr %18, align 8, !tbaa !5
  %122 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %121, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %122, ptr align 16 %120, i64 16, i1 false), !tbaa.struct !26
  %123 = load ptr, ptr %18, align 8, !tbaa !5
  %124 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %123, i32 0, i32 2
  %125 = load float, ptr %5, align 4, !tbaa !20
  %126 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %124, float noundef %125)
  %127 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %128 = getelementptr inbounds %union.anon.0, ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds { double, double }, ptr %128, i32 0, i32 0
  %130 = extractvalue { double, double } %126, 0
  store double %130, ptr %129, align 16
  %131 = getelementptr inbounds { double, double }, ptr %128, i32 0, i32 1
  %132 = extractvalue { double, double } %126, 1
  store double %132, ptr %131, align 8
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %133, i32 0, i32 1
  %135 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %136 = load double, ptr %135, align 16
  %137 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %138 = load double, ptr %137, align 8
  %139 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %134, double %136, double %138)
  br label %162

140:                                              ; preds = %80
  %141 = load ptr, ptr %18, align 8, !tbaa !5
  %142 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %141, i32 0, i32 1
  %143 = load ptr, ptr %18, align 8, !tbaa !5
  %144 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %143, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %144, ptr align 16 %142, i64 16, i1 false), !tbaa.struct !26
  %145 = load ptr, ptr %18, align 8, !tbaa !5
  %146 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %145, i32 0, i32 2
  %147 = load float, ptr %5, align 4, !tbaa !20
  %148 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %146, float noundef %147)
  %149 = getelementptr inbounds %"class.JPH::Vec3", ptr %22, i32 0, i32 0
  %150 = getelementptr inbounds %union.anon.0, ptr %149, i32 0, i32 0
  %151 = getelementptr inbounds { double, double }, ptr %150, i32 0, i32 0
  %152 = extractvalue { double, double } %148, 0
  store double %152, ptr %151, align 16
  %153 = getelementptr inbounds { double, double }, ptr %150, i32 0, i32 1
  %154 = extractvalue { double, double } %148, 1
  store double %154, ptr %153, align 8
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  %156 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %155, i32 0, i32 1
  %157 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %158 = load double, ptr %157, align 16
  %159 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %160 = load double, ptr %159, align 8
  %161 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %156, double %158, double %160)
  br label %162

162:                                              ; preds = %140, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %16, align 8, !tbaa !5
  %165 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %164, i32 1
  store ptr %165, ptr %16, align 8, !tbaa !5
  br label %75

166:                                              ; preds = %79
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH16MotionProperties16GetLinearDampingEv(ptr noundef nonnull align 16 dereferenceable(182)) #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH16MotionProperties19GetAccumulatedForceEv(ptr noundef nonnull align 16 dereferenceable(182)) #7 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #6 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3mLEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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 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 #6 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 #7 = { alwaysinline 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 #8 = { 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, !13, i64 132}
!10 = !{!"_ZTSN3JPH21SoftBodyUpdateContextE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !12, i64 96, !12, i64 112, !13, i64 128, !13, i64 132, !14, i64 136, !16, i64 140, !16, i64 144, !16, i64 148, !16, i64 152, !16, i64 156, !16, i64 160, !16, i64 164, !12, i64 176, !19, i64 192}
!11 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!12 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_ZTSSt6atomicIN3JPH21SoftBodyUpdateContext6EStateEE", !15, i64 0}
!15 = !{!"_ZTSN3JPH21SoftBodyUpdateContext6EStateE", !7, i64 0}
!16 = !{!"_ZTSSt6atomicIjE", !17, i64 0}
!17 = !{!"_ZTSSt13__atomic_baseIjE", !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN3JPH9ECanSleepE", !7, i64 0}
!20 = !{!13, !13, i64 0}
!21 = !{!22, !13, i64 76}
!22 = !{!"_ZTSN3JPH14SoftBodyVertexE", !12, i64 0, !12, i64 16, !12, i64 32, !23, i64 48, !18, i64 64, !25, i64 68, !13, i64 72, !13, i64 76}
!23 = !{!"_ZTSN3JPH5PlaneE", !24, i64 0}
!24 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!25 = !{!"bool", !7, i64 0}
!26 = !{i64 0, i64 16, !27}
!27 = !{!7, !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.JPH::Vec3" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }

; 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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH24SoftBodyMotionProperties18IntegratePositionsERKNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1) local_unnamed_addr #5 align 2 {
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = getelementptr inbounds i8, ptr %1, i64 132
  %12 = load float, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store float 0.000000e+00, ptr %3, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %13 = tail call noundef float @_ZNK3JPH16MotionProperties16GetLinearDampingEv(ptr noundef nonnull align 16 dereferenceable(182) %0)
  %14 = fneg float %13
  %15 = tail call float @llvm.fmuladd.f32(float %14, float %12, float 1.000000e+00)
  store float %15, ptr %4, align 4, !tbaa !19
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %17 = load float, ptr %16, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %18 = getelementptr inbounds i8, ptr %1, i64 96
  %19 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %18, float noundef %12)
  %20 = extractvalue { double, double } %19, 0
  store double %20, ptr %5, align 16
  %21 = getelementptr inbounds i8, ptr %5, i64 8
  %22 = extractvalue { double, double } %19, 1
  store double %22, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  %23 = call { double, double } @_ZNK3JPH16MotionProperties19GetAccumulatedForceEv(ptr noundef nonnull align 16 dereferenceable(182) %0)
  %24 = extractvalue { double, double } %23, 0
  store double %24, ptr %8, align 16
  %25 = getelementptr inbounds i8, ptr %8, i64 8
  %26 = extractvalue { double, double } %23, 1
  store double %26, ptr %25, align 8
  %27 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %8, float noundef %12)
  %28 = extractvalue { double, double } %27, 0
  store double %28, ptr %7, align 16
  %29 = getelementptr inbounds i8, ptr %7, i64 8
  %30 = extractvalue { double, double } %27, 1
  store double %30, ptr %29, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  %31 = getelementptr inbounds i8, ptr %0, i64 192
  %32 = call noundef i64 @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  %33 = uitofp i64 %32 to float
  store float %33, ptr %9, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  store float 1.000000e+00, ptr %10, align 4, !tbaa !19
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %35 = load float, ptr %34, align 4, !tbaa !19
  %36 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %7, float noundef %35)
  %37 = extractvalue { double, double } %36, 0
  store double %37, ptr %6, align 16
  %38 = getelementptr inbounds i8, ptr %6, i64 8
  %39 = extractvalue { double, double } %36, 1
  store double %39, ptr %38, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  %40 = call noundef ptr @_ZN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  %41 = call noundef ptr @_ZN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  %.not34 = icmp eq ptr %40, %41
  br i1 %.not34, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %59, %2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  ret void

.lr.ph:                                           ; preds = %2, %59
  %.035 = phi ptr [ %64, %59 ], [ %40, %2 ]
  %42 = getelementptr inbounds i8, ptr %.035, i64 76
  %43 = load float, ptr %42, align 4, !tbaa !20
  %44 = fcmp ogt float %43, 0.000000e+00
  br i1 %44, label %45, label %56

45:                                               ; preds = %.lr.ph
  %46 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %6, float noundef %43)
  %47 = extractvalue { double, double } %46, 0
  %48 = extractvalue { double, double } %46, 1
  %49 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %5, double %47, double %48)
  %50 = extractvalue { double, double } %49, 0
  %51 = extractvalue { double, double } %49, 1
  %52 = getelementptr inbounds i8, ptr %.035, i64 32
  %53 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %52, double %50, double %51)
  %54 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3mLEf(ptr noundef nonnull align 16 dereferenceable(16) %52, float noundef %17)
  %55 = getelementptr inbounds i8, ptr %.035, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %.035, ptr noundef nonnull align 16 dereferenceable(16) %55, i64 16, i1 false), !tbaa.struct !25
  br label %59

56:                                               ; preds = %.lr.ph
  %57 = getelementptr inbounds i8, ptr %.035, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %.035, ptr noundef nonnull align 16 dereferenceable(16) %57, i64 16, i1 false), !tbaa.struct !25
  %58 = getelementptr inbounds i8, ptr %.035, i64 32
  br label %59

59:                                               ; preds = %56, %45
  %.sink40 = phi ptr [ %58, %56 ], [ %52, %45 ]
  %.sink = phi ptr [ %57, %56 ], [ %55, %45 ]
  %60 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %.sink40, float noundef %12)
  %61 = extractvalue { double, double } %60, 0
  %62 = extractvalue { double, double } %60, 1
  %63 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %.sink, double %61, double %62)
  %64 = getelementptr inbounds i8, ptr %.035, i64 80
  %.not = icmp eq ptr %64, %41
  br i1 %.not, label %._crit_edge, label %.lr.ph
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH16MotionProperties16GetLinearDampingEv(ptr noundef nonnull align 16 dereferenceable(182)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) local_unnamed_addr #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH16MotionProperties19GetAccumulatedForceEv(ptr noundef nonnull align 16 dereferenceable(182)) local_unnamed_addr #7 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) local_unnamed_addr #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #6 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3mLEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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 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 #6 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 #7 = { alwaysinline 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 #8 = { 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, !12, i64 132}
!6 = !{!"_ZTSN3JPH21SoftBodyUpdateContextE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 96, !11, i64 112, !12, i64 128, !12, i64 132, !13, i64 136, !15, i64 140, !15, i64 144, !15, i64 148, !15, i64 152, !15, i64 156, !15, i64 160, !15, i64 164, !11, i64 176, !18, i64 192}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN3JPH5Mat44E", !8, i64 0}
!11 = !{!"_ZTSN3JPH4Vec3E", !8, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!"_ZTSSt6atomicIN3JPH21SoftBodyUpdateContext6EStateEE", !14, i64 0}
!14 = !{!"_ZTSN3JPH21SoftBodyUpdateContext6EStateE", !8, i64 0}
!15 = !{!"_ZTSSt6atomicIjE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIjE", !17, i64 0}
!17 = !{!"int", !8, i64 0}
!18 = !{!"_ZTSN3JPH9ECanSleepE", !8, i64 0}
!19 = !{!12, !12, i64 0}
!20 = !{!21, !12, i64 76}
!21 = !{!"_ZTSN3JPH14SoftBodyVertexE", !11, i64 0, !11, i64 16, !11, i64 32, !22, i64 48, !17, i64 64, !24, i64 68, !12, i64 72, !12, i64 76}
!22 = !{!"_ZTSN3JPH5PlaneE", !23, i64 0}
!23 = !{!"_ZTSN3JPH4Vec4E", !8, i64 0}
!24 = !{!"bool", !8, i64 0}
!25 = !{i64 0, i64 16, !26}
!26 = !{!8, !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass