; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/Shape/HeightFieldShape.ll (ZNK3JPH16HeightFieldShape5CloneEv)

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

declare i32 @__gxx_personality_v0(...)

; 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: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH16HeightFieldShapenwEm(i64 noundef) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH16HeightFieldShapedlEPv(ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16HeightFieldShape15AllocateBuffersEv(ptr noundef nonnull align 16 dereferenceable(176)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH16HeightFieldShape5CloneEv(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref.24") align 8 %0, ptr noundef nonnull align 16 dereferenceable(176) %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %4, align 8
  store i1 false, ptr %5, align 1
  %9 = call noundef ptr @_ZN3JPH16HeightFieldShapenwEm(i64 noundef 176)
  invoke void @_ZN3JPH16HeightFieldShapeC2Ev(ptr noundef nonnull align 16 dereferenceable(176) %9)
          to label %10 unwind label %100

10:                                               ; preds = %2
  call void @_ZN3JPH3RefINS_16HeightFieldShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %9)
  %11 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %12 unwind label %104

12:                                               ; preds = %10
  %13 = invoke noundef i64 @_ZNK3JPH5Shape11GetUserDataEv(ptr noundef nonnull align 8 dereferenceable(26) %8)
          to label %14 unwind label %104

14:                                               ; preds = %12
  invoke void @_ZN3JPH5Shape11SetUserDataEm(ptr noundef nonnull align 8 dereferenceable(26) %11, i64 noundef %13)
          to label %15 unwind label %104

15:                                               ; preds = %14
  %16 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 2
  %17 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %18 unwind label %104

18:                                               ; preds = %15
  %19 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %17, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 %16, i64 16, i1 false), !tbaa.struct !9
  %20 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 3
  %21 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %22 unwind label %104

22:                                               ; preds = %18
  %23 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %21, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %20, i64 16, i1 false), !tbaa.struct !9
  %24 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 4
  %25 = load i32, ptr %24, align 16, !tbaa !11
  %26 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %27 unwind label %104

27:                                               ; preds = %22
  %28 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %26, i32 0, i32 4
  store i32 %25, ptr %28, align 16, !tbaa !11
  %29 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 5
  %30 = load i32, ptr %29, align 4, !tbaa !25
  %31 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %32 unwind label %104

32:                                               ; preds = %27
  %33 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %31, i32 0, i32 5
  store i32 %30, ptr %33, align 4, !tbaa !25
  %34 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 9
  %35 = load i8, ptr %34, align 4, !tbaa !26
  %36 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %37 unwind label %104

37:                                               ; preds = %32
  %38 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %36, i32 0, i32 9
  store i8 %35, ptr %38, align 4, !tbaa !26
  %39 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 10
  %40 = load i8, ptr %39, align 1, !tbaa !27
  %41 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %42 unwind label %104

42:                                               ; preds = %37
  %43 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %41, i32 0, i32 10
  store i8 %40, ptr %43, align 1, !tbaa !27
  %44 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 11
  %45 = load i16, ptr %44, align 2, !tbaa !28
  %46 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %47 unwind label %104

47:                                               ; preds = %42
  %48 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %46, i32 0, i32 11
  store i16 %45, ptr %48, align 2, !tbaa !28
  %49 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 12
  %50 = load i16, ptr %49, align 8, !tbaa !29
  %51 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %52 unwind label %104

52:                                               ; preds = %47
  %53 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %51, i32 0, i32 12
  store i16 %50, ptr %53, align 8, !tbaa !29
  %54 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %55 unwind label %104

55:                                               ; preds = %52
  invoke void @_ZN3JPH16HeightFieldShape15AllocateBuffersEv(ptr noundef nonnull align 16 dereferenceable(176) %54)
          to label %56 unwind label %104

56:                                               ; preds = %55
  %57 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %58 unwind label %104

58:                                               ; preds = %56
  %59 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %57, i32 0, i32 14
  %60 = load ptr, ptr %59, align 16, !tbaa !30
  %61 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 14
  %62 = load ptr, ptr %61, align 16, !tbaa !30
  %63 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 7
  %64 = load i32, ptr %63, align 4, !tbaa !31
  %65 = zext i32 %64 to i64
  %66 = mul i64 %65, 16
  %67 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 6
  %68 = load i32, ptr %67, align 8, !tbaa !32
  %69 = zext i32 %68 to i64
  %70 = add i64 %66, %69
  %71 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 8
  %72 = load i32, ptr %71, align 16, !tbaa !33
  %73 = zext i32 %72 to i64
  %74 = add i64 %70, %73
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %60, ptr align 16 %62, i64 %74, i1 false)
  %75 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %76 unwind label %104

76:                                               ; preds = %58
  %77 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %75, i32 0, i32 17
  %78 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 17
  %79 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE8capacityEv(ptr noundef nonnull align 8 dereferenceable(24) %78)
          to label %80 unwind label %104

80:                                               ; preds = %76
  invoke void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef %79)
          to label %81 unwind label %104

81:                                               ; preds = %80
  %82 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 17
  %83 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %84 unwind label %104

84:                                               ; preds = %81
  %85 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %83, i32 0, i32 17
  %86 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(24) %85, ptr noundef nonnull align 8 dereferenceable(24) %82)
          to label %87 unwind label %104

87:                                               ; preds = %84
  %88 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 18
  %89 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %90 unwind label %104

90:                                               ; preds = %87
  %91 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %89, i32 0, i32 18
  %92 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %91, ptr noundef nonnull align 8 dereferenceable(24) %88)
          to label %93 unwind label %104

93:                                               ; preds = %90
  %94 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %8, i32 0, i32 19
  %95 = load i32, ptr %94, align 8, !tbaa !34
  %96 = invoke noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %97 unwind label %104

97:                                               ; preds = %93
  %98 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %96, i32 0, i32 19
  store i32 %95, ptr %98, align 8, !tbaa !34
  store i1 true, ptr %5, align 1
  %99 = load i1, ptr %5, align 1
  br i1 %99, label %109, label %108

100:                                              ; preds = %2
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %6, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %7, align 4
  call void @_ZN3JPH16HeightFieldShapedlEPv(ptr noundef %9) #7
  br label %110

104:                                              ; preds = %93, %90, %87, %84, %81, %80, %76, %58, %56, %55, %52, %47, %42, %37, %32, %27, %22, %18, %15, %14, %12, %10
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %6, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %7, align 4
  call void @_ZN3JPH3RefINS_16HeightFieldShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #7
  br label %110

108:                                              ; preds = %97
  call void @_ZN3JPH3RefINS_16HeightFieldShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #7
  br label %109

109:                                              ; preds = %108, %97
  ret void

110:                                              ; preds = %104, %100
  %111 = load ptr, ptr %6, align 8
  %112 = load i32, ptr %7, align 4
  %113 = insertvalue { ptr, i32 } poison, ptr %111, 0
  %114 = insertvalue { ptr, i32 } %113, i32 %112, 1
  resume { ptr, i32 } %114
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16HeightFieldShapeC2Ev(ptr noundef nonnull align 16 dereferenceable(176)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefINS_16HeightFieldShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5Shape11SetUserDataEm(ptr noundef nonnull align 8 dereferenceable(26), i64 noundef) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5Shape11GetUserDataEv(ptr noundef nonnull align 8 dereferenceable(26)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE8capacityEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH3RefINS_16HeightFieldShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="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 = { 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 #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 = { 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 #6 = { 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 = { 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, !17, i64 64}
!12 = !{!"_ZTSN3JPH16HeightFieldShapeE", !13, i64 0, !21, i64 32, !21, i64 48, !17, i64 64, !17, i64 68, !17, i64 72, !17, i64 76, !17, i64 80, !7, i64 84, !7, i64 85, !22, i64 86, !22, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !23, i64 120, !24, i64 144, !17, i64 168}
!13 = !{!"_ZTSN3JPH5ShapeE", !14, i64 8, !18, i64 16, !19, i64 24, !20, i64 25}
!14 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !15, i64 0}
!15 = !{!"_ZTSSt6atomicIjE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIjE", !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!20 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!21 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!22 = !{!"short", !7, i64 0}
!23 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !18, i64 0, !18, i64 8, !6, i64 16}
!24 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !18, i64 0, !18, i64 8, !6, i64 16}
!25 = !{!12, !17, i64 68}
!26 = !{!12, !7, i64 84}
!27 = !{!12, !7, i64 85}
!28 = !{!12, !22, i64 86}
!29 = !{!12, !22, i64 88}
!30 = !{!12, !6, i64 96}
!31 = !{!12, !17, i64 76}
!32 = !{!12, !17, i64 72}
!33 = !{!12, !17, i64 80}
!34 = !{!12, !17, i64 168}


; 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::Ref.24" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH16HeightFieldShapenwEm(i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH16HeightFieldShapedlEPv(ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16HeightFieldShape15AllocateBuffersEv(ptr noundef nonnull align 16 dereferenceable(176)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH16HeightFieldShape5CloneEv(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref.24") align 8 %0, ptr noundef nonnull align 16 dereferenceable(176) %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = tail call noundef ptr @_ZN3JPH16HeightFieldShapenwEm(i64 noundef 176)
  invoke void @_ZN3JPH16HeightFieldShapeC2Ev(ptr noundef nonnull align 16 dereferenceable(176) %3)
          to label %4 unwind label %74

4:                                                ; preds = %2
  tail call void @_ZN3JPH3RefINS_16HeightFieldShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %3)
  %5 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %6 = tail call noundef i64 @_ZNK3JPH5Shape11GetUserDataEv(ptr noundef nonnull align 8 dereferenceable(26) %1)
  tail call void @_ZN3JPH5Shape11SetUserDataEm(ptr noundef nonnull align 8 dereferenceable(26) %5, i64 noundef %6)
  %7 = getelementptr inbounds i8, ptr %1, i64 32
  %8 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %9 = getelementptr inbounds i8, ptr %8, i64 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %9, ptr noundef nonnull align 16 dereferenceable(16) %7, i64 16, i1 false), !tbaa.struct !5
  %10 = getelementptr inbounds i8, ptr %1, i64 48
  %11 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %12 = getelementptr inbounds i8, ptr %11, i64 48
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %12, ptr noundef nonnull align 16 dereferenceable(16) %10, i64 16, i1 false), !tbaa.struct !5
  %13 = getelementptr inbounds i8, ptr %1, i64 64
  %14 = load i32, ptr %13, align 16, !tbaa !9
  %15 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %16 = getelementptr inbounds i8, ptr %15, i64 64
  store i32 %14, ptr %16, align 16, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %1, i64 68
  %18 = load i32, ptr %17, align 4, !tbaa !24
  %19 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %20 = getelementptr inbounds i8, ptr %19, i64 68
  store i32 %18, ptr %20, align 4, !tbaa !24
  %21 = getelementptr inbounds i8, ptr %1, i64 84
  %22 = load i8, ptr %21, align 4, !tbaa !25
  %23 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %24 = getelementptr inbounds i8, ptr %23, i64 84
  store i8 %22, ptr %24, align 4, !tbaa !25
  %25 = getelementptr inbounds i8, ptr %1, i64 85
  %26 = load i8, ptr %25, align 1, !tbaa !26
  %27 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %28 = getelementptr inbounds i8, ptr %27, i64 85
  store i8 %26, ptr %28, align 1, !tbaa !26
  %29 = getelementptr inbounds i8, ptr %1, i64 86
  %30 = load i16, ptr %29, align 2, !tbaa !27
  %31 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %32 = getelementptr inbounds i8, ptr %31, i64 86
  store i16 %30, ptr %32, align 2, !tbaa !27
  %33 = getelementptr inbounds i8, ptr %1, i64 88
  %34 = load i16, ptr %33, align 8, !tbaa !28
  %35 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %36 = getelementptr inbounds i8, ptr %35, i64 88
  store i16 %34, ptr %36, align 8, !tbaa !28
  %37 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  invoke void @_ZN3JPH16HeightFieldShape15AllocateBuffersEv(ptr noundef nonnull align 16 dereferenceable(176) %37)
          to label %38 unwind label %76

38:                                               ; preds = %4
  %39 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %40 = getelementptr inbounds i8, ptr %39, i64 96
  %41 = load ptr, ptr %40, align 16, !tbaa !29
  %42 = getelementptr inbounds i8, ptr %1, i64 96
  %43 = load ptr, ptr %42, align 16, !tbaa !29
  %44 = getelementptr inbounds i8, ptr %1, i64 76
  %45 = load i32, ptr %44, align 4, !tbaa !30
  %46 = zext i32 %45 to i64
  %47 = shl nuw nsw i64 %46, 4
  %48 = getelementptr inbounds i8, ptr %1, i64 72
  %49 = load i32, ptr %48, align 8, !tbaa !31
  %50 = zext i32 %49 to i64
  %51 = add nuw nsw i64 %47, %50
  %52 = getelementptr inbounds i8, ptr %1, i64 80
  %53 = load i32, ptr %52, align 16, !tbaa !32
  %54 = zext i32 %53 to i64
  %55 = add nuw nsw i64 %51, %54
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %41, ptr align 16 %43, i64 %55, i1 false)
  %56 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %57 = getelementptr inbounds i8, ptr %56, i64 120
  %58 = getelementptr inbounds i8, ptr %1, i64 120
  %59 = tail call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE8capacityEv(ptr noundef nonnull align 8 dereferenceable(24) %58)
  invoke void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %59)
          to label %60 unwind label %76

60:                                               ; preds = %38
  %61 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %62 = getelementptr inbounds i8, ptr %61, i64 120
  %63 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %58)
          to label %64 unwind label %76

64:                                               ; preds = %60
  %65 = getelementptr inbounds i8, ptr %1, i64 144
  %66 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %67 = getelementptr inbounds i8, ptr %66, i64 144
  %68 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 8 dereferenceable(24) %65)
          to label %69 unwind label %76

69:                                               ; preds = %64
  %70 = getelementptr inbounds i8, ptr %1, i64 168
  %71 = load i32, ptr %70, align 8, !tbaa !33
  %72 = tail call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %73 = getelementptr inbounds i8, ptr %72, i64 168
  store i32 %71, ptr %73, align 8, !tbaa !33
  ret void

74:                                               ; preds = %2
  %75 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3JPH16HeightFieldShapedlEPv(ptr noundef %3) #7
  br label %78

76:                                               ; preds = %64, %60, %38, %4
  %77 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3JPH3RefINS_16HeightFieldShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #7
  br label %78

78:                                               ; preds = %76, %74
  %.pn = phi { ptr, i32 } [ %77, %76 ], [ %75, %74 ]
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16HeightFieldShapeC2Ev(ptr noundef nonnull align 16 dereferenceable(176)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefINS_16HeightFieldShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5Shape11SetUserDataEm(ptr noundef nonnull align 8 dereferenceable(26), i64 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5Shape11GetUserDataEv(ptr noundef nonnull align 8 dereferenceable(26)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE8capacityEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH3RefINS_16HeightFieldShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="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 = { 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 #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 = { 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 #6 = { 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 = { 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 = !{i64 0, i64 16, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !15, i64 64}
!10 = !{!"_ZTSN3JPH16HeightFieldShapeE", !11, i64 0, !19, i64 32, !19, i64 48, !15, i64 64, !15, i64 68, !15, i64 72, !15, i64 76, !15, i64 80, !7, i64 84, !7, i64 85, !20, i64 86, !20, i64 88, !21, i64 96, !21, i64 104, !21, i64 112, !22, i64 120, !23, i64 144, !15, i64 168}
!11 = !{!"_ZTSN3JPH5ShapeE", !12, i64 8, !16, i64 16, !17, i64 24, !18, i64 25}
!12 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !13, i64 0}
!13 = !{!"_ZTSSt6atomicIjE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseIjE", !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!18 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!19 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = !{!"any pointer", !7, i64 0}
!22 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !16, i64 0, !16, i64 8, !21, i64 16}
!23 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !16, i64 0, !16, i64 8, !21, i64 16}
!24 = !{!10, !15, i64 68}
!25 = !{!10, !7, i64 84}
!26 = !{!10, !7, i64 85}
!27 = !{!10, !20, i64 86}
!28 = !{!10, !20, i64 88}
!29 = !{!10, !21, i64 96}
!30 = !{!10, !15, i64 76}
!31 = !{!10, !15, i64 72}
!32 = !{!10, !15, i64 80}
!33 = !{!10, !15, i64 168}


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