; 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> }
%"class.JPH::SubShapeIDCreator" = type { %"class.JPH::SubShapeID", i32 }
%"class.JPH::SubShapeID" = type { i32 }
%"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> }
%"struct.JPH::RayCastT" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::BroadPhaseCastResult" = type { %"class.JPH::BodyID", float }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::RayCastResult" = type { %"class.JPH::BroadPhaseCastResult", %"class.JPH::SubShapeID" }

; 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: 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 uwtable
define dso_local noundef zeroext i1 @_ZNK3JPH13SoftBodyShape7CastRayERKNS_7RayCastERKNS_17SubShapeIDCreatorERNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 16 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(12) %3) unnamed_addr #1 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %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 %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca float, align 4
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca i32, align 4
  %27 = alloca %"class.JPH::SubShapeIDCreator", align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %29 = call noundef i32 @_ZNK3JPH13SoftBodyShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 8 dereferenceable(40) %28)
  store i32 %29, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 -1, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %30 = getelementptr inbounds %"class.JPH::SoftBodyShape", ptr %28, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties11GetVerticesEv(ptr noundef nonnull align 16 dereferenceable(372) %31)
  store ptr %32, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %33 = getelementptr inbounds %"class.JPH::SoftBodyShape", ptr %28, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties8GetFacesEv(ptr noundef nonnull align 16 dereferenceable(372) %34)
  store ptr %35, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36)
  store ptr %37, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %38)
  store ptr %39, ptr %15, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %112, %4
  %41 = load ptr, ptr %14, align 8, !tbaa !5
  %42 = load ptr, ptr %15, align 8, !tbaa !5
  %43 = icmp ne ptr %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %115

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %46, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Face", ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds [3 x i32], ptr %49, i64 0, i64 0
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = zext i32 %51 to i64
  %53 = call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef %52)
  %54 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %53, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 %54, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = load ptr, ptr %16, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Face", ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds [3 x i32], ptr %57, i64 0, i64 1
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %60 = zext i32 %59 to i64
  %61 = call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %60)
  %62 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %61, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %62, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Face", ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds [3 x i32], ptr %65, i64 0, i64 2
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = zext i32 %67 to i64
  %69 = call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %68)
  %70 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %69, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 %70, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.JPH::RayCastT", ptr %71, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 %72, i64 16, i1 false), !tbaa.struct !20
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.JPH::RayCastT", ptr %73, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 %74, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %17, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %18, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %25, ptr align 16 %19, i64 16, i1 false), !tbaa.struct !20
  %75 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %76 = load double, ptr %75, align 16
  %77 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %78 = load double, ptr %77, align 8
  %79 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %80 = load double, ptr %79, align 16
  %81 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %82 = load double, ptr %81, align 8
  %83 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %84 = load double, ptr %83, align 16
  %85 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %86 = load double, ptr %85, align 8
  %87 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %88 = load double, ptr %87, align 16
  %89 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %90 = load double, ptr %89, align 8
  %91 = call noundef float @_ZN3JPH11RayTriangleENS_4Vec3ES0_S0_S0_S0_(double %76, double %78, double %80, double %82, double %84, double %86, double %88, double %90, ptr noundef byval(%"class.JPH::Vec3") align 16 %25)
  store float %91, ptr %20, align 4, !tbaa !22
  %92 = load float, ptr %20, align 4, !tbaa !22
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %93, i32 0, i32 1
  %95 = load float, ptr %94, align 4, !tbaa !24
  %96 = fcmp olt float %92, %95
  br i1 %96, label %97, label %111

97:                                               ; preds = %45
  %98 = load float, ptr %20, align 4, !tbaa !22
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %99, i32 0, i32 1
  store float %98, ptr %100, align 4, !tbaa !24
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = getelementptr inbounds %"class.JPH::SoftBodyShape", ptr %28, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !11
  %104 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties8GetFacesEv(ptr noundef nonnull align 16 dereferenceable(372) %103)
  %105 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %104)
  %106 = ptrtoint ptr %101 to i64
  %107 = ptrtoint ptr %105 to i64
  %108 = sub i64 %106, %107
  %109 = sdiv exact i64 %108, 16
  %110 = trunc i64 %109 to i32
  store i32 %110, ptr %11, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %97, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %112

112:                                              ; preds = %111
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Face", ptr %113, i32 1
  store ptr %114, ptr %14, align 8, !tbaa !5
  br label %40

115:                                              ; preds = %44
  %116 = load i32, ptr %11, align 4, !tbaa !9
  %117 = icmp eq i32 %116, -1
  br i1 %117, label %118, label %119

118:                                              ; preds = %115
  store i1 false, ptr %5, align 1
  store i32 1, ptr %26, align 4
  br label %127

119:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = load i32, ptr %10, align 4, !tbaa !9
  %123 = call i64 @_ZNK3JPH17SubShapeIDCreator6PushIDEjj(ptr noundef nonnull align 4 dereferenceable(8) %120, i32 noundef %121, i32 noundef %122)
  store i64 %123, ptr %27, align 4
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %27)
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = getelementptr inbounds %"class.JPH::RayCastResult", ptr %125, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %126, ptr align 4 %124, i64 4, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  store i1 true, ptr %5, align 1
  store i32 1, ptr %26, align 4
  br label %127

127:                                              ; preds = %119, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %128 = load i1, ptr %5, align 1
  ret i1 %128
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties11GetVerticesEv(ptr noundef nonnull align 16 dereferenceable(372)) #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)) #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)) #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) #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN3JPH11RayTriangleENS_4Vec3ES0_S0_S0_S0_(double, double, double, double, double, double, double, double, ptr noundef byval(%"class.JPH::Vec3") align 16) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 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)) #3 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { 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 #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 32}
!12 = !{!"_ZTSN3JPH13SoftBodyShapeE", !13, i64 0, !6, i64 32}
!13 = !{!"_ZTSN3JPH5ShapeE", !14, i64 8, !17, i64 16, !18, i64 24, !19, i64 25}
!14 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !15, i64 0}
!15 = !{!"_ZTSSt6atomicIjE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!19 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!20 = !{i64 0, i64 16, !21}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{!25, !23, i64 4}
!25 = !{!"_ZTSN3JPH20BroadPhaseCastResultE", !26, i64 0, !23, i64 4}
!26 = !{!"_ZTSN3JPH6BodyIDE", !10, i64 0}
!27 = !{i64 0, i64 4, !9}


; 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 }
%union.anon = type { <4 x float> }
%"class.JPH::SubShapeIDCreator" = type { %"class.JPH::SubShapeID", i32 }
%"class.JPH::SubShapeID" = type { i32 }

; 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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3JPH13SoftBodyShape7CastRayERKNS_7RayCastERKNS_17SubShapeIDCreatorERNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr nocapture noundef nonnull readonly align 16 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr nocapture noundef nonnull align 4 dereferenceable(12) %3) unnamed_addr #1 align 2 {
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca %"class.JPH::SubShapeIDCreator", align 8
  %7 = tail call noundef i32 @_ZNK3JPH13SoftBodyShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties11GetVerticesEv(ptr noundef nonnull align 16 dereferenceable(372) %9)
  %11 = load ptr, ptr %8, align 8, !tbaa !5
  %12 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties8GetFacesEv(ptr noundef nonnull align 16 dereferenceable(372) %11)
  %13 = tail call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %14 = tail call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %.not39 = icmp eq ptr %13, %14
  br i1 %.not39, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %4
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 24
  %16 = getelementptr inbounds i8, ptr %3, i64 4
  br label %17

._crit_edge:                                      ; preds = %44
  %.not43 = icmp eq i32 %.1, -1
  br i1 %.not43, label %._crit_edge.thread, label %46

17:                                               ; preds = %.lr.ph, %44
  %.03641 = phi i32 [ -1, %.lr.ph ], [ %.1, %44 ]
  %.03740 = phi ptr [ %13, %.lr.ph ], [ %45, %44 ]
  %18 = load i32, ptr %.03740, align 4, !tbaa !18
  %19 = zext i32 %18 to i64
  %20 = tail call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %19)
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %.sroa.011.0.copyload = load double, ptr %21, align 16
  %.sroa.412.0..sroa_idx = getelementptr inbounds i8, ptr %20, i64 24
  %.sroa.412.0.copyload = load double, ptr %.sroa.412.0..sroa_idx, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %.03740, i64 4
  %23 = load i32, ptr %22, align 4, !tbaa !18
  %24 = zext i32 %23 to i64
  %25 = tail call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %24)
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  %.sroa.010.0.copyload = load double, ptr %26, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 24
  %.sroa.4.0.copyload = load double, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %.03740, i64 8
  %28 = load i32, ptr %27, align 4, !tbaa !18
  %29 = zext i32 %28 to i64
  %30 = tail call noundef nonnull align 16 dereferenceable(80) ptr @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %29)
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  %.sroa.08.0.copyload = load <4 x float>, ptr %31, align 16, !tbaa !19
  %.sroa.05.0.copyload = load double, ptr %1, align 16
  %.sroa.26.0.copyload = load double, ptr %.sroa.26.0..sroa_idx, align 8, !tbaa !19
  %.sroa.03.0.copyload = load double, ptr %15, align 16
  %.sroa.24.0.copyload = load double, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !19
  store <4 x float> %.sroa.08.0.copyload, ptr %5, align 16, !tbaa !19
  %32 = tail call noundef float @_ZN3JPH11RayTriangleENS_4Vec3ES0_S0_S0_S0_(double %.sroa.05.0.copyload, double %.sroa.26.0.copyload, double %.sroa.03.0.copyload, double %.sroa.24.0.copyload, double %.sroa.011.0.copyload, double %.sroa.412.0.copyload, double %.sroa.010.0.copyload, double %.sroa.4.0.copyload, ptr noundef nonnull byval(%"class.JPH::Vec3") align 16 %5)
  %33 = load float, ptr %16, align 4, !tbaa !20
  %34 = fcmp olt float %32, %33
  br i1 %34, label %35, label %44

35:                                               ; preds = %17
  store float %32, ptr %16, align 4, !tbaa !20
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH24SoftBodyMotionProperties8GetFacesEv(ptr noundef nonnull align 16 dereferenceable(372) %36)
  %38 = tail call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings4FaceENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %37)
  %39 = ptrtoint ptr %.03740 to i64
  %40 = ptrtoint ptr %38 to i64
  %41 = sub i64 %39, %40
  %42 = lshr exact i64 %41, 4
  %43 = trunc i64 %42 to i32
  br label %44

44:                                               ; preds = %35, %17
  %.1 = phi i32 [ %43, %35 ], [ %.03641, %17 ]
  %45 = getelementptr inbounds i8, ptr %.03740, i64 16
  %.not = icmp eq ptr %45, %14
  br i1 %.not, label %._crit_edge, label %17

46:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %47 = tail call i64 @_ZNK3JPH17SubShapeIDCreator6PushIDEjj(ptr noundef nonnull align 4 dereferenceable(8) %2, i32 noundef %.1, i32 noundef %7)
  store i64 %47, ptr %6, align 8
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %49 = getelementptr inbounds i8, ptr %3, i64 8
  %50 = load i32, ptr %48, align 4, !tbaa !18
  store i32 %50, ptr %49, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %4, %._crit_edge, %46
  %51 = phi i1 [ false, %._crit_edge ], [ true, %46 ], [ false, %4 ]
  ret i1 %51
}

; 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 #2 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 #3 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 #3 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 #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN3JPH11RayTriangleENS_4Vec3ES0_S0_S0_S0_(double, double, double, double, double, double, double, double, ptr noundef byval(%"class.JPH::Vec3") align 16) local_unnamed_addr #5

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass