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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH8RefConstINS_5ShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #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: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Quat10ConjugatedEv(ptr noundef nonnull align 16 dereferenceable(16)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH12ScaleHelpers14IsUniformScaleENS_4Vec3E(double, double) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH12ScaleHelpers17CanScaleBeRotatedENS_4QuatENS_4Vec3E(double, double, double, double) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH12ScaleHelpers11RotateScaleENS_4QuatENS_4Vec3E(double, double, double, double) #4

; Function Attrs: mustprogress uwtable
define dso_local { double, double } @_ZNK3JPH22RotatedTranslatedShape14MakeScaleValidENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(80) %0, double %1, double %2) unnamed_addr #5 align 2 {
  %4 = alloca %"class.JPH::Vec3", align 16
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca ptr, align 8
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca i32, align 4
  %12 = alloca %"class.JPH::Quat", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Quat", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Quat", 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 %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Quat", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = getelementptr inbounds { double, double }, ptr %5, i32 0, i32 0
  store double %1, ptr %27, align 16
  %28 = getelementptr inbounds { double, double }, ptr %5, i32 0, i32 1
  store double %2, ptr %28, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 %5, i64 16, i1 false), !tbaa.struct !9
  %30 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %31 = load double, ptr %30, align 16
  %32 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %33 = load double, ptr %32, align 8
  %34 = call { double, double } @_ZN3JPH12ScaleHelpers16MakeNonZeroScaleENS_4Vec3E(double %31, double %33)
  %35 = getelementptr inbounds %"class.JPH::Vec3", ptr %7, i32 0, i32 0
  %36 = getelementptr inbounds %union.anon.4, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 0
  %38 = extractvalue { double, double } %34, 0
  store double %38, ptr %37, align 16
  %39 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 1
  %40 = extractvalue { double, double } %34, 1
  store double %40, ptr %39, align 8
  %41 = getelementptr inbounds %"class.JPH::RotatedTranslatedShape", ptr %29, i32 0, i32 1
  %42 = load i8, ptr %41, align 8, !tbaa !11, !range !27, !noundef !28
  %43 = trunc i8 %42 to i1
  br i1 %43, label %50, label %44

44:                                               ; preds = %3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %7, i64 16, i1 false), !tbaa.struct !9
  %45 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  %46 = load double, ptr %45, align 16
  %47 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  %48 = load double, ptr %47, align 8
  %49 = call noundef zeroext i1 @_ZN3JPH12ScaleHelpers14IsUniformScaleENS_4Vec3E(double %46, double %48)
  br i1 %49, label %50, label %67

50:                                               ; preds = %44, %3
  %51 = getelementptr inbounds %"class.JPH::DecoratedShape", ptr %29, i32 0, i32 1
  %52 = call noundef ptr @_ZNK3JPH8RefConstINS_5ShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %51)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %7, i64 16, i1 false), !tbaa.struct !9
  %53 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %54 = load double, ptr %53, align 16
  %55 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %56 = load double, ptr %55, align 8
  %57 = load ptr, ptr %52, align 8, !tbaa !29
  %58 = getelementptr inbounds ptr, ptr %57, i64 33
  %59 = load ptr, ptr %58, align 8
  %60 = call { double, double } %59(ptr noundef nonnull align 8 dereferenceable(26) %52, double %54, double %56)
  %61 = getelementptr inbounds %"class.JPH::Vec3", ptr %4, i32 0, i32 0
  %62 = getelementptr inbounds %union.anon.4, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds { double, double }, ptr %62, i32 0, i32 0
  %64 = extractvalue { double, double } %60, 0
  store double %64, ptr %63, align 16
  %65 = getelementptr inbounds { double, double }, ptr %62, i32 0, i32 1
  %66 = extractvalue { double, double } %60, 1
  store double %66, ptr %65, align 8
  store i32 1, ptr %11, align 4
  br label %198

67:                                               ; preds = %44
  %68 = getelementptr inbounds %"class.JPH::RotatedTranslatedShape", ptr %29, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 %68, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %7, i64 16, i1 false), !tbaa.struct !9
  %69 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %70 = load double, ptr %69, align 16
  %71 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %72 = load double, ptr %71, align 8
  %73 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %74 = load double, ptr %73, align 16
  %75 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %76 = load double, ptr %75, align 8
  %77 = call noundef zeroext i1 @_ZN3JPH12ScaleHelpers17CanScaleBeRotatedENS_4QuatENS_4Vec3E(double %70, double %72, double %74, double %76)
  br i1 %77, label %78, label %135

78:                                               ; preds = %67
  %79 = getelementptr inbounds %"class.JPH::RotatedTranslatedShape", ptr %29, i32 0, i32 3
  %80 = call { double, double } @_ZNK3JPH4Quat10ConjugatedEv(ptr noundef nonnull align 16 dereferenceable(16) %79)
  %81 = getelementptr inbounds %"class.JPH::Quat", ptr %14, i32 0, i32 0
  %82 = getelementptr inbounds %"class.JPH::Vec4", ptr %81, i32 0, i32 0
  %83 = getelementptr inbounds %union.anon.5, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds { double, double }, ptr %83, i32 0, i32 0
  %85 = extractvalue { double, double } %80, 0
  store double %85, ptr %84, align 16
  %86 = getelementptr inbounds { double, double }, ptr %83, i32 0, i32 1
  %87 = extractvalue { double, double } %80, 1
  store double %87, ptr %86, align 8
  %88 = getelementptr inbounds %"class.JPH::DecoratedShape", ptr %29, i32 0, i32 1
  %89 = call noundef ptr @_ZNK3JPH8RefConstINS_5ShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %88)
  %90 = getelementptr inbounds %"class.JPH::RotatedTranslatedShape", ptr %29, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 %90, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %7, i64 16, i1 false), !tbaa.struct !9
  %91 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %92 = load double, ptr %91, align 16
  %93 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %94 = load double, ptr %93, align 8
  %95 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %96 = load double, ptr %95, align 16
  %97 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %98 = load double, ptr %97, align 8
  %99 = call { double, double } @_ZN3JPH12ScaleHelpers11RotateScaleENS_4QuatENS_4Vec3E(double %92, double %94, double %96, double %98)
  %100 = getelementptr inbounds %"class.JPH::Vec3", ptr %16, i32 0, i32 0
  %101 = getelementptr inbounds %union.anon.4, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds { double, double }, ptr %101, i32 0, i32 0
  %103 = extractvalue { double, double } %99, 0
  store double %103, ptr %102, align 16
  %104 = getelementptr inbounds { double, double }, ptr %101, i32 0, i32 1
  %105 = extractvalue { double, double } %99, 1
  store double %105, ptr %104, align 8
  %106 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %107 = load double, ptr %106, align 16
  %108 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %109 = load double, ptr %108, align 8
  %110 = load ptr, ptr %89, align 8, !tbaa !29
  %111 = getelementptr inbounds ptr, ptr %110, i64 33
  %112 = load ptr, ptr %111, align 8
  %113 = call { double, double } %112(ptr noundef nonnull align 8 dereferenceable(26) %89, double %107, double %109)
  %114 = getelementptr inbounds %"class.JPH::Vec3", ptr %15, i32 0, i32 0
  %115 = getelementptr inbounds %union.anon.4, ptr %114, i32 0, i32 0
  %116 = getelementptr inbounds { double, double }, ptr %115, i32 0, i32 0
  %117 = extractvalue { double, double } %113, 0
  store double %117, ptr %116, align 16
  %118 = getelementptr inbounds { double, double }, ptr %115, i32 0, i32 1
  %119 = extractvalue { double, double } %113, 1
  store double %119, ptr %118, align 8
  %120 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %121 = load double, ptr %120, align 16
  %122 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %123 = load double, ptr %122, align 8
  %124 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %125 = load double, ptr %124, align 16
  %126 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %127 = load double, ptr %126, align 8
  %128 = call { double, double } @_ZN3JPH12ScaleHelpers11RotateScaleENS_4QuatENS_4Vec3E(double %121, double %123, double %125, double %127)
  %129 = getelementptr inbounds %"class.JPH::Vec3", ptr %4, i32 0, i32 0
  %130 = getelementptr inbounds %union.anon.4, ptr %129, i32 0, i32 0
  %131 = getelementptr inbounds { double, double }, ptr %130, i32 0, i32 0
  %132 = extractvalue { double, double } %128, 0
  store double %132, ptr %131, align 16
  %133 = getelementptr inbounds { double, double }, ptr %130, i32 0, i32 1
  %134 = extractvalue { double, double } %128, 1
  store double %134, ptr %133, align 8
  store i32 1, ptr %11, align 4
  br label %198

135:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #9
  %136 = call { double, double } @_ZNK3JPH4Vec33AbsEv(ptr noundef nonnull align 16 dereferenceable(16) %7)
  %137 = getelementptr inbounds %"class.JPH::Vec3", ptr %20, i32 0, i32 0
  %138 = getelementptr inbounds %union.anon.4, ptr %137, i32 0, i32 0
  %139 = getelementptr inbounds { double, double }, ptr %138, i32 0, i32 0
  %140 = extractvalue { double, double } %136, 0
  store double %140, ptr %139, align 16
  %141 = getelementptr inbounds { double, double }, ptr %138, i32 0, i32 1
  %142 = extractvalue { double, double } %136, 1
  store double %142, ptr %141, align 8
  %143 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %144 = load double, ptr %143, align 16
  %145 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %146 = load double, ptr %145, align 8
  %147 = call { double, double } @_ZN3JPH12ScaleHelpers16MakeUniformScaleENS_4Vec3E(double %144, double %146)
  %148 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %149 = getelementptr inbounds %union.anon.4, ptr %148, i32 0, i32 0
  %150 = getelementptr inbounds { double, double }, ptr %149, i32 0, i32 0
  %151 = extractvalue { double, double } %147, 0
  store double %151, ptr %150, align 16
  %152 = getelementptr inbounds { double, double }, ptr %149, i32 0, i32 1
  %153 = extractvalue { double, double } %147, 1
  store double %153, ptr %152, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #9
  %154 = call { double, double } @_ZNK3JPH4Vec37GetSignEv(ptr noundef nonnull align 16 dereferenceable(16) %7)
  %155 = getelementptr inbounds %"class.JPH::Vec3", ptr %22, i32 0, i32 0
  %156 = getelementptr inbounds %union.anon.4, ptr %155, i32 0, i32 0
  %157 = getelementptr inbounds { double, double }, ptr %156, i32 0, i32 0
  %158 = extractvalue { double, double } %154, 0
  store double %158, ptr %157, align 16
  %159 = getelementptr inbounds { double, double }, ptr %156, i32 0, i32 1
  %160 = extractvalue { double, double } %154, 1
  store double %160, ptr %159, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %19, i64 16, i1 false), !tbaa.struct !9
  %161 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %162 = load double, ptr %161, align 16
  %163 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %164 = load double, ptr %163, align 8
  %165 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %22, double %162, double %164)
  %166 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %167 = getelementptr inbounds %union.anon.4, ptr %166, i32 0, i32 0
  %168 = getelementptr inbounds { double, double }, ptr %167, i32 0, i32 0
  %169 = extractvalue { double, double } %165, 0
  store double %169, ptr %168, align 16
  %170 = getelementptr inbounds { double, double }, ptr %167, i32 0, i32 1
  %171 = extractvalue { double, double } %165, 1
  store double %171, ptr %170, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #9
  %172 = getelementptr inbounds %"class.JPH::RotatedTranslatedShape", ptr %29, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %172, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %25, ptr align 16 %21, i64 16, i1 false), !tbaa.struct !9
  %173 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %174 = load double, ptr %173, align 16
  %175 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %176 = load double, ptr %175, align 8
  %177 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %178 = load double, ptr %177, align 16
  %179 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %180 = load double, ptr %179, align 8
  %181 = call noundef zeroext i1 @_ZN3JPH12ScaleHelpers17CanScaleBeRotatedENS_4QuatENS_4Vec3E(double %174, double %176, double %178, double %180)
  br i1 %181, label %182, label %183

182:                                              ; preds = %135
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 %21, i64 16, i1 false), !tbaa.struct !9
  store i32 1, ptr %11, align 4
  br label %197

183:                                              ; preds = %135
  %184 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %7)
  %185 = call noundef float @_ZN3JPH4SignIfEET_S1_(float noundef %184)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 %19, i64 16, i1 false), !tbaa.struct !9
  %186 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %187 = load double, ptr %186, align 16
  %188 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %189 = load double, ptr %188, align 8
  %190 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %185, double %187, double %189)
  %191 = getelementptr inbounds %"class.JPH::Vec3", ptr %4, i32 0, i32 0
  %192 = getelementptr inbounds %union.anon.4, ptr %191, i32 0, i32 0
  %193 = getelementptr inbounds { double, double }, ptr %192, i32 0, i32 0
  %194 = extractvalue { double, double } %190, 0
  store double %194, ptr %193, align 16
  %195 = getelementptr inbounds { double, double }, ptr %192, i32 0, i32 1
  %196 = extractvalue { double, double } %190, 1
  store double %196, ptr %195, align 8
  store i32 1, ptr %11, align 4
  br label %197

197:                                              ; preds = %183, %182
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #9
  br label %198

198:                                              ; preds = %197, %78, %50
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #9
  %199 = getelementptr inbounds %"class.JPH::Vec3", ptr %4, i32 0, i32 0
  %200 = getelementptr inbounds %union.anon.4, ptr %199, i32 0, i32 0
  %201 = load { double, double }, ptr %200, align 16
  ret { double, double } %201
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH12ScaleHelpers16MakeNonZeroScaleENS_4Vec3E(double, double) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH12ScaleHelpers16MakeUniformScaleENS_4Vec3E(double, double) #4

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH4SignIfEET_S1_(float noundef) #7

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { alwaysinline mustprogress 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 #8 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { 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 0, i64 16, !10}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !23, i64 40}
!12 = !{!"_ZTSN3JPH22RotatedTranslatedShapeE", !13, i64 0, !23, i64 40, !24, i64 48, !25, i64 64}
!13 = !{!"_ZTSN3JPH14DecoratedShapeE", !14, i64 0, !22, i64 32}
!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_5ShapeEEE", !6, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!25 = !{!"_ZTSN3JPH4QuatE", !26, i64 0}
!26 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !8, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::Vec3" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH12ScaleHelpers14IsUniformScaleENS_4Vec3E(double, double) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH12ScaleHelpers17CanScaleBeRotatedENS_4QuatENS_4Vec3E(double, double, double, double) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH12ScaleHelpers11RotateScaleENS_4QuatENS_4Vec3E(double, double, double, double) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local { double, double } @_ZNK3JPH22RotatedTranslatedShape14MakeScaleValidENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(80) %0, double %1, double %2) unnamed_addr #4 align 2 {
  %4 = alloca %"class.JPH::Vec3", align 16
  %5 = alloca %"class.JPH::Vec3", align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  %6 = tail call { double, double } @_ZN3JPH12ScaleHelpers16MakeNonZeroScaleENS_4Vec3E(double %1, double %2)
  %7 = extractvalue { double, double } %6, 0
  store double %7, ptr %4, align 16
  %8 = getelementptr inbounds i8, ptr %4, i64 8
  %9 = extractvalue { double, double } %6, 1
  store double %9, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = load i8, ptr %10, align 8, !tbaa !5, !range !24, !noundef !25
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %15, label %13

13:                                               ; preds = %3
  %14 = tail call noundef zeroext i1 @_ZN3JPH12ScaleHelpers14IsUniformScaleENS_4Vec3E(double %7, double %9)
  br i1 %14, label %15, label %22

15:                                               ; preds = %13, %3
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = tail call noundef ptr @_ZNK3JPH8RefConstINS_5ShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %18 = load ptr, ptr %17, align 8, !tbaa !26
  %19 = getelementptr inbounds i8, ptr %18, i64 264
  %20 = load ptr, ptr %19, align 8
  %21 = tail call { double, double } %20(ptr noundef nonnull align 8 dereferenceable(26) %17, double %7, double %9)
  br label %60

22:                                               ; preds = %13
  %23 = getelementptr inbounds i8, ptr %0, i64 64
  %.sroa.024.0.copyload = load double, ptr %23, align 16
  %.sroa.225.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 72
  %.sroa.225.0.copyload = load double, ptr %.sroa.225.0..sroa_idx, align 8, !tbaa !28
  %24 = tail call noundef zeroext i1 @_ZN3JPH12ScaleHelpers17CanScaleBeRotatedENS_4QuatENS_4Vec3E(double %.sroa.024.0.copyload, double %.sroa.225.0.copyload, double %7, double %9)
  br i1 %24, label %25, label %41

25:                                               ; preds = %22
  %26 = tail call { double, double } @_ZNK3JPH4Quat10ConjugatedEv(ptr noundef nonnull align 16 dereferenceable(16) %23)
  %27 = extractvalue { double, double } %26, 0
  %28 = extractvalue { double, double } %26, 1
  %29 = getelementptr inbounds i8, ptr %0, i64 32
  %30 = tail call noundef ptr @_ZNK3JPH8RefConstINS_5ShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %29)
  %.sroa.014.0.copyload = load double, ptr %23, align 16
  %.sroa.215.0.copyload = load double, ptr %.sroa.225.0..sroa_idx, align 8, !tbaa !28
  %31 = tail call { double, double } @_ZN3JPH12ScaleHelpers11RotateScaleENS_4QuatENS_4Vec3E(double %.sroa.014.0.copyload, double %.sroa.215.0.copyload, double %7, double %9)
  %32 = extractvalue { double, double } %31, 0
  %33 = extractvalue { double, double } %31, 1
  %34 = load ptr, ptr %30, align 8, !tbaa !26
  %35 = getelementptr inbounds i8, ptr %34, i64 264
  %36 = load ptr, ptr %35, align 8
  %37 = tail call { double, double } %36(ptr noundef nonnull align 8 dereferenceable(26) %30, double %32, double %33)
  %38 = extractvalue { double, double } %37, 0
  %39 = extractvalue { double, double } %37, 1
  %40 = tail call { double, double } @_ZN3JPH12ScaleHelpers11RotateScaleENS_4QuatENS_4Vec3E(double %27, double %28, double %38, double %39)
  br label %60

41:                                               ; preds = %22
  %42 = call { double, double } @_ZNK3JPH4Vec33AbsEv(ptr noundef nonnull align 16 dereferenceable(16) %4)
  %43 = extractvalue { double, double } %42, 0
  %44 = extractvalue { double, double } %42, 1
  %45 = call { double, double } @_ZN3JPH12ScaleHelpers16MakeUniformScaleENS_4Vec3E(double %43, double %44)
  %46 = extractvalue { double, double } %45, 0
  %47 = extractvalue { double, double } %45, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %48 = call { double, double } @_ZNK3JPH4Vec37GetSignEv(ptr noundef nonnull align 16 dereferenceable(16) %4)
  %49 = extractvalue { double, double } %48, 0
  store double %49, ptr %5, align 16
  %50 = getelementptr inbounds i8, ptr %5, i64 8
  %51 = extractvalue { double, double } %48, 1
  store double %51, ptr %50, align 8
  %52 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %5, double %46, double %47)
  %53 = extractvalue { double, double } %52, 0
  %54 = extractvalue { double, double } %52, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  %.sroa.03.0.copyload = load double, ptr %23, align 16
  %.sroa.24.0.copyload = load double, ptr %.sroa.225.0..sroa_idx, align 8, !tbaa !28
  %55 = call noundef zeroext i1 @_ZN3JPH12ScaleHelpers17CanScaleBeRotatedENS_4QuatENS_4Vec3E(double %.sroa.03.0.copyload, double %.sroa.24.0.copyload, double %53, double %54)
  br i1 %55, label %60, label %56

56:                                               ; preds = %41
  %57 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %4)
  %58 = call noundef float @_ZN3JPH4SignIfEET_S1_(float noundef %57)
  %59 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %58, double %46, double %47)
  br label %60

60:                                               ; preds = %56, %41, %25, %15
  %.fca.1.insert.merged = phi { double, double } [ %21, %15 ], [ %40, %25 ], [ %59, %56 ], [ %52, %41 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  ret { double, double } %.fca.1.insert.merged
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH12ScaleHelpers16MakeNonZeroScaleENS_4Vec3E(double, double) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH12ScaleHelpers16MakeUniformScaleENS_4Vec3E(double, double) local_unnamed_addr #3

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) local_unnamed_addr #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH4SignIfEET_S1_(float noundef) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #7 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"="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 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 = { 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"="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 #6 = { alwaysinline 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 #7 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !20, i64 40}
!6 = !{!"_ZTSN3JPH22RotatedTranslatedShapeE", !7, i64 0, !20, i64 40, !21, i64 48, !22, i64 64}
!7 = !{!"_ZTSN3JPH14DecoratedShapeE", !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 = !{!"_ZTSN3JPH8RefConstINS_5ShapeEEE", !19, i64 0}
!19 = !{!"any pointer", !13, i64 0}
!20 = !{!"bool", !13, i64 0}
!21 = !{!"_ZTSN3JPH4Vec3E", !13, i64 0}
!22 = !{!"_ZTSN3JPH4QuatE", !23, i64 0}
!23 = !{!"_ZTSN3JPH4Vec4E", !13, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !14, i64 0}
!28 = !{!13, !13, i64 0}


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