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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH21DebugRendererRecorder19CreateTriangleBatchEPKNS_13DebugRenderer6VertexEiPKji(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, ptr noundef %4, i32 noundef %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::lock_guard", align 8
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca %"struct.JPH::AssertLastParam", align 1
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %7, align 8
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !9
  %21 = load ptr, ptr %8, align 8
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %33, label %24

24:                                               ; preds = %6
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %33, label %27

27:                                               ; preds = %24
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = icmp eq ptr %28, null
  br i1 %29, label %33, label %30

30:                                               ; preds = %27
  %31 = load i32, ptr %12, align 4, !tbaa !9
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %40

33:                                               ; preds = %30, %27, %24, %6
  %34 = call noundef ptr @_ZN3JPH21DebugRendererRecorder9BatchImplnwEm(i64 noundef 16)
  invoke void @_ZN3JPH21DebugRendererRecorder9BatchImplC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %34, i32 noundef 0)
          to label %35 unwind label %36

35:                                               ; preds = %33
  call void @_ZN3JPH3RefINS_16RefTargetVirtualEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %34)
  br label %116

36:                                               ; preds = %33
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %13, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %14, align 4
  call void @_ZN3JPH21DebugRendererRecorder9BatchImpldlEPv(ptr noundef %34) #6
  br label %117

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

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %45 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %21, i32 0, i32 3
  %46 = load i32, ptr %45, align 8, !tbaa !37
  %47 = add i32 %46, 1
  store i32 %47, ptr %45, align 8, !tbaa !37
  store i32 %46, ptr %17, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %44
  %49 = load i32, ptr %17, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %63, label %51

51:                                               ; preds = %48
  %52 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 55)
          to label %53 unwind label %59

53:                                               ; preds = %51
  br i1 %52, label %54, label %63

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

55:                                               ; preds = %40
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %13, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  br label %115

59:                                               ; preds = %100, %96, %86, %72, %65, %51
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %13, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %14, align 4
  br label %114

63:                                               ; preds = %54, %53, %48
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %21, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !11
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %68 unwind label %59

68:                                               ; preds = %65
  %69 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %21, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %71 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %71, ptr %19, align 4, !tbaa !9
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %72 unwind label %102

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %73 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %21, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = mul i64 %77, 36
  %79 = load ptr, ptr %74, align 8, !tbaa !39
  %80 = getelementptr inbounds ptr, ptr %79, i64 2
  %81 = load ptr, ptr %80, align 8
  invoke void %81(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef %75, i64 noundef %78)
          to label %82 unwind label %59

82:                                               ; preds = %72
  %83 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %21, i32 0, i32 2
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %85 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %85, ptr %20, align 4, !tbaa !9
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %86 unwind label %106

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  %87 = getelementptr inbounds %"class.JPH::DebugRendererRecorder", ptr %21, i32 0, i32 2
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = mul i64 %91, 4
  %93 = load ptr, ptr %88, align 8, !tbaa !39
  %94 = getelementptr inbounds ptr, ptr %93, i64 2
  %95 = load ptr, ptr %94, align 8
  invoke void %95(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef %89, i64 noundef %92)
          to label %96 unwind label %59

96:                                               ; preds = %86
  %97 = invoke noundef ptr @_ZN3JPH21DebugRendererRecorder9BatchImplnwEm(i64 noundef 16)
          to label %98 unwind label %59

98:                                               ; preds = %96
  %99 = load i32, ptr %17, align 4, !tbaa !9
  invoke void @_ZN3JPH21DebugRendererRecorder9BatchImplC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %97, i32 noundef %99)
          to label %100 unwind label %110

100:                                              ; preds = %98
  invoke void @_ZN3JPH3RefINS_16RefTargetVirtualEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %97)
          to label %101 unwind label %59

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

102:                                              ; preds = %68
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %13, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %114

106:                                              ; preds = %82
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %13, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %114

110:                                              ; preds = %98
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %13, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %14, align 4
  call void @_ZN3JPH21DebugRendererRecorder9BatchImpldlEPv(ptr noundef %97) #6
  br label %114

114:                                              ; preds = %110, %106, %102, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %115

115:                                              ; preds = %114, %55
  call void @_ZNSt10lock_guardIN3JPH5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %117

116:                                              ; preds = %101, %35
  ret void

117:                                              ; preds = %115, %36
  %118 = load ptr, ptr %13, align 8
  %119 = load i32, ptr %14, align 4
  %120 = insertvalue { ptr, i32 } poison, ptr %118, 0
  %121 = insertvalue { ptr, i32 } %120, i32 %119, 1
  resume { ptr, i32 } %121
}

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 2158570993}
!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: 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH21DebugRendererRecorder19CreateTriangleBatchEPKNS_13DebugRenderer6VertexEiPKji(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, ptr noundef %4, i32 noundef %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.std::lock_guard", align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = icmp eq ptr %2, null
  %13 = icmp eq i32 %3, 0
  %or.cond = or i1 %12, %13
  %14 = icmp eq ptr %4, null
  %or.cond3 = or i1 %or.cond, %14
  %15 = icmp eq i32 %5, 0
  %or.cond5 = or i1 %or.cond3, %15
  br i1 %or.cond5, label %16, label %18

16:                                               ; preds = %6
  %17 = tail call noundef ptr @_ZN3JPH21DebugRendererRecorder9BatchImplnwEm(i64 noundef 16)
  tail call void @_ZN3JPH21DebugRendererRecorder9BatchImplC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %17, i32 noundef 0)
  tail call void @_ZN3JPH3RefINS_16RefTargetVirtualEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %17)
  br label %65

18:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %19 = getelementptr inbounds i8, ptr %1, i64 320
  call void @_ZNSt10lock_guardIN3JPH5MutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(48) %19)
  %20 = getelementptr inbounds i8, ptr %1, i64 368
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #5
  store i8 1, ptr %8, align 1, !tbaa !33
  invoke void @_ZN3JPH9StreamOut5WriteINS_21DebugRendererRecorder8ECommandETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS5_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %22 unwind label %30

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %23 = getelementptr inbounds i8, ptr %1, i64 376
  %24 = load i32, ptr %23, align 8, !tbaa !35
  %25 = add i32 %24, 1
  store i32 %25, ptr %23, align 8, !tbaa !35
  store i32 %24, ptr %9, align 4, !tbaa !36
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %26, label %34

26:                                               ; preds = %22
  %27 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 55)
          to label %28 unwind label %32

28:                                               ; preds = %26
  br i1 %27, label %29, label %34

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

30:                                               ; preds = %18
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  br label %64

32:                                               ; preds = %56, %54, %47, %38, %34, %26
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %63

34:                                               ; preds = %29, %28, %22
  %35 = load ptr, ptr %20, align 8, !tbaa !5
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %36 unwind label %32

36:                                               ; preds = %34
  %37 = load ptr, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  store i32 %3, ptr %10, align 4, !tbaa !36
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %38 unwind label %59

38:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  %39 = load ptr, ptr %20, align 8, !tbaa !5
  %40 = sext i32 %3 to i64
  %41 = mul nsw i64 %40, 36
  %42 = load ptr, ptr %39, align 8, !tbaa !38
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = load ptr, ptr %43, align 8
  invoke void %44(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull %2, i64 noundef %41)
          to label %45 unwind label %32

45:                                               ; preds = %38
  %46 = load ptr, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  store i32 %5, ptr %11, align 4, !tbaa !36
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %47 unwind label %61

47:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  %48 = load ptr, ptr %20, align 8, !tbaa !5
  %49 = sext i32 %5 to i64
  %50 = shl nsw i64 %49, 2
  %51 = load ptr, ptr %48, align 8, !tbaa !38
  %52 = getelementptr inbounds i8, ptr %51, i64 16
  %53 = load ptr, ptr %52, align 8
  invoke void %53(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull %4, i64 noundef %50)
          to label %54 unwind label %32

54:                                               ; preds = %47
  %55 = invoke noundef ptr @_ZN3JPH21DebugRendererRecorder9BatchImplnwEm(i64 noundef 16)
          to label %56 unwind label %32

56:                                               ; preds = %54
  %57 = load i32, ptr %9, align 4, !tbaa !36
  call void @_ZN3JPH21DebugRendererRecorder9BatchImplC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %55, i32 noundef %57)
  invoke void @_ZN3JPH3RefINS_16RefTargetVirtualEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %55)
          to label %58 unwind label %32

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

59:                                               ; preds = %36
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  br label %63

61:                                               ; preds = %45
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br label %63

63:                                               ; preds = %61, %59, %32
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %62, %61 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  br label %64

64:                                               ; preds = %63, %30
  %.pn.pn = phi { ptr, i32 } [ %.pn, %63 ], [ %31, %30 ]
  call void @_ZNSt10lock_guardIN3JPH5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  resume { ptr, i32 } %.pn.pn

65:                                               ; preds = %58, %16
  ret void
}

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 2158570993}
!38 = !{!39, !39, i64 0}
!39 = !{!"vtable pointer", !11, i64 0}


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