; LLVM IR from ysyesilyurt/ComputerGraphics :: ForwardRenderingPipeline/Camera.ll (ZN6CameraC2ERKS_)

; 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 { i32, [4 x i8], %class.Vec3, %class.Vec3, %class.Vec3, %class.Vec3, %class.Vec3, double, double, double, double, double, double, i32, i32, %"class.std::__cxx11::basic_string" }
%class.Vec3 = type <{ double, double, double, i32, [4 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

declare void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6CameraC2ERKS_(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef nonnull align 8 dereferenceable(256) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  %8 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 2
  call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %8)
  %9 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 3
  call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %9)
  %10 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 4
  call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %10)
  %11 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 5
  call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %11)
  %12 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 6
  call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %12)
  %13 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 15
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %class.Camera, ptr %14, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 0
  store i32 %16, ptr %17, align 8, !tbaa !9
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %class.Camera, ptr %18, i32 0, i32 2
  %20 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %19, i64 28, i1 false), !tbaa.struct !17
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %class.Camera, ptr %21, i32 0, i32 3
  %23 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %22, i64 28, i1 false), !tbaa.struct !17
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.Camera, ptr %24, i32 0, i32 4
  %26 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %25, i64 28, i1 false), !tbaa.struct !17
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.Camera, ptr %27, i32 0, i32 5
  %29 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %28, i64 28, i1 false), !tbaa.struct !17
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.Camera, ptr %30, i32 0, i32 6
  %32 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 8 %31, i64 28, i1 false), !tbaa.struct !17
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %class.Camera, ptr %33, i32 0, i32 7
  %35 = load double, ptr %34, align 8, !tbaa !20
  %36 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 7
  store double %35, ptr %36, align 8, !tbaa !20
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %class.Camera, ptr %37, i32 0, i32 8
  %39 = load double, ptr %38, align 8, !tbaa !21
  %40 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 8
  store double %39, ptr %40, align 8, !tbaa !21
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %class.Camera, ptr %41, i32 0, i32 9
  %43 = load double, ptr %42, align 8, !tbaa !22
  %44 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 9
  store double %43, ptr %44, align 8, !tbaa !22
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %class.Camera, ptr %45, i32 0, i32 10
  %47 = load double, ptr %46, align 8, !tbaa !23
  %48 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 10
  store double %47, ptr %48, align 8, !tbaa !23
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %class.Camera, ptr %49, i32 0, i32 11
  %51 = load double, ptr %50, align 8, !tbaa !24
  %52 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 11
  store double %51, ptr %52, align 8, !tbaa !24
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %class.Camera, ptr %53, i32 0, i32 12
  %55 = load double, ptr %54, align 8, !tbaa !25
  %56 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 12
  store double %55, ptr %56, align 8, !tbaa !25
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %class.Camera, ptr %57, i32 0, i32 13
  %59 = load i32, ptr %58, align 8, !tbaa !26
  %60 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 13
  store i32 %59, ptr %60, align 8, !tbaa !26
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %class.Camera, ptr %61, i32 0, i32 14
  %63 = load i32, ptr %62, align 4, !tbaa !27
  %64 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 14
  store i32 %63, ptr %64, align 4, !tbaa !27
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %class.Camera, ptr %65, i32 0, i32 15
  %67 = getelementptr inbounds %class.Camera, ptr %7, i32 0, i32 15
  %68 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %67, ptr noundef nonnull align 8 dereferenceable(32) %66)
          to label %69 unwind label %70

69:                                               ; preds = %2
  ret void

70:                                               ; preds = %2
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %5, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  br label %74

74:                                               ; preds = %70
  %75 = load ptr, ptr %5, align 8
  %76 = load i32, ptr %6, align 4
  %77 = insertvalue { ptr, i32 } poison, ptr %75, 0
  %78 = insertvalue { ptr, i32 } %77, i32 %76, 1
  resume { ptr, i32 } %78
}

attributes #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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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, !11, i64 0}
!10 = !{!"_ZTS6Camera", !11, i64 0, !12, i64 8, !12, i64 40, !12, i64 72, !12, i64 104, !12, i64 136, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !11, i64 216, !11, i64 220, !14, i64 224}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS4Vec3", !13, i64 0, !13, i64 8, !13, i64 16, !11, i64 24}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !16, i64 8, !7, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{i64 0, i64 8, !18, i64 8, i64 8, !18, i64 16, i64 8, !18, i64 24, i64 4, !19}
!18 = !{!13, !13, i64 0}
!19 = !{!11, !11, i64 0}
!20 = !{!10, !13, i64 168}
!21 = !{!10, !13, i64 176}
!22 = !{!10, !13, i64 184}
!23 = !{!10, !13, i64 192}
!24 = !{!10, !13, i64 200}
!25 = !{!10, !13, i64 208}
!26 = !{!10, !11, i64 216}
!27 = !{!10, !11, 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"

declare void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6CameraC2ERKS_(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef nonnull align 8 dereferenceable(256) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 104
  tail call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 136
  tail call void @_ZN4Vec3C1Ev(ptr noundef nonnull align 8 dereferenceable(28) %7)
  %8 = getelementptr inbounds i8, ptr %0, i64 224
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  %9 = load i32, ptr %1, align 8, !tbaa !5
  store i32 %9, ptr %0, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %3, ptr noundef nonnull align 8 dereferenceable(28) %10, i64 28, i1 false), !tbaa.struct !16
  %11 = getelementptr inbounds i8, ptr %1, i64 40
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %4, ptr noundef nonnull align 8 dereferenceable(28) %11, i64 28, i1 false), !tbaa.struct !16
  %12 = getelementptr inbounds i8, ptr %1, i64 72
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %5, ptr noundef nonnull align 8 dereferenceable(28) %12, i64 28, i1 false), !tbaa.struct !16
  %13 = getelementptr inbounds i8, ptr %1, i64 104
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %6, ptr noundef nonnull align 8 dereferenceable(28) %13, i64 28, i1 false), !tbaa.struct !16
  %14 = getelementptr inbounds i8, ptr %1, i64 136
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %7, ptr noundef nonnull align 8 dereferenceable(28) %14, i64 28, i1 false), !tbaa.struct !16
  %15 = getelementptr inbounds i8, ptr %1, i64 168
  %16 = getelementptr inbounds i8, ptr %0, i64 168
  %17 = load <2 x double>, ptr %15, align 8, !tbaa !17
  store <2 x double> %17, ptr %16, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %1, i64 184
  %19 = getelementptr inbounds i8, ptr %0, i64 184
  %20 = load <2 x double>, ptr %18, align 8, !tbaa !17
  store <2 x double> %20, ptr %19, align 8, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %1, i64 200
  %22 = getelementptr inbounds i8, ptr %0, i64 200
  %23 = load <2 x double>, ptr %21, align 8, !tbaa !17
  store <2 x double> %23, ptr %22, align 8, !tbaa !17
  %24 = getelementptr inbounds i8, ptr %1, i64 216
  %25 = getelementptr inbounds i8, ptr %0, i64 216
  %26 = load <2 x i32>, ptr %24, align 8, !tbaa !18
  store <2 x i32> %26, ptr %25, align 8, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %1, i64 224
  %28 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %27)
          to label %29 unwind label %30

29:                                               ; preds = %2
  ret void

30:                                               ; preds = %2
  %31 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  resume { ptr, i32 } %31
}

attributes #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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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, !7, i64 0}
!6 = !{!"_ZTS6Camera", !7, i64 0, !10, i64 8, !10, i64 40, !10, i64 72, !10, i64 104, !10, i64 136, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !7, i64 216, !7, i64 220, !12, i64 224}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS4Vec3", !11, i64 0, !11, i64 8, !11, i64 16, !7, i64 24}
!11 = !{!"double", !8, i64 0}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !13, i64 0, !15, i64 8, !8, i64 16}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !14, i64 0}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"long", !8, i64 0}
!16 = !{i64 0, i64 8, !17, i64 8, i64 8, !17, i64 16, i64 8, !17, i64 24, i64 4, !18}
!17 = !{!11, !11, i64 0}
!18 = !{!7, !7, i64 0}


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