; LLVM IR from zig-gamedev/zphysics :: libs/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.18 }
%union.anon.18 = 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 }
%"class.JPH::TriangleSplitterBinning" = type { %"class.JPH::TriangleSplitter", i32, i32, i32, %"class.JPH::Array.24" }
%"class.JPH::TriangleSplitter" = type { ptr, ptr, ptr, %"class.JPH::Array", %"class.JPH::Array.21" }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.21" = type { i64, i64, ptr }
%"class.JPH::Array.24" = type { i64, i64, ptr }
%"class.JPH::AABBTreeBuilder" = type <{ ptr, i32, [4 x i8] }>
%"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", i32, [4 x i8] }>
%"class.JPH::ByteBuffer" = type { %"class.JPH::Array.20" }
%"class.JPH::Array.20" = 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.19", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.19" = 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 }
%"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 }

@_ZTVN3JPH9MeshShapeE = external dso_local unnamed_addr constant { [36 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 [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(16)) #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(144) %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 %"class.JPH::TriangleSplitterBinning", align 8
  %31 = alloca %"class.JPH::AABBTreeBuilder", align 8
  %32 = alloca %"struct.JPH::AABBTreeBuilderStats", align 8
  %33 = alloca ptr, align 8
  %34 = alloca %"class.JPH::AABBTreeToBuffer", align 8
  %35 = alloca ptr, align 8
  %36 = 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
  %37 = load ptr, ptr %4, align 8
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3JPH5ShapeC2ENS_10EShapeTypeENS_13EShapeSubTypeERKNS_13ShapeSettingsERNS_6ResultINS_3RefIS0_EEEE(ptr noundef nonnull align 8 dereferenceable(26) %37, i8 noundef zeroext 3, i8 noundef zeroext 12, ptr noundef nonnull align 8 dereferenceable(64) %38, ptr noundef nonnull align 8 dereferenceable(33) %39)
  store ptr getelementptr inbounds inrange(-16, 272) ({ [36 x ptr] }, ptr @_ZTVN3JPH9MeshShapeE, i32 0, i32 0, i32 2), ptr %37, align 8, !tbaa !9
  %40 = getelementptr inbounds %"class.JPH::MeshShape", ptr %37, i32 0, i32 1
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #8
  %41 = getelementptr inbounds %"class.JPH::MeshShape", ptr %37, i32 0, i32 2
  call void @_ZN3JPH10ByteBufferC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %41) #8
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %42, i32 0, i32 2
  %44 = invoke noundef zeroext i1 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %43)
          to label %45 unwind label %49

45:                                               ; preds = %3
  br i1 %44, label %46, label %53

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

48:                                               ; preds = %46
  br label %408

49:                                               ; preds = %46, %3
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %7, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %8, align 4
  br label %425

53:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #8
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %54, i32 0, i32 2
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %56, 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) %55, ptr noundef nonnull align 8 dereferenceable(24) %57)
          to label %58 unwind label %69

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

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

65:                                               ; preds = %172, %62
  %66 = load i32, ptr %10, align 4, !tbaa !11
  %67 = icmp sge i32 %66, 0
  br i1 %67, label %77, label %68

68:                                               ; preds = %65
  store i32 2, ptr %11, align 4
  br label %176

69:                                               ; preds = %332, %188, %184, %179, %53
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %7, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %8, align 4
  br label %424

73:                                               ; preds = %58
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %7, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %8, align 4
  br label %178

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

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

88:                                               ; preds = %83
  br i1 %87, label %93, label %89

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

92:                                               ; preds = %89
  br i1 %91, label %93, label %111

93:                                               ; preds = %92, %88
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #8
  %95 = 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 %95)
          to label %96 unwind label %102

96:                                               ; preds = %93
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %94, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %97 unwind label %106

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

98:                                               ; preds = %89, %83, %77
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %7, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %8, align 4
  br label %175

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

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

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

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

119:                                              ; preds = %161, %111
  %120 = load ptr, ptr %15, align 8, !tbaa !5
  %121 = load ptr, ptr %16, align 8, !tbaa !5
  %122 = icmp ne ptr %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 5, ptr %11, align 4
  br label %165

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

132:                                              ; preds = %124
  %133 = icmp uge i64 %128, %131
  br i1 %133, label %134, label %157

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

140:                                              ; preds = %134
  %141 = trunc i64 %139 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 %136, i32 noundef %141)
          to label %142 unwind label %148

142:                                              ; preds = %140
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %135, ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %143 unwind label %152

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

144:                                              ; preds = %124
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %7, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %8, align 4
  br label %164

148:                                              ; preds = %140, %134
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %7, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %8, align 4
  br label %156

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

156:                                              ; preds = %152, %148
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  br label %164

157:                                              ; preds = %132
  store i32 0, ptr %11, align 4
  br label %158

158:                                              ; preds = %157, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  %159 = load i32, ptr %11, align 4
  switch i32 %159, label %165 [
    i32 0, label %160
  ]

160:                                              ; preds = %158
  br label %161

161:                                              ; preds = %160
  %162 = load ptr, ptr %15, align 8, !tbaa !5
  %163 = getelementptr inbounds i32, ptr %162, i32 1
  store ptr %163, ptr %15, align 8, !tbaa !5
  br label %119

164:                                              ; preds = %156, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %175

165:                                              ; preds = %158, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  %166 = load i32, ptr %11, align 4
  switch i32 %166, label %169 [
    i32 5, label %167
  ]

167:                                              ; preds = %165
  br label %168

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

169:                                              ; preds = %168, %165, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %170 = load i32, ptr %11, align 4
  switch i32 %170, label %176 [
    i32 0, label %171
  ]

171:                                              ; preds = %169
  br label %172

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

175:                                              ; preds = %164, %110, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %178

176:                                              ; preds = %169, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  %177 = load i32, ptr %11, align 4
  switch i32 %177, label %406 [
    i32 2, label %179
  ]

178:                                              ; preds = %175, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %424

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

184:                                              ; preds = %179
  %185 = getelementptr inbounds %"class.JPH::MeshShape", ptr %37, i32 0, i32 1
  %186 = invoke noundef zeroext i1 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %185)
          to label %187 unwind label %69

187:                                              ; preds = %184
  br i1 %186, label %275, label %188

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

191:                                              ; preds = %188
  %192 = icmp ugt i64 %190, 32
  br i1 %192, label %193, label %206

193:                                              ; preds = %191
  %194 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #8
  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 %195 unwind label %197

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

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

197:                                              ; preds = %193
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %7, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %8, align 4
  br label %205

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

205:                                              ; preds = %201, %197
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #8
  br label %424

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

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

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

215:                                              ; preds = %266, %214
  %216 = load ptr, ptr %21, align 8, !tbaa !5
  %217 = load ptr, ptr %22, align 8, !tbaa !5
  %218 = icmp ne ptr %216, %217
  br i1 %218, label %228, label %219

219:                                              ; preds = %215
  store i32 7, ptr %11, align 4
  br label %270

220:                                              ; preds = %206
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %7, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %8, align 4
  br label %273

224:                                              ; preds = %211
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %7, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %8, align 4
  br label %272

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

236:                                              ; preds = %228
  %237 = icmp uge i64 %233, %235
  br i1 %237, label %238, label %262

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

245:                                              ; preds = %238
  %246 = trunc i64 %244 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 %242, i32 noundef %246)
          to label %247 unwind label %253

247:                                              ; preds = %245
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEONSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEE(ptr noundef nonnull align 8 dereferenceable(33) %239, ptr noundef nonnull align 8 dereferenceable(32) %24)
          to label %248 unwind label %257

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

249:                                              ; preds = %228
  %250 = landingpad { ptr, i32 }
          cleanup
  %251 = extractvalue { ptr, i32 } %250, 0
  store ptr %251, ptr %7, align 8
  %252 = extractvalue { ptr, i32 } %250, 1
  store i32 %252, ptr %8, align 4
  br label %269

253:                                              ; preds = %245, %238
  %254 = landingpad { ptr, i32 }
          cleanup
  %255 = extractvalue { ptr, i32 } %254, 0
  store ptr %255, ptr %7, align 8
  %256 = extractvalue { ptr, i32 } %254, 1
  store i32 %256, ptr %8, align 4
  br label %261

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

261:                                              ; preds = %257, %253
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #8
  br label %269

262:                                              ; preds = %236
  store i32 0, ptr %11, align 4
  br label %263

263:                                              ; preds = %262, %248
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  %264 = load i32, ptr %11, align 4
  switch i32 %264, label %270 [
    i32 0, label %265
  ]

265:                                              ; preds = %263
  br label %266

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

269:                                              ; preds = %261, %249
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %272

270:                                              ; preds = %263, %219
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  %271 = load i32, ptr %11, align 4
  switch i32 %271, label %406 [
    i32 7, label %274
  ]

272:                                              ; preds = %269, %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %273

273:                                              ; preds = %272, %220
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %424

274:                                              ; preds = %270
  br label %322

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

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

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

284:                                              ; preds = %314, %283
  %285 = load ptr, ptr %26, align 8, !tbaa !5
  %286 = load ptr, ptr %27, align 8, !tbaa !5
  %287 = icmp ne ptr %285, %286
  br i1 %287, label %297, label %288

288:                                              ; preds = %284
  store i32 9, ptr %11, align 4
  br label %317

289:                                              ; preds = %275
  %290 = landingpad { ptr, i32 }
          cleanup
  %291 = extractvalue { ptr, i32 } %290, 0
  store ptr %291, ptr %7, align 8
  %292 = extractvalue { ptr, i32 } %290, 1
  store i32 %292, ptr %8, align 4
  br label %320

293:                                              ; preds = %280
  %294 = landingpad { ptr, i32 }
          cleanup
  %295 = extractvalue { ptr, i32 } %294, 0
  store ptr %295, ptr %7, align 8
  %296 = extractvalue { ptr, i32 } %294, 1
  store i32 %296, ptr %8, align 4
  br label %319

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

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

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

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

310:                                              ; preds = %297
  store i32 0, ptr %11, align 4
  br label %311

311:                                              ; preds = %310, %305
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  %312 = load i32, ptr %11, align 4
  switch i32 %312, label %317 [
    i32 0, label %313
  ]

313:                                              ; preds = %311
  br label %314

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

317:                                              ; preds = %311, %288
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  %318 = load i32, ptr %11, align 4
  switch i32 %318, label %406 [
    i32 9, label %321
  ]

319:                                              ; preds = %306, %293
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %320

320:                                              ; preds = %319, %289
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %424

321:                                              ; preds = %317
  br label %322

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

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

332:                                              ; preds = %327, %322
  %333 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %333, ptr noundef @.str.7)
          to label %334 unwind label %69

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

335:                                              ; preds = %327
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #8
  %336 = load ptr, ptr %5, align 8, !tbaa !5
  %337 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %336, 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) %337)
          to label %338 unwind label %363

338:                                              ; preds = %335
  %339 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN3JPH9MeshShape16sFindActiveEdgesERKNS_17MeshShapeSettingsERNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS5_EEEE(ptr noundef nonnull align 8 dereferenceable(144) %339, ptr noundef nonnull align 8 dereferenceable(24) %29)
          to label %340 unwind label %367

340:                                              ; preds = %338
  call void @llvm.lifetime.start.p0(i64 112, ptr %30) #8
  %341 = load ptr, ptr %5, align 8, !tbaa !5
  %342 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %341, 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) %342, ptr noundef nonnull align 8 dereferenceable(24) %29, i32 noundef 8, i32 noundef 128, i32 noundef 6)
          to label %343 unwind label %371

343:                                              ; preds = %340
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #8
  %344 = load ptr, ptr %5, align 8, !tbaa !5
  %345 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %344, i32 0, i32 4
  %346 = load i32, ptr %345, align 8, !tbaa !18
  invoke void @_ZN3JPH15AABBTreeBuilderC1ERNS_16TriangleSplitterEj(ptr noundef nonnull align 8 dereferenceable(12) %31, ptr noundef nonnull align 8 dereferenceable(72) %30, i32 noundef %346)
          to label %347 unwind label %375

347:                                              ; preds = %343
  call void @llvm.lifetime.start.p0(i64 56, ptr %32) #8
  call void @_ZN3JPH20AABBTreeBuilderStatsC2Ev(ptr noundef nonnull align 8 dereferenceable(52) %32) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %348 = invoke noundef ptr @_ZN3JPH15AABBTreeBuilder5BuildERNS_20AABBTreeBuilderStatsE(ptr noundef nonnull align 8 dereferenceable(12) %31, ptr noundef nonnull align 8 dereferenceable(52) %32)
          to label %349 unwind label %379

349:                                              ; preds = %347
  store ptr %348, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %34) #8
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %34) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  store ptr null, ptr %35, align 8, !tbaa !5
  %350 = load ptr, ptr %5, align 8, !tbaa !5
  %351 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %350, i32 0, i32 1
  %352 = load ptr, ptr %33, align 8, !tbaa !5
  %353 = invoke noundef zeroext i1 @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEE7ConvertERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS6_EEEEPKNS_15AABBTreeBuilder4NodeERPKc(ptr noundef nonnull align 8 dereferenceable(28) %34, ptr noundef nonnull align 8 dereferenceable(24) %351, ptr noundef %352, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %354 unwind label %383

354:                                              ; preds = %349
  br i1 %353, label %387, label %355

355:                                              ; preds = %354
  %356 = load ptr, ptr %6, align 8, !tbaa !5
  %357 = load ptr, ptr %35, align 8, !tbaa !5
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %356, ptr noundef %357)
          to label %358 unwind label %383

358:                                              ; preds = %355
  %359 = load ptr, ptr %33, align 8, !tbaa !5
  %360 = icmp eq ptr %359, null
  br i1 %360, label %362, label %361

361:                                              ; preds = %358
  call void @_ZN3JPH15AABBTreeBuilder4NodeD1Ev(ptr noundef nonnull align 16 dereferenceable(72) %359) #8
  call void @_ZN3JPH15AABBTreeBuilder4NodedlEPv(ptr noundef %359) #8
  br label %362

362:                                              ; preds = %361, %358
  store i32 1, ptr %11, align 4
  br label %405

363:                                              ; preds = %335
  %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 %423

367:                                              ; preds = %338
  %368 = landingpad { ptr, i32 }
          cleanup
  %369 = extractvalue { ptr, i32 } %368, 0
  store ptr %369, ptr %7, align 8
  %370 = extractvalue { ptr, i32 } %368, 1
  store i32 %370, ptr %8, align 4
  br label %422

371:                                              ; preds = %340
  %372 = landingpad { ptr, i32 }
          cleanup
  %373 = extractvalue { ptr, i32 } %372, 0
  store ptr %373, ptr %7, align 8
  %374 = extractvalue { ptr, i32 } %372, 1
  store i32 %374, ptr %8, align 4
  br label %421

375:                                              ; preds = %343
  %376 = landingpad { ptr, i32 }
          cleanup
  %377 = extractvalue { ptr, i32 } %376, 0
  store ptr %377, ptr %7, align 8
  %378 = extractvalue { ptr, i32 } %376, 1
  store i32 %378, ptr %8, align 4
  br label %420

379:                                              ; preds = %347
  %380 = landingpad { ptr, i32 }
          cleanup
  %381 = extractvalue { ptr, i32 } %380, 0
  store ptr %381, ptr %7, align 8
  %382 = extractvalue { ptr, i32 } %380, 1
  store i32 %382, ptr %8, align 4
  br label %419

383:                                              ; preds = %398, %394, %391, %355, %349
  %384 = landingpad { ptr, i32 }
          cleanup
  %385 = extractvalue { ptr, i32 } %384, 0
  store ptr %385, ptr %7, align 8
  %386 = extractvalue { ptr, i32 } %384, 1
  store i32 %386, ptr %8, align 4
  br label %418

387:                                              ; preds = %354
  %388 = load ptr, ptr %33, align 8, !tbaa !5
  %389 = icmp eq ptr %388, null
  br i1 %389, label %391, label %390

390:                                              ; preds = %387
  call void @_ZN3JPH15AABBTreeBuilder4NodeD1Ev(ptr noundef nonnull align 16 dereferenceable(72) %388) #8
  call void @_ZN3JPH15AABBTreeBuilder4NodedlEPv(ptr noundef %388) #8
  br label %391

391:                                              ; preds = %390, %387
  %392 = getelementptr inbounds %"class.JPH::MeshShape", ptr %37, i32 0, i32 2
  %393 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(28) %34)
          to label %394 unwind label %383

394:                                              ; preds = %391
  call void @_ZN3JPH5ArrayIhNS_19STLAlignedAllocatorIhLm64EEEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %392, ptr noundef nonnull align 8 dereferenceable(24) %393) #8
  %395 = invoke noundef i32 @_ZNK3JPH9MeshShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 8 dereferenceable(80) %37)
          to label %396 unwind label %383

396:                                              ; preds = %394
  %397 = icmp ugt i32 %395, 32
  br i1 %397, label %398, label %401

398:                                              ; preds = %396
  %399 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %399, ptr noundef @.str.8)
          to label %400 unwind label %383

400:                                              ; preds = %398
  store i32 1, ptr %11, align 4
  br label %405

401:                                              ; preds = %396
  %402 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  invoke void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef %37)
          to label %403 unwind label %409

403:                                              ; preds = %401
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE3SetEOS3_(ptr noundef nonnull align 8 dereferenceable(33) %402, ptr noundef nonnull align 8 dereferenceable(8) %36)
          to label %404 unwind label %413

404:                                              ; preds = %403
  call void @_ZN3JPH3RefINS_5ShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %36) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  store i32 0, ptr %11, align 4
  br label %405

405:                                              ; preds = %404, %400, %362
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %34) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #8
  call void @_ZN3JPH23TriangleSplitterBinningD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %30) #8
  call void @llvm.lifetime.end.p0(i64 112, ptr %30) #8
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #8
  br label %406

406:                                              ; preds = %405, %334, %317, %270, %196, %176
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #8
  %407 = load i32, ptr %11, align 4
  switch i32 %407, label %431 [
    i32 0, label %408
    i32 1, label %408
  ]

408:                                              ; preds = %406, %406, %48
  ret void

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

413:                                              ; preds = %403
  %414 = landingpad { ptr, i32 }
          cleanup
  %415 = extractvalue { ptr, i32 } %414, 0
  store ptr %415, ptr %7, align 8
  %416 = extractvalue { ptr, i32 } %414, 1
  store i32 %416, ptr %8, align 4
  call void @_ZN3JPH3RefINS_5ShapeEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %36) #8
  br label %417

417:                                              ; preds = %413, %409
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  br label %418

418:                                              ; preds = %417, %383
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %34) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %34) #8
  br label %419

419:                                              ; preds = %418, %379
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %32) #8
  br label %420

420:                                              ; preds = %419, %375
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #8
  call void @_ZN3JPH23TriangleSplitterBinningD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %30) #8
  br label %421

421:                                              ; preds = %420, %371
  call void @llvm.lifetime.end.p0(i64 112, ptr %30) #8
  br label %422

422:                                              ; preds = %421, %367
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #8
  br label %423

423:                                              ; preds = %422, %363
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #8
  br label %424

424:                                              ; preds = %423, %320, %273, %205, %178, %69
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #8
  br label %425

425:                                              ; preds = %424, %49
  call void @_ZN3JPH5ArrayIhNS_19STLAlignedAllocatorIhLm64EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %41) #8
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #8
  call void @_ZN3JPH5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(26) %37) #8
  br label %426

426:                                              ; preds = %425
  %427 = load ptr, ptr %7, align 8
  %428 = load i32, ptr %8, align 4
  %429 = insertvalue { ptr, i32 } poison, ptr %427, 0
  %430 = insertvalue { ptr, i32 } %429, i32 %428, 1
  resume { ptr, i32 } %430

431:                                              ; preds = %406
  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(16) 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(144), ptr noundef nonnull align 8 dereferenceable(24)) #2 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 @_ZN3JPH15AABBTreeBuilderC1ERNS_16TriangleSplitterEj(ptr noundef nonnull align 8 dereferenceable(12), 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(12), ptr noundef nonnull align 8 dereferenceable(52)) #5

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

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

; Function Attrs: nounwind
declare void @_ZN3JPH15AABBTreeBuilder4NodeD1Ev(ptr noundef nonnull align 16 dereferenceable(72)) unnamed_addr #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH15AABBTreeBuilder4NodedlEPv(ptr noundef) #7 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_26NodeCodecQuadTreeHalfFloatILi1EEEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(28)) #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_26NodeCodecQuadTreeHalfFloatILi1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH23TriangleSplitterBinningD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #1 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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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}
!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}
!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}


; 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.18 }
%union.anon.18 = 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 }
%"class.JPH::TriangleSplitterBinning" = type { %"class.JPH::TriangleSplitter", i32, i32, i32, %"class.JPH::Array.24" }
%"class.JPH::TriangleSplitter" = type { ptr, ptr, ptr, %"class.JPH::Array", %"class.JPH::Array.21" }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.21" = type { i64, i64, ptr }
%"class.JPH::Array.24" = type { i64, i64, ptr }
%"class.JPH::AABBTreeBuilder" = type <{ ptr, i32, [4 x i8] }>
%"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", i32, [4 x i8] }>
%"class.JPH::ByteBuffer" = type { %"class.JPH::Array.20" }
%"class.JPH::Array.20" = type { i64, i64, ptr }
%"class.JPH::Ref" = type { ptr }

@_ZTVN3JPH9MeshShapeE = external dso_local unnamed_addr constant { [36 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 [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(16)) 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(144) %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 %"class.JPH::TriangleSplitterBinning", 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, 272) (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) #8
  %17 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @_ZN3JPH10ByteBufferC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %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 %143 unwind label %21

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

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #8
  %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 %.critedge122, label %.lr.ph.preheader

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

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

.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(16) 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(16) %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)
  %.not104 = icmp ugt i64 %41, %40
  br i1 %.not104, 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) #8
  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) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br label %142

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

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

.critedge.1:                                      ; preds = %.critedge.preheader
  %.099.ptr.1 = getelementptr inbounds i8, ptr %32, i64 4
  %49 = load i32, ptr %.099.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)
  %.not104.1 = icmp ugt i64 %51, %50
  br i1 %.not104.1, label %.critedge.2, label %56

.critedge.2:                                      ; preds = %.critedge.1
  %.099.ptr.2 = getelementptr inbounds i8, ptr %32, i64 8
  %52 = load i32, ptr %.099.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)
  %.not104.2 = icmp ugt i64 %54, %53
  br i1 %.not104.2, label %.loopexit, label %56

.loopexit:                                        ; preds = %.critedge.2
  %55 = icmp ult i64 %indvars.iv, 2
  br i1 %55, label %.critedge122, 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) #8
  %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) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  br label %142

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

.critedge122:                                     ; 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 = %.critedge122
  %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) #8
  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) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  br label %142

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

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)
  %.not106141 = icmp eq ptr %74, %75
  br i1 %.not106141, label %.critedge126, label %.lr.ph143

.lr.ph143:                                        ; preds = %73, %.critedge124
  %.0100142 = phi ptr [ %87, %.critedge124 ], [ %74, %73 ]
  %76 = getelementptr inbounds i8, ptr %.0100142, 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)
  %.not107 = icmp ugt i64 %79, %78
  br i1 %.not107, label %.critedge124, label %80

80:                                               ; preds = %.lr.ph143
  %81 = getelementptr inbounds i8, ptr %.0100142, i64 12
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  %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) #8
  br label %152

.critedge124:                                     ; preds = %.lr.ph143
  %87 = getelementptr inbounds i8, ptr %.0100142, i64 16
  %.not106 = icmp eq ptr %87, %75
  br i1 %.not106, label %.critedge126, label %.lr.ph143

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) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  br label %142

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)
  %.not108144 = icmp eq ptr %90, %91
  br i1 %.not108144, label %.critedge126, label %.critedge128

92:                                               ; preds = %.critedge128
  %93 = getelementptr inbounds i8, ptr %.090145, i64 16
  %.not108 = icmp eq ptr %93, %91
  br i1 %.not108, label %.critedge126, label %.critedge128

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

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

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

.critedge126:                                     ; preds = %.critedge124, %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 = %.critedge126
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull @.str.7)
          to label %142 unwind label %30

103:                                              ; preds = %.critedge126
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #8
  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 %118

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

105:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %10) #8
  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 %106 unwind label %122

106:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #8
  %107 = load i32, ptr %99, align 8, !tbaa !16
  invoke void @_ZN3JPH15AABBTreeBuilderC1ERNS_16TriangleSplitterEj(ptr noundef nonnull align 8 dereferenceable(12) %11, ptr noundef nonnull align 8 dereferenceable(72) %10, i32 noundef %107)
          to label %108 unwind label %124

108:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %12) #8
  call void @_ZN3JPH20AABBTreeBuilderStatsC2Ev(ptr noundef nonnull align 8 dereferenceable(52) %12) #8
  %109 = invoke noundef ptr @_ZN3JPH15AABBTreeBuilder5BuildERNS_20AABBTreeBuilderStatsE(ptr noundef nonnull align 8 dereferenceable(12) %11, ptr noundef nonnull align 8 dereferenceable(52) %12)
          to label %110 unwind label %126

110:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #8
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  store ptr null, ptr %14, align 8, !tbaa !31
  %111 = invoke noundef zeroext i1 @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEE7ConvertERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS6_EEEEPKNS_15AABBTreeBuilder4NodeERPKc(ptr noundef nonnull align 8 dereferenceable(28) %13, ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef %109, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %112 unwind label %128

112:                                              ; preds = %110
  br i1 %111, label %130, label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %14, align 8, !tbaa !31
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef %114)
          to label %115 unwind label %128

115:                                              ; preds = %113
  %116 = icmp eq ptr %109, null
  br i1 %116, label %141, label %117

117:                                              ; preds = %115
  call void @_ZN3JPH15AABBTreeBuilder4NodeD1Ev(ptr noundef nonnull align 16 dereferenceable(72) %109) #8
  call void @_ZN3JPH15AABBTreeBuilder4NodedlEPv(ptr noundef nonnull %109) #8
  br label %141

118:                                              ; preds = %103
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %151

120:                                              ; preds = %104
  %121 = landingpad { ptr, i32 }
          cleanup
  br label %150

122:                                              ; preds = %105
  %123 = landingpad { ptr, i32 }
          cleanup
  br label %149

124:                                              ; preds = %106
  %125 = landingpad { ptr, i32 }
          cleanup
  br label %148

126:                                              ; preds = %108
  %127 = landingpad { ptr, i32 }
          cleanup
  br label %147

128:                                              ; preds = %138, %133, %113, %110
  %129 = landingpad { ptr, i32 }
          cleanup
  br label %146

130:                                              ; preds = %112
  %131 = icmp eq ptr %109, null
  br i1 %131, label %133, label %132

132:                                              ; preds = %130
  call void @_ZN3JPH15AABBTreeBuilder4NodeD1Ev(ptr noundef nonnull align 16 dereferenceable(72) %109) #8
  call void @_ZN3JPH15AABBTreeBuilder4NodedlEPv(ptr noundef nonnull %109) #8
  br label %133

133:                                              ; preds = %132, %130
  %134 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(28) %13)
  call void @_ZN3JPH5ArrayIhNS_19STLAlignedAllocatorIhLm64EEEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %134) #8
  %135 = invoke noundef i32 @_ZNK3JPH9MeshShape26GetSubShapeIDBitsRecursiveEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
          to label %136 unwind label %128

136:                                              ; preds = %133
  %137 = icmp ugt i32 %135, 32
  br i1 %137, label %138, label %139

138:                                              ; preds = %136
  invoke void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %2, ptr noundef nonnull @.str.8)
          to label %141 unwind label %128

139:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  invoke void @_ZN3JPH3RefINS_5ShapeEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull %0)
          to label %140 unwind label %144

140:                                              ; preds = %139
  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) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  br label %141

141:                                              ; preds = %138, %115, %117, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %13) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  call void @_ZN3JPH23TriangleSplitterBinningD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %10) #8
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %10) #8
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #8
  br label %142

142:                                              ; preds = %96, %88, %59, %44, %102, %141, %70
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  br label %143

143:                                              ; preds = %20, %142
  ret void

144:                                              ; preds = %139
  %145 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  br label %146

146:                                              ; preds = %144, %128
  %.pn110 = phi { ptr, i32 } [ %129, %128 ], [ %145, %144 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  call void @_ZN3JPH16AABBTreeToBufferINS_37TriangleCodecIndexed8BitPackSOA4FlagsENS_26NodeCodecQuadTreeHalfFloatILi1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %13) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #8
  br label %147

147:                                              ; preds = %146, %126
  %.pn110.pn = phi { ptr, i32 } [ %.pn110, %146 ], [ %127, %126 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #8
  br label %148

148:                                              ; preds = %147, %124
  %.pn110.pn.pn = phi { ptr, i32 } [ %.pn110.pn, %147 ], [ %125, %124 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  call void @_ZN3JPH23TriangleSplitterBinningD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %10) #8
  br label %149

149:                                              ; preds = %148, %122
  %.pn110.pn.pn.pn = phi { ptr, i32 } [ %.pn110.pn.pn, %148 ], [ %123, %122 ]
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %10) #8
  br label %150

150:                                              ; preds = %149, %120
  %.pn110.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn110.pn.pn.pn, %149 ], [ %121, %120 ]
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #8
  br label %151

151:                                              ; preds = %150, %118
  %.pn110.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn110.pn.pn.pn.pn, %150 ], [ %119, %118 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #8
  br label %152

152:                                              ; preds = %45, %47, %60, %151, %97, %85, %71, %30
  %.pn117 = phi { ptr, i32 } [ %31, %30 ], [ %.pn110.pn.pn.pn.pn.pn, %151 ], [ %98, %97 ], [ %72, %71 ], [ %86, %85 ], [ %48, %47 ], [ %61, %60 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  br label %153

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

; 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(16) 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(144), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 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 @_ZN3JPH15AABBTreeBuilderC1ERNS_16TriangleSplitterEj(ptr noundef nonnull align 8 dereferenceable(12), 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(12), ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #5

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

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

; Function Attrs: nounwind
declare void @_ZN3JPH15AABBTreeBuilder4NodeD1Ev(ptr noundef nonnull align 16 dereferenceable(72)) unnamed_addr #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH15AABBTreeBuilder4NodedlEPv(ptr noundef) local_unnamed_addr #7 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_26NodeCodecQuadTreeHalfFloatILi1EEEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(28)) 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_26NodeCodecQuadTreeHalfFloatILi1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH23TriangleSplitterBinningD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #1 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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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}
!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}
!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 = !{!27, !27, i64 0}


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