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

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

%"struct.rmg::Vec2" = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon }
%struct.anon = type { float, float }
%"class.rmg::Object2D" = type <{ %"class.rmg::Object", i8, [3 x i8], i32, i32, %"struct.rmg::Mat3", float, %"struct.rmg::Vec2", [4 x i8] }>
%"class.rmg::Object" = type { ptr, i64, ptr, %"struct.rmg::ColorRGBA", i8, i32 }
%"struct.rmg::ColorRGBA" = type { float, float, float, float }
%"struct.rmg::Mat3" = type { %union.anon }
%union.anon = type { [3 x [3 x float]] }

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

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZNK3rmg8Object2D14getTranslationEv(ptr noundef nonnull align 8 dereferenceable(108) %0) #1 align 2 {
  %2 = alloca %"struct.rmg::Vec2", align 4
  %3 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8
  %5 = getelementptr inbounds %"class.rmg::Object2D", ptr %4, i32 0, i32 5
  %6 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %5, i8 noundef zeroext 0)
  %7 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %6, i8 noundef zeroext 2)
  %8 = load float, ptr %7, align 4, !tbaa !9
  %9 = getelementptr inbounds %"class.rmg::Object2D", ptr %4, i32 0, i32 5
  %10 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %9, i8 noundef zeroext 1)
  %11 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %10, i8 noundef zeroext 2)
  %12 = load float, ptr %11, align 4, !tbaa !9
  call void @_ZN3rmg4Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef %8, float noundef %12)
  %13 = getelementptr inbounds %"struct.rmg::Vec2", ptr %2, i32 0, i32 0
  %14 = getelementptr inbounds %union.anon.0, ptr %13, i32 0, i32 0
  %15 = load <2 x float>, ptr %14, align 4
  ret <2 x float> %15
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36), i8 noundef zeroext) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef zeroext) #2 align 2

attributes #0 = { 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 #1 = { mustprogress 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 #2 = { 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" }

!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 = !{!"float", !7, i64 0}


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

%"struct.rmg::Vec2" = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon }
%struct.anon = type { float, float }

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

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZNK3rmg8Object2D14getTranslationEv(ptr noundef nonnull align 8 dereferenceable(108) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"struct.rmg::Vec2", align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 60
  %4 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext 0)
  %5 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 noundef zeroext 2)
  %6 = load float, ptr %5, align 4, !tbaa !5
  %7 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext 1)
  %8 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %7, i8 noundef zeroext 2)
  %9 = load float, ptr %8, align 4, !tbaa !5
  call void @_ZN3rmg4Vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef %6, float noundef %9)
  %10 = load <2 x float>, ptr %2, align 8
  ret <2 x float> %10
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36), i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef zeroext) local_unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { mustprogress 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 #2 = { 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" }

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InstCombinePass,SROAPass,TailCallElimPass