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

; 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 }
%union.anon = type { <4 x float> }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::CastConvexVsTriangles" = type <{ ptr, ptr, ptr, [8 x i8], %"class.JPH::Vec3", %"class.JPH::SubShapeIDCreator", ptr, %"class.JPH::ConvexShape::SupportBuffer", ptr, float, [4 x i8] }>
%"class.JPH::SubShapeIDCreator" = type { %"class.JPH::SubShapeID", i32 }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::ConvexShape::SupportBuffer" = type { [4160 x i8] }
%"class.JPH::SoftBodyShape" = type { %"class.JPH::Shape.base", ptr }
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"struct.JPH::SoftBodySharedSettings::Face" = type { [3 x i32], i32 }
%"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" }
%"class.JPH::Vec4" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [49 x i8], align 1

; 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: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH13SoftBodyShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties8GetFacesEv(ptr noundef nonnull align 16 dereferenceable(372)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #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) #3

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK3JPH17SubShapeIDCreator6PushIDEjj(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef, i32 noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3JPH5Shape10GetSubTypeEv(ptr noundef nonnull align 8 dereferenceable(26)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13SoftBodyShape21sCastConvexVsSoftBodyERKNS_9ShapeCastERKNS_17ShapeCastSettingsEPKNS_5ShapeENS_4Vec3ERKNS_11ShapeFilterERKNS_5Mat44ERKNS_17SubShapeIDCreatorESJ_RNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(144) %0, ptr noundef nonnull align 16 dereferenceable(36) %1, ptr noundef %2, double %3, double %4, ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef nonnull align 16 dereferenceable(64) %6, ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 1 %9) #1 align 2 {
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"struct.JPH::AssertLastParam", align 1
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca %"class.JPH::CastConvexVsTriangles", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca %"class.JPH::Vec3", align 16
  %32 = alloca %"class.JPH::Vec3", align 16
  %33 = alloca %"class.JPH::Vec3", align 16
  %34 = alloca %"class.JPH::Vec3", align 16
  %35 = alloca %"class.JPH::Vec3", align 16
  %36 = alloca %"class.JPH::Vec3", align 16
  %37 = alloca %"class.JPH::SubShapeIDCreator", align 4
  %38 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  store double %3, ptr %38, align 16
  %39 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  store double %4, ptr %39, align 8
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store ptr %2, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  store ptr %8, ptr %18, align 8, !tbaa !5
  store ptr %9, ptr %19, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %10
  %41 = load ptr, ptr %14, align 8, !tbaa !5
  %42 = call noundef zeroext i8 @_ZNK3JPH5Shape10GetSubTypeEv(ptr noundef nonnull align 8 dereferenceable(26) %41)
  %43 = icmp eq i8 %42, 14
  br i1 %43, label %47, label %44

44:                                               ; preds = %40
  %45 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 283)
  br i1 %45, label %46, label %47

46:                                               ; preds = %44
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !9
  br label %47

47:                                               ; preds = %46, %44, %40
  br label %48

48:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %49 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %49, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %50 = load ptr, ptr %21, align 8, !tbaa !5
  %51 = getelementptr inbounds %"class.JPH::SoftBodyShape", ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !10
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties11GetVerticesEv(ptr noundef nonnull align 16 dereferenceable(372) %52)
  store ptr %53, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %54 = load ptr, ptr %21, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.JPH::SoftBodyShape", ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !10
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties8GetFacesEv(ptr noundef nonnull align 16 dereferenceable(372) %56)
  store ptr %57, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %58 = load ptr, ptr %21, align 8, !tbaa !5
  %59 = call noundef i32 @_ZNK3JPH13SoftBodyShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 8 dereferenceable(40) %58)
  store i32 %59, ptr %24, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4240, ptr %25) #7
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 %11, i64 16, i1 false), !tbaa.struct !21
  %62 = load ptr, ptr %16, align 8, !tbaa !5
  %63 = load ptr, ptr %17, align 8, !tbaa !5
  %64 = load ptr, ptr %19, align 8, !tbaa !5
  %65 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %66 = load double, ptr %65, align 16
  %67 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %68 = load double, ptr %67, align 8
  call void @_ZN3JPH21CastConvexVsTrianglesC1ERKNS_9ShapeCastERKNS_17ShapeCastSettingsENS_4Vec3ERKNS_5Mat44ERKNS_17SubShapeIDCreatorERNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(4236) %25, ptr noundef nonnull align 16 dereferenceable(144) %60, ptr noundef nonnull align 16 dereferenceable(36) %61, double %66, double %68, ptr noundef nonnull align 16 dereferenceable(64) %62, ptr noundef nonnull align 4 dereferenceable(8) %63, ptr noundef nonnull align 1 %64)
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %69 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %69, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %70 = load ptr, ptr %27, align 8, !tbaa !5
  %71 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %70)
  store ptr %71, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %72 = load ptr, ptr %27, align 8, !tbaa !5
  %73 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %72)
  store ptr %73, ptr %29, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %129, %48
  %75 = load ptr, ptr %28, align 8, !tbaa !5
  %76 = load ptr, ptr %29, align 8, !tbaa !5
  %77 = icmp ne ptr %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %132

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %80 = load ptr, ptr %28, align 8, !tbaa !5
  store ptr %80, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #7
  %81 = load ptr, ptr %22, align 8, !tbaa !5
  %82 = load ptr, ptr %30, align 8, !tbaa !5
  %83 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Face", ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds [3 x i32], ptr %83, i64 0, i64 0
  %85 = load i32, ptr %84, align 4, !tbaa !20
  %86 = zext i32 %85 to i64
  %87 = call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %86)
  %88 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %87, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %31, ptr align 16 %88, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #7
  %89 = load ptr, ptr %22, align 8, !tbaa !5
  %90 = load ptr, ptr %30, align 8, !tbaa !5
  %91 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Face", ptr %90, i32 0, i32 0
  %92 = getelementptr inbounds [3 x i32], ptr %91, i64 0, i64 1
  %93 = load i32, ptr %92, align 4, !tbaa !20
  %94 = zext i32 %93 to i64
  %95 = call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %89, i64 noundef %94)
  %96 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %95, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %32, ptr align 16 %96, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #7
  %97 = load ptr, ptr %22, align 8, !tbaa !5
  %98 = load ptr, ptr %30, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Face", ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds [3 x i32], ptr %99, i64 0, i64 2
  %101 = load i32, ptr %100, align 4, !tbaa !20
  %102 = zext i32 %101 to i64
  %103 = call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %97, i64 noundef %102)
  %104 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %103, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %33, ptr align 16 %104, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %34, ptr align 16 %31, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %35, ptr align 16 %32, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %36, ptr align 16 %33, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  %105 = load ptr, ptr %18, align 8, !tbaa !5
  %106 = load ptr, ptr %30, align 8, !tbaa !5
  %107 = load ptr, ptr %23, align 8, !tbaa !5
  %108 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %107)
  %109 = ptrtoint ptr %106 to i64
  %110 = ptrtoint ptr %108 to i64
  %111 = sub i64 %109, %110
  %112 = sdiv exact i64 %111, 16
  %113 = trunc i64 %112 to i32
  %114 = load i32, ptr %24, align 4, !tbaa !20
  %115 = call i64 @_ZNK3JPH17SubShapeIDCreator6PushIDEjj(ptr noundef nonnull align 4 dereferenceable(8) %105, i32 noundef %113, i32 noundef %114)
  store i64 %115, ptr %37, align 4
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %37)
  %117 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 0
  %118 = load double, ptr %117, align 16
  %119 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 1
  %120 = load double, ptr %119, align 8
  %121 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 0
  %122 = load double, ptr %121, align 16
  %123 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 1
  %124 = load double, ptr %123, align 8
  %125 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 0
  %126 = load double, ptr %125, align 16
  %127 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 1
  %128 = load double, ptr %127, align 8
  call void @_ZN3JPH21CastConvexVsTriangles4CastENS_4Vec3ES1_S1_hRKNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(4236) %25, double %118, double %120, double %122, double %124, double %126, double %128, i8 noundef zeroext 7, ptr noundef nonnull align 4 dereferenceable(4) %116)
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %129

129:                                              ; preds = %79
  %130 = load ptr, ptr %28, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Face", ptr %130, i32 1
  store ptr %131, ptr %28, align 8, !tbaa !5
  br label %74

132:                                              ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4240, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  ret void
}

declare void @_ZN3JPH21CastConvexVsTrianglesC1ERKNS_9ShapeCastERKNS_17ShapeCastSettingsENS_4Vec3ERKNS_5Mat44ERKNS_17SubShapeIDCreatorERNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(4236), ptr noundef nonnull align 16 dereferenceable(144), ptr noundef nonnull align 16 dereferenceable(36), double, double, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 1) unnamed_addr #6

declare void @_ZN3JPH21CastConvexVsTriangles4CastENS_4Vec3ES1_S1_hRKNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(4236), double, double, double, double, double, double, i8 noundef zeroext, ptr noundef nonnull align 4 dereferenceable(4)) #6

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 = { inlinehint 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 #6 = { "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 = { 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 = !{i64 2158489760}
!10 = !{!11, !6, i64 32}
!11 = !{!"_ZTSN3JPH13SoftBodyShapeE", !12, i64 0, !6, i64 32}
!12 = !{!"_ZTSN3JPH5ShapeE", !13, i64 8, !17, i64 16, !18, i64 24, !19, i64 25}
!13 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !14, i64 0}
!14 = !{!"_ZTSSt6atomicIjE", !15, i64 0}
!15 = !{!"_ZTSSt13__atomic_baseIjE", !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!19 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!20 = !{!16, !16, i64 0}
!21 = !{i64 0, i64 16, !22}
!22 = !{!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::CastConvexVsTriangles" = type <{ ptr, ptr, ptr, [8 x i8], %"class.JPH::Vec3", %"class.JPH::SubShapeIDCreator", ptr, %"class.JPH::ConvexShape::SupportBuffer", ptr, float, [4 x i8] }>
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::SubShapeIDCreator" = type { %"class.JPH::SubShapeID", i32 }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::ConvexShape::SupportBuffer" = type { [4160 x i8] }

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [49 x i8], align 1

; 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: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH13SoftBodyShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties8GetFacesEv(ptr noundef nonnull align 16 dereferenceable(372)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK3JPH17SubShapeIDCreator6PushIDEjj(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3JPH5Shape10GetSubTypeEv(ptr noundef nonnull align 8 dereferenceable(26)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13SoftBodyShape21sCastConvexVsSoftBodyERKNS_9ShapeCastERKNS_17ShapeCastSettingsEPKNS_5ShapeENS_4Vec3ERKNS_11ShapeFilterERKNS_5Mat44ERKNS_17SubShapeIDCreatorESJ_RNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(144) %0, ptr noundef nonnull align 16 dereferenceable(36) %1, ptr noundef nonnull %2, double %3, double %4, ptr nocapture noundef nonnull readnone align 8 dereferenceable(12) %5, ptr noundef nonnull align 16 dereferenceable(64) %6, ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 1 %9) local_unnamed_addr #1 align 2 {
  %11 = alloca %"class.JPH::CastConvexVsTriangles", align 16
  %12 = alloca %"class.JPH::SubShapeIDCreator", align 8
  %13 = tail call noundef zeroext i8 @_ZNK3JPH5Shape10GetSubTypeEv(ptr noundef nonnull align 8 dereferenceable(26) %2)
  %14 = icmp eq i8 %13, 14
  br i1 %14, label %18, label %15

15:                                               ; preds = %10
  %16 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 283)
  br i1 %16, label %17, label %18

17:                                               ; preds = %15
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !5
  br label %18

18:                                               ; preds = %10, %15, %17
  %19 = getelementptr inbounds i8, ptr %2, i64 32
  %20 = load ptr, ptr %19, align 8, !tbaa !6
  %21 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties11GetVerticesEv(ptr noundef nonnull align 16 dereferenceable(372) %20)
  %22 = load ptr, ptr %19, align 8, !tbaa !6
  %23 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties8GetFacesEv(ptr noundef nonnull align 16 dereferenceable(372) %22)
  %24 = tail call noundef i32 @_ZNK3JPH13SoftBodyShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 8 dereferenceable(40) %2)
  call void @llvm.lifetime.start.p0(i64 4240, ptr nonnull %11) #6
  call void @_ZN3JPH21CastConvexVsTrianglesC1ERKNS_9ShapeCastERKNS_17ShapeCastSettingsENS_4Vec3ERKNS_5Mat44ERKNS_17SubShapeIDCreatorERNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(4236) %11, ptr noundef nonnull align 16 dereferenceable(144) %0, ptr noundef nonnull align 16 dereferenceable(36) %1, double %3, double %4, ptr noundef nonnull align 16 dereferenceable(64) %6, ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 1 %9)
  %25 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %26 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %.not39 = icmp eq ptr %25, %26
  br i1 %.not39, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %18
  call void @llvm.lifetime.end.p0(i64 4240, ptr nonnull %11) #6
  ret void

.lr.ph:                                           ; preds = %18, %.lr.ph
  %.040 = phi ptr [ %49, %.lr.ph ], [ %25, %18 ]
  %27 = load i32, ptr %.040, align 4, !tbaa !19
  %28 = zext i32 %27 to i64
  %29 = call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %28)
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %.sroa.08.0.copyload = load double, ptr %30, align 16
  %.sroa.49.0..sroa_idx = getelementptr inbounds i8, ptr %29, i64 24
  %.sroa.49.0.copyload = load double, ptr %.sroa.49.0..sroa_idx, align 8, !tbaa !20
  %31 = getelementptr inbounds i8, ptr %.040, i64 4
  %32 = load i32, ptr %31, align 4, !tbaa !19
  %33 = zext i32 %32 to i64
  %34 = call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %33)
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %.sroa.06.0.copyload = load double, ptr %35, align 16
  %.sroa.47.0..sroa_idx = getelementptr inbounds i8, ptr %34, i64 24
  %.sroa.47.0.copyload = load double, ptr %.sroa.47.0..sroa_idx, align 8, !tbaa !20
  %36 = getelementptr inbounds i8, ptr %.040, i64 8
  %37 = load i32, ptr %36, align 4, !tbaa !19
  %38 = zext i32 %37 to i64
  %39 = call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %38)
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  %.sroa.05.0.copyload = load double, ptr %40, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %39, i64 24
  %.sroa.4.0.copyload = load double, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %41 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %42 = ptrtoint ptr %.040 to i64
  %43 = ptrtoint ptr %41 to i64
  %44 = sub i64 %42, %43
  %45 = lshr exact i64 %44, 4
  %46 = trunc i64 %45 to i32
  %47 = call i64 @_ZNK3JPH17SubShapeIDCreator6PushIDEjj(ptr noundef nonnull align 4 dereferenceable(8) %8, i32 noundef %46, i32 noundef %24)
  store i64 %47, ptr %12, align 8
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @_ZN3JPH21CastConvexVsTriangles4CastENS_4Vec3ES1_S1_hRKNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(4236) %11, double %.sroa.08.0.copyload, double %.sroa.49.0.copyload, double %.sroa.06.0.copyload, double %.sroa.47.0.copyload, double %.sroa.05.0.copyload, double %.sroa.4.0.copyload, i8 noundef zeroext 7, ptr noundef nonnull align 4 dereferenceable(4) %48)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %49 = getelementptr inbounds i8, ptr %.040, i64 16
  %.not = icmp eq ptr %49, %26
  br i1 %.not, label %._crit_edge, label %.lr.ph
}

declare void @_ZN3JPH21CastConvexVsTrianglesC1ERKNS_9ShapeCastERKNS_17ShapeCastSettingsENS_4Vec3ERKNS_5Mat44ERKNS_17SubShapeIDCreatorERNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(4236), ptr noundef nonnull align 16 dereferenceable(144), ptr noundef nonnull align 16 dereferenceable(36), double, double, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 1) unnamed_addr #5

declare void @_ZN3JPH21CastConvexVsTriangles4CastENS_4Vec3ES1_S1_hRKNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(4236), double, double, double, double, double, double, i8 noundef zeroext, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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 = { inlinehint 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 #3 = { 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 #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 = { "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 = !{i64 2158489760}
!6 = !{!7, !18, i64 32}
!7 = !{!"_ZTSN3JPH13SoftBodyShapeE", !8, i64 0, !18, i64 32}
!8 = !{!"_ZTSN3JPH5ShapeE", !9, i64 8, !15, i64 16, !16, i64 24, !17, i64 25}
!9 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !10, i64 0}
!10 = !{!"_ZTSSt6atomicIjE", !11, i64 0}
!11 = !{!"_ZTSSt13__atomic_baseIjE", !12, i64 0}
!12 = !{!"int", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"long", !13, i64 0}
!16 = !{!"_ZTSN3JPH10EShapeTypeE", !13, i64 0}
!17 = !{!"_ZTSN3JPH13EShapeSubTypeE", !13, i64 0}
!18 = !{!"any pointer", !13, i64 0}
!19 = !{!12, !12, i64 0}
!20 = !{!13, !13, i64 0}


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