; LLVM IR from aap/librw :: tools/playground/camera.ll (ZN6CameraC2Ev)

; 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.Camera = type { ptr, %"struct.rw::V3d", %"struct.rw::V3d", %"struct.rw::V3d", %"struct.rw::V3d", float, float, float, float }
%"struct.rw::V3d" = type { float, float, float }

; 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) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6CameraC2Ev(ptr noundef nonnull align 8 dereferenceable(72) %0) unnamed_addr #1 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 1
  %5 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 2
  %6 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 3
  %7 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 4
  %8 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 1
  call void @_ZN2rw3V3d3setEfff(ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef 0.000000e+00, float noundef 6.000000e+00, float noundef 0.000000e+00)
  %9 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 2
  call void @_ZN2rw3V3d3setEfff(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %10 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 3
  call void @_ZN2rw3V3d3setEfff(ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %11 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 3
  %12 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 8 %11, i64 12, i1 false), !tbaa.struct !9
  %13 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 5
  store float 7.000000e+01, ptr %13, align 8, !tbaa !12
  %14 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 6
  store float 1.000000e+00, ptr %14, align 4, !tbaa !15
  %15 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 7
  store float 0x3FB99999A0000000, ptr %15, align 8, !tbaa !16
  %16 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 8
  store float 1.000000e+02, ptr %16, align 4, !tbaa !17
  %17 = getelementptr inbounds %class.Camera, ptr %3, i32 0, i32 0
  store ptr null, ptr %17, align 8, !tbaa !18
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2rw3V3d3setEfff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) #2 align 2

attributes #0 = { nocallback nofree 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" }

!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 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !11, i64 56}
!13 = !{!"_ZTS6Camera", !6, i64 0, !14, i64 8, !14, i64 20, !14, i64 32, !14, i64 44, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68}
!14 = !{!"_ZTSN2rw3V3dE", !11, i64 0, !11, i64 4, !11, i64 8}
!15 = !{!13, !11, i64 60}
!16 = !{!13, !11, i64 64}
!17 = !{!13, !11, i64 68}
!18 = !{!13, !6, 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"

; 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) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6CameraC2Ev(ptr noundef nonnull align 8 dereferenceable(72) %0) unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN2rw3V3d3setEfff(ptr noundef nonnull align 4 dereferenceable(12) %2, float noundef 0.000000e+00, float noundef 6.000000e+00, float noundef 0.000000e+00)
  %3 = getelementptr inbounds i8, ptr %0, i64 20
  tail call void @_ZN2rw3V3d3setEfff(ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @_ZN2rw3V3d3setEfff(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %5 = getelementptr inbounds i8, ptr %0, i64 44
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 8 dereferenceable(12) %4, i64 12, i1 false), !tbaa.struct !5
  %6 = getelementptr inbounds i8, ptr %0, i64 56
  store <4 x float> <float 7.000000e+01, float 1.000000e+00, float 0x3FB99999A0000000, float 1.000000e+02>, ptr %6, align 8, !tbaa !6
  store ptr null, ptr %0, align 8, !tbaa !10
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2rw3V3d3setEfff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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" }

!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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !12, i64 0}
!11 = !{!"_ZTS6Camera", !12, i64 0, !13, i64 8, !13, i64 20, !13, i64 32, !13, i64 44, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTSN2rw3V3dE", !7, i64 0, !7, i64 4, !7, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass