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

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

@_ZTVN3rmg10Cylinder3DE = external dso_local unnamed_addr constant { [5 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg10Cylinder3DC2Ev(ptr noundef nonnull align 8 dereferenceable(224) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  call void @_ZN3rmg8Object3DC2Ev(ptr noundef nonnull align 8 dereferenceable(216) %3)
  store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTVN3rmg10Cylinder3DE, i32 0, i32 0, i32 2), ptr %3, align 8, !tbaa !9
  %4 = getelementptr inbounds %"class.rmg::Cylinder3D", ptr %3, i32 0, i32 1
  store float 1.000000e+00, ptr %4, align 8, !tbaa !11
  %5 = getelementptr inbounds %"class.rmg::Cylinder3D", ptr %3, i32 0, i32 2
  store float 1.000000e+00, ptr %5, align 4, !tbaa !23
  ret void
}

declare void @_ZN3rmg8Object3DC2Ev(ptr noundef nonnull align 8 dereferenceable(216)) unnamed_addr #1

attributes #0 = { 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 #1 = { "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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !17, i64 216}
!12 = !{!"_ZTSN3rmg10Cylinder3DE", !13, i64 0, !17, i64 216, !17, i64 220}
!13 = !{!"_ZTSN3rmg8Object3DE", !14, i64 0, !20, i64 48, !21, i64 112, !6, i64 128, !17, i64 136, !17, i64 140, !17, i64 144, !6, i64 152, !6, i64 160, !22, i64 168, !6, i64 184, !6, i64 192, !22, i64 200}
!14 = !{!"_ZTSN3rmg6ObjectE", !15, i64 8, !6, i64 16, !16, i64 24, !18, i64 40, !19, i64 44}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTSN3rmg9ColorRGBAE", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12}
!17 = !{!"float", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTSN3rmg10ObjectTypeE", !7, i64 0}
!20 = !{!"_ZTSN3rmg4Mat4E", !7, i64 0}
!21 = !{!"_ZTSN3rmg4Vec3E", !7, i64 0}
!22 = !{!"_ZTSN3rmg8internal7PendingE", !6, i64 0, !6, i64 8}
!23 = !{!12, !17, i64 220}


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

@_ZTVN3rmg10Cylinder3DE = external dso_local unnamed_addr constant { [5 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg10Cylinder3DC2Ev(ptr noundef nonnull align 8 dereferenceable(224) %0) unnamed_addr #0 align 2 {
  tail call void @_ZN3rmg8Object3DC2Ev(ptr noundef nonnull align 8 dereferenceable(216) %0)
  store ptr getelementptr inbounds inrange(-16, 24) (i8, ptr @_ZTVN3rmg10Cylinder3DE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 216
  store <2 x float> <float 1.000000e+00, float 1.000000e+00>, ptr %2, align 8, !tbaa !8
  ret void
}

declare void @_ZN3rmg8Object3DC2Ev(ptr noundef nonnull align 8 dereferenceable(216)) unnamed_addr #1

attributes #0 = { 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 #1 = { "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}


; Effective O3 passes: InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass