; LLVM IR from devlinzhou/deterministic_physics :: UnrealDemo/Source/UnrealDemo/gphysics/src/collision/glacier_collision_algorithm._5b807488 (ZN18GCollisionManerger4InitEv)

; 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.GCollisionManerger = type { [10 x [10 x ptr]] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18GCollisionManerger4InitEv(ptr noundef nonnull align 8 dereferenceable(800) %0) #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #4
  invoke void @_ZN17GCG_Sphere_SphereC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext false)
          to label %7 unwind label %46

7:                                                ; preds = %1
  %8 = getelementptr inbounds %class.GCollisionManerger, ptr %5, i32 0, i32 0
  %9 = getelementptr inbounds [10 x [10 x ptr]], ptr %8, i64 0, i64 1
  %10 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 1
  store ptr %6, ptr %10, align 8, !tbaa !5
  %11 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #4
  invoke void @_ZN11GCG_Box_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %11, i1 noundef zeroext false)
          to label %12 unwind label %50

12:                                               ; preds = %7
  %13 = getelementptr inbounds %class.GCollisionManerger, ptr %5, i32 0, i32 0
  %14 = getelementptr inbounds [10 x [10 x ptr]], ptr %13, i64 0, i64 2
  %15 = getelementptr inbounds [10 x ptr], ptr %14, i64 0, i64 2
  store ptr %11, ptr %15, align 8, !tbaa !5
  %16 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #4
  invoke void @_ZN14GCG_Sphere_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %16, i1 noundef zeroext false)
          to label %17 unwind label %54

17:                                               ; preds = %12
  %18 = getelementptr inbounds %class.GCollisionManerger, ptr %5, i32 0, i32 0
  %19 = getelementptr inbounds [10 x [10 x ptr]], ptr %18, i64 0, i64 1
  %20 = getelementptr inbounds [10 x ptr], ptr %19, i64 0, i64 2
  store ptr %16, ptr %20, align 8, !tbaa !5
  %21 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #4
  invoke void @_ZN14GCG_Sphere_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %21, i1 noundef zeroext true)
          to label %22 unwind label %58

22:                                               ; preds = %17
  %23 = getelementptr inbounds %class.GCollisionManerger, ptr %5, i32 0, i32 0
  %24 = getelementptr inbounds [10 x [10 x ptr]], ptr %23, i64 0, i64 2
  %25 = getelementptr inbounds [10 x ptr], ptr %24, i64 0, i64 1
  store ptr %21, ptr %25, align 8, !tbaa !5
  %26 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #4
  invoke void @_ZN16GCG_Sphere_PlaneC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %26, i1 noundef zeroext false)
          to label %27 unwind label %62

27:                                               ; preds = %22
  %28 = getelementptr inbounds %class.GCollisionManerger, ptr %5, i32 0, i32 0
  %29 = getelementptr inbounds [10 x [10 x ptr]], ptr %28, i64 0, i64 1
  %30 = getelementptr inbounds [10 x ptr], ptr %29, i64 0, i64 7
  store ptr %26, ptr %30, align 8, !tbaa !5
  %31 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #4
  invoke void @_ZN16GCG_Sphere_PlaneC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %31, i1 noundef zeroext true)
          to label %32 unwind label %66

32:                                               ; preds = %27
  %33 = getelementptr inbounds %class.GCollisionManerger, ptr %5, i32 0, i32 0
  %34 = getelementptr inbounds [10 x [10 x ptr]], ptr %33, i64 0, i64 7
  %35 = getelementptr inbounds [10 x ptr], ptr %34, i64 0, i64 1
  store ptr %31, ptr %35, align 8, !tbaa !5
  %36 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #4
  invoke void @_ZN13GCG_Plane_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %36, i1 noundef zeroext false)
          to label %37 unwind label %70

37:                                               ; preds = %32
  %38 = getelementptr inbounds %class.GCollisionManerger, ptr %5, i32 0, i32 0
  %39 = getelementptr inbounds [10 x [10 x ptr]], ptr %38, i64 0, i64 7
  %40 = getelementptr inbounds [10 x ptr], ptr %39, i64 0, i64 2
  store ptr %36, ptr %40, align 8, !tbaa !5
  %41 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #4
  invoke void @_ZN13GCG_Plane_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %41, i1 noundef zeroext true)
          to label %42 unwind label %74

42:                                               ; preds = %37
  %43 = getelementptr inbounds %class.GCollisionManerger, ptr %5, i32 0, i32 0
  %44 = getelementptr inbounds [10 x [10 x ptr]], ptr %43, i64 0, i64 2
  %45 = getelementptr inbounds [10 x ptr], ptr %44, i64 0, i64 7
  store ptr %41, ptr %45, align 8, !tbaa !5
  ret void

46:                                               ; preds = %1
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %3, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %6, i64 noundef 16) #5
  br label %78

50:                                               ; preds = %7
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %3, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %11, i64 noundef 16) #5
  br label %78

54:                                               ; preds = %12
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %3, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %16, i64 noundef 16) #5
  br label %78

58:                                               ; preds = %17
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %3, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %21, i64 noundef 16) #5
  br label %78

62:                                               ; preds = %22
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %3, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %26, i64 noundef 16) #5
  br label %78

66:                                               ; preds = %27
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %3, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %31, i64 noundef 16) #5
  br label %78

70:                                               ; preds = %32
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %3, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %36, i64 noundef 16) #5
  br label %78

74:                                               ; preds = %37
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %3, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %41, i64 noundef 16) #5
  br label %78

78:                                               ; preds = %74, %70, %66, %62, %58, %54, %50, %46
  %79 = load ptr, ptr %3, align 8
  %80 = load i32, ptr %4, align 4
  %81 = insertvalue { ptr, i32 } poison, ptr %79, 0
  %82 = insertvalue { ptr, i32 } %81, i32 %80, 1
  resume { ptr, i32 } %82
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17GCG_Sphere_SphereC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11GCG_Box_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14GCG_Sphere_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16GCG_Sphere_PlaneC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13GCG_Plane_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #3 align 2

attributes #0 = { 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 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 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 #4 = { builtin allocsize(0) }
attributes #5 = { builtin 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"

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18GCollisionManerger4InitEv(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(800) %0) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #4
  invoke void @_ZN17GCG_Sphere_SphereC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %2, i1 noundef zeroext false)
          to label %3 unwind label %19

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  store ptr %2, ptr %4, align 8, !tbaa !5
  %5 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #4
  tail call void @_ZN11GCG_Box_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext false)
  %6 = getelementptr inbounds i8, ptr %0, i64 176
  store ptr %5, ptr %6, align 8, !tbaa !5
  %7 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #4
  tail call void @_ZN14GCG_Sphere_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false)
  %8 = getelementptr inbounds i8, ptr %0, i64 96
  store ptr %7, ptr %8, align 8, !tbaa !5
  %9 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #4
  tail call void @_ZN14GCG_Sphere_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %9, i1 noundef zeroext true)
  %10 = getelementptr inbounds i8, ptr %0, i64 168
  store ptr %9, ptr %10, align 8, !tbaa !5
  %11 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #4
  tail call void @_ZN16GCG_Sphere_PlaneC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %11, i1 noundef zeroext false)
  %12 = getelementptr inbounds i8, ptr %0, i64 136
  store ptr %11, ptr %12, align 8, !tbaa !5
  %13 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #4
  tail call void @_ZN16GCG_Sphere_PlaneC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %13, i1 noundef zeroext true)
  %14 = getelementptr inbounds i8, ptr %0, i64 568
  store ptr %13, ptr %14, align 8, !tbaa !5
  %15 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #4
  tail call void @_ZN13GCG_Plane_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %15, i1 noundef zeroext false)
  %16 = getelementptr inbounds i8, ptr %0, i64 576
  store ptr %15, ptr %16, align 8, !tbaa !5
  %17 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #4
  tail call void @_ZN13GCG_Plane_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %17, i1 noundef zeroext true)
  %18 = getelementptr inbounds i8, ptr %0, i64 216
  store ptr %17, ptr %18, align 8, !tbaa !5
  ret void

19:                                               ; preds = %1
  %20 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %2, i64 noundef 16) #5
  resume { ptr, i32 } %20
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17GCG_Sphere_SphereC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11GCG_Box_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14GCG_Sphere_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16GCG_Sphere_PlaneC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13GCG_Plane_BoxC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #3 align 2

attributes #0 = { 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 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 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 #4 = { builtin allocsize(0) }
attributes #5 = { builtin 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"}


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