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

; 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"

%"struct.JPH::CompoundShape::SubShape" = type <{ %"class.JPH::RefConst.13", %"class.JPH::Float3", %"class.JPH::Float3", i32, i8, [3 x i8] }>
%"class.JPH::RefConst.13" = type { ptr }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::MutableCompoundShape" = type { %"class.JPH::CompoundShape.base", %"class.JPH::Array.10", [8 x i8] }
%"class.JPH::CompoundShape.base" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::Vec3", %"class.JPH::AABox", %"class.JPH::Array.7", float }>
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.5", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.5" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Vec3" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Array.7" = type { i64, i64, ptr }
%"class.JPH::Array.10" = type { i64, i64, ptr }
%"class.JPH::CompoundShape" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::Vec3", %"class.JPH::AABox", %"class.JPH::Array.7", float, [4 x i8] }>
%"class.JPH::CompoundShapeSettings" = type { %"class.JPH::ShapeSettings", %"class.JPH::Array" }
%"class.JPH::ShapeSettings" = type { %"class.JPH::SerializableObject", %"class.JPH::RefTarget", i64, %"class.JPH::Result" }
%"class.JPH::SerializableObject" = type { ptr }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"class.JPH::Result" = type <{ %union.anon, i8, [7 x i8] }>
%union.anon = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon.2 }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon.2 = type { i64, [8 x i8] }
%"class.JPH::Array" = type { i64, i64, ptr }
%"struct.JPH::CompoundShapeSettings::SubShapeSettings" = type <{ %"class.JPH::RefConst", %"class.JPH::RefConst.13", %"class.JPH::Vec3", %"class.JPH::Quat", i32, [12 x i8] }>
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.14 }
%union.anon.14 = type { <4 x float> }

@_ZTVN3JPH20MutableCompoundShapeE = external dso_local unnamed_addr constant { [39 x ptr] }, align 8
@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

; 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 void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH20MutableCompoundShapeC2ERKNS_28MutableCompoundShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 16 dereferenceable(144) %0, ptr noundef nonnull align 8 dereferenceable(88) %1, ptr noundef nonnull align 8 dereferenceable(33) %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.JPH::CompoundShape::SubShape", align 8
  %15 = alloca %"class.JPH::Ref", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3JPH13CompoundShapeC2ENS_13EShapeSubTypeERKNS_13ShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 16 dereferenceable(108) %16, i8 noundef zeroext 8, ptr noundef nonnull align 8 dereferenceable(64) %17, ptr noundef nonnull align 8 dereferenceable(33) %18)
  store ptr getelementptr inbounds inrange(-16, 296) ({ [39 x ptr] }, ptr @_ZTVN3JPH20MutableCompoundShapeE, i32 0, i32 0, i32 2), ptr %16, align 16, !tbaa !9
  %19 = getelementptr inbounds %"class.JPH::MutableCompoundShape", ptr %16, i32 0, i32 1
  call void @_ZN3JPH5ArrayINS_20MutableCompoundShape6BoundsENS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  %20 = getelementptr inbounds %"class.JPH::CompoundShape", ptr %16, i32 0, i32 4
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.JPH::CompoundShapeSettings", ptr %21, i32 0, i32 1
  %23 = invoke noundef i64 @_ZNK3JPH5ArrayINS_21CompoundShapeSettings16SubShapeSettingsENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %24 unwind label %39

24:                                               ; preds = %3
  invoke void @_ZN3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %23)
          to label %25 unwind label %39

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.JPH::CompoundShapeSettings", ptr %26, i32 0, i32 1
  store ptr %27, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = invoke noundef ptr @_ZNK3JPH5ArrayINS_21CompoundShapeSettings16SubShapeSettingsENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %28)
          to label %30 unwind label %43

30:                                               ; preds = %25
  store ptr %29, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = invoke noundef ptr @_ZNK3JPH5ArrayINS_21CompoundShapeSettings16SubShapeSettingsENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
          to label %33 unwind label %47

33:                                               ; preds = %30
  store ptr %32, ptr %11, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %76, %33
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = icmp ne ptr %35, %36
  br i1 %37, label %51, label %38

38:                                               ; preds = %34
  store i32 2, ptr %12, align 4
  br label %80

39:                                               ; preds = %94, %90, %88, %85, %84, %24, %3
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %7, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %8, align 4
  br label %111

43:                                               ; preds = %25
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %7, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %8, align 4
  br label %83

47:                                               ; preds = %30
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %7, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %8, align 4
  br label %82

51:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %52, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #6
  invoke void @_ZN3JPH13CompoundShape8SubShapeC2Ev(ptr noundef nonnull align 8 dereferenceable(37) %14)
          to label %53 unwind label %59

53:                                               ; preds = %51
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = invoke noundef zeroext i1 @_ZN3JPH13CompoundShape8SubShape12FromSettingsERKNS_21CompoundShapeSettings16SubShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 8 dereferenceable(37) %14, ptr noundef nonnull align 16 dereferenceable(52) %54, ptr noundef nonnull align 8 dereferenceable(33) %55)
          to label %57 unwind label %63

57:                                               ; preds = %53
  br i1 %56, label %67, label %58

58:                                               ; preds = %57
  store i32 1, ptr %12, align 4
  br label %70

59:                                               ; preds = %51
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %7, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %8, align 4
  br label %79

63:                                               ; preds = %67, %53
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %7, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %8, align 4
  call void @_ZN3JPH13CompoundShape8SubShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %14) #6
  br label %79

67:                                               ; preds = %57
  %68 = getelementptr inbounds %"class.JPH::CompoundShape", ptr %16, i32 0, i32 4
  invoke void @_ZN3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 8 dereferenceable(37) %14)
          to label %69 unwind label %63

69:                                               ; preds = %67
  store i32 0, ptr %12, align 4
  br label %70

70:                                               ; preds = %69, %58
  call void @_ZN3JPH13CompoundShape8SubShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %14) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #6
  %71 = load i32, ptr %12, align 4
  switch i32 %71, label %73 [
    i32 0, label %72
  ]

72:                                               ; preds = %70
  store i32 0, ptr %12, align 4
  br label %73

73:                                               ; preds = %72, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %74 = load i32, ptr %12, align 4
  switch i32 %74, label %80 [
    i32 0, label %75
  ]

75:                                               ; preds = %73
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.JPH::CompoundShapeSettings::SubShapeSettings", ptr %77, i32 1
  store ptr %78, ptr %10, align 8, !tbaa !5
  br label %34

79:                                               ; preds = %63, %59
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %82

80:                                               ; preds = %73, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %81 = load i32, ptr %12, align 4
  switch i32 %81, label %117 [
    i32 2, label %84
    i32 1, label %101
  ]

82:                                               ; preds = %79, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %83

83:                                               ; preds = %82, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %111

84:                                               ; preds = %80
  invoke void @_ZN3JPH20MutableCompoundShape18AdjustCenterOfMassEv(ptr noundef nonnull align 16 dereferenceable(144) %16)
          to label %85 unwind label %39

85:                                               ; preds = %84
  %86 = getelementptr inbounds %"class.JPH::CompoundShape", ptr %16, i32 0, i32 4
  %87 = invoke noundef i64 @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %86)
          to label %88 unwind label %39

88:                                               ; preds = %85
  %89 = trunc i64 %87 to i32
  invoke void @_ZN3JPH20MutableCompoundShape23CalculateSubShapeBoundsEjj(ptr noundef nonnull align 16 dereferenceable(144) %16, i32 noundef 0, i32 noundef %89)
          to label %90 unwind label %39

90:                                               ; preds = %88
  %91 = invoke noundef i32 @_ZNK3JPH13CompoundShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 16 dereferenceable(108) %16)
          to label %92 unwind label %39

92:                                               ; preds = %90
  %93 = icmp ugt i32 %91, 32
  br i1 %93, label %94, label %97

94:                                               ; preds = %92
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %95, ptr noundef @.str.1)
          to label %96 unwind label %39

96:                                               ; preds = %94
  br label %101

97:                                               ; preds = %92
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  invoke void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %16)
          to label %99 unwind label %102

99:                                               ; preds = %97
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE3SetEOS3_(ptr noundef nonnull align 8 dereferenceable(33) %98, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %100 unwind label %106

100:                                              ; preds = %99
  call void @_ZN3JPH3RefINS_5ShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %101

101:                                              ; preds = %100, %96, %80
  ret void

102:                                              ; preds = %97
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %7, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %8, align 4
  br label %110

106:                                              ; preds = %99
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %7, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %8, align 4
  call void @_ZN3JPH3RefINS_5ShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %110

110:                                              ; preds = %106, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %111

111:                                              ; preds = %110, %83, %39
  call void @_ZN3JPH5ArrayINS_20MutableCompoundShape6BoundsENS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  call void @_ZN3JPH13CompoundShapeD2Ev(ptr noundef nonnull align 16 dereferenceable(108) %16) #6
  br label %112

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

117:                                              ; preds = %80
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH13CompoundShapeC2ENS_13EShapeSubTypeERKNS_13ShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 16 dereferenceable(108), i8 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ArrayINS_20MutableCompoundShape6BoundsENS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH13CompoundShape8SubShape12FromSettingsERKNS_21CompoundShapeSettings16SubShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 8 dereferenceable(37), ptr noundef nonnull align 16 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(33)) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH20MutableCompoundShape23CalculateSubShapeBoundsEjj(ptr noundef nonnull align 16 dereferenceable(144), i32 noundef, i32 noundef) #2 align 2

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

declare noundef i32 @_ZNK3JPH13CompoundShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 16 dereferenceable(108)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE3SetEOS3_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH13CompoundShapeD2Ev(ptr noundef nonnull align 16 dereferenceable(108)) unnamed_addr #1 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 = { 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 = { 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 = { "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, !10, i64 0}
!10 = !{!"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"

%"struct.JPH::CompoundShape::SubShape" = type <{ %"class.JPH::RefConst.13", %"class.JPH::Float3", %"class.JPH::Float3", i32, i8, [3 x i8] }>
%"class.JPH::RefConst.13" = type { ptr }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::Ref" = type { ptr }

@_ZTVN3JPH20MutableCompoundShapeE = external dso_local unnamed_addr constant { [39 x ptr] }, align 8
@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

; 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 void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH20MutableCompoundShapeC2ERKNS_28MutableCompoundShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 16 dereferenceable(144) %0, ptr noundef nonnull align 8 dereferenceable(88) %1, ptr noundef nonnull align 8 dereferenceable(33) %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.JPH::CompoundShape::SubShape", align 8
  %5 = alloca %"class.JPH::Ref", align 8
  tail call void @_ZN3JPH13CompoundShapeC2ENS_13EShapeSubTypeERKNS_13ShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 16 dereferenceable(108) %0, i8 noundef zeroext 8, ptr noundef nonnull align 8 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(33) %2)
  store ptr getelementptr inbounds inrange(-16, 296) (i8, ptr @_ZTVN3JPH20MutableCompoundShapeE, i64 16), ptr %0, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 112
  tail call void @_ZN3JPH5ArrayINS_20MutableCompoundShape6BoundsENS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 80
  %8 = getelementptr inbounds i8, ptr %1, i64 64
  %9 = tail call noundef i64 @_ZNK3JPH5ArrayINS_21CompoundShapeSettings16SubShapeSettingsENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  invoke void @_ZN3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %9)
          to label %10 unwind label %13

10:                                               ; preds = %3
  %11 = tail call noundef ptr @_ZNK3JPH5ArrayINS_21CompoundShapeSettings16SubShapeSettingsENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %12 = tail call noundef ptr @_ZNK3JPH5ArrayINS_21CompoundShapeSettings16SubShapeSettingsENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %.not31 = icmp eq ptr %11, %12
  br i1 %.not31, label %._crit_edge, label %.lr.ph

13:                                               ; preds = %34, %30, %27, %._crit_edge, %3
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %37

.lr.ph:                                           ; preds = %10, %23
  %.02432 = phi ptr [ %24, %23 ], [ %11, %10 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  invoke void @_ZN3JPH13CompoundShape8SubShapeC2Ev(ptr noundef nonnull align 8 dereferenceable(37) %4)
          to label %15 unwind label %18

15:                                               ; preds = %.lr.ph
  %16 = invoke noundef zeroext i1 @_ZN3JPH13CompoundShape8SubShape12FromSettingsERKNS_21CompoundShapeSettings16SubShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 8 dereferenceable(37) %4, ptr noundef nonnull align 16 dereferenceable(52) %.02432, ptr noundef nonnull align 8 dereferenceable(33) %2)
          to label %17 unwind label %20

17:                                               ; preds = %15
  br i1 %16, label %22, label %26

18:                                               ; preds = %.lr.ph
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %25

20:                                               ; preds = %22, %15
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH13CompoundShape8SubShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %4) #6
  br label %25

22:                                               ; preds = %17
  invoke void @_ZN3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(37) %4)
          to label %23 unwind label %20

23:                                               ; preds = %22
  call void @_ZN3JPH13CompoundShape8SubShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  %24 = getelementptr inbounds i8, ptr %.02432, i64 64
  %.not = icmp eq ptr %24, %12
  br i1 %.not, label %._crit_edge, label %.lr.ph

25:                                               ; preds = %20, %18
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  br label %37

26:                                               ; preds = %17
  call void @_ZN3JPH13CompoundShape8SubShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  br label %36

._crit_edge:                                      ; preds = %23, %10
  invoke void @_ZN3JPH20MutableCompoundShape18AdjustCenterOfMassEv(ptr noundef nonnull align 16 dereferenceable(144) %0)
          to label %27 unwind label %13

27:                                               ; preds = %._crit_edge
  %28 = call noundef i64 @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %29 = trunc i64 %28 to i32
  invoke void @_ZN3JPH20MutableCompoundShape23CalculateSubShapeBoundsEjj(ptr noundef nonnull align 16 dereferenceable(144) %0, i32 noundef 0, i32 noundef %29)
          to label %30 unwind label %13

30:                                               ; preds = %27
  %31 = invoke noundef i32 @_ZNK3JPH13CompoundShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 16 dereferenceable(108) %0)
          to label %32 unwind label %13

32:                                               ; preds = %30
  %33 = icmp ugt i32 %31, 32
  br i1 %33, label %34, label %35

34:                                               ; preds = %32
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull @.str.1)
          to label %36 unwind label %13

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %0)
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE3SetEOS3_(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @_ZN3JPH3RefINS_5ShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %36

36:                                               ; preds = %26, %34, %35
  ret void

37:                                               ; preds = %25, %13
  %.pn26 = phi { ptr, i32 } [ %14, %13 ], [ %.pn, %25 ]
  call void @_ZN3JPH5ArrayINS_20MutableCompoundShape6BoundsENS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @_ZN3JPH13CompoundShapeD2Ev(ptr noundef nonnull align 16 dereferenceable(108) %0) #6
  resume { ptr, i32 } %.pn26
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH13CompoundShapeC2ENS_13EShapeSubTypeERKNS_13ShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 16 dereferenceable(108), i8 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ArrayINS_20MutableCompoundShape6BoundsENS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH13CompoundShape8SubShape12FromSettingsERKNS_21CompoundShapeSettings16SubShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 8 dereferenceable(37), ptr noundef nonnull align 16 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH20MutableCompoundShape23CalculateSubShapeBoundsEjj(ptr noundef nonnull align 16 dereferenceable(144), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

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

declare noundef i32 @_ZNK3JPH13CompoundShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 16 dereferenceable(108)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE3SetEOS3_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH13CompoundShapeD2Ev(ptr noundef nonnull align 16 dereferenceable(108)) unnamed_addr #1 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 = { 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 = { 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 = { "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass