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

; 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.3 }
%union.anon.3 = type { <4 x float> }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::TriangleShape" = type <{ %"class.JPH::ConvexShape.base", [4 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, [12 x i8] }>
%"class.JPH::ConvexShape.base" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::RefConst", float }>
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.4", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.4" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::RefConst" = type { ptr }

@.str.3 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

; 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) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK3JPH13TriangleShape18GetSupportFunctionENS_11ConvexShape12ESupportModeERNS1_13SupportBufferENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(112) %0, i32 noundef %1, ptr noundef nonnull align 16 dereferenceable(4160) %2, double %3, double %4) unnamed_addr #3 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  %23 = alloca %"struct.JPH::AssertLastParam", align 1
  %24 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  store double %3, ptr %24, align 16
  %25 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  store double %4, ptr %25, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  %26 = load ptr, ptr %8, align 8
  %27 = load i32, ptr %9, align 4, !tbaa !9
  switch i32 %27, label %135 [
    i32 1, label %28
    i32 2, label %28
    i32 0, label %85
  ]

28:                                               ; preds = %5, %5
  %29 = getelementptr inbounds %"class.JPH::TriangleShape", ptr %26, i32 0, i32 5
  %30 = load float, ptr %29, align 16, !tbaa !11
  %31 = fcmp ogt float %30, 0.000000e+00
  br i1 %31, label %32, label %84

32:                                               ; preds = %28
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.JPH::TriangleShape", ptr %26, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 %34, i64 16, i1 false), !tbaa.struct !25
  %35 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %36 = load double, ptr %35, align 16
  %37 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %38 = load double, ptr %37, align 8
  %39 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %36, double %38)
  %40 = getelementptr inbounds %"class.JPH::Vec3", ptr %11, i32 0, i32 0
  %41 = getelementptr inbounds %union.anon.3, ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds { double, double }, ptr %41, i32 0, i32 0
  %43 = extractvalue { double, double } %39, 0
  store double %43, ptr %42, align 16
  %44 = getelementptr inbounds { double, double }, ptr %41, i32 0, i32 1
  %45 = extractvalue { double, double } %39, 1
  store double %45, ptr %44, align 8
  %46 = getelementptr inbounds %"class.JPH::TriangleShape", ptr %26, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %46, i64 16, i1 false), !tbaa.struct !25
  %47 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %48 = load double, ptr %47, align 16
  %49 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %50 = load double, ptr %49, align 8
  %51 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %48, double %50)
  %52 = getelementptr inbounds %"class.JPH::Vec3", ptr %13, i32 0, i32 0
  %53 = getelementptr inbounds %union.anon.3, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds { double, double }, ptr %53, i32 0, i32 0
  %55 = extractvalue { double, double } %51, 0
  store double %55, ptr %54, align 16
  %56 = getelementptr inbounds { double, double }, ptr %53, i32 0, i32 1
  %57 = extractvalue { double, double } %51, 1
  store double %57, ptr %56, align 8
  %58 = getelementptr inbounds %"class.JPH::TriangleShape", ptr %26, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %58, i64 16, i1 false), !tbaa.struct !25
  %59 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %60 = load double, ptr %59, align 16
  %61 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %62 = load double, ptr %61, align 8
  %63 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %60, double %62)
  %64 = getelementptr inbounds %"class.JPH::Vec3", ptr %15, i32 0, i32 0
  %65 = getelementptr inbounds %union.anon.3, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 0
  %67 = extractvalue { double, double } %63, 0
  store double %67, ptr %66, align 16
  %68 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 1
  %69 = extractvalue { double, double } %63, 1
  store double %69, ptr %68, align 8
  %70 = getelementptr inbounds %"class.JPH::TriangleShape", ptr %26, i32 0, i32 5
  %71 = load float, ptr %70, align 16, !tbaa !11
  %72 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %73 = load double, ptr %72, align 16
  %74 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %75 = load double, ptr %74, align 8
  %76 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %77 = load double, ptr %76, align 16
  %78 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %79 = load double, ptr %78, align 8
  %80 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %81 = load double, ptr %80, align 16
  %82 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %83 = load double, ptr %82, align 8
  call void @_ZN3JPH13TriangleShape18TriangleWithConvexC2ENS_4Vec3ES2_S2_f(ptr noundef nonnull align 16 dereferenceable(64) %33, double %73, double %75, double %77, double %79, double %81, double %83, float noundef %71)
  store ptr %33, ptr %6, align 8
  br label %141

84:                                               ; preds = %28
  br label %85

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

135:                                              ; preds = %5
  br label %136

136:                                              ; preds = %135
  %137 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 158)
  br i1 %137, label %138, label %139

138:                                              ; preds = %136
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !27
  br label %139

139:                                              ; preds = %138, %136
  br label %140

140:                                              ; preds = %139
  store ptr null, ptr %6, align 8
  br label %141

141:                                              ; preds = %140, %85, %32
  %142 = load ptr, ptr %6, align 8
  ret ptr %142
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH13TriangleShape18TriangleWithConvexC2ENS_4Vec3ES2_S2_f(ptr noundef nonnull align 16 dereferenceable(64), double, double, double, double, double, double, float noundef) unnamed_addr #3 align 2

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { 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 = !{!"_ZTSN3JPH11ConvexShape12ESupportModeE", !7, i64 0}
!11 = !{!12, !23, i64 96}
!12 = !{!"_ZTSN3JPH13TriangleShapeE", !13, i64 0, !24, i64 48, !24, i64 64, !24, i64 80, !23, i64 96}
!13 = !{!"_ZTSN3JPH11ConvexShapeE", !14, i64 0, !22, i64 32, !23, i64 40}
!14 = !{!"_ZTSN3JPH5ShapeE", !15, i64 8, !19, i64 16, !20, i64 24, !21, i64 25}
!15 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !16, i64 0}
!16 = !{!"_ZTSSt6atomicIjE", !17, i64 0}
!17 = !{!"_ZTSSt13__atomic_baseIjE", !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!21 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!22 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !6, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!25 = !{i64 0, i64 16, !26}
!26 = !{!7, !7, i64 0}
!27 = !{i64 2158192110}


; 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.3 }
%union.anon.3 = type { <4 x float> }

@.str.3 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK3JPH13TriangleShape18GetSupportFunctionENS_11ConvexShape12ESupportModeERNS1_13SupportBufferENS_4Vec3E(ptr nocapture noundef nonnull readonly align 16 dereferenceable(112) %0, i32 noundef %1, ptr noundef nonnull align 16 dereferenceable(4160) %2, double %3, double %4) unnamed_addr #2 align 2 {
  %6 = alloca %"class.JPH::Vec3", align 16
  store double %3, ptr %6, align 16
  %7 = getelementptr inbounds i8, ptr %6, i64 8
  store double %4, ptr %7, align 8
  switch i32 %1, label %39 [
    i32 1, label %8
    i32 2, label %8
    i32 0, label %26
  ]

8:                                                ; preds = %5, %5
  %9 = getelementptr inbounds i8, ptr %0, i64 96
  %10 = load float, ptr %9, align 16, !tbaa !5
  %11 = fcmp ogt float %10, 0.000000e+00
  br i1 %11, label %12, label %26

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %.sroa.019.0.copyload = load double, ptr %13, align 16
  %.sroa.220.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 56
  %.sroa.220.0.copyload = load double, ptr %.sroa.220.0..sroa_idx, align 8, !tbaa !22
  %14 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.019.0.copyload, double %.sroa.220.0.copyload)
  %15 = extractvalue { double, double } %14, 0
  %16 = extractvalue { double, double } %14, 1
  %17 = getelementptr inbounds i8, ptr %0, i64 64
  %.sroa.015.0.copyload = load double, ptr %17, align 16
  %.sroa.216.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 72
  %.sroa.216.0.copyload = load double, ptr %.sroa.216.0..sroa_idx, align 8, !tbaa !22
  %18 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.015.0.copyload, double %.sroa.216.0.copyload)
  %19 = extractvalue { double, double } %18, 0
  %20 = extractvalue { double, double } %18, 1
  %21 = getelementptr inbounds i8, ptr %0, i64 80
  %.sroa.011.0.copyload = load double, ptr %21, align 16
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 88
  %.sroa.212.0.copyload = load double, ptr %.sroa.212.0..sroa_idx, align 8, !tbaa !22
  %22 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.011.0.copyload, double %.sroa.212.0.copyload)
  %23 = extractvalue { double, double } %22, 0
  %24 = extractvalue { double, double } %22, 1
  %25 = load float, ptr %9, align 16, !tbaa !5
  call void @_ZN3JPH13TriangleShape18TriangleWithConvexC2ENS_4Vec3ES2_S2_f(ptr noundef nonnull align 16 dereferenceable(64) %2, double %15, double %16, double %19, double %20, double %23, double %24, float noundef %25)
  br label %42

26:                                               ; preds = %8, %5
  %27 = getelementptr inbounds i8, ptr %0, i64 48
  %.sroa.07.0.copyload = load double, ptr %27, align 16
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 56
  %.sroa.28.0.copyload = load double, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !22
  %28 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.07.0.copyload, double %.sroa.28.0.copyload)
  %29 = extractvalue { double, double } %28, 0
  %30 = extractvalue { double, double } %28, 1
  %31 = getelementptr inbounds i8, ptr %0, i64 64
  %.sroa.03.0.copyload = load double, ptr %31, align 16
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 72
  %.sroa.24.0.copyload = load double, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !22
  %32 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.03.0.copyload, double %.sroa.24.0.copyload)
  %33 = extractvalue { double, double } %32, 0
  %34 = extractvalue { double, double } %32, 1
  %35 = getelementptr inbounds i8, ptr %0, i64 80
  %.sroa.0.0.copyload = load double, ptr %35, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 88
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !22
  %36 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %37 = extractvalue { double, double } %36, 0
  %38 = extractvalue { double, double } %36, 1
  call void @_ZN3JPH13TriangleShape16TriangleNoConvexC2ENS_4Vec3ES2_S2_(ptr noundef nonnull align 16 dereferenceable(64) %2, double %29, double %30, double %33, double %34, double %37, double %38)
  br label %42

39:                                               ; preds = %5
  %40 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 158)
  br i1 %40, label %41, label %42

41:                                               ; preds = %39
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !23
  br label %42

42:                                               ; preds = %41, %39, %26, %12
  %.0 = phi ptr [ %2, %26 ], [ %2, %12 ], [ null, %39 ], [ null, %41 ]
  ret ptr %.0
}

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

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

attributes #0 = { 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 #1 = { 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 #2 = { 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 = { 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, !20, i64 96}
!6 = !{!"_ZTSN3JPH13TriangleShapeE", !7, i64 0, !21, i64 48, !21, i64 64, !21, i64 80, !20, i64 96}
!7 = !{!"_ZTSN3JPH11ConvexShapeE", !8, i64 0, !18, i64 32, !20, i64 40}
!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 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !19, i64 0}
!19 = !{!"any pointer", !13, i64 0}
!20 = !{!"float", !13, i64 0}
!21 = !{!"_ZTSN3JPH4Vec3E", !13, i64 0}
!22 = !{!13, !13, i64 0}
!23 = !{i64 2158192110}


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