; LLVM IR from devlinzhou/deterministic_physics :: UnrealDemo/Source/UnrealDemo/gphysics/src/collision (glacier_collision_box)

; 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.GTransform_QT = type { %class.GQuaternion, %class.GVector3 }
%class.GQuaternion = type { %class.GFloat, %class.GFloat, %class.GFloat, %class.GFloat }
%class.GFloat = type { i32 }
%class.GVector3 = type { %class.GFloat, %class.GFloat, %class.GFloat }
%class.GPlane = type { %class.GVector3, %class.GFloat }
%class.GShapeBox = type { %class.GShapeConvexBase.base, %class.GVector3 }
%class.GShapeConvexBase.base = type <{ ptr, %class.GShapeBase }>
%class.GShapeBase = type { i32 }

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK13GTransform_QTmlERKS_(ptr dead_on_unwind noalias writable sret(%class.GTransform_QT) align 4, ptr noundef nonnull align 4 dereferenceable(28), ptr noundef nonnull align 4 dereferenceable(28)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK13GTransform_QT15GetInverse_fastEv(ptr dead_on_unwind noalias writable sret(%class.GTransform_QT) align 4, ptr noundef nonnull align 4 dereferenceable(28)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN14GCollision_Box9Box_PlaneERK9GShapeBoxRK13GTransform_QTRK11GShapePlaneS5_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(28) %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(28) %3) #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %class.GTransform_QT, align 4
  %10 = alloca %class.GTransform_QT, align 4
  %11 = alloca %class.GPlane, align 4
  %12 = alloca %class.GVector3, align 4
  %13 = alloca %class.GVector3, align 4
  %14 = alloca { i64, i32 }, align 8
  %15 = alloca { i64, i32 }, align 8
  %16 = alloca %class.GVector3, align 4
  %17 = alloca { i64, i32 }, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 28, ptr %9) #4
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 28, ptr %10) #4
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK13GTransform_QT15GetInverse_fastEv(ptr dead_on_unwind writable sret(%class.GTransform_QT) align 4 %10, ptr noundef nonnull align 4 dereferenceable(28) %19)
  call void @_ZNK13GTransform_QTmlERKS_(ptr dead_on_unwind writable sret(%class.GTransform_QT) align 4 %9, ptr noundef nonnull align 4 dereferenceable(28) %18, ptr noundef nonnull align 4 dereferenceable(28) %10)
  call void @llvm.lifetime.end.p0(i64 28, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #4
  %20 = call { i64, i32 } @_ZN8GVector35UnitXEv()
  store { i64, i32 } %20, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %14, i64 12, i1 false)
  %21 = call { i64, i32 } @_ZNK13GTransform_QT15TransformNormalERK8GVector3(ptr noundef nonnull align 4 dereferenceable(28) %9, ptr noundef nonnull align 4 dereferenceable(12) %13)
  store { i64, i32 } %21, ptr %15, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 8 %15, i64 12, i1 false)
  %22 = getelementptr inbounds %class.GTransform_QT, ptr %9, i32 0, i32 1
  call void @_ZN6GPlaneC2ERK8GVector3S2_(ptr noundef nonnull align 4 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %22)
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #4
  %23 = call { i64, i32 } @_ZN8GVector34ZeroEv()
  store { i64, i32 } %23, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %17, i64 12, i1 false)
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.GShapeBox, ptr %24, i32 0, i32 1
  %26 = call noundef i32 @_ZNK6GPlane7GetSideERK8GVector3S2_(ptr noundef nonnull align 4 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %25)
  %27 = icmp eq i32 %26, 0
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 28, ptr %9) #4
  ret i1 %27
}

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZNK13GTransform_QT15TransformNormalERK8GVector3(ptr noundef nonnull align 4 dereferenceable(28), ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN8GVector35UnitXEv() #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6GPlaneC2ERK8GVector3S2_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6GPlane7GetSideERK8GVector3S2_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN8GVector34ZeroEv() #1 align 2

attributes #0 = { nocallback nofree nosync 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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"}


; 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.GTransform_QT = type { %class.GQuaternion, %class.GVector3 }
%class.GQuaternion = type { %class.GFloat, %class.GFloat, %class.GFloat, %class.GFloat }
%class.GFloat = type { i32 }
%class.GVector3 = type { %class.GFloat, %class.GFloat, %class.GFloat }
%class.GPlane = type { %class.GVector3, %class.GFloat }

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK13GTransform_QTmlERKS_(ptr dead_on_unwind noalias writable sret(%class.GTransform_QT) align 4, ptr noundef nonnull align 4 dereferenceable(28), ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK13GTransform_QT15GetInverse_fastEv(ptr dead_on_unwind noalias writable sret(%class.GTransform_QT) align 4, ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN14GCollision_Box9Box_PlaneERK9GShapeBoxRK13GTransform_QTRK11GShapePlaneS5_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(28) %1, ptr nocapture noundef nonnull readnone align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(28) %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %class.GTransform_QT, align 4
  %6 = alloca %class.GTransform_QT, align 4
  %7 = alloca %class.GPlane, align 4
  %8 = alloca %class.GVector3, align 8
  %9 = alloca %class.GVector3, align 8
  %10 = alloca %class.GVector3, align 8
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %6) #3
  call void @_ZNK13GTransform_QT15GetInverse_fastEv(ptr dead_on_unwind nonnull writable sret(%class.GTransform_QT) align 4 %6, ptr noundef nonnull align 4 dereferenceable(28) %1)
  call void @_ZNK13GTransform_QTmlERKS_(ptr dead_on_unwind nonnull writable sret(%class.GTransform_QT) align 4 %5, ptr noundef nonnull align 4 dereferenceable(28) %3, ptr noundef nonnull align 4 dereferenceable(28) %6)
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #3
  %11 = call { i64, i32 } @_ZN8GVector35UnitXEv()
  %.fca.0.extract5 = extractvalue { i64, i32 } %11, 0
  %.fca.1.extract6 = extractvalue { i64, i32 } %11, 1
  store i64 %.fca.0.extract5, ptr %9, align 8
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %.fca.1.extract6, ptr %.sroa.28.0..sroa_idx, align 8
  %12 = call { i64, i32 } @_ZNK13GTransform_QT15TransformNormalERK8GVector3(ptr noundef nonnull align 4 dereferenceable(28) %5, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %.fca.0.extract1 = extractvalue { i64, i32 } %12, 0
  %.fca.1.extract2 = extractvalue { i64, i32 } %12, 1
  store i64 %.fca.0.extract1, ptr %8, align 8
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  store i32 %.fca.1.extract2, ptr %.sroa.24.0..sroa_idx, align 8
  %13 = getelementptr inbounds i8, ptr %5, i64 16
  call void @_ZN6GPlaneC2ERK8GVector3S2_(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #3
  %14 = call { i64, i32 } @_ZN8GVector34ZeroEv()
  %.fca.0.extract = extractvalue { i64, i32 } %14, 0
  %.fca.1.extract = extractvalue { i64, i32 } %14, 1
  store i64 %.fca.0.extract, ptr %10, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %15 = getelementptr inbounds i8, ptr %0, i64 12
  %16 = call noundef i32 @_ZNK6GPlane7GetSideERK8GVector3S2_(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %15)
  %17 = icmp eq i32 %16, 0
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %5) #3
  ret i1 %17
}

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZNK13GTransform_QT15TransformNormalERK8GVector3(ptr noundef nonnull align 4 dereferenceable(28), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN8GVector35UnitXEv() local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6GPlaneC2ERK8GVector3S2_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6GPlane7GetSideERK8GVector3S2_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN8GVector34ZeroEv() local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync 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 = { 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)"}


; Effective O3 passes: GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass