; LLVM IR from jrouwe/JoltPhysics :: JoltViewer (JoltViewer)

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

%"class.JPH::Ref.26" = type { ptr }
%"class.std::lock_guard" = type { ptr }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::DebugRendererRecorder" = type { %"class.JPH::DebugRenderer", %"class.JPH::Mutex", ptr, i32, i32, %"class.JPH::UnorderedMap.13", %"struct.JPH::DebugRendererRecorder::Frame" }
%"class.JPH::DebugRenderer" = type { ptr, %"class.JPH::Ref", %"class.JPH::Ref", %"class.JPH::Ref", %"class.JPH::Ref", %"class.JPH::Ref", %"class.JPH::Ref", %"class.JPH::Ref", %"class.JPH::UnorderedMap", %"class.JPH::UnorderedMap", %"class.JPH::UnorderedMap.1", %"class.JPH::UnorderedMap.1", %"class.JPH::UnorderedMap.5", %"class.JPH::UnorderedMap.5", %"class.JPH::UnorderedMap.9", %"class.JPH::UnorderedMap.9" }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::UnorderedMap" = type { %"class.JPH::HashTable.base", [4 x i8] }
%"class.JPH::HashTable.base" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.1" = type { %"class.JPH::HashTable.base.3", [4 x i8] }
%"class.JPH::HashTable.base.3" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.5" = type { %"class.JPH::HashTable.base.7", [4 x i8] }
%"class.JPH::HashTable.base.7" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.9" = type { %"class.JPH::HashTable.base.11", [4 x i8] }
%"class.JPH::HashTable.base.11" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::Mutex" = type { %"class.std::mutex", %"class.std::thread::id" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::thread::id" = type { i64 }
%"class.JPH::UnorderedMap.13" = type { %"class.JPH::HashTable.base.15", [4 x i8] }
%"class.JPH::HashTable.base.15" = type <{ ptr, ptr, i32, i32, i32 }>
%"struct.JPH::DebugRendererRecorder::Frame" = type { %"class.JPH::Array", %"class.JPH::Array.17", %"class.JPH::Array.20", %"class.JPH::Array.23" }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.17" = type { i64, i64, ptr }
%"class.JPH::Array.20" = type { i64, i64, ptr }
%"class.JPH::Array.23" = type { i64, i64, ptr }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 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: mustprogress uwtable
declare dso_local void @_ZNSt10lock_guardIN3JPH5MutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH21DebugRendererRecorder19CreateTriangleBatchEPKNS_13DebugRenderer8TriangleEi(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref.26") align 8 %0, ptr noundef nonnull align 8 dereferenceable(512) %1, ptr noundef %2, i32 noundef %3) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::lock_guard", align 8
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca %"struct.JPH::AssertLastParam", align 1
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %16 = load ptr, ptr %6, align 8
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %22, label %19

19:                                               ; preds = %4
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %29

22:                                               ; preds = %19, %4
  %23 = call noundef ptr @_ZN3JPH21DebugRendererRecorder9BatchImplnwEm(i64 noundef 16)
  invoke void @_ZN3JPH21DebugRendererRecorder9BatchImplC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %23, i32 noundef 0)
          to label %24 unwind label %25

24:                                               ; preds = %22
  call void @_ZN3JPH3RefINS_16RefTargetVirtualEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %23)
  br label %87

25:                                               ; preds = %22
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %9, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %10, align 4
  call void @_ZN3JPH21DebugRendererRecorder9BatchImpldlEPv(ptr noundef %23) #6
  br label %88

29:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %30 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %16, i32 0, i32 1
  call void @_ZNSt10lock_guardIN3JPH5MutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(48) %30)
  %31 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %16, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  store i8 0, ptr %12, align 1, !tbaa !35
  invoke void @_ZN3JPH9StreamOut5WriteINS_21DebugRendererRecorder8ECommandETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS5_(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %33 unwind label %44

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %34 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %16, i32 0, i32 3
  %35 = load i32, ptr %34, align 8, !tbaa !37
  %36 = add i32 %35, 1
  store i32 %36, ptr %34, align 8, !tbaa !37
  store i32 %35, ptr %13, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %33
  %38 = load i32, ptr %13, align 4, !tbaa !9
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %52, label %40

40:                                               ; preds = %37
  %41 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 37)
          to label %42 unwind label %48

42:                                               ; preds = %40
  br i1 %41, label %43, label %52

43:                                               ; preds = %42
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !38
  br label %52

44:                                               ; preds = %29
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  br label %86

48:                                               ; preds = %75, %71, %61, %54, %40
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %9, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %10, align 4
  br label %85

52:                                               ; preds = %43, %42, %37
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %16, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !11
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %57 unwind label %48

57:                                               ; preds = %54
  %58 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %16, i32 0, i32 2
  %59 = load ptr, ptr %58, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %60 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %60, ptr %15, align 4, !tbaa !9
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %61 unwind label %77

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %62 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %16, i32 0, i32 2
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = mul i64 %66, 108
  %68 = load ptr, ptr %63, align 8, !tbaa !39
  %69 = getelementptr inbounds ptr, ptr %68, i64 2
  %70 = load ptr, ptr %69, align 8
  invoke void %70(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef %64, i64 noundef %67)
          to label %71 unwind label %48

71:                                               ; preds = %61
  %72 = invoke noundef ptr @_ZN3JPH21DebugRendererRecorder9BatchImplnwEm(i64 noundef 16)
          to label %73 unwind label %48

73:                                               ; preds = %71
  %74 = load i32, ptr %13, align 4, !tbaa !9
  invoke void @_ZN3JPH21DebugRendererRecorder9BatchImplC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %72, i32 noundef %74)
          to label %75 unwind label %81

75:                                               ; preds = %73
  invoke void @_ZN3JPH3RefINS_16RefTargetVirtualEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %72)
          to label %76 unwind label %48

76:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @_ZNSt10lock_guardIN3JPH5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %87

77:                                               ; preds = %57
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %9, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %85

81:                                               ; preds = %73
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %9, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %10, align 4
  call void @_ZN3JPH21DebugRendererRecorder9BatchImpldlEPv(ptr noundef %72) #6
  br label %85

85:                                               ; preds = %81, %77, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %86

86:                                               ; preds = %85, %44
  call void @_ZNSt10lock_guardIN3JPH5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %88

87:                                               ; preds = %76, %24
  ret void

88:                                               ; preds = %86, %25
  %89 = load ptr, ptr %9, align 8
  %90 = load i32, ptr %10, align 4
  %91 = insertvalue { ptr, i32 } poison, ptr %89, 0
  %92 = insertvalue { ptr, i32 } %91, i32 %90, 1
  resume { ptr, i32 } %92
}

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 368}
!12 = !{!"_ZTSN3JPH21DebugRendererRecorderE", !13, i64 0, !23, i64 320, !6, i64 368, !10, i64 376, !10, i64 380, !28, i64 384, !30, i64 416}
!13 = !{!"_ZTSN3JPH13DebugRendererE", !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !15, i64 64, !15, i64 96, !17, i64 128, !17, i64 160, !19, i64 192, !19, i64 224, !21, i64 256, !21, i64 288}
!14 = !{!"_ZTSN3JPH3RefINS_13DebugRenderer8GeometryEEE", !6, i64 0}
!15 = !{!"_ZTSN3JPH12UnorderedMapINS_13DebugRenderer15SwingConeLimitsENS_3RefINS1_8GeometryEEENS1_21SwingConeLimitsHasherESt8equal_toIS2_EEE", !16, i64 0}
!16 = !{!"_ZTSN3JPH9HashTableINS_13DebugRenderer15SwingConeLimitsESt4pairIS2_NS_3RefINS1_8GeometryEEEENS_18UnorderedMapDetailIS2_S6_EENS1_21SwingConeLimitsHasherESt8equal_toIS2_EEE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!17 = !{!"_ZTSN3JPH12UnorderedMapINS_13DebugRenderer18SwingPyramidLimitsENS_3RefINS1_8GeometryEEENS1_24SwingPyramidLimitsHasherESt8equal_toIS2_EEE", !18, i64 0}
!18 = !{!"_ZTSN3JPH9HashTableINS_13DebugRenderer18SwingPyramidLimitsESt4pairIS2_NS_3RefINS1_8GeometryEEEENS_18UnorderedMapDetailIS2_S6_EENS1_24SwingPyramidLimitsHasherESt8equal_toIS2_EEE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!19 = !{!"_ZTSN3JPH12UnorderedMapIfNS_3RefINS_13DebugRenderer8GeometryEEENS_4HashIfEESt8equal_toIfEEE", !20, i64 0}
!20 = !{!"_ZTSN3JPH9HashTableIfSt4pairIfNS_3RefINS_13DebugRenderer8GeometryEEEENS_18UnorderedMapDetailIfS5_EENS_4HashIfEESt8equal_toIfEEE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!21 = !{!"_ZTSN3JPH12UnorderedMapINS_13DebugRenderer15TaperedCylinderENS_3RefINS1_8GeometryEEENS1_21TaperedCylinderHasherESt8equal_toIS2_EEE", !22, i64 0}
!22 = !{!"_ZTSN3JPH9HashTableINS_13DebugRenderer15TaperedCylinderESt4pairIS2_NS_3RefINS1_8GeometryEEEENS_18UnorderedMapDetailIS2_S6_EENS1_21TaperedCylinderHasherESt8equal_toIS2_EEE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!23 = !{!"_ZTSN3JPH5MutexE", !24, i64 0, !26, i64 40}
!24 = !{!"_ZTSSt5mutex", !25, i64 0}
!25 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!26 = !{!"_ZTSNSt6thread2idE", !27, i64 0}
!27 = !{!"long", !7, i64 0}
!28 = !{!"_ZTSN3JPH12UnorderedMapINS_3RefINS_13DebugRenderer8GeometryEEEjNS_4HashIS4_EESt8equal_toIS4_EEE", !29, i64 0}
!29 = !{!"_ZTSN3JPH9HashTableINS_3RefINS_13DebugRenderer8GeometryEEESt4pairIS4_jENS_18UnorderedMapDetailIS4_jEENS_4HashIS4_EESt8equal_toIS4_EEE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!30 = !{!"_ZTSN3JPH21DebugRendererRecorder5FrameE", !31, i64 0, !32, i64 24, !33, i64 48, !34, i64 72}
!31 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder8LineBlobENS_12STLAllocatorIS2_EEEE", !27, i64 0, !27, i64 8, !6, i64 16}
!32 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder12TriangleBlobENS_12STLAllocatorIS2_EEEE", !27, i64 0, !27, i64 8, !6, i64 16}
!33 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder8TextBlobENS_12STLAllocatorIS2_EEEE", !27, i64 0, !27, i64 8, !6, i64 16}
!34 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder12GeometryBlobENS_12STLAllocatorIS2_EEEE", !27, i64 0, !27, i64 8, !6, i64 16}
!35 = !{!36, !36, i64 0}
!36 = !{!"_ZTSN3JPH21DebugRendererRecorder8ECommandE", !7, i64 0}
!37 = !{!12, !10, i64 376}
!38 = !{i64 2158566607}
!39 = !{!40, !40, i64 0}
!40 = !{!"vtable pointer", !8, i64 0}


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

%"class.JPH::Ref.26" = type { ptr }
%"class.std::lock_guard" = type { ptr }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 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: mustprogress uwtable
declare dso_local void @_ZNSt10lock_guardIN3JPH5MutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH21DebugRendererRecorder19CreateTriangleBatchEPKNS_13DebugRenderer8TriangleEi(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref.26") align 8 %0, ptr noundef nonnull align 8 dereferenceable(512) %1, ptr noundef %2, i32 noundef %3) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::lock_guard", align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = icmp eq ptr %2, null
  %10 = icmp eq i32 %3, 0
  %or.cond = or i1 %9, %10
  br i1 %or.cond, label %11, label %13

11:                                               ; preds = %4
  %12 = tail call noundef ptr @_ZN3JPH21DebugRendererRecorder9BatchImplnwEm(i64 noundef 16)
  tail call void @_ZN3JPH21DebugRendererRecorder9BatchImplC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 0)
  tail call void @_ZN3JPH3RefINS_16RefTargetVirtualEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %12)
  br label %49

13:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %14 = getelementptr inbounds i8, ptr %1, i64 320
  call void @_ZNSt10lock_guardIN3JPH5MutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(48) %14)
  %15 = getelementptr inbounds i8, ptr %1, i64 368
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  store i8 0, ptr %6, align 1, !tbaa !33
  invoke void @_ZN3JPH9StreamOut5WriteINS_21DebugRendererRecorder8ECommandETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS5_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %17 unwind label %25

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %18 = getelementptr inbounds i8, ptr %1, i64 376
  %19 = load i32, ptr %18, align 8, !tbaa !35
  %20 = add i32 %19, 1
  store i32 %20, ptr %18, align 8, !tbaa !35
  store i32 %19, ptr %7, align 4, !tbaa !36
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %21, label %29

21:                                               ; preds = %17
  %22 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 37)
          to label %23 unwind label %27

23:                                               ; preds = %21
  br i1 %22, label %24, label %29

24:                                               ; preds = %23
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !37
  br label %29

25:                                               ; preds = %13
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  br label %48

27:                                               ; preds = %42, %40, %33, %29, %21
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %47

29:                                               ; preds = %24, %23, %17
  %30 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %31 unwind label %27

31:                                               ; preds = %29
  %32 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 %3, ptr %8, align 4, !tbaa !36
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %33 unwind label %45

33:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  %34 = load ptr, ptr %15, align 8, !tbaa !5
  %35 = sext i32 %3 to i64
  %36 = mul nsw i64 %35, 108
  %37 = load ptr, ptr %34, align 8, !tbaa !38
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  %39 = load ptr, ptr %38, align 8
  invoke void %39(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull %2, i64 noundef %36)
          to label %40 unwind label %27

40:                                               ; preds = %33
  %41 = invoke noundef ptr @_ZN3JPH21DebugRendererRecorder9BatchImplnwEm(i64 noundef 16)
          to label %42 unwind label %27

42:                                               ; preds = %40
  %43 = load i32, ptr %7, align 4, !tbaa !36
  call void @_ZN3JPH21DebugRendererRecorder9BatchImplC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %41, i32 noundef %43)
  invoke void @_ZN3JPH3RefINS_16RefTargetVirtualEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %41)
          to label %44 unwind label %27

44:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @_ZNSt10lock_guardIN3JPH5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %49

45:                                               ; preds = %31
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br label %47

47:                                               ; preds = %45, %27
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  br label %48

48:                                               ; preds = %47, %25
  %.pn.pn = phi { ptr, i32 } [ %.pn, %47 ], [ %26, %25 ]
  call void @_ZNSt10lock_guardIN3JPH5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn.pn

49:                                               ; preds = %44, %11
  ret void
}

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

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !9, i64 368}
!6 = !{!"_ZTSN3JPH21DebugRendererRecorderE", !7, i64 0, !21, i64 320, !9, i64 368, !14, i64 376, !14, i64 380, !26, i64 384, !28, i64 416}
!7 = !{!"_ZTSN3JPH13DebugRendererE", !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !12, i64 64, !12, i64 96, !15, i64 128, !15, i64 160, !17, i64 192, !17, i64 224, !19, i64 256, !19, i64 288}
!8 = !{!"_ZTSN3JPH3RefINS_13DebugRenderer8GeometryEEE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN3JPH12UnorderedMapINS_13DebugRenderer15SwingConeLimitsENS_3RefINS1_8GeometryEEENS1_21SwingConeLimitsHasherESt8equal_toIS2_EEE", !13, i64 0}
!13 = !{!"_ZTSN3JPH9HashTableINS_13DebugRenderer15SwingConeLimitsESt4pairIS2_NS_3RefINS1_8GeometryEEEENS_18UnorderedMapDetailIS2_S6_EENS1_21SwingConeLimitsHasherESt8equal_toIS2_EEE", !9, i64 0, !9, i64 8, !14, i64 16, !14, i64 20, !14, i64 24}
!14 = !{!"int", !10, i64 0}
!15 = !{!"_ZTSN3JPH12UnorderedMapINS_13DebugRenderer18SwingPyramidLimitsENS_3RefINS1_8GeometryEEENS1_24SwingPyramidLimitsHasherESt8equal_toIS2_EEE", !16, i64 0}
!16 = !{!"_ZTSN3JPH9HashTableINS_13DebugRenderer18SwingPyramidLimitsESt4pairIS2_NS_3RefINS1_8GeometryEEEENS_18UnorderedMapDetailIS2_S6_EENS1_24SwingPyramidLimitsHasherESt8equal_toIS2_EEE", !9, i64 0, !9, i64 8, !14, i64 16, !14, i64 20, !14, i64 24}
!17 = !{!"_ZTSN3JPH12UnorderedMapIfNS_3RefINS_13DebugRenderer8GeometryEEENS_4HashIfEESt8equal_toIfEEE", !18, i64 0}
!18 = !{!"_ZTSN3JPH9HashTableIfSt4pairIfNS_3RefINS_13DebugRenderer8GeometryEEEENS_18UnorderedMapDetailIfS5_EENS_4HashIfEESt8equal_toIfEEE", !9, i64 0, !9, i64 8, !14, i64 16, !14, i64 20, !14, i64 24}
!19 = !{!"_ZTSN3JPH12UnorderedMapINS_13DebugRenderer15TaperedCylinderENS_3RefINS1_8GeometryEEENS1_21TaperedCylinderHasherESt8equal_toIS2_EEE", !20, i64 0}
!20 = !{!"_ZTSN3JPH9HashTableINS_13DebugRenderer15TaperedCylinderESt4pairIS2_NS_3RefINS1_8GeometryEEEENS_18UnorderedMapDetailIS2_S6_EENS1_21TaperedCylinderHasherESt8equal_toIS2_EEE", !9, i64 0, !9, i64 8, !14, i64 16, !14, i64 20, !14, i64 24}
!21 = !{!"_ZTSN3JPH5MutexE", !22, i64 0, !24, i64 40}
!22 = !{!"_ZTSSt5mutex", !23, i64 0}
!23 = !{!"_ZTSSt12__mutex_base", !10, i64 0}
!24 = !{!"_ZTSNSt6thread2idE", !25, i64 0}
!25 = !{!"long", !10, i64 0}
!26 = !{!"_ZTSN3JPH12UnorderedMapINS_3RefINS_13DebugRenderer8GeometryEEEjNS_4HashIS4_EESt8equal_toIS4_EEE", !27, i64 0}
!27 = !{!"_ZTSN3JPH9HashTableINS_3RefINS_13DebugRenderer8GeometryEEESt4pairIS4_jENS_18UnorderedMapDetailIS4_jEENS_4HashIS4_EESt8equal_toIS4_EEE", !9, i64 0, !9, i64 8, !14, i64 16, !14, i64 20, !14, i64 24}
!28 = !{!"_ZTSN3JPH21DebugRendererRecorder5FrameE", !29, i64 0, !30, i64 24, !31, i64 48, !32, i64 72}
!29 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder8LineBlobENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !9, i64 16}
!30 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder12TriangleBlobENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !9, i64 16}
!31 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder8TextBlobENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !9, i64 16}
!32 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder12GeometryBlobENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !9, i64 16}
!33 = !{!34, !34, i64 0}
!34 = !{!"_ZTSN3JPH21DebugRendererRecorder8ECommandE", !10, i64 0}
!35 = !{!6, !14, i64 376}
!36 = !{!14, !14, i64 0}
!37 = !{i64 2158566607}
!38 = !{!39, !39, i64 0}
!39 = !{!"vtable pointer", !11, i64 0}


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