; LLVM IR from jrouwe/JoltPhysics :: Jolt/AABBTree (AABBTreeBuilder)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.JPH::TriangleSplitter::Range" = type { i32, i32 }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::AABBTreeBuilder::Node" = type { %"class.JPH::AABox", i32, i32, [2 x i32] }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::AABBTreeBuilder" = type { ptr, i32, %"class.JPH::Array", %"class.JPH::Array.3" }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.3" = type { i64, i64, ptr }

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@_ZN3JPH5TraceE = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 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

; 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 uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(8) %1) #3 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"struct.JPH::TriangleSplitter::Range", align 4
  %7 = alloca %"struct.JPH::TriangleSplitter::Range", align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.JPH::AssertLastParam", align 1
  %10 = alloca %"struct.JPH::TriangleSplitter::Range", align 4
  %11 = alloca %"struct.JPH::TriangleSplitter::Range", align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.JPH::AABBTreeBuilder::Node", align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.JPH::AABBTreeBuilder::Node", align 16
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %24)
  %26 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = icmp ugt i32 %25, %27
  br i1 %28, label %29, label %111

29:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %30 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = load ptr, ptr %31, align 8, !tbaa !16
  %34 = getelementptr inbounds ptr, ptr %33, i64 3
  %35 = load ptr, ptr %34, align 8
  %36 = call noundef zeroext i1 %35(ptr noundef nonnull align 8 dereferenceable(72) %31, ptr noundef nonnull align 4 dereferenceable(8) %32, ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %7)
  br i1 %36, label %71, label %37

37:                                               ; preds = %29
  %38 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %39)
  %41 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 1
  %42 = load i32, ptr %41, align 8, !tbaa !9
  call void (ptr, ...) %38(ptr noundef @.str.2, i32 noundef %40, i32 noundef %42)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %43)
  %45 = udiv i32 %44, 2
  store i32 %45, ptr %8, align 4, !tbaa !18
  br label %46

46:                                               ; preds = %37
  %47 = load i32, ptr %8, align 4, !tbaa !18
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %52, label %49

49:                                               ; preds = %46
  %50 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 207)
  br i1 %50, label %51, label %52

51:                                               ; preds = %49
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !19
  br label %52

52:                                               ; preds = %51, %49, %46
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %55, i32 0, i32 0
  %57 = load i32, ptr %56, align 4, !tbaa !20
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %58, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !20
  %61 = load i32, ptr %8, align 4, !tbaa !18
  %62 = add i32 %60, %61
  call void @_ZN3JPH16TriangleSplitter5RangeC2Ejj(ptr noundef nonnull align 4 dereferenceable(8) %10, i32 noundef %57, i32 noundef %62)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %10, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 4, !tbaa !20
  %66 = load i32, ptr %8, align 4, !tbaa !18
  %67 = add i32 %65, %66
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 4, !tbaa !23
  call void @_ZN3JPH16TriangleSplitter5RangeC2Ejj(ptr noundef nonnull align 4 dereferenceable(8) %11, i32 noundef %67, i32 noundef %70)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %71

71:                                               ; preds = %54, %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %72 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 2
  %73 = call noundef i64 @_ZNK3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %72)
  %74 = trunc i64 %73 to i32
  store i32 %74, ptr %12, align 4, !tbaa !18
  %75 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #7
  call void @llvm.memset.p0.i64(ptr align 16 %13, i8 0, i64 48, i1 false)
  call void @_ZN3JPH15AABBTreeBuilder4NodeC2Ev(ptr noundef nonnull align 16 dereferenceable(48) %13)
  call void @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 16 dereferenceable(48) %13)
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %76 = call noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64) %23, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store i32 %76, ptr %14, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %77 = call noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64) %23, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store i32 %77, ptr %15, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %78 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 2
  %79 = load i32, ptr %12, align 4, !tbaa !18
  %80 = zext i32 %79 to i64
  %81 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %80)
  store ptr %81, ptr %16, align 8, !tbaa !5
  %82 = load i32, ptr %14, align 4, !tbaa !18
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %83, i32 0, i32 3
  %85 = getelementptr inbounds [2 x i32], ptr %84, i64 0, i64 0
  store i32 %82, ptr %85, align 8, !tbaa !18
  %86 = load i32, ptr %15, align 4, !tbaa !18
  %87 = load ptr, ptr %16, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %87, i32 0, i32 3
  %89 = getelementptr inbounds [2 x i32], ptr %88, i64 0, i64 1
  store i32 %86, ptr %89, align 4, !tbaa !18
  %90 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 2
  %91 = load ptr, ptr %16, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %91, i32 0, i32 3
  %93 = getelementptr inbounds [2 x i32], ptr %92, i64 0, i64 0
  %94 = load i32, ptr %93, align 8, !tbaa !18
  %95 = zext i32 %94 to i64
  %96 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %90, i64 noundef %95)
  %97 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %16, align 8, !tbaa !5
  %99 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %98, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %99, ptr align 16 %97, i64 32, i1 false), !tbaa.struct !24
  %100 = load ptr, ptr %16, align 8, !tbaa !5
  %101 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 2
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %103, i32 0, i32 3
  %105 = getelementptr inbounds [2 x i32], ptr %104, i64 0, i64 1
  %106 = load i32, ptr %105, align 4, !tbaa !18
  %107 = zext i32 %106 to i64
  %108 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %102, i64 noundef %107)
  %109 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %108, i32 0, i32 0
  call void @_ZN3JPH5AABox11EncapsulateERKS0_(ptr noundef nonnull align 16 dereferenceable(32) %101, ptr noundef nonnull align 16 dereferenceable(32) %109)
  %110 = load i32, ptr %12, align 4, !tbaa !18
  store i32 %110, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %161

111:                                              ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %112 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 2
  %113 = call noundef i64 @_ZNK3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %112)
  %114 = trunc i64 %113 to i32
  store i32 %114, ptr %17, align 4, !tbaa !18
  %115 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 48, ptr %18) #7
  call void @llvm.memset.p0.i64(ptr align 16 %18, i8 0, i64 48, i1 false)
  call void @_ZN3JPH15AABBTreeBuilder4NodeC2Ev(ptr noundef nonnull align 16 dereferenceable(48) %18)
  call void @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %115, ptr noundef nonnull align 16 dereferenceable(48) %18)
  call void @llvm.lifetime.end.p0(i64 48, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %116 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 2
  %117 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %116)
  store ptr %117, ptr %19, align 8, !tbaa !5
  %118 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 3
  %119 = call noundef i64 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %118)
  %120 = trunc i64 %119 to i32
  %121 = load ptr, ptr %19, align 8, !tbaa !5
  %122 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %121, i32 0, i32 1
  store i32 %120, ptr %122, align 16, !tbaa !26
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !23
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 4, !tbaa !20
  %129 = sub i32 %125, %128
  %130 = load ptr, ptr %19, align 8, !tbaa !5
  %131 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %130, i32 0, i32 2
  store i32 %129, ptr %131, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %132 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !15
  %134 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH16TriangleSplitter11GetVerticesEv(ptr noundef nonnull align 8 dereferenceable(72) %133)
  store ptr %134, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 4, !tbaa !20
  store i32 %137, ptr %21, align 4, !tbaa !18
  br label %138

138:                                              ; preds = %156, %111
  %139 = load i32, ptr %21, align 4, !tbaa !18
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %140, i32 0, i32 1
  %142 = load i32, ptr %141, align 4, !tbaa !23
  %143 = icmp ult i32 %139, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %159

145:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %146 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8, !tbaa !15
  %148 = load i32, ptr %21, align 4, !tbaa !18
  %149 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNK3JPH16TriangleSplitter11GetTriangleEj(ptr noundef nonnull align 8 dereferenceable(72) %147, i32 noundef %148)
  store ptr %149, ptr %22, align 8, !tbaa !5
  %150 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %23, i32 0, i32 3
  %151 = load ptr, ptr %22, align 8, !tbaa !5
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %150, ptr noundef nonnull align 4 dereferenceable(20) %151)
  %152 = load ptr, ptr %19, align 8, !tbaa !5
  %153 = getelementptr inbounds %"class.JPH::AABBTreeBuilder::Node", ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %20, align 8, !tbaa !5
  %155 = load ptr, ptr %22, align 8, !tbaa !5
  call void @_ZN3JPH5AABox11EncapsulateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(32) %153, ptr noundef nonnull align 8 dereferenceable(24) %154, ptr noundef nonnull align 4 dereferenceable(20) %155)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %156

156:                                              ; preds = %145
  %157 = load i32, ptr %21, align 4, !tbaa !18
  %158 = add i32 %157, 1
  store i32 %158, ptr %21, align 4, !tbaa !18
  br label %138, !llvm.loop !31

159:                                              ; preds = %144
  %160 = load i32, ptr %17, align 4, !tbaa !18
  store i32 %160, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %161

161:                                              ; preds = %159, %71
  %162 = load i32, ptr %3, align 4
  ret i32 %162
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox11EncapsulateERKS0_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) #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)) #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZNK3JPH16TriangleSplitter11GetTriangleEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox11EncapsulateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(20)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTSN3JPH15AABBTreeBuilderE", !6, i64 0, !11, i64 8, !12, i64 16, !14, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEE", !13, i64 0, !13, i64 8, !6, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEE", !13, i64 0, !13, i64 8, !6, i64 16}
!15 = !{!10, !6, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !8, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{i64 2156963303}
!20 = !{!21, !11, i64 0}
!21 = !{!"_ZTSN3JPH16TriangleSplitter5RangeE", !11, i64 0, !11, i64 4}
!22 = !{i64 0, i64 4, !18, i64 4, i64 4, !18}
!23 = !{!21, !11, i64 4}
!24 = !{i64 0, i64 16, !25, i64 16, i64 16, !25}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !11, i64 32}
!27 = !{!"_ZTSN3JPH15AABBTreeBuilder4NodeE", !28, i64 0, !11, i64 32, !11, i64 36, !7, i64 40}
!28 = !{!"_ZTSN3JPH5AABoxE", !29, i64 0, !29, i64 16}
!29 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!30 = !{!27, !11, i64 36}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.JPH::TriangleSplitter::Range" = type { i32, i32 }
%"class.JPH::AABBTreeBuilder::Node" = type { %"class.JPH::AABox", i32, i32, [2 x i32] }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@_ZN3JPH5TraceE = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 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

; 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 uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(8) %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %"struct.JPH::TriangleSplitter::Range", align 8
  %4 = alloca %"struct.JPH::TriangleSplitter::Range", align 8
  %5 = alloca %"struct.JPH::TriangleSplitter::Range", align 8
  %6 = alloca %"struct.JPH::TriangleSplitter::Range", align 8
  %7 = alloca %"class.JPH::AABBTreeBuilder::Node", align 16
  %8 = alloca %"class.JPH::AABBTreeBuilder::Node", align 16
  %9 = tail call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %1)
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = icmp ugt i32 %9, %11
  br i1 %12, label %13, label %51

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %14 = load ptr, ptr %0, align 8, !tbaa !14
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %15, i64 24
  %17 = load ptr, ptr %16, align 8
  %18 = call noundef zeroext i1 %17(ptr noundef nonnull align 8 dereferenceable(72) %14, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
  br i1 %18, label %37, label %19

19:                                               ; preds = %13
  %20 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !17
  %21 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %1)
  %22 = load i32, ptr %10, align 8, !tbaa !5
  call void (ptr, ...) %20(ptr noundef nonnull @.str.2, i32 noundef %21, i32 noundef %22)
  %23 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %1)
  %24 = lshr i32 %23, 1
  %.not = icmp ult i32 %23, 2
  br i1 %.not, label %25, label %28

25:                                               ; preds = %19
  %26 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 207)
  br i1 %26, label %27, label %28

27:                                               ; preds = %25
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !18
  br label %28

28:                                               ; preds = %27, %25, %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %29 = load i32, ptr %1, align 4, !tbaa !19
  %30 = add i32 %29, %24
  call void @_ZN3JPH16TriangleSplitter5RangeC2Ejj(ptr noundef nonnull align 4 dereferenceable(8) %5, i32 noundef %29, i32 noundef %30)
  %31 = load i64, ptr %5, align 8
  store i64 %31, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %32 = load i32, ptr %1, align 4, !tbaa !19
  %33 = add i32 %32, %24
  %34 = getelementptr inbounds i8, ptr %1, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !21
  call void @_ZN3JPH16TriangleSplitter5RangeC2Ejj(ptr noundef nonnull align 4 dereferenceable(8) %6, i32 noundef %33, i32 noundef %35)
  %36 = load i64, ptr %6, align 8
  store i64 %36, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %37

37:                                               ; preds = %28, %13
  %38 = getelementptr inbounds i8, ptr %0, i64 16
  %39 = call noundef i64 @_ZNK3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %38)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %7, i8 0, i64 48, i1 false)
  call void @_ZN3JPH15AABBTreeBuilder4NodeC2Ev(ptr noundef nonnull align 16 dereferenceable(48) %7)
  call void @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 16 dereferenceable(48) %7)
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #7
  %40 = call noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %41 = call noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(8) %4)
  %42 = and i64 %39, 4294967295
  %43 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %42)
  %44 = getelementptr inbounds i8, ptr %43, i64 40
  store i32 %40, ptr %44, align 8, !tbaa !22
  %45 = getelementptr inbounds i8, ptr %43, i64 44
  store i32 %41, ptr %45, align 4, !tbaa !22
  %46 = zext i32 %40 to i64
  %47 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %46)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %43, ptr noundef nonnull align 16 dereferenceable(32) %47, i64 32, i1 false), !tbaa.struct !23
  %48 = load i32, ptr %45, align 4, !tbaa !22
  %49 = zext i32 %48 to i64
  %50 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %49)
  call void @_ZN3JPH5AABox11EncapsulateERKS0_(ptr noundef nonnull align 16 dereferenceable(32) %43, ptr noundef nonnull align 16 dereferenceable(32) %50)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %.loopexit

51:                                               ; preds = %2
  %52 = getelementptr inbounds i8, ptr %0, i64 16
  %53 = tail call noundef i64 @_ZNK3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %52)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %8, i8 0, i64 48, i1 false)
  call void @_ZN3JPH15AABBTreeBuilder4NodeC2Ev(ptr noundef nonnull align 16 dereferenceable(48) %8)
  call void @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %52, ptr noundef nonnull align 16 dereferenceable(48) %8)
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #7
  %54 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %52)
  %55 = getelementptr inbounds i8, ptr %0, i64 40
  %56 = call noundef i64 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %55)
  %57 = trunc i64 %56 to i32
  %58 = getelementptr inbounds i8, ptr %54, i64 32
  store i32 %57, ptr %58, align 16, !tbaa !25
  %59 = getelementptr inbounds i8, ptr %1, i64 4
  %60 = load i32, ptr %59, align 4, !tbaa !21
  %61 = load i32, ptr %1, align 4, !tbaa !19
  %62 = sub i32 %60, %61
  %63 = getelementptr inbounds i8, ptr %54, i64 36
  store i32 %62, ptr %63, align 4, !tbaa !29
  %64 = load ptr, ptr %0, align 8, !tbaa !14
  %65 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3JPH16TriangleSplitter11GetVerticesEv(ptr noundef nonnull align 8 dereferenceable(72) %64)
  %66 = load i32, ptr %1, align 4, !tbaa !19
  %67 = load i32, ptr %59, align 4, !tbaa !21
  %68 = icmp ult i32 %66, %67
  br i1 %68, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %51, %.lr.ph
  %.03637 = phi i32 [ %71, %.lr.ph ], [ %66, %51 ]
  %69 = load ptr, ptr %0, align 8, !tbaa !14
  %70 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNK3JPH16TriangleSplitter11GetTriangleEj(ptr noundef nonnull align 8 dereferenceable(72) %69, i32 noundef %.03637)
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 4 dereferenceable(20) %70)
  call void @_ZN3JPH5AABox11EncapsulateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(32) %54, ptr noundef nonnull align 8 dereferenceable(24) %65, ptr noundef nonnull align 4 dereferenceable(20) %70)
  %71 = add nuw i32 %.03637, 1
  %72 = load i32, ptr %59, align 4, !tbaa !21
  %73 = icmp ult i32 %71, %72
  br i1 %73, label %.lr.ph, label %.loopexit, !llvm.loop !30

.loopexit:                                        ; preds = %.lr.ph, %51, %37
  %.0.in = phi i64 [ %39, %37 ], [ %53, %51 ], [ %53, %.lr.ph ]
  %.0 = trunc i64 %.0.in to i32
  ret i32 %.0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox11EncapsulateERKS0_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE4backEv(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_15IndexedTriangleENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZNK3JPH16TriangleSplitter11GetTriangleEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox11EncapsulateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"_ZTSN3JPH15AABBTreeBuilderE", !7, i64 0, !10, i64 8, !11, i64 16, !13, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEE", !12, i64 0, !12, i64 8, !7, i64 16}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_ZTSN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEE", !12, i64 0, !12, i64 8, !7, i64 16}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !9, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{i64 2156963303}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTSN3JPH16TriangleSplitter5RangeE", !10, i64 0, !10, i64 4}
!21 = !{!20, !10, i64 4}
!22 = !{!10, !10, i64 0}
!23 = !{i64 0, i64 16, !24, i64 16, i64 16, !24}
!24 = !{!8, !8, i64 0}
!25 = !{!26, !10, i64 32}
!26 = !{!"_ZTSN3JPH15AABBTreeBuilder4NodeE", !27, i64 0, !10, i64 32, !10, i64 36, !8, i64 40}
!27 = !{!"_ZTSN3JPH5AABoxE", !28, i64 0, !28, i64 16}
!28 = !{!"_ZTSN3JPH4Vec3E", !8, i64 0}
!29 = !{!26, !10, i64 36}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


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