; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/Shape (CompoundShape)

; 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::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.8 }
%union.anon.8 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon.7 }
%union.anon.7 = type { <4 x float> }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::SubShapeIDCreator" = type { %"class.JPH::SubShapeID", i32 }
%"class.JPH::SubShapeID" = type { i32 }
%"struct.JPH::ShapeCast" = type { %"struct.JPH::ShapeCastT" }
%"struct.JPH::ShapeCastT" = type { ptr, %"class.JPH::Vec3", %"class.JPH::Mat44", %"class.JPH::Vec3", %"class.JPH::AABox" }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::CompoundShape" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::Vec3", %"class.JPH::AABox", %"class.JPH::Array.11", float, [4 x i8] }>
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.10", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.10" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Array.11" = type { i64, i64, ptr }
%"struct.JPH::CompoundShape::SubShape" = type <{ %"class.JPH::RefConst.9", %"class.JPH::Float3", %"class.JPH::Float3", i32, i8, [3 x i8] }>
%"class.JPH::RefConst.9" = type { ptr }
%"class.JPH::Float3" = type { float, float, float }

@.str.2 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [99 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: 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) #1

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64)) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH13CompoundShape8SubShape24GetLocalTransformNoScaleENS_4Vec3E(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 8 dereferenceable(37), double, double) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH13CompoundShape8SubShape14TransformScaleENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(37), double, double) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH13CompoundShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 16 dereferenceable(108)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(37) ptr @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13CompoundShape20sCastCompoundVsShapeERKNS_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 8 dereferenceable(24) %9) #6 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 i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  %27 = alloca %"class.JPH::SubShapeIDCreator", align 4
  %28 = alloca %"class.JPH::Mat44", align 16
  %29 = alloca %"class.JPH::Mat44", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = alloca %"class.JPH::Vec3", align 16
  %32 = alloca %"class.JPH::Vec3", align 16
  %33 = alloca %"struct.JPH::ShapeCast", align 16
  %34 = alloca %"class.JPH::Vec3", align 16
  %35 = alloca %"class.JPH::Vec3", align 16
  %36 = alloca %"class.JPH::Vec3", align 16
  %37 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  store double %3, ptr %37, align 16
  %38 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  store double %4, ptr %38, 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 %39

39:                                               ; preds = %10
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.JPH::ShapeCastT", ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 16, !tbaa !9
  %43 = call noundef zeroext i8 @_ZNK3JPH5Shape7GetTypeEv(ptr noundef nonnull align 8 dereferenceable(26) %42)
  %44 = icmp eq i8 %43, 1
  br i1 %44, label %48, label %45

45:                                               ; preds = %39
  %46 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 290)
  br i1 %46, label %47, label %48

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

48:                                               ; preds = %47, %45, %39
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.JPH::ShapeCastT", ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 16, !tbaa !9
  store ptr %52, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %53 = load ptr, ptr %21, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.JPH::CompoundShape", ptr %53, i32 0, i32 4
  %55 = call noundef i64 @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54)
  %56 = trunc i64 %55 to i32
  store i32 %56, ptr %22, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %57 = load ptr, ptr %21, align 8, !tbaa !5
  %58 = call noundef i32 @_ZNK3JPH13CompoundShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 16 dereferenceable(108) %57)
  store i32 %58, ptr %23, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !15
  br label %59

59:                                               ; preds = %127, %49
  %60 = load i32, ptr %24, align 4, !tbaa !15
  %61 = load i32, ptr %22, align 4, !tbaa !15
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 4, ptr %25, align 4
  br label %130

64:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %65 = load ptr, ptr %21, align 8, !tbaa !5
  %66 = getelementptr inbounds %"class.JPH::CompoundShape", ptr %65, i32 0, i32 4
  %67 = load i32, ptr %24, align 4, !tbaa !15
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(37) ptr @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %68)
  store ptr %69, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %70 = load ptr, ptr %17, align 8, !tbaa !5
  %71 = load i32, ptr %24, align 4, !tbaa !15
  %72 = load i32, ptr %23, align 4, !tbaa !15
  %73 = call i64 @_ZNK3JPH17SubShapeIDCreator6PushIDEjj(ptr noundef nonnull align 4 dereferenceable(8) %70, i32 noundef %71, i32 noundef %72)
  store i64 %73, ptr %27, align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr %28) #7
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.JPH::ShapeCastT", ptr %74, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 64, ptr %29) #7
  %76 = load ptr, ptr %26, align 8, !tbaa !5
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.JPH::ShapeCastT", ptr %77, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %30, ptr align 16 %78, i64 16, i1 false), !tbaa.struct !17
  %79 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %80 = load double, ptr %79, align 16
  %81 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %82 = load double, ptr %81, align 8
  call void @_ZNK3JPH13CompoundShape8SubShape24GetLocalTransformNoScaleENS_4Vec3E(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %29, ptr noundef nonnull align 8 dereferenceable(37) %76, double %80, double %82)
  call void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %28, ptr noundef nonnull align 16 dereferenceable(64) %75, ptr noundef nonnull align 16 dereferenceable(64) %29)
  call void @llvm.lifetime.end.p0(i64 64, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #7
  %83 = load ptr, ptr %26, align 8, !tbaa !5
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.JPH::ShapeCastT", ptr %84, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %32, ptr align 16 %85, i64 16, i1 false), !tbaa.struct !17
  %86 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 0
  %87 = load double, ptr %86, align 16
  %88 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 1
  %89 = load double, ptr %88, align 8
  %90 = call { double, double } @_ZNK3JPH13CompoundShape8SubShape14TransformScaleENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(37) %83, double %87, double %89)
  %91 = getelementptr inbounds %"class.JPH::Vec3", ptr %31, i32 0, i32 0
  %92 = getelementptr inbounds %union.anon.7, 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
  call void @llvm.lifetime.start.p0(i64 144, ptr %33) #7
  %97 = load ptr, ptr %26, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.JPH::CompoundShape::SubShape", ptr %97, i32 0, i32 0
  %99 = call noundef ptr @_ZNK3JPH8RefConstINS_5ShapeEEcvPKS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %98)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %34, ptr align 16 %31, i64 16, i1 false), !tbaa.struct !17
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.JPH::ShapeCastT", ptr %100, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %35, ptr align 16 %101, i64 16, i1 false), !tbaa.struct !17
  %102 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 0
  %103 = load double, ptr %102, align 16
  %104 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 1
  %105 = load double, ptr %104, align 8
  %106 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 0
  %107 = load double, ptr %106, align 16
  %108 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 1
  %109 = load double, ptr %108, align 8
  call void @_ZN3JPH9ShapeCastCI2NS_10ShapeCastTINS_4Vec3ENS_5Mat44ES0_EEEPKNS_5ShapeES2_RKS3_S2_(ptr noundef nonnull align 16 dereferenceable(144) %33, ptr noundef %99, double %103, double %105, ptr noundef nonnull align 16 dereferenceable(64) %28, double %107, double %109)
  %110 = load ptr, ptr %13, align 8, !tbaa !5
  %111 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %36, ptr align 16 %11, i64 16, i1 false), !tbaa.struct !17
  %112 = load ptr, ptr %15, align 8, !tbaa !5
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  %114 = load ptr, ptr %18, align 8, !tbaa !5
  %115 = load ptr, ptr %19, align 8, !tbaa !5
  %116 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 0
  %117 = load double, ptr %116, align 16
  %118 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 1
  %119 = load double, ptr %118, align 8
  call void @_ZN3JPH17CollisionDispatch27sCastShapeVsShapeLocalSpaceERKNS_9ShapeCastERKNS_17ShapeCastSettingsEPKNS_5ShapeENS_4Vec3ERKNS_11ShapeFilterERKNS_5Mat44ERKNS_17SubShapeIDCreatorESJ_RNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(144) %33, ptr noundef nonnull align 16 dereferenceable(36) %110, ptr noundef %111, double %117, double %119, ptr noundef nonnull align 8 dereferenceable(12) %112, ptr noundef nonnull align 16 dereferenceable(64) %113, ptr noundef nonnull align 4 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(8) %114, ptr noundef nonnull align 8 dereferenceable(24) %115)
  %120 = load ptr, ptr %19, align 8, !tbaa !5
  %121 = call noundef zeroext i1 @_ZNK3JPH18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEE14ShouldEarlyOutEv(ptr noundef nonnull align 8 dereferenceable(24) %120)
  br i1 %121, label %122, label %123

122:                                              ; preds = %64
  store i32 4, ptr %25, align 4
  br label %124

123:                                              ; preds = %64
  store i32 0, ptr %25, align 4
  br label %124

124:                                              ; preds = %123, %122
  call void @llvm.lifetime.end.p0(i64 144, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  %125 = load i32, ptr %25, align 4
  switch i32 %125, label %130 [
    i32 0, label %126
  ]

126:                                              ; preds = %124
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %24, align 4, !tbaa !15
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %24, align 4, !tbaa !15
  br label %59, !llvm.loop !19

130:                                              ; preds = %124, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %131

131:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH9ShapeCastCI2NS_10ShapeCastTINS_4Vec3ENS_5Mat44ES0_EEEPKNS_5ShapeES2_RKS3_S2_(ptr noundef nonnull align 16 dereferenceable(144), ptr noundef, double, double, ptr noundef nonnull align 16 dereferenceable(64), double, double) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH17CollisionDispatch27sCastShapeVsShapeLocalSpaceERKNS_9ShapeCastERKNS_17ShapeCastSettingsEPKNS_5ShapeENS_4Vec3ERKNS_11ShapeFilterERKNS_5Mat44ERKNS_17SubShapeIDCreatorESJ_RNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(144), ptr noundef nonnull align 16 dereferenceable(36), ptr noundef, double, double, ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #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 = { 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, !6, i64 0}
!10 = !{!"_ZTSN3JPH10ShapeCastTINS_4Vec3ENS_5Mat44ENS_9ShapeCastEEE", !6, i64 0, !11, i64 16, !12, i64 32, !11, i64 96, !13, i64 112}
!11 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!12 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!13 = !{!"_ZTSN3JPH5AABoxE", !11, i64 0, !11, i64 16}
!14 = !{i64 2158061229}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{i64 0, i64 16, !18}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; 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::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.8 }
%union.anon.8 = type { <4 x float> }
%"class.JPH::SubShapeIDCreator" = type { %"class.JPH::SubShapeID", i32 }
%"class.JPH::SubShapeID" = type { i32 }
%"struct.JPH::ShapeCast" = type { %"struct.JPH::ShapeCastT" }
%"struct.JPH::ShapeCastT" = type { ptr, %"class.JPH::Vec3", %"class.JPH::Mat44", %"class.JPH::Vec3", %"class.JPH::AABox" }
%"class.JPH::Vec3" = type { %union.anon.7 }
%union.anon.7 = type { <4 x float> }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }

@.str.2 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [99 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH13CompoundShape8SubShape24GetLocalTransformNoScaleENS_4Vec3E(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 8 dereferenceable(37), double, double) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH13CompoundShape8SubShape14TransformScaleENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(37), double, double) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH13CompoundShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 16 dereferenceable(108)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13CompoundShape20sCastCompoundVsShapeERKNS_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 8 dereferenceable(24) %9) local_unnamed_addr #5 align 2 {
  %11 = alloca %"class.JPH::SubShapeIDCreator", align 8
  %12 = alloca %"class.JPH::Mat44", align 16
  %13 = alloca %"class.JPH::Mat44", align 16
  %14 = alloca %"struct.JPH::ShapeCast", align 16
  %15 = load ptr, ptr %0, align 16, !tbaa !5
  %16 = tail call noundef zeroext i8 @_ZNK3JPH5Shape7GetTypeEv(ptr noundef nonnull align 8 dereferenceable(26) %15)
  %17 = icmp eq i8 %16, 1
  br i1 %17, label %21, label %18

18:                                               ; preds = %10
  %19 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 290)
  br i1 %19, label %20, label %21

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

21:                                               ; preds = %10, %18, %20
  %22 = load ptr, ptr %0, align 16, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 80
  %24 = tail call noundef i64 @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %25 = trunc i64 %24 to i32
  %26 = tail call noundef i32 @_ZNK3JPH13CompoundShape17GetSubShapeIDBitsEv(ptr noundef nonnull align 16 dereferenceable(108) %22)
  %27 = icmp sgt i32 %25, 0
  br i1 %27, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %21
  %28 = getelementptr inbounds i8, ptr %0, i64 32
  %29 = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 24
  %30 = getelementptr inbounds i8, ptr %0, i64 96
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 104
  %wide.trip.count = and i64 %24, 2147483647
  br label %31

31:                                               ; preds = %31, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %31 ]
  %32 = call noundef nonnull align 8 dereferenceable(37) ptr @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %indvars.iv)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %33 = trunc nuw nsw i64 %indvars.iv to i32
  %34 = call i64 @_ZNK3JPH17SubShapeIDCreator6PushIDEjj(ptr noundef nonnull align 4 dereferenceable(8) %7, i32 noundef %33, i32 noundef %26)
  store i64 %34, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %13) #6
  %.sroa.08.0.copyload = load double, ptr %29, align 16
  %.sroa.29.0.copyload = load double, ptr %.sroa.29.0..sroa_idx, align 8, !tbaa !14
  call void @_ZNK3JPH13CompoundShape8SubShape24GetLocalTransformNoScaleENS_4Vec3E(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %13, ptr noundef nonnull align 8 dereferenceable(37) %32, double %.sroa.08.0.copyload, double %.sroa.29.0.copyload)
  call void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %12, ptr noundef nonnull align 16 dereferenceable(64) %28, ptr noundef nonnull align 16 dereferenceable(64) %13)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #6
  %.sroa.05.0.copyload = load double, ptr %29, align 16
  %.sroa.26.0.copyload = load double, ptr %.sroa.29.0..sroa_idx, align 8, !tbaa !14
  %35 = call { double, double } @_ZNK3JPH13CompoundShape8SubShape14TransformScaleENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(37) %32, double %.sroa.05.0.copyload, double %.sroa.26.0.copyload)
  %36 = extractvalue { double, double } %35, 0
  %37 = extractvalue { double, double } %35, 1
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %14) #6
  %38 = call noundef ptr @_ZNK3JPH8RefConstINS_5ShapeEEcvPKS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %32)
  %.sroa.01.0.copyload = load double, ptr %30, align 16
  %.sroa.22.0.copyload = load double, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !14
  call void @_ZN3JPH9ShapeCastCI2NS_10ShapeCastTINS_4Vec3ENS_5Mat44ES0_EEEPKNS_5ShapeES2_RKS3_S2_(ptr noundef nonnull align 16 dereferenceable(144) %14, ptr noundef %38, double %36, double %37, ptr noundef nonnull align 16 dereferenceable(64) %12, double %.sroa.01.0.copyload, double %.sroa.22.0.copyload)
  call void @_ZN3JPH17CollisionDispatch27sCastShapeVsShapeLocalSpaceERKNS_9ShapeCastERKNS_17ShapeCastSettingsEPKNS_5ShapeENS_4Vec3ERKNS_11ShapeFilterERKNS_5Mat44ERKNS_17SubShapeIDCreatorESJ_RNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(144) %14, 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) %11, ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %39 = call noundef zeroext i1 @_ZNK3JPH18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEE14ShouldEarlyOutEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  %or.cond = select i1 %39, i1 true, i1 %exitcond.not
  br i1 %or.cond, label %._crit_edge, label %31, !llvm.loop !15

._crit_edge:                                      ; preds = %31, %21
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3JPH5Shape7GetTypeEv(ptr noundef nonnull align 8 dereferenceable(26)) 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 #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH9ShapeCastCI2NS_10ShapeCastTINS_4Vec3ENS_5Mat44ES0_EEEPKNS_5ShapeES2_RKS3_S2_(ptr noundef nonnull align 16 dereferenceable(144), ptr noundef, double, double, ptr noundef nonnull align 16 dereferenceable(64), double, double) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH17CollisionDispatch27sCastShapeVsShapeLocalSpaceERKNS_9ShapeCastERKNS_17ShapeCastSettingsEPKNS_5ShapeENS_4Vec3ERKNS_11ShapeFilterERKNS_5Mat44ERKNS_17SubShapeIDCreatorESJ_RNS_18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEEE(ptr noundef nonnull align 16 dereferenceable(144), ptr noundef nonnull align 16 dereferenceable(36), ptr noundef, double, double, ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH18CollisionCollectorINS_15ShapeCastResultENS_33CollisionCollectorTraitsCastShapeEE14ShouldEarlyOutEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 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 = { 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 #3 = { 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 #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 = { 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, !7, i64 0}
!6 = !{!"_ZTSN3JPH10ShapeCastTINS_4Vec3ENS_5Mat44ENS_9ShapeCastEEE", !7, i64 0, !10, i64 16, !11, i64 32, !10, i64 96, !12, i64 112}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN3JPH4Vec3E", !8, i64 0}
!11 = !{!"_ZTSN3JPH5Mat44E", !8, i64 0}
!12 = !{!"_ZTSN3JPH5AABoxE", !10, i64 0, !10, i64 16}
!13 = !{i64 2158061229}
!14 = !{!8, !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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