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

; 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::TriangleCodecIndexed8BitPackSOA4Flags::ValidationContext" = type { ptr, %"class.JPH::AABox" }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon.14 }
%union.anon.14 = type { <4 x float> }
%"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.5" = type { i64, i64, ptr }
%union.Storage = type { %"class.JPH::TriangleSplitterBinning" }
%"class.JPH::TriangleSplitterBinning" = type { %"class.JPH::TriangleSplitter", i32, i32, i32, %"class.JPH::Array.20" }
%"class.JPH::TriangleSplitter" = type { ptr, ptr, ptr, %"class.JPH::Array", %"class.JPH::Array.17" }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.17" = type { i64, i64, ptr }
%"class.JPH::Array.20" = type { i64, i64, ptr }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::AABBTreeBuilder" = type { ptr, i32, %"class.JPH::Array.23", %"class.JPH::Array.5" }
%"class.JPH::Array.23" = type { i64, i64, ptr }
%"struct.JPH::AABBTreeBuilderStats" = type { %"struct.JPH::TriangleSplitter::Stats", float, i32, i32, i32, i32, i32, i32, i32, float, [4 x i8] }
%"struct.JPH::TriangleSplitter::Stats" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::AABBTreeToBuffer" = type { %"class.JPH::ByteBuffer" }
%"class.JPH::ByteBuffer" = type { %"class.JPH::Array.16" }
%"class.JPH::Array.16" = type { i64, i64, ptr }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::MeshShape" = type { %"class.JPH::Shape.base", %"class.JPH::Array.8", %"class.JPH::ByteBuffer" }
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.15", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.15" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Array.8" = type { i64, i64, ptr }
%"class.JPH::MeshShapeSettings" = type { %"class.JPH::ShapeSettings", %"class.JPH::Array", %"class.JPH::Array.5", %"class.JPH::Array.8", i32, float, i8, i32 }
%"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.JPH::IndexedTriangleNoMaterial" = type { [3 x i32] }
%"class.JPH::IndexedTriangle" = type { %"class.JPH::IndexedTriangleNoMaterial", i32, i32 }

@_ZTVN3JPH9MeshShapeE = external dso_local unnamed_addr constant { [37 x ptr] }, align 8
@.str.1 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [70 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 @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContextC2ERKNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS3_EEEERKNS2_INS_6Float3ENS4_IS9_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH25IndexedTriangleNoMaterial12IsDegenerateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContext12IsDegenerateERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(20)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 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 @_ZN3JPH9MeshShapeC2ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(152) %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 %"class.JPH::TriangleCodecIndexed8BitPackSOA4Flags::ValidationContext", align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"class.std::__cxx11::basic_string", align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca %"class.JPH::Array.5", align 8
  %30 = alloca %union.Storage, align 8
  %31 = alloca ptr, align 8
  %32 = alloca %"struct.JPH::AssertLastParam", align 1
  %33 = alloca %"class.JPH::AABBTreeBuilder", align 8
  %34 = alloca %"struct.JPH::AABBTreeBuilderStats", align 8
  %35 = alloca ptr, align 8
  %36 = alloca %"class.JPH::AABBTreeToBuffer", align 8
  %37 = alloca ptr, align 8
  %38 = 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
  %39 = load ptr, ptr %4, align 8
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3JPH5ShapeC2ENS_10EShapeTypeENS_13EShapeSubTypeERKNS_13ShapeSettingsERNS_6ResultINS_3RefIS0_EEEE(ptr noundef nonnull align 8 dereferenceable(26) %39, i8 noundef zeroext 3, i8 noundef zeroext 12, ptr noundef nonnull align 8 dereferenceable(64) %40, ptr noundef nonnull align 8 dereferenceable(33) %41)
  store ptr getelementptr inbounds inrange(-16, 280) ({ [37 x ptr] }, ptr @_ZTVN3JPH9MeshShapeE, i32 0, i32 0, i32 2), ptr %39, align 8, !tbaa !9
  %42 = getelementptr inbounds %"class.JPH::MeshShape", ptr %39, i32 0, i32 1
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %42) #6
  %43 = getelementptr inbounds %"class.JPH::MeshShape", ptr %39, i32 0, i32 2
  call void @_ZN3JPH10ByteBufferC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %43) #6
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %44, i32 0, i32 2
  %46 = invoke noundef zeroext i1 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %45)
          to label %47 unwind label %51

47:                                               ; preds = %3
  br i1 %46, label %48, label %55

48:                                               ; preds = %47
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %49, ptr noundef @.str.1)
          to label %50 unwind label %51

50:                                               ; preds = %48
  br label %437

51:                                               ; preds = %48, %3
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %7, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %8, align 4
  br label %455

55:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #6
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %58, i32 0, i32 1
  invoke void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContextC2ERKNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS3_EEEERKNS2_INS_6Float3ENS4_IS9_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(24) %59)
          to label %60 unwind label %71

60:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %61, i32 0, i32 2
  %63 = invoke noundef i64 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %62)
          to label %64 unwind label %75

64:                                               ; preds = %60
  %65 = trunc i64 %63 to i32
  %66 = sub nsw i32 %65, 1
  store i32 %66, ptr %10, align 4, !tbaa !11
  br label %67

67:                                               ; preds = %174, %64
  %68 = load i32, ptr %10, align 4, !tbaa !11
  %69 = icmp sge i32 %68, 0
  br i1 %69, label %79, label %70

70:                                               ; preds = %67
  store i32 2, ptr %11, align 4
  br label %178

71:                                               ; preds = %334, %190, %186, %181, %55
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %7, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %8, align 4
  br label %454

75:                                               ; preds = %60
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %7, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %8, align 4
  br label %180

79:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %80, i32 0, i32 2
  %82 = load i32, ptr %10, align 4, !tbaa !11
  %83 = sext i32 %82 to i64
  %84 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %83)
          to label %85 unwind label %100

85:                                               ; preds = %79
  store ptr %84, ptr %12, align 8, !tbaa !5
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %87, i32 0, i32 1
  %89 = invoke noundef zeroext i1 @_ZNK3JPH25IndexedTriangleNoMaterial12IsDegenerateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(12) %86, ptr noundef nonnull align 8 dereferenceable(24) %88)
          to label %90 unwind label %100

90:                                               ; preds = %85
  br i1 %89, label %95, label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = invoke noundef zeroext i1 @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContext12IsDegenerateERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(48) %9, ptr noundef nonnull align 4 dereferenceable(20) %92)
          to label %94 unwind label %100

94:                                               ; preds = %91
  br i1 %93, label %95, label %113

95:                                               ; preds = %94, %90
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #6
  %97 = load i32, ptr %10, align 4, !tbaa !11
  invoke void (ptr, ptr, ...) @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %13, ptr noundef @.str.2, i32 noundef %97)
          to label %98 unwind label %104

98:                                               ; preds = %95
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %96, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %99 unwind label %108

99:                                               ; preds = %98
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  store i32 1, ptr %11, align 4
  br label %171

100:                                              ; preds = %91, %85, %79
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %7, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %8, align 4
  br label %177

104:                                              ; preds = %95
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %7, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %8, align 4
  br label %112

108:                                              ; preds = %98
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %7, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br label %112

112:                                              ; preds = %108, %104
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  br label %177

113:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = getelementptr inbounds %"class.JPH::IndexedTriangleNoMaterial", ptr %114, i32 0, i32 0
  store ptr %115, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = getelementptr inbounds [3 x i32], ptr %116, i64 0, i64 0
  store ptr %117, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %118 = load ptr, ptr %14, align 8, !tbaa !5
  %119 = getelementptr inbounds [3 x i32], ptr %118, i64 0, i64 0
  %120 = getelementptr inbounds i32, ptr %119, i64 3
  store ptr %120, ptr %16, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %163, %113
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  %123 = load ptr, ptr %16, align 8, !tbaa !5
  %124 = icmp ne ptr %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 5, ptr %11, align 4
  br label %167

126:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %127 = load ptr, ptr %15, align 8, !tbaa !5
  %128 = load i32, ptr %127, align 4, !tbaa !11
  store i32 %128, ptr %17, align 4, !tbaa !11
  %129 = load i32, ptr %17, align 4, !tbaa !11
  %130 = zext i32 %129 to i64
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %131, i32 0, i32 1
  %133 = invoke noundef i64 @_ZNK3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %132)
          to label %134 unwind label %146

134:                                              ; preds = %126
  %135 = icmp uge i64 %130, %133
  br i1 %135, label %136, label %159

136:                                              ; preds = %134
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #6
  %138 = load i32, ptr %17, align 4, !tbaa !11
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %139, i32 0, i32 1
  %141 = invoke noundef i64 @_ZNK3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %140)
          to label %142 unwind label %150

142:                                              ; preds = %136
  %143 = trunc i64 %141 to i32
  invoke void (ptr, ptr, ...) @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %18, ptr noundef @.str.3, i32 noundef %138, i32 noundef %143)
          to label %144 unwind label %150

144:                                              ; preds = %142
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %137, ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %145 unwind label %154

145:                                              ; preds = %144
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #6
  store i32 1, ptr %11, align 4
  br label %160

146:                                              ; preds = %126
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %7, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %8, align 4
  br label %166

150:                                              ; preds = %142, %136
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %7, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %8, align 4
  br label %158

154:                                              ; preds = %144
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %7, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #6
  br label %158

158:                                              ; preds = %154, %150
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #6
  br label %166

159:                                              ; preds = %134
  store i32 0, ptr %11, align 4
  br label %160

160:                                              ; preds = %159, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  %161 = load i32, ptr %11, align 4
  switch i32 %161, label %167 [
    i32 0, label %162
  ]

162:                                              ; preds = %160
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %15, align 8, !tbaa !5
  %165 = getelementptr inbounds i32, ptr %164, i32 1
  store ptr %165, ptr %15, align 8, !tbaa !5
  br label %121

166:                                              ; preds = %158, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %177

167:                                              ; preds = %160, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %168 = load i32, ptr %11, align 4
  switch i32 %168, label %171 [
    i32 5, label %169
  ]

169:                                              ; preds = %167
  br label %170

170:                                              ; preds = %169
  store i32 0, ptr %11, align 4
  br label %171

171:                                              ; preds = %170, %167, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %172 = load i32, ptr %11, align 4
  switch i32 %172, label %178 [
    i32 0, label %173
  ]

173:                                              ; preds = %171
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %10, align 4, !tbaa !11
  %176 = add nsw i32 %175, -1
  store i32 %176, ptr %10, align 4, !tbaa !11
  br label %67, !llvm.loop !13

177:                                              ; preds = %166, %112, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %180

178:                                              ; preds = %171, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %179 = load i32, ptr %11, align 4
  switch i32 %179, label %435 [
    i32 2, label %181
  ]

180:                                              ; preds = %177, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %454

181:                                              ; preds = %178
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %182, i32 0, i32 3
  %184 = getelementptr inbounds %"class.JPH::MeshShape", ptr %39, i32 0, i32 1
  %185 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(24) %184, ptr noundef nonnull align 8 dereferenceable(24) %183)
          to label %186 unwind label %71

186:                                              ; preds = %181
  %187 = getelementptr inbounds %"class.JPH::MeshShape", ptr %39, i32 0, i32 1
  %188 = invoke noundef zeroext i1 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %187)
          to label %189 unwind label %71

189:                                              ; preds = %186
  br i1 %188, label %277, label %190

190:                                              ; preds = %189
  %191 = getelementptr inbounds %"class.JPH::MeshShape", ptr %39, i32 0, i32 1
  %192 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %191)
          to label %193 unwind label %71

193:                                              ; preds = %190
  %194 = icmp ugt i64 %192, 32
  br i1 %194, label %195, label %208

195:                                              ; preds = %193
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #6
  invoke void (ptr, ptr, ...) @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %19, ptr noundef @.str.4, i32 noundef 32)
          to label %197 unwind label %199

197:                                              ; preds = %195
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %196, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %198 unwind label %203

198:                                              ; preds = %197
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #6
  store i32 1, ptr %11, align 4
  br label %435

199:                                              ; preds = %195
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %7, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %8, align 4
  br label %207

203:                                              ; preds = %197
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %7, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  br label %207

207:                                              ; preds = %203, %199
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #6
  br label %454

208:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %209, i32 0, i32 2
  store ptr %210, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %211 = load ptr, ptr %20, align 8, !tbaa !5
  %212 = invoke noundef ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %211)
          to label %213 unwind label %222

213:                                              ; preds = %208
  store ptr %212, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %214 = load ptr, ptr %20, align 8, !tbaa !5
  %215 = invoke noundef ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %214)
          to label %216 unwind label %226

216:                                              ; preds = %213
  store ptr %215, ptr %22, align 8, !tbaa !5
  br label %217

217:                                              ; preds = %268, %216
  %218 = load ptr, ptr %21, align 8, !tbaa !5
  %219 = load ptr, ptr %22, align 8, !tbaa !5
  %220 = icmp ne ptr %218, %219
  br i1 %220, label %230, label %221

221:                                              ; preds = %217
  store i32 7, ptr %11, align 4
  br label %272

222:                                              ; preds = %208
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %7, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %8, align 4
  br label %275

226:                                              ; preds = %213
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %7, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %8, align 4
  br label %274

230:                                              ; preds = %217
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %231 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %231, ptr %23, align 8, !tbaa !5
  %232 = load ptr, ptr %23, align 8, !tbaa !5
  %233 = getelementptr inbounds %"class.JPH::IndexedTriangle", ptr %232, i32 0, i32 1
  %234 = load i32, ptr %233, align 4, !tbaa !15
  %235 = zext i32 %234 to i64
  %236 = getelementptr inbounds %"class.JPH::MeshShape", ptr %39, i32 0, i32 1
  %237 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %236)
          to label %238 unwind label %251

238:                                              ; preds = %230
  %239 = icmp uge i64 %235, %237
  br i1 %239, label %240, label %264

240:                                              ; preds = %238
  %241 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #6
  %242 = load ptr, ptr %23, align 8, !tbaa !5
  %243 = getelementptr inbounds %"class.JPH::IndexedTriangle", ptr %242, i32 0, i32 1
  %244 = load i32, ptr %243, align 4, !tbaa !15
  %245 = getelementptr inbounds %"class.JPH::MeshShape", ptr %39, i32 0, i32 1
  %246 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %245)
          to label %247 unwind label %255

247:                                              ; preds = %240
  %248 = trunc i64 %246 to i32
  invoke void (ptr, ptr, ...) @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %24, ptr noundef @.str.5, i32 noundef %244, i32 noundef %248)
          to label %249 unwind label %255

249:                                              ; preds = %247
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %241, ptr noundef nonnull align 8 dereferenceable(32) %24)
          to label %250 unwind label %259

250:                                              ; preds = %249
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #6
  store i32 1, ptr %11, align 4
  br label %265

251:                                              ; preds = %230
  %252 = landingpad { ptr, i32 }
          cleanup
  %253 = extractvalue { ptr, i32 } %252, 0
  store ptr %253, ptr %7, align 8
  %254 = extractvalue { ptr, i32 } %252, 1
  store i32 %254, ptr %8, align 4
  br label %271

255:                                              ; preds = %247, %240
  %256 = landingpad { ptr, i32 }
          cleanup
  %257 = extractvalue { ptr, i32 } %256, 0
  store ptr %257, ptr %7, align 8
  %258 = extractvalue { ptr, i32 } %256, 1
  store i32 %258, ptr %8, align 4
  br label %263

259:                                              ; preds = %249
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %7, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #6
  br label %263

263:                                              ; preds = %259, %255
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #6
  br label %271

264:                                              ; preds = %238
  store i32 0, ptr %11, align 4
  br label %265

265:                                              ; preds = %264, %250
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  %266 = load i32, ptr %11, align 4
  switch i32 %266, label %272 [
    i32 0, label %267
  ]

267:                                              ; preds = %265
  br label %268

268:                                              ; preds = %267
  %269 = load ptr, ptr %21, align 8, !tbaa !5
  %270 = getelementptr inbounds %"class.JPH::IndexedTriangle", ptr %269, i32 1
  store ptr %270, ptr %21, align 8, !tbaa !5
  br label %217

271:                                              ; preds = %263, %251
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %274

272:                                              ; preds = %265, %221
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  %273 = load i32, ptr %11, align 4
  switch i32 %273, label %435 [
    i32 7, label %276
  ]

274:                                              ; preds = %271, %226
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %275

275:                                              ; preds = %274, %222
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %454

276:                                              ; preds = %272
  br label %324

277:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %278 = load ptr, ptr %5, align 8, !tbaa !5
  %279 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %278, i32 0, i32 2
  store ptr %279, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %280 = load ptr, ptr %25, align 8, !tbaa !5
  %281 = invoke noundef ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %280)
          to label %282 unwind label %291

282:                                              ; preds = %277
  store ptr %281, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %283 = load ptr, ptr %25, align 8, !tbaa !5
  %284 = invoke noundef ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %283)
          to label %285 unwind label %295

285:                                              ; preds = %282
  store ptr %284, ptr %27, align 8, !tbaa !5
  br label %286

286:                                              ; preds = %316, %285
  %287 = load ptr, ptr %26, align 8, !tbaa !5
  %288 = load ptr, ptr %27, align 8, !tbaa !5
  %289 = icmp ne ptr %287, %288
  br i1 %289, label %299, label %290

290:                                              ; preds = %286
  store i32 9, ptr %11, align 4
  br label %319

291:                                              ; preds = %277
  %292 = landingpad { ptr, i32 }
          cleanup
  %293 = extractvalue { ptr, i32 } %292, 0
  store ptr %293, ptr %7, align 8
  %294 = extractvalue { ptr, i32 } %292, 1
  store i32 %294, ptr %8, align 4
  br label %322

295:                                              ; preds = %282
  %296 = landingpad { ptr, i32 }
          cleanup
  %297 = extractvalue { ptr, i32 } %296, 0
  store ptr %297, ptr %7, align 8
  %298 = extractvalue { ptr, i32 } %296, 1
  store i32 %298, ptr %8, align 4
  br label %321

299:                                              ; preds = %286
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %300 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %300, ptr %28, align 8, !tbaa !5
  %301 = load ptr, ptr %28, align 8, !tbaa !5
  %302 = getelementptr inbounds %"class.JPH::IndexedTriangle", ptr %301, i32 0, i32 1
  %303 = load i32, ptr %302, align 4, !tbaa !15
  %304 = icmp ne i32 %303, 0
  br i1 %304, label %305, label %312

305:                                              ; preds = %299
  %306 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %306, ptr noundef @.str.6)
          to label %307 unwind label %308

307:                                              ; preds = %305
  store i32 1, ptr %11, align 4
  br label %313

308:                                              ; preds = %305
  %309 = landingpad { ptr, i32 }
          cleanup
  %310 = extractvalue { ptr, i32 } %309, 0
  store ptr %310, ptr %7, align 8
  %311 = extractvalue { ptr, i32 } %309, 1
  store i32 %311, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %321

312:                                              ; preds = %299
  store i32 0, ptr %11, align 4
  br label %313

313:                                              ; preds = %312, %307
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  %314 = load i32, ptr %11, align 4
  switch i32 %314, label %319 [
    i32 0, label %315
  ]

315:                                              ; preds = %313
  br label %316

316:                                              ; preds = %315
  %317 = load ptr, ptr %26, align 8, !tbaa !5
  %318 = getelementptr inbounds %"class.JPH::IndexedTriangle", ptr %317, i32 1
  store ptr %318, ptr %26, align 8, !tbaa !5
  br label %286

319:                                              ; preds = %313, %290
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  %320 = load i32, ptr %11, align 4
  switch i32 %320, label %435 [
    i32 9, label %323
  ]

321:                                              ; preds = %308, %295
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %322

322:                                              ; preds = %321, %291
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %454

323:                                              ; preds = %319
  br label %324

324:                                              ; preds = %323, %276
  %325 = load ptr, ptr %5, align 8, !tbaa !5
  %326 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %325, i32 0, i32 4
  %327 = load i32, ptr %326, align 8, !tbaa !18
  %328 = icmp ult i32 %327, 1
  br i1 %328, label %334, label %329

329:                                              ; preds = %324
  %330 = load ptr, ptr %5, align 8, !tbaa !5
  %331 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %330, i32 0, i32 4
  %332 = load i32, ptr %331, align 8, !tbaa !18
  %333 = icmp ugt i32 %332, 8
  br i1 %333, label %334, label %337

334:                                              ; preds = %329, %324
  %335 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %335, ptr noundef @.str.7)
          to label %336 unwind label %71

336:                                              ; preds = %334
  store i32 1, ptr %11, align 4
  br label %435

337:                                              ; preds = %329
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #6
  %338 = load ptr, ptr %5, align 8, !tbaa !5
  %339 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %338, i32 0, i32 2
  invoke void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 8 dereferenceable(24) %339)
          to label %340 unwind label %347

340:                                              ; preds = %337
  %341 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN3JPH9MeshShape16sFindActiveEdgesERKNS_17MeshShapeSettingsERNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS5_EEEE(ptr noundef nonnull align 8 dereferenceable(152) %341, ptr noundef nonnull align 8 dereferenceable(24) %29)
          to label %342 unwind label %351

342:                                              ; preds = %340
  call void @llvm.lifetime.start.p0(i64 112, ptr %30) #6
  invoke void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %30)
          to label %343 unwind label %355

343:                                              ; preds = %342
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  store ptr null, ptr %31, align 8, !tbaa !5
  %344 = load ptr, ptr %5, align 8, !tbaa !5
  %345 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %344, i32 0, i32 7
  %346 = load i32, ptr %345, align 4, !tbaa !34
  switch i32 %346, label %371 [
    i32 0, label %359
    i32 1, label %367
  ]

347:                                              ; preds = %337
  %348 = landingpad { ptr, i32 }
          cleanup
  %349 = extractvalue { ptr, i32 } %348, 0
  store ptr %349, ptr %7, align 8
  %350 = extractvalue { ptr, i32 } %348, 1
  store i32 %350, ptr %8, align 4
  br label %453

351:                                              ; preds = %340
  %352 = landingpad { ptr, i32 }
          cleanup
  %353 = extractvalue { ptr, i32 } %352, 0
  store ptr %353, ptr %7, align 8
  %354 = extractvalue { ptr, i32 } %352, 1
  store i32 %354, ptr %8, align 4
  br label %452

355:                                              ; preds = %342
  %356 = landingpad { ptr, i32 }
          cleanup
  %357 = extractvalue { ptr, i32 } %356, 0
  store ptr %357, ptr %7, align 8
  %358 = extractvalue { ptr, i32 } %356, 1
  store i32 %358, ptr %8, align 4
  br label %451

359:                                              ; preds = %343
  %360 = load ptr, ptr %5, align 8, !tbaa !5
  %361 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %360, i32 0, i32 1
  invoke void @_ZN3JPH23TriangleSplitterBinningC1ERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS1_INS_15IndexedTriangleENS3_IS8_EEEEjjj(ptr noundef nonnull align 8 dereferenceable(112) %30, ptr noundef nonnull align 8 dereferenceable(24) %361, ptr noundef nonnull align 8 dereferenceable(24) %29, i32 noundef 8, i32 noundef 128, i32 noundef 6)
          to label %362 unwind label %363

362:                                              ; preds = %359
  store ptr %30, ptr %31, align 8, !tbaa !5
  br label %379

363:                                              ; preds = %372, %367, %359
  %364 = landingpad { ptr, i32 }
          cleanup
  %365 = extractvalue { ptr, i32 } %364, 0
  store ptr %365, ptr %7, align 8
  %366 = extractvalue { ptr, i32 } %364, 1
  store i32 %366, ptr %8, align 4
  br label %450

367:                                              ; preds = %343
  %368 = load ptr, ptr %5, align 8, !tbaa !5
  %369 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %368, i32 0, i32 1
  invoke void @_ZN3JPH20TriangleSplitterMeanC1ERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS1_INS_15IndexedTriangleENS3_IS8_EEEE(ptr noundef nonnull align 8 dereferenceable(72) %30, ptr noundef nonnull align 8 dereferenceable(24) %369, ptr noundef nonnull align 8 dereferenceable(24) %29)
          to label %370 unwind label %363

370:                                              ; preds = %367
  store ptr %30, ptr %31, align 8, !tbaa !5
  br label %379

371:                                              ; preds = %343
  br label %372

372:                                              ; preds = %371
  %373 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 216)
          to label %374 unwind label %363

374:                                              ; preds = %372
  br i1 %373, label %375, label %376

375:                                              ; preds = %374
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !35
  br label %376

376:                                              ; preds = %375, %374
  br label %377

377:                                              ; preds = %376
  br label %378

378:                                              ; preds = %377
  br label %379

379:                                              ; preds = %378, %370, %362
  call void @llvm.lifetime.start.p0(i64 64, ptr %33) #6
  %380 = load ptr, ptr %31, align 8, !tbaa !5
  %381 = load ptr, ptr %5, align 8, !tbaa !5
  %382 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %381, i32 0, i32 4
  %383 = load i32, ptr %382, align 8, !tbaa !18
  invoke void @_ZN3JPH15AABBTreeBuilderC1ERNS_16TriangleSplitterEj(ptr noundef nonnull align 8 dereferenceable(64) %33, ptr noundef nonnull align 8 dereferenceable(72) %380, i32 noundef %383)
          to label %384 unwind label %408

384:                                              ; preds = %379
  call void @llvm.lifetime.start.p0(i64 56, ptr %34) #6
  call void @_ZN3JPH20AABBTreeBuilderStatsC2Ev(ptr noundef nonnull align 8 dereferenceable(52) %34) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  %385 = invoke noundef ptr @_ZN3JPH15AABBTreeBuilder5BuildERNS_20AABBTreeBuilderStatsE(ptr noundef nonnull align 8 dereferenceable(64) %33, ptr noundef nonnull align 8 dereferenceable(52) %34)
          to label %386 unwind label %412

386:                                              ; preds = %384
  store ptr %385, ptr %35, align 8, !tbaa !5
  %387 = load ptr, ptr %31, align 8, !tbaa !5
  %388 = load ptr, ptr %387, align 8, !tbaa !9
  %389 = getelementptr inbounds ptr, ptr %388, i64 0
  %390 = load ptr, ptr %389, align 8
  call void %390(ptr noundef nonnull align 8 dereferenceable(72) %387) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %36) #6
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %36) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  store ptr null, ptr %37, align 8, !tbaa !5
  %391 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH15AABBTreeBuilder12GetTrianglesEv(ptr noundef nonnull align 8 dereferenceable(64) %33)
          to label %392 unwind label %416

392:                                              ; preds = %386
  %393 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH15AABBTreeBuilder8GetNodesEv(ptr noundef nonnull align 8 dereferenceable(64) %33)
          to label %394 unwind label %416

394:                                              ; preds = %392
  %395 = load ptr, ptr %5, align 8, !tbaa !5
  %396 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %395, i32 0, i32 1
  %397 = load ptr, ptr %35, align 8, !tbaa !5
  %398 = load ptr, ptr %5, align 8, !tbaa !5
  %399 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %398, i32 0, i32 6
  %400 = load i8, ptr %399, align 8, !tbaa !36, !range !37, !noundef !38
  %401 = trunc i8 %400 to i1
  %402 = invoke noundef zeroext i1 @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEE7ConvertERKNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS5_EEEERKNS4_INS_15AABBTreeBuilder4NodeENS6_ISC_EEEERKNS4_INS_6Float3ENS6_ISH_EEEEPKSC_bRPKc(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(24) %391, ptr noundef nonnull align 8 dereferenceable(24) %393, ptr noundef nonnull align 8 dereferenceable(24) %396, ptr noundef %397, i1 noundef zeroext %401, ptr noundef nonnull align 8 dereferenceable(8) %37)
          to label %403 unwind label %416

403:                                              ; preds = %394
  br i1 %402, label %420, label %404

404:                                              ; preds = %403
  %405 = load ptr, ptr %6, align 8, !tbaa !5
  %406 = load ptr, ptr %37, align 8, !tbaa !5
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %405, ptr noundef %406)
          to label %407 unwind label %416

407:                                              ; preds = %404
  store i32 1, ptr %11, align 4
  br label %434

408:                                              ; preds = %379
  %409 = landingpad { ptr, i32 }
          cleanup
  %410 = extractvalue { ptr, i32 } %409, 0
  store ptr %410, ptr %7, align 8
  %411 = extractvalue { ptr, i32 } %409, 1
  store i32 %411, ptr %8, align 4
  br label %449

412:                                              ; preds = %384
  %413 = landingpad { ptr, i32 }
          cleanup
  %414 = extractvalue { ptr, i32 } %413, 0
  store ptr %414, ptr %7, align 8
  %415 = extractvalue { ptr, i32 } %413, 1
  store i32 %415, ptr %8, align 4
  br label %448

416:                                              ; preds = %427, %423, %420, %404, %394, %392, %386
  %417 = landingpad { ptr, i32 }
          cleanup
  %418 = extractvalue { ptr, i32 } %417, 0
  store ptr %418, ptr %7, align 8
  %419 = extractvalue { ptr, i32 } %417, 1
  store i32 %419, ptr %8, align 4
  br label %447

420:                                              ; preds = %403
  %421 = getelementptr inbounds %"class.JPH::MeshShape", ptr %39, i32 0, i32 2
  %422 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(24) %36)
          to label %423 unwind label %416

423:                                              ; preds = %420
  call void @_ZN3JPH5ArrayIhNS_19STLAlignedAllocatorIhLm64EEEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %421, ptr noundef nonnull align 8 dereferenceable(24) %422) #6
  %424 = invoke noundef i32 @_ZNK3JPH9MeshShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 8 dereferenceable(80) %39)
          to label %425 unwind label %416

425:                                              ; preds = %423
  %426 = icmp ugt i32 %424, 32
  br i1 %426, label %427, label %430

427:                                              ; preds = %425
  %428 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %428, ptr noundef @.str.10)
          to label %429 unwind label %416

429:                                              ; preds = %427
  store i32 1, ptr %11, align 4
  br label %434

430:                                              ; preds = %425
  %431 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  invoke void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef %39)
          to label %432 unwind label %438

432:                                              ; preds = %430
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE3SetEOS3_(ptr noundef nonnull align 8 dereferenceable(33) %431, ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %433 unwind label %442

433:                                              ; preds = %432
  call void @_ZN3JPH3RefINS_5ShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  store i32 0, ptr %11, align 4
  br label %434

434:                                              ; preds = %433, %429, %407
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %36) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %34) #6
  call void @_ZN3JPH15AABBTreeBuilderD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %33) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %30) #6
  call void @llvm.lifetime.end.p0(i64 112, ptr %30) #6
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #6
  br label %435

435:                                              ; preds = %434, %336, %319, %272, %198, %178
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #6
  %436 = load i32, ptr %11, align 4
  switch i32 %436, label %461 [
    i32 0, label %437
    i32 1, label %437
  ]

437:                                              ; preds = %435, %435, %50
  ret void

438:                                              ; preds = %430
  %439 = landingpad { ptr, i32 }
          cleanup
  %440 = extractvalue { ptr, i32 } %439, 0
  store ptr %440, ptr %7, align 8
  %441 = extractvalue { ptr, i32 } %439, 1
  store i32 %441, ptr %8, align 4
  br label %446

442:                                              ; preds = %432
  %443 = landingpad { ptr, i32 }
          cleanup
  %444 = extractvalue { ptr, i32 } %443, 0
  store ptr %444, ptr %7, align 8
  %445 = extractvalue { ptr, i32 } %443, 1
  store i32 %445, ptr %8, align 4
  call void @_ZN3JPH3RefINS_5ShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %38) #6
  br label %446

446:                                              ; preds = %442, %438
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  br label %447

447:                                              ; preds = %446, %416
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %36) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %36) #6
  br label %448

448:                                              ; preds = %447, %412
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %34) #6
  call void @_ZN3JPH15AABBTreeBuilderD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %33) #6
  br label %449

449:                                              ; preds = %448, %408
  call void @llvm.lifetime.end.p0(i64 64, ptr %33) #6
  br label %450

450:                                              ; preds = %449, %363
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %30) #6
  br label %451

451:                                              ; preds = %450, %355
  call void @llvm.lifetime.end.p0(i64 112, ptr %30) #6
  br label %452

452:                                              ; preds = %451, %351
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #6
  br label %453

453:                                              ; preds = %452, %347
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #6
  br label %454

454:                                              ; preds = %453, %322, %275, %207, %180, %71
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #6
  br label %455

455:                                              ; preds = %454, %51
  call void @_ZN3JPH5ArrayIhNS_19STLAlignedAllocatorIhLm64EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %43) #6
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %42) #6
  call void @_ZN3JPH5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(26) %39) #6
  br label %456

456:                                              ; preds = %455
  %457 = load ptr, ptr %7, align 8
  %458 = load i32, ptr %8, align 4
  %459 = insertvalue { ptr, i32 } poison, ptr %457, 0
  %460 = insertvalue { ptr, i32 } %459, i32 %458, 1
  resume { ptr, i32 } %460

461:                                              ; preds = %435
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ShapeC2ENS_10EShapeTypeENS_13EShapeSubTypeERKNS_13ShapeSettingsERNS_6ResultINS_3RefIS0_EEEE(ptr noundef nonnull align 8 dereferenceable(26), i8 noundef zeroext, i8 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #4 align 2

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

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

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

; 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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

declare void @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ...) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageC2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #4 align 2

declare void @_ZN3JPH23TriangleSplitterBinningC1ERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS1_INS_15IndexedTriangleENS3_IS8_EEEEjjj(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #5

declare void @_ZN3JPH20TriangleSplitterMeanC1ERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS1_INS_15IndexedTriangleENS3_IS8_EEEE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #3

declare void @_ZN3JPH15AABBTreeBuilderC1ERNS_16TriangleSplitterEj(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) unnamed_addr #5

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

declare noundef ptr @_ZN3JPH15AABBTreeBuilder5BuildERNS_20AABBTreeBuilderStatsE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(52)) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH15AABBTreeBuilder12GetTrianglesEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH15AABBTreeBuilder8GetNodesEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH9MeshShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 8 dereferenceable(80)) 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)) #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(26)) unnamed_addr #4 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 = { 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 #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 = { "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}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !12, i64 12}
!16 = !{!"_ZTSN3JPH15IndexedTriangleE", !17, i64 0, !12, i64 12, !12, i64 16}
!17 = !{!"_ZTSN3JPH25IndexedTriangleNoMaterialE", !7, i64 0}
!18 = !{!19, !12, i64 136}
!19 = !{!"_ZTSN3JPH17MeshShapeSettingsE", !20, i64 0, !28, i64 64, !29, i64 88, !30, i64 112, !12, i64 136, !31, i64 140, !32, i64 144, !33, i64 148}
!20 = !{!"_ZTSN3JPH13ShapeSettingsE", !21, i64 0, !22, i64 8, !25, i64 16, !26, i64 24}
!21 = !{!"_ZTSN3JPH18SerializableObjectE"}
!22 = !{!"_ZTSN3JPH9RefTargetINS_13ShapeSettingsEEE", !23, i64 0}
!23 = !{!"_ZTSSt6atomicIjE", !24, i64 0}
!24 = !{!"_ZTSSt13__atomic_baseIjE", !12, i64 0}
!25 = !{!"long", !7, i64 0}
!26 = !{!"_ZTSN3JPH6ResultINS_3RefINS_5ShapeEEEEE", !7, i64 0, !27, i64 32}
!27 = !{!"_ZTSN3JPH6ResultINS_3RefINS_5ShapeEEEE6EStateE", !7, i64 0}
!28 = !{!"_ZTSN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEEE", !25, i64 0, !25, i64 8, !6, i64 16}
!29 = !{!"_ZTSN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEE", !25, i64 0, !25, i64 8, !6, i64 16}
!30 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !25, i64 0, !25, i64 8, !6, i64 16}
!31 = !{!"float", !7, i64 0}
!32 = !{!"bool", !7, i64 0}
!33 = !{!"_ZTSN3JPH17MeshShapeSettings13EBuildQualityE", !7, i64 0}
!34 = !{!19, !33, i64 148}
!35 = !{i64 2158739439}
!36 = !{!19, !32, i64 144}
!37 = !{i8 0, i8 2}
!38 = !{}


; 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::TriangleCodecIndexed8BitPackSOA4Flags::ValidationContext" = type { ptr, %"class.JPH::AABox" }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon.14 }
%union.anon.14 = type { <4 x float> }
%"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.5" = type { i64, i64, ptr }
%union.Storage = type { %"class.JPH::TriangleSplitterBinning" }
%"class.JPH::TriangleSplitterBinning" = type { %"class.JPH::TriangleSplitter", i32, i32, i32, %"class.JPH::Array.20" }
%"class.JPH::TriangleSplitter" = type { ptr, ptr, ptr, %"class.JPH::Array", %"class.JPH::Array.17" }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.17" = type { i64, i64, ptr }
%"class.JPH::Array.20" = type { i64, i64, ptr }
%"class.JPH::AABBTreeBuilder" = type { ptr, i32, %"class.JPH::Array.23", %"class.JPH::Array.5" }
%"class.JPH::Array.23" = type { i64, i64, ptr }
%"struct.JPH::AABBTreeBuilderStats" = type { %"struct.JPH::TriangleSplitter::Stats", float, i32, i32, i32, i32, i32, i32, i32, float, [4 x i8] }
%"struct.JPH::TriangleSplitter::Stats" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::AABBTreeToBuffer" = type { %"class.JPH::ByteBuffer" }
%"class.JPH::ByteBuffer" = type { %"class.JPH::Array.16" }
%"class.JPH::Array.16" = type { i64, i64, ptr }
%"class.JPH::Ref" = type { ptr }

@_ZTVN3JPH9MeshShapeE = external dso_local unnamed_addr constant { [37 x ptr] }, align 8
@.str.1 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [70 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 @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContextC2ERKNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS3_EEEERKNS2_INS_6Float3ENS4_IS9_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH25IndexedTriangleNoMaterial12IsDegenerateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContext12IsDegenerateERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 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 @_ZN3JPH9MeshShapeC2ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(152) %1, ptr noundef nonnull align 8 dereferenceable(33) %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.JPH::TriangleCodecIndexed8BitPackSOA4Flags::ValidationContext", align 16
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.JPH::Array.5", align 8
  %10 = alloca %union.Storage, align 8
  %11 = alloca %"class.JPH::AABBTreeBuilder", align 8
  %12 = alloca %"struct.JPH::AABBTreeBuilderStats", align 8
  %13 = alloca %"class.JPH::AABBTreeToBuffer", align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"class.JPH::Ref", align 8
  tail call void @_ZN3JPH5ShapeC2ENS_10EShapeTypeENS_13EShapeSubTypeERKNS_13ShapeSettingsERNS_6ResultINS_3RefIS0_EEEE(ptr noundef nonnull align 8 dereferenceable(26) %0, i8 noundef zeroext 3, i8 noundef zeroext 12, ptr noundef nonnull align 8 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(33) %2)
  store ptr getelementptr inbounds inrange(-16, 280) (i8, ptr @_ZTVN3JPH9MeshShapeE, i64 16), ptr %0, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %17 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @_ZN3JPH10ByteBufferC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  %18 = getelementptr inbounds i8, ptr %1, i64 88
  %19 = tail call noundef zeroext i1 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  br i1 %19, label %20, label %23

20:                                               ; preds = %3
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull @.str.1)
          to label %152 unwind label %21

21:                                               ; preds = %20
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %162

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #6
  %24 = getelementptr inbounds i8, ptr %1, i64 64
  invoke void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContextC2ERKNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS3_EEEERKNS2_INS_6Float3ENS4_IS9_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %25 unwind label %30

25:                                               ; preds = %23
  %26 = call noundef i64 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %27 = trunc i64 %26 to i32
  %28 = icmp slt i32 %27, 1
  br i1 %28, label %.critedge124, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %25
  %29 = and i64 %26, 2147483647
  br label %.lr.ph

30:                                               ; preds = %102, %.critedge124, %23
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %161

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.loopexit
  %indvars.iv = phi i64 [ %29, %.lr.ph.preheader ], [ %indvars.iv.next, %.loopexit ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %32 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv.next)
          to label %33 unwind label %45

33:                                               ; preds = %.lr.ph
  %34 = invoke noundef zeroext i1 @_ZNK3JPH25IndexedTriangleNoMaterial12IsDegenerateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(12) %32, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %35 unwind label %45

35:                                               ; preds = %33
  br i1 %34, label %42, label %36

36:                                               ; preds = %35
  %37 = invoke noundef zeroext i1 @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContext12IsDegenerateERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(20) %32)
          to label %38 unwind label %45

38:                                               ; preds = %36
  br i1 %37, label %42, label %.critedge.preheader

.critedge.preheader:                              ; preds = %38
  %39 = load i32, ptr %32, align 4, !tbaa !8
  %40 = zext i32 %39 to i64
  %41 = call noundef i64 @_ZNK3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
  %.not106 = icmp ugt i64 %41, %40
  br i1 %.not106, label %.critedge.1, label %56

42:                                               ; preds = %38, %35
  %43 = trunc nuw nsw i64 %indvars.iv.next to i32
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  invoke void (ptr, ptr, ...) @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull @.str.2, i32 noundef %43)
          to label %44 unwind label %47

44:                                               ; preds = %42
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull align 8 dereferenceable(32) %5)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %151

45:                                               ; preds = %36, %33, %.lr.ph
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %161

47:                                               ; preds = %42
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %161

.critedge.1:                                      ; preds = %.critedge.preheader
  %.0103.ptr.1 = getelementptr inbounds i8, ptr %32, i64 4
  %49 = load i32, ptr %.0103.ptr.1, align 4, !tbaa !8
  %50 = zext i32 %49 to i64
  %51 = call noundef i64 @_ZNK3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
  %.not106.1 = icmp ugt i64 %51, %50
  br i1 %.not106.1, label %.critedge.2, label %56

.critedge.2:                                      ; preds = %.critedge.1
  %.0103.ptr.2 = getelementptr inbounds i8, ptr %32, i64 8
  %52 = load i32, ptr %.0103.ptr.2, align 4, !tbaa !8
  %53 = zext i32 %52 to i64
  %54 = call noundef i64 @_ZNK3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
  %.not106.2 = icmp ugt i64 %54, %53
  br i1 %.not106.2, label %.loopexit, label %56

.loopexit:                                        ; preds = %.critedge.2
  %55 = icmp ult i64 %indvars.iv, 2
  br i1 %55, label %.critedge124, label %.lr.ph, !llvm.loop !11

56:                                               ; preds = %.critedge.2, %.critedge.1, %.critedge.preheader
  %.lcssa = phi i32 [ %39, %.critedge.preheader ], [ %49, %.critedge.1 ], [ %52, %.critedge.2 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  %57 = call noundef i64 @_ZNK3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
  %58 = trunc i64 %57 to i32
  invoke void (ptr, ptr, ...) @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull @.str.3, i32 noundef %.lcssa, i32 noundef %58)
          to label %59 unwind label %60

59:                                               ; preds = %56
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull align 8 dereferenceable(32) %6)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  br label %151

60:                                               ; preds = %56
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  br label %161

.critedge124:                                     ; preds = %.loopexit, %25
  %62 = getelementptr inbounds i8, ptr %1, i64 112
  %63 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %62)
          to label %64 unwind label %30

64:                                               ; preds = %.critedge124
  %65 = call noundef zeroext i1 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  br i1 %65, label %89, label %66

66:                                               ; preds = %64
  %67 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %68 = icmp ugt i64 %67, 32
  br i1 %68, label %69, label %73

69:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  invoke void (ptr, ptr, ...) @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef nonnull @.str.4, i32 noundef 32)
          to label %70 unwind label %71

70:                                               ; preds = %69
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull align 8 dereferenceable(32) %7)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  br label %151

71:                                               ; preds = %69
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  br label %161

73:                                               ; preds = %66
  %74 = call noundef ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %75 = call noundef ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %.not108143 = icmp eq ptr %74, %75
  br i1 %.not108143, label %.critedge128, label %.lr.ph145

.lr.ph145:                                        ; preds = %73, %.critedge126
  %.0104144 = phi ptr [ %87, %.critedge126 ], [ %74, %73 ]
  %76 = getelementptr inbounds i8, ptr %.0104144, i64 12
  %77 = load i32, ptr %76, align 4, !tbaa !13
  %78 = zext i32 %77 to i64
  %79 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %.not109 = icmp ugt i64 %79, %78
  br i1 %.not109, label %.critedge126, label %80

80:                                               ; preds = %.lr.ph145
  %81 = getelementptr inbounds i8, ptr %.0104144, i64 12
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  %82 = load i32, ptr %81, align 4, !tbaa !13
  %83 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %84 = trunc i64 %83 to i32
  invoke void (ptr, ptr, ...) @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull @.str.5, i32 noundef %82, i32 noundef %84)
          to label %88 unwind label %85

85:                                               ; preds = %80
  %86 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  br label %161

.critedge126:                                     ; preds = %.lr.ph145
  %87 = getelementptr inbounds i8, ptr %.0104144, i64 20
  %.not108 = icmp eq ptr %87, %75
  br i1 %.not108, label %.critedge128, label %.lr.ph145

88:                                               ; preds = %80
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull align 8 dereferenceable(32) %8)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  br label %151

89:                                               ; preds = %64
  %90 = call noundef ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %91 = call noundef ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %.not110146 = icmp eq ptr %90, %91
  br i1 %.not110146, label %.critedge128, label %.critedge130

92:                                               ; preds = %.critedge130
  %93 = getelementptr inbounds i8, ptr %.094147, i64 20
  %.not110 = icmp eq ptr %93, %91
  br i1 %.not110, label %.critedge128, label %.critedge130

.critedge130:                                     ; preds = %89, %92
  %.094147 = phi ptr [ %93, %92 ], [ %90, %89 ]
  %94 = getelementptr inbounds i8, ptr %.094147, i64 12
  %95 = load i32, ptr %94, align 4, !tbaa !13
  %.not111 = icmp eq i32 %95, 0
  br i1 %.not111, label %92, label %96

96:                                               ; preds = %.critedge130
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull @.str.6)
          to label %151 unwind label %97

97:                                               ; preds = %96
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %161

.critedge128:                                     ; preds = %.critedge126, %92, %73, %89
  %99 = getelementptr inbounds i8, ptr %1, i64 136
  %100 = load i32, ptr %99, align 8, !tbaa !16
  %101 = add i32 %100, -9
  %or.cond = icmp ult i32 %101, -8
  br i1 %or.cond, label %102, label %103

102:                                              ; preds = %.critedge128
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull @.str.7)
          to label %151 unwind label %30

103:                                              ; preds = %.critedge128
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  invoke void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %104 unwind label %108

104:                                              ; preds = %103
  invoke void @_ZN3JPH9MeshShape16sFindActiveEdgesERKNS_17MeshShapeSettingsERNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS5_EEEE(ptr noundef nonnull align 8 dereferenceable(152) %1, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %105 unwind label %110

105:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %10) #6
  call void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %10)
  %106 = getelementptr inbounds i8, ptr %1, i64 148
  %107 = load i32, ptr %106, align 4, !tbaa !33
  switch i32 %107, label %116 [
    i32 0, label %112
    i32 1, label %115
  ]

108:                                              ; preds = %103
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %160

110:                                              ; preds = %104
  %111 = landingpad { ptr, i32 }
          cleanup
  br label %159

112:                                              ; preds = %105
  invoke void @_ZN3JPH23TriangleSplitterBinningC1ERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS1_INS_15IndexedTriangleENS3_IS8_EEEEjjj(ptr noundef nonnull align 8 dereferenceable(112) %10, ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef 8, i32 noundef 128, i32 noundef 6)
          to label %120 unwind label %113

113:                                              ; preds = %116, %115, %112
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %158

115:                                              ; preds = %105
  invoke void @_ZN3JPH20TriangleSplitterMeanC1ERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS1_INS_15IndexedTriangleENS3_IS8_EEEE(ptr noundef nonnull align 8 dereferenceable(72) %10, ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %120 unwind label %113

116:                                              ; preds = %105
  %117 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 216)
          to label %118 unwind label %113

118:                                              ; preds = %116
  br i1 %117, label %119, label %120

119:                                              ; preds = %118
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !34
  br label %120

120:                                              ; preds = %115, %112, %118, %119
  %.083 = phi ptr [ null, %119 ], [ null, %118 ], [ %10, %112 ], [ %10, %115 ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %11) #6
  %121 = load i32, ptr %99, align 8, !tbaa !16
  invoke void @_ZN3JPH15AABBTreeBuilderC1ERNS_16TriangleSplitterEj(ptr noundef nonnull align 8 dereferenceable(64) %11, ptr noundef nonnull align 8 dereferenceable(72) %.083, i32 noundef %121)
          to label %122 unwind label %136

122:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %12) #6
  call void @_ZN3JPH20AABBTreeBuilderStatsC2Ev(ptr noundef nonnull align 8 dereferenceable(52) %12) #6
  %123 = invoke noundef ptr @_ZN3JPH15AABBTreeBuilder5BuildERNS_20AABBTreeBuilderStatsE(ptr noundef nonnull align 8 dereferenceable(64) %11, ptr noundef nonnull align 8 dereferenceable(52) %12)
          to label %124 unwind label %138

124:                                              ; preds = %122
  %125 = load ptr, ptr %.083, align 8, !tbaa !5
  %126 = load ptr, ptr %125, align 8
  call void %126(ptr noundef nonnull align 8 dereferenceable(72) %.083) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #6
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  store ptr null, ptr %14, align 8, !tbaa !35
  %127 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH15AABBTreeBuilder12GetTrianglesEv(ptr noundef nonnull align 8 dereferenceable(64) %11)
  %128 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH15AABBTreeBuilder8GetNodesEv(ptr noundef nonnull align 8 dereferenceable(64) %11)
  %129 = getelementptr inbounds i8, ptr %1, i64 144
  %130 = load i8, ptr %129, align 8, !tbaa !36, !range !37, !noundef !38
  %131 = trunc nuw i8 %130 to i1
  %132 = invoke noundef zeroext i1 @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEE7ConvertERKNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS5_EEEERKNS4_INS_15AABBTreeBuilder4NodeENS6_ISC_EEEERKNS4_INS_6Float3ENS6_ISH_EEEEPKSC_bRPKc(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %127, ptr noundef nonnull align 8 dereferenceable(24) %128, ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef %123, i1 noundef zeroext %131, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %133 unwind label %140

133:                                              ; preds = %124
  br i1 %132, label %142, label %134

134:                                              ; preds = %133
  %135 = load ptr, ptr %14, align 8, !tbaa !35
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef %135)
          to label %150 unwind label %140

136:                                              ; preds = %120
  %137 = landingpad { ptr, i32 }
          cleanup
  br label %157

138:                                              ; preds = %122
  %139 = landingpad { ptr, i32 }
          cleanup
  br label %156

140:                                              ; preds = %147, %142, %134, %124
  %141 = landingpad { ptr, i32 }
          cleanup
  br label %155

142:                                              ; preds = %133
  %143 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @_ZN3JPH5ArrayIhNS_19STLAlignedAllocatorIhLm64EEEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %143) #6
  %144 = invoke noundef i32 @_ZNK3JPH9MeshShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
          to label %145 unwind label %140

145:                                              ; preds = %142
  %146 = icmp ugt i32 %144, 32
  br i1 %146, label %147, label %148

147:                                              ; preds = %145
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull @.str.10)
          to label %150 unwind label %140

148:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  invoke void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull %0)
          to label %149 unwind label %153

149:                                              ; preds = %148
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE3SetEOS3_(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull align 8 dereferenceable(8) %15)
  call void @_ZN3JPH3RefINS_5ShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  br label %150

150:                                              ; preds = %147, %134, %149
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #6
  call void @_ZN3JPH15AABBTreeBuilderD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %11) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #6
  call void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %10) #6
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %10) #6
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br label %151

151:                                              ; preds = %96, %88, %59, %44, %102, %150, %70
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #6
  br label %152

152:                                              ; preds = %20, %151
  ret void

153:                                              ; preds = %148
  %154 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  br label %155

155:                                              ; preds = %153, %140
  %.pn112 = phi { ptr, i32 } [ %141, %140 ], [ %154, %153 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #6
  br label %156

156:                                              ; preds = %155, %138
  %.pn112.pn = phi { ptr, i32 } [ %.pn112, %155 ], [ %139, %138 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #6
  call void @_ZN3JPH15AABBTreeBuilderD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %11) #6
  br label %157

157:                                              ; preds = %156, %136
  %.pn112.pn.pn = phi { ptr, i32 } [ %.pn112.pn, %156 ], [ %137, %136 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #6
  br label %158

158:                                              ; preds = %157, %113
  %.pn112.pn.pn.pn = phi { ptr, i32 } [ %.pn112.pn.pn, %157 ], [ %114, %113 ]
  call void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %10) #6
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %10) #6
  br label %159

159:                                              ; preds = %158, %110
  %.pn112.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn112.pn.pn.pn, %158 ], [ %111, %110 ]
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  br label %160

160:                                              ; preds = %159, %108
  %.pn112.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn112.pn.pn.pn.pn, %159 ], [ %109, %108 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br label %161

161:                                              ; preds = %45, %47, %60, %160, %97, %85, %71, %30
  %.pn119 = phi { ptr, i32 } [ %31, %30 ], [ %.pn112.pn.pn.pn.pn.pn, %160 ], [ %98, %97 ], [ %72, %71 ], [ %86, %85 ], [ %48, %47 ], [ %61, %60 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #6
  br label %162

162:                                              ; preds = %161, %21
  %.pn121 = phi { ptr, i32 } [ %22, %21 ], [ %.pn119, %161 ]
  call void @_ZN3JPH5ArrayIhNS_19STLAlignedAllocatorIhLm64EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  call void @_ZN3JPH5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(26) %0) #6
  resume { ptr, i32 } %.pn121
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ShapeC2ENS_10EShapeTypeENS_13EShapeSubTypeERKNS_13ShapeSettingsERNS_6ResultINS_3RefIS0_EEEE(ptr noundef nonnull align 8 dereferenceable(26), i8 noundef zeroext, i8 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #4 align 2

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

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

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

; 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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

declare void @_ZN3JPH12StringFormatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ...) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_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_15IndexedTriangleENS_12STLAllocatorIS1_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_15IndexedTriangleENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageC2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #4 align 2

declare void @_ZN3JPH23TriangleSplitterBinningC1ERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS1_INS_15IndexedTriangleENS3_IS8_EEEEjjj(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #5

declare void @_ZN3JPH20TriangleSplitterMeanC1ERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS1_INS_15IndexedTriangleENS3_IS8_EEEE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZN3JPH15AABBTreeBuilderC1ERNS_16TriangleSplitterEj(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) unnamed_addr #5

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

declare noundef ptr @_ZN3JPH15AABBTreeBuilder5BuildERNS_20AABBTreeBuilderStatsE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH15AABBTreeBuilder12GetTrianglesEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH15AABBTreeBuilder8GetNodesEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH9MeshShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 8 dereferenceable(80)) 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 #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZZN3JPH9MeshShapeC1ERKNS_17MeshShapeSettingsERNS_6ResultINS_3RefINS_5ShapeEEEEEEN7StorageD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(26)) unnamed_addr #4 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 = { 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 #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 = { "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"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !9, i64 12}
!14 = !{!"_ZTSN3JPH15IndexedTriangleE", !15, i64 0, !9, i64 12, !9, i64 16}
!15 = !{!"_ZTSN3JPH25IndexedTriangleNoMaterialE", !10, i64 0}
!16 = !{!17, !9, i64 136}
!17 = !{!"_ZTSN3JPH17MeshShapeSettingsE", !18, i64 0, !26, i64 64, !28, i64 88, !29, i64 112, !9, i64 136, !30, i64 140, !31, i64 144, !32, i64 148}
!18 = !{!"_ZTSN3JPH13ShapeSettingsE", !19, i64 0, !20, i64 8, !23, i64 16, !24, i64 24}
!19 = !{!"_ZTSN3JPH18SerializableObjectE"}
!20 = !{!"_ZTSN3JPH9RefTargetINS_13ShapeSettingsEEE", !21, i64 0}
!21 = !{!"_ZTSSt6atomicIjE", !22, i64 0}
!22 = !{!"_ZTSSt13__atomic_baseIjE", !9, i64 0}
!23 = !{!"long", !10, i64 0}
!24 = !{!"_ZTSN3JPH6ResultINS_3RefINS_5ShapeEEEEE", !10, i64 0, !25, i64 32}
!25 = !{!"_ZTSN3JPH6ResultINS_3RefINS_5ShapeEEEE6EStateE", !10, i64 0}
!26 = !{!"_ZTSN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEEE", !23, i64 0, !23, i64 8, !27, i64 16}
!27 = !{!"any pointer", !10, i64 0}
!28 = !{!"_ZTSN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEE", !23, i64 0, !23, i64 8, !27, i64 16}
!29 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !23, i64 0, !23, i64 8, !27, i64 16}
!30 = !{!"float", !10, i64 0}
!31 = !{!"bool", !10, i64 0}
!32 = !{!"_ZTSN3JPH17MeshShapeSettings13EBuildQualityE", !10, i64 0}
!33 = !{!17, !32, i64 148}
!34 = !{i64 2158739439}
!35 = !{!27, !27, i64 0}
!36 = !{!17, !31, i64 144}
!37 = !{i8 0, i8 2}
!38 = !{}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass