; LLVM IR from achilles288/robot-monitor-graphics :: src/base/particle.ll (ZN3rmg10Particle3DC2EOS0_)

; 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.rmg::internal::Pending" = type { ptr, ptr }
%"struct.rmg::Vec3" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.rmg::Vec2" = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { float, float }
%"struct.rmg::Mat3" = type { %union.anon.2 }
%union.anon.2 = type { [3 x [3 x float]] }
%"class.rmg::Particle3D" = type <{ %"class.rmg::Object", ptr, ptr, %"class.rmg::internal::Pending", %"struct.rmg::Vec3", %"struct.rmg::Vec2", float, %"struct.rmg::Mat3", [4 x i8] }>
%"class.rmg::Object" = type { ptr, i64, ptr, %"struct.rmg::ColorRGBA", i8, i32 }
%"struct.rmg::ColorRGBA" = type { float, float, float, float }

@_ZTVN3rmg10Particle3DE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3rmg4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN3rmg4Mat3C1Ev(ptr noundef nonnull align 4 dereferenceable(36)) unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3rmg4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #1 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: nounwind
declare void @_ZN3rmg8internal7PendingD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN3rmg8internal7PendingaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #5

declare void @_ZN3rmg6ObjectC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3rmg10Particle3DC2EOS0_(ptr noundef nonnull align 8 dereferenceable(140) %0, ptr noundef nonnull align 8 dereferenceable(140) %1) unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.rmg::internal::Pending", align 8
  %8 = alloca %"class.rmg::internal::Pending", align 8
  %9 = alloca %"struct.rmg::Vec3", align 4
  %10 = alloca %"struct.rmg::Vec3", align 4
  %11 = alloca { <2 x float>, float }, align 8
  %12 = alloca %"struct.rmg::Vec2", align 4
  %13 = alloca %"struct.rmg::Vec2", align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.rmg::Mat3", align 4
  %16 = alloca %"struct.rmg::Mat3", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN3rmg6ObjectC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef nonnull align 8 dereferenceable(48) %18)
          to label %19 unwind label %64

19:                                               ; preds = %2
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN3rmg10Particle3DE, i32 0, i32 0, i32 2), ptr %17, align 8, !tbaa !9
  %20 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 1
  store ptr null, ptr %20, align 8, !tbaa !11
  %21 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 2
  store ptr null, ptr %21, align 8, !tbaa !23
  %22 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 3
  call void @_ZN3rmg8internal7PendingC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #10
  %23 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 4
  invoke void @_ZN3rmg4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %23)
          to label %24 unwind label %64

24:                                               ; preds = %19
  %25 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 5
  invoke void @_ZN3rmg4Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %25)
          to label %26 unwind label %64

26:                                               ; preds = %24
  %27 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 7
  invoke void @_ZN3rmg4Mat3C1Ev(ptr noundef nonnull align 4 dereferenceable(36) %27)
          to label %28 unwind label %64

28:                                               ; preds = %26
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.rmg::Particle3D", ptr %29, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #10
  store ptr null, ptr %5, align 8, !tbaa !24
  %31 = call noundef ptr @_ZSt8exchangeIPN3rmg8internal13SpriteTextureEDnET_RS4_OT0_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %5) #10
  %32 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 1
  store ptr %31, ptr %32, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #10
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.rmg::Particle3D", ptr %33, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  store ptr null, ptr %6, align 8, !tbaa !24
  %35 = call noundef ptr @_ZSt8exchangeIPjDnET_RS1_OT0_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %6) #10
  %36 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 2
  store ptr %35, ptr %36, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #10
  call void @_ZN3rmg8internal7PendingC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #10
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.rmg::Particle3D", ptr %37, i32 0, i32 3
  invoke void @_ZSt8exchangeIN3rmg8internal7PendingERS2_ET_RS4_OT0_(ptr dead_on_unwind writable sret(%"class.rmg::internal::Pending") align 8 %8, ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %39 unwind label %64

39:                                               ; preds = %28
  %40 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 3
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3rmg8internal7PendingaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(16) %8) #10
  call void @_ZN3rmg8internal7PendingD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #10
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.rmg::Particle3D", ptr %42, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #10
  invoke void @_ZN3rmg4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %44 unwind label %64

44:                                               ; preds = %39
  %45 = call { <2 x float>, float } @_ZSt8exchangeIN3rmg4Vec3ES1_ET_RS2_OT0_(ptr noundef nonnull align 4 dereferenceable(12) %43, ptr noundef nonnull align 4 dereferenceable(12) %10) #10
  %46 = getelementptr inbounds %"struct.rmg::Vec3", ptr %9, i32 0, i32 0
  %47 = getelementptr inbounds %union.anon, ptr %46, i32 0, i32 0
  store { <2 x float>, float } %45, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %47, ptr align 8 %11, i64 12, i1 false)
  %48 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %48, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.rmg::Particle3D", ptr %49, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  invoke void @_ZN3rmg4Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %13, float noundef 1.000000e+00, float noundef 1.000000e+00)
          to label %51 unwind label %64

51:                                               ; preds = %44
  %52 = call <2 x float> @_ZSt8exchangeIN3rmg4Vec2ES1_ET_RS2_OT0_(ptr noundef nonnull align 4 dereferenceable(8) %50, ptr noundef nonnull align 4 dereferenceable(8) %13) #10
  %53 = getelementptr inbounds %"struct.rmg::Vec2", ptr %12, i32 0, i32 0
  %54 = getelementptr inbounds %union.anon.0, ptr %53, i32 0, i32 0
  store <2 x float> %52, ptr %54, align 4
  %55 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %55, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.rmg::Particle3D", ptr %56, i32 0, i32 6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  store i32 0, ptr %14, align 4, !tbaa !29
  %58 = call noundef float @_ZSt8exchangeIfiET_RS0_OT0_(ptr noundef nonnull align 4 dereferenceable(4) %57, ptr noundef nonnull align 4 dereferenceable(4) %14) #10
  %59 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 6
  store float %58, ptr %59, align 4, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.start.p0(i64 36, ptr %15) #10
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %"class.rmg::Particle3D", ptr %60, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 36, ptr %16) #10
  invoke void @_ZN3rmg4Mat3C1Ev(ptr noundef nonnull align 4 dereferenceable(36) %16)
          to label %62 unwind label %64

62:                                               ; preds = %51
  call void @_ZSt8exchangeIN3rmg4Mat3ES1_ET_RS2_OT0_(ptr dead_on_unwind writable sret(%"struct.rmg::Mat3") align 4 %15, ptr noundef nonnull align 4 dereferenceable(36) %61, ptr noundef nonnull align 4 dereferenceable(36) %16) #10
  %63 = getelementptr inbounds %"class.rmg::Particle3D", ptr %17, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %63, ptr align 4 %15, i64 36, i1 false), !tbaa.struct !32
  call void @llvm.lifetime.end.p0(i64 36, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 36, ptr %15) #10
  call void @_ZN3rmg8internal7PendingD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #10
  ret void

64:                                               ; preds = %51, %44, %39, %28, %26, %24, %19, %2
  %65 = landingpad { ptr, i32 }
          catch ptr null
  %66 = extractvalue { ptr, i32 } %65, 0
  call void @__clang_call_terminate(ptr %66) #11
  unreachable
}

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt8exchangeIN3rmg8internal7PendingERS2_ET_RS4_OT0_(ptr dead_on_unwind noalias writable sret(%"class.rmg::internal::Pending") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZSt8exchangeIN3rmg4Vec3ES1_ET_RS2_OT0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #9

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZSt8exchangeIN3rmg4Vec2ES1_ET_RS2_OT0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #9

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt8exchangeIfiET_RS0_OT0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt8exchangeIN3rmg4Mat3ES1_ET_RS2_OT0_(ptr dead_on_unwind noalias writable sret(%"struct.rmg::Mat3") align 4, ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(36)) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 48}
!12 = !{!"_ZTSN3rmg10Particle3DE", !13, i64 0, !6, i64 48, !6, i64 56, !19, i64 64, !20, i64 80, !21, i64 92, !16, i64 100, !22, i64 104}
!13 = !{!"_ZTSN3rmg6ObjectE", !14, i64 8, !6, i64 16, !15, i64 24, !17, i64 40, !18, i64 44}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN3rmg9ColorRGBAE", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12}
!16 = !{!"float", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTSN3rmg10ObjectTypeE", !7, i64 0}
!19 = !{!"_ZTSN3rmg8internal7PendingE", !6, i64 0, !6, i64 8}
!20 = !{!"_ZTSN3rmg4Vec3E", !7, i64 0}
!21 = !{!"_ZTSN3rmg4Vec2E", !7, i64 0}
!22 = !{!"_ZTSN3rmg4Mat3E", !7, i64 0}
!23 = !{!12, !6, i64 56}
!24 = !{!25, !25, i64 0}
!25 = !{!"std::nullptr_t", !7, i64 0}
!26 = !{i64 0, i64 12, !27}
!27 = !{!7, !7, i64 0}
!28 = !{i64 0, i64 8, !27}
!29 = !{!30, !30, i64 0}
!30 = !{!"int", !7, i64 0}
!31 = !{!12, !16, i64 100}
!32 = !{i64 0, i64 36, !27}


; 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.rmg::internal::Pending" = type { ptr, ptr }
%"struct.rmg::Vec3" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.rmg::Vec2" = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { float, float }
%"struct.rmg::Mat3" = type { %union.anon.2 }
%union.anon.2 = type { [3 x [3 x float]] }

@_ZTVN3rmg10Particle3DE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3rmg4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN3rmg4Mat3C1Ev(ptr noundef nonnull align 4 dereferenceable(36)) unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3rmg4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #1 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: nounwind
declare void @_ZN3rmg8internal7PendingD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN3rmg8internal7PendingaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

declare void @_ZN3rmg6ObjectC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3rmg10Particle3DC2EOS0_(ptr noundef nonnull align 8 dereferenceable(140) %0, ptr noundef nonnull align 8 dereferenceable(140) %1) unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.rmg::internal::Pending", align 8
  %6 = alloca %"class.rmg::internal::Pending", align 8
  %7 = alloca %"struct.rmg::Vec3", align 4
  %8 = alloca %"struct.rmg::Vec2", align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.rmg::Mat3", align 4
  %11 = alloca %"struct.rmg::Mat3", align 4
  invoke void @_ZN3rmg6ObjectC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %12 unwind label %36

12:                                               ; preds = %2
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN3rmg10Particle3DE, i64 16), ptr %0, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %13, i8 0, i64 16, i1 false)
  tail call void @_ZN3rmg8internal7PendingC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #11
  %15 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZN3rmg4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %15)
  %16 = getelementptr inbounds i8, ptr %0, i64 92
  tail call void @_ZN3rmg4Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %16)
  %17 = getelementptr inbounds i8, ptr %0, i64 104
  invoke void @_ZN3rmg4Mat3C1Ev(ptr noundef nonnull align 4 dereferenceable(36) %17)
          to label %18 unwind label %36

18:                                               ; preds = %12
  %19 = getelementptr inbounds i8, ptr %0, i64 56
  %20 = getelementptr inbounds i8, ptr %1, i64 48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #11
  store ptr null, ptr %3, align 8, !tbaa !8
  %21 = call noundef ptr @_ZSt8exchangeIPN3rmg8internal13SpriteTextureEDnET_RS4_OT0_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %3) #11
  store ptr %21, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #11
  %22 = getelementptr inbounds i8, ptr %1, i64 56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #11
  store ptr null, ptr %4, align 8, !tbaa !8
  %23 = call noundef ptr @_ZSt8exchangeIPjDnET_RS1_OT0_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %4) #11
  store ptr %23, ptr %19, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #11
  call void @_ZN3rmg8internal7PendingC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #11
  %24 = getelementptr inbounds i8, ptr %1, i64 64
  invoke void @_ZSt8exchangeIN3rmg8internal7PendingERS2_ET_RS4_OT0_(ptr dead_on_unwind nonnull writable sret(%"class.rmg::internal::Pending") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %25 unwind label %36

25:                                               ; preds = %18
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3rmg8internal7PendingaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %6) #11
  call void @_ZN3rmg8internal7PendingD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #11
  %27 = getelementptr inbounds i8, ptr %1, i64 80
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #11
  call void @_ZN3rmg4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %28 = call { <2 x float>, float } @_ZSt8exchangeIN3rmg4Vec3ES1_ET_RS2_OT0_(ptr noundef nonnull align 4 dereferenceable(12) %27, ptr noundef nonnull align 4 dereferenceable(12) %7) #11
  %.fca.0.extract = extractvalue { <2 x float>, float } %28, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %28, 1
  store <2 x float> %.fca.0.extract, ptr %15, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 88
  store float %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #11
  %29 = getelementptr inbounds i8, ptr %1, i64 92
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #11
  call void @_ZN3rmg4Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %8, float noundef 1.000000e+00, float noundef 1.000000e+00)
  %30 = call <2 x float> @_ZSt8exchangeIN3rmg4Vec2ES1_ET_RS2_OT0_(ptr noundef nonnull align 4 dereferenceable(8) %29, ptr noundef nonnull align 4 dereferenceable(8) %8) #11
  store <2 x float> %30, ptr %16, align 4, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #11
  %31 = getelementptr inbounds i8, ptr %1, i64 100
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #11
  store i32 0, ptr %9, align 4, !tbaa !26
  %32 = call noundef float @_ZSt8exchangeIfiET_RS0_OT0_(ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %9) #11
  %33 = getelementptr inbounds i8, ptr %0, i64 100
  store float %32, ptr %33, align 4, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #11
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %10) #11
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %11) #11
  invoke void @_ZN3rmg4Mat3C1Ev(ptr noundef nonnull align 4 dereferenceable(36) %11)
          to label %34 unwind label %36

34:                                               ; preds = %25
  %35 = getelementptr inbounds i8, ptr %1, i64 104
  call void @_ZSt8exchangeIN3rmg4Mat3ES1_ET_RS2_OT0_(ptr dead_on_unwind nonnull writable sret(%"struct.rmg::Mat3") align 4 %10, ptr noundef nonnull align 4 dereferenceable(36) %35, ptr noundef nonnull align 4 dereferenceable(36) %11) #11
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(36) %17, ptr noundef nonnull align 4 dereferenceable(36) %10, i64 36, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %11) #11
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #11
  call void @_ZN3rmg8internal7PendingD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #11
  ret void

36:                                               ; preds = %25, %18, %12, %2
  %37 = landingpad { ptr, i32 }
          catch ptr null
  %38 = extractvalue { ptr, i32 } %37, 0
  call void @__clang_call_terminate(ptr %38) #12
  unreachable
}

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt8exchangeIN3rmg8internal7PendingERS2_ET_RS4_OT0_(ptr dead_on_unwind noalias writable sret(%"class.rmg::internal::Pending") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZSt8exchangeIN3rmg4Vec3ES1_ET_RS2_OT0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #9

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZSt8exchangeIN3rmg4Vec2ES1_ET_RS2_OT0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #9

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt8exchangeIfiET_RS0_OT0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt8exchangeIN3rmg4Mat3ES1_ET_RS2_OT0_(ptr dead_on_unwind noalias writable sret(%"struct.rmg::Mat3") align 4, ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #1

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"std::nullptr_t", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !15, i64 48}
!12 = !{!"_ZTSN3rmg10Particle3DE", !13, i64 0, !15, i64 48, !15, i64 56, !20, i64 64, !21, i64 80, !22, i64 92, !17, i64 100, !23, i64 104}
!13 = !{!"_ZTSN3rmg6ObjectE", !14, i64 8, !15, i64 16, !16, i64 24, !18, i64 40, !19, i64 44}
!14 = !{!"long", !10, i64 0}
!15 = !{!"any pointer", !10, i64 0}
!16 = !{!"_ZTSN3rmg9ColorRGBAE", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12}
!17 = !{!"float", !10, i64 0}
!18 = !{!"bool", !10, i64 0}
!19 = !{!"_ZTSN3rmg10ObjectTypeE", !10, i64 0}
!20 = !{!"_ZTSN3rmg8internal7PendingE", !15, i64 0, !15, i64 8}
!21 = !{!"_ZTSN3rmg4Vec3E", !10, i64 0}
!22 = !{!"_ZTSN3rmg4Vec2E", !10, i64 0}
!23 = !{!"_ZTSN3rmg4Mat3E", !10, i64 0}
!24 = !{!12, !15, i64 56}
!25 = !{!10, !10, i64 0}
!26 = !{!27, !27, i64 0}
!27 = !{!"int", !10, i64 0}
!28 = !{!12, !17, i64 100}
!29 = !{i64 0, i64 36, !25}


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