; LLVM IR from devlinzhou/deterministic_physics :: UnrealDemo/Source/UnrealDemo/gphysics/src/utils (glacier_physics_utils)

; 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.GColor = type { i32 }
%class.GVector3 = type { %class.GFloat, %class.GFloat, %class.GFloat }
%class.GFloat = type { i32 }
%class.GTransform_QT = type { %class.GQuaternion, %class.GVector3 }
%class.GQuaternion = type { %class.GFloat, %class.GFloat, %class.GFloat, %class.GFloat }
%class.GCollisionContact = type { i64, i32, i32, [16 x %class.GManifoldPoint] }
%class.GManifoldPoint = type <{ %class.GVector3, %class.GVector3, %class.GFloat, i32, i8, [3 x i8] }>
%class.GCObject = type { ptr, %class.GCollisionShape, i32, i32, %class.GTransform_QT, %class.GTransform_QT, %class.GAABB, %class.GAABB, i32, ptr, i8, i32, %"class.std::set", %"class.std::vector.44" }
%class.GCollisionShape = type { i32, %class.GVector3, ptr }
%class.GAABB = type { %class.GVector3, %class.GVector3 }
%"class.std::set" = type { %"class.std::_Rb_tree.40" }
%"class.std::_Rb_tree.40" = type { %"struct.std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.44" = type { %"struct.std::_Vector_base.45" }
%"struct.std::_Vector_base.45" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12GPhyscsUtils11DrawContactERK17GCollisionContactP12IGlacierDraw6GColorPK13GPhysicsWorld(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1, i32 %2, ptr noundef %3) #2 align 2 {
  %5 = alloca %class.GColor, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %class.GVector3, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %class.GVector3, align 4
  %14 = alloca %class.GVector3, align 4
  %15 = alloca %class.GVector3, align 4
  %16 = alloca %class.GVector3, align 4
  %17 = alloca %class.GFloat, align 4
  %18 = alloca { i64, i32 }, align 8
  %19 = alloca { i64, i32 }, align 8
  %20 = alloca %class.GTransform_QT, align 4
  %21 = alloca %class.GFloat, align 4
  %22 = alloca %class.GColor, align 4
  %23 = alloca %class.GTransform_QT, align 4
  %24 = alloca %class.GFloat, align 4
  %25 = alloca %class.GColor, align 4
  %26 = alloca %class.GColor, align 4
  %27 = alloca %class.GColor, align 4
  %28 = getelementptr inbounds %class.GColor, ptr %5, i32 0, i32 0
  store i32 %2, ptr %28, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #6
  call void @_ZN8GVector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %9)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr null, ptr %10, align 8, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %37

31:                                               ; preds = %4
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %class.GCollisionContact, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 8, !tbaa !9
  %36 = call noundef ptr @_ZNK13GPhysicsWorld19FindCollisionObjectEj(ptr noundef nonnull align 8 dereferenceable(1048) %32, i32 noundef %35)
  store ptr %36, ptr %10, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %31, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !13
  br label %38

38:                                               ; preds = %105, %37
  %39 = load i32, ptr %11, align 4, !tbaa !13
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call noundef i32 @_ZNK17GCollisionContact13GetPointCountEv(ptr noundef nonnull align 8 dereferenceable(592) %40)
  %42 = icmp slt i32 %39, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %108

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %class.GCollisionContact, ptr %45, i32 0, i32 3
  %47 = load i32, ptr %11, align 4, !tbaa !13
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [16 x %class.GManifoldPoint], ptr %46, i64 0, i64 %48
  store ptr %49, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #6
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = getelementptr inbounds %class.GManifoldPoint, ptr %50, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %51, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #6
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = getelementptr inbounds %class.GManifoldPoint, ptr %52, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %53, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #6
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = getelementptr inbounds %class.GManifoldPoint, ptr %54, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %55, i64 4, i1 false), !tbaa.struct !15
  %56 = getelementptr inbounds %class.GFloat, ptr %17, i32 0, i32 0
  %57 = load i32, ptr %56, align 4
  %58 = call { i64, i32 } @_ZNK8GVector3mlE6GFloat(ptr noundef nonnull align 4 dereferenceable(12) %14, i32 %57)
  store { i64, i32 } %58, ptr %18, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %18, i64 12, i1 false)
  %59 = call { i64, i32 } @_ZNK8GVector3miERKS_(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %16)
  store { i64, i32 } %59, ptr %19, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 8 %19, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #6
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 28, ptr %20) #6
  call void @_ZN13GTransform_QTC2ERK8GVector3(ptr noundef nonnull align 4 dereferenceable(28) %20, ptr noundef nonnull align 4 dereferenceable(12) %13)
  %61 = call i32 @_ZN5GMath7Makef32Eijj(i32 noundef 0, i32 noundef 15, i32 noundef 1000)
  %62 = getelementptr inbounds %class.GFloat, ptr %21, i32 0, i32 0
  store i32 %61, ptr %62, align 4
  %63 = call i32 @_ZN6GColor5WhiteEv()
  %64 = getelementptr inbounds %class.GColor, ptr %22, i32 0, i32 0
  store i32 %63, ptr %64, align 4
  %65 = getelementptr inbounds %class.GFloat, ptr %21, i32 0, i32 0
  %66 = load i32, ptr %65, align 4
  %67 = getelementptr inbounds %class.GColor, ptr %22, i32 0, i32 0
  %68 = load i32, ptr %67, align 4
  %69 = load ptr, ptr %60, align 8, !tbaa !16
  %70 = getelementptr inbounds ptr, ptr %69, i64 2
  %71 = load ptr, ptr %70, align 8
  call void %71(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 4 dereferenceable(28) %20, i32 %66, i32 %68, i32 noundef 4)
  call void @llvm.lifetime.end.p0(i64 28, ptr %20) #6
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 28, ptr %23) #6
  call void @_ZN13GTransform_QTC2ERK8GVector3(ptr noundef nonnull align 4 dereferenceable(28) %23, ptr noundef nonnull align 4 dereferenceable(12) %15)
  %73 = call i32 @_ZN5GMath7Makef32Eijj(i32 noundef 0, i32 noundef 7, i32 noundef 1000)
  %74 = getelementptr inbounds %class.GFloat, ptr %24, i32 0, i32 0
  store i32 %73, ptr %74, align 4
  %75 = call i32 @_ZN6GColor4GrayEv()
  %76 = getelementptr inbounds %class.GColor, ptr %25, i32 0, i32 0
  store i32 %75, ptr %76, align 4
  %77 = getelementptr inbounds %class.GFloat, ptr %24, i32 0, i32 0
  %78 = load i32, ptr %77, align 4
  %79 = getelementptr inbounds %class.GColor, ptr %25, i32 0, i32 0
  %80 = load i32, ptr %79, align 4
  %81 = load ptr, ptr %72, align 8, !tbaa !16
  %82 = getelementptr inbounds ptr, ptr %81, i64 2
  %83 = load ptr, ptr %82, align 8
  call void %83(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull align 4 dereferenceable(28) %23, i32 %78, i32 %80, i32 noundef 4)
  call void @llvm.lifetime.end.p0(i64 28, ptr %23) #6
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %5, i64 4, i1 false), !tbaa.struct !15
  %85 = getelementptr inbounds %class.GColor, ptr %26, i32 0, i32 0
  %86 = load i32, ptr %85, align 4
  %87 = load ptr, ptr %84, align 8, !tbaa !16
  %88 = getelementptr inbounds ptr, ptr %87, i64 0
  %89 = load ptr, ptr %88, align 8
  call void %89(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %15, i32 %86)
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %92, label %104

92:                                               ; preds = %44
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = getelementptr inbounds %class.GCObject, ptr %94, i32 0, i32 5
  %96 = getelementptr inbounds %class.GTransform_QT, ptr %95, i32 0, i32 1
  %97 = call i32 @_ZN6GColor4GrayEv()
  %98 = getelementptr inbounds %class.GColor, ptr %27, i32 0, i32 0
  store i32 %97, ptr %98, align 4
  %99 = getelementptr inbounds %class.GColor, ptr %27, i32 0, i32 0
  %100 = load i32, ptr %99, align 4
  %101 = load ptr, ptr %93, align 8, !tbaa !16
  %102 = getelementptr inbounds ptr, ptr %101, i64 0
  %103 = load ptr, ptr %102, align 8
  call void %103(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %96, i32 %100)
  br label %104

104:                                              ; preds = %92, %44
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %11, align 4, !tbaa !13
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %11, align 4, !tbaa !13
  br label %38, !llvm.loop !18

108:                                              ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8GVector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

declare noundef ptr @_ZNK13GPhysicsWorld19FindCollisionObjectEj(ptr noundef nonnull align 8 dereferenceable(1048), i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK17GCollisionContact13GetPointCountEv(ptr noundef nonnull align 8 dereferenceable(592)) #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN5GMath7Makef32Eijj(i32 noundef, i32 noundef, i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN6GColor5WhiteEv() #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN6GColor4GrayEv() #2 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !12, i64 8}
!10 = !{!"_ZTS17GCollisionContact", !11, i64 0, !12, i64 8, !12, i64 12, !7, i64 16}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{i64 0, i64 4, !13, i64 4, i64 4, !13, i64 8, i64 4, !13}
!15 = !{i64 0, i64 4, !13}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !8, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"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.GVector3 = type { %class.GFloat, %class.GFloat, %class.GFloat }
%class.GFloat = type { i32 }
%class.GTransform_QT = type { %class.GQuaternion, %class.GVector3 }
%class.GQuaternion = type { %class.GFloat, %class.GFloat, %class.GFloat, %class.GFloat }
%class.GManifoldPoint = type <{ %class.GVector3, %class.GVector3, %class.GFloat, i32, i8, [3 x i8] }>

; Function Attrs: mustprogress 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12GPhyscsUtils11DrawContactERK17GCollisionContactP12IGlacierDraw6GColorPK13GPhysicsWorld(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1, i32 %2, ptr noundef %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %class.GVector3, align 4
  %6 = alloca %class.GVector3, align 4
  %7 = alloca %class.GVector3, align 4
  %8 = alloca %class.GVector3, align 8
  %9 = alloca %class.GVector3, align 8
  %10 = alloca %class.GTransform_QT, align 4
  %11 = alloca %class.GTransform_QT, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #6
  call void @_ZN8GVector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %16, label %12

12:                                               ; preds = %4
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %15 = call noundef ptr @_ZNK13GPhysicsWorld19FindCollisionObjectEj(ptr noundef nonnull align 8 dereferenceable(1048) %3, i32 noundef %14)
  br label %16

16:                                               ; preds = %12, %4
  %.0 = phi ptr [ %15, %12 ], [ null, %4 ]
  %17 = call noundef i32 @_ZNK17GCollisionContact13GetPointCountEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.210.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  %.not30 = icmp eq ptr %.0, null
  %20 = getelementptr inbounds i8, ptr %.0, i64 84
  br label %21

._crit_edge:                                      ; preds = %43, %16
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #6
  ret void

21:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %22 = getelementptr inbounds [16 x %class.GManifoldPoint], ptr %19, i64 0, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %22, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  %23 = getelementptr inbounds i8, ptr %22, i64 12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %23, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #6
  %24 = getelementptr inbounds i8, ptr %22, i64 24
  %.sroa.011.0.copyload = load i32, ptr %24, align 4, !tbaa !12
  %25 = call { i64, i32 } @_ZNK8GVector3mlE6GFloat(ptr noundef nonnull align 4 dereferenceable(12) %7, i32 %.sroa.011.0.copyload)
  %.fca.0.extract7 = extractvalue { i64, i32 } %25, 0
  %.fca.1.extract8 = extractvalue { i64, i32 } %25, 1
  store i64 %.fca.0.extract7, ptr %9, align 8
  store i32 %.fca.1.extract8, ptr %.sroa.210.0..sroa_idx, align 8
  %26 = call { i64, i32 } @_ZNK8GVector3miERKS_(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %.fca.0.extract = extractvalue { i64, i32 } %26, 0
  %.fca.1.extract = extractvalue { i64, i32 } %26, 1
  store i64 %.fca.0.extract, ptr %8, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %10) #6
  call void @_ZN13GTransform_QTC2ERK8GVector3(ptr noundef nonnull align 4 dereferenceable(28) %10, ptr noundef nonnull align 4 dereferenceable(12) %6)
  %27 = call i32 @_ZN5GMath7Makef32Eijj(i32 noundef 0, i32 noundef 15, i32 noundef 1000)
  %28 = call i32 @_ZN6GColor5WhiteEv()
  %29 = load ptr, ptr %1, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %31 = load ptr, ptr %30, align 8
  call void %31(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(28) %10, i32 %27, i32 %28, i32 noundef 4)
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %11) #6
  call void @_ZN13GTransform_QTC2ERK8GVector3(ptr noundef nonnull align 4 dereferenceable(28) %11, ptr noundef nonnull align 4 dereferenceable(12) %8)
  %32 = call i32 @_ZN5GMath7Makef32Eijj(i32 noundef 0, i32 noundef 7, i32 noundef 1000)
  %33 = call i32 @_ZN6GColor4GrayEv()
  %34 = load ptr, ptr %1, align 8, !tbaa !13
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %36 = load ptr, ptr %35, align 8
  call void %36(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(28) %11, i32 %32, i32 %33, i32 noundef 4)
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %11) #6
  %37 = load ptr, ptr %1, align 8, !tbaa !13
  %38 = load ptr, ptr %37, align 8
  call void %38(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %8, i32 %2)
  br i1 %.not30, label %43, label %39

39:                                               ; preds = %21
  %40 = call i32 @_ZN6GColor4GrayEv()
  %41 = load ptr, ptr %1, align 8, !tbaa !13
  %42 = load ptr, ptr %41, align 8
  call void %42(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %20, i32 %40)
  br label %43

43:                                               ; preds = %39, %21
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = call noundef i32 @_ZNK17GCollisionContact13GetPointCountEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %21, label %._crit_edge, !llvm.loop !15
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8GVector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

declare noundef ptr @_ZNK13GPhysicsWorld19FindCollisionObjectEj(ptr noundef nonnull align 8 dereferenceable(1048), i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK17GCollisionContact13GetPointCountEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN5GMath7Makef32Eijj(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN6GColor5WhiteEv() local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN6GColor4GrayEv() local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !10, i64 8}
!6 = !{!"_ZTS17GCollisionContact", !7, i64 0, !10, i64 8, !10, i64 12, !8, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{i64 0, i64 4, !12, i64 4, i64 4, !12, i64 8, i64 4, !12}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !9, 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