; LLVM IR from Pi-Man/PiE :: source/Camera5DoF.ll (ZN3PiE10Camera5DoFC2EP10SDL_Window)

; 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.std::array.0" = type { [3 x float] }
%"struct.PiE::Camera5DoF" = type <{ %"struct.PiE::Camera", float, float, %"struct.PiE::Vec", [4 x i8] }>
%"struct.PiE::Camera" = type { ptr, %"class.std::mutex", %"struct.PiE::Matrix", %"struct.PiE::Matrix", %"struct.PiE::Matrix", %"struct.PiE::Matrix", ptr, i8, float, float, float }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"struct.PiE::Matrix" = type { %"struct.std::array" }
%"struct.std::array" = type { [16 x float] }
%"struct.PiE::Vec" = type { %"struct.std::array.0" }

@_ZTVN3PiE10Camera5DoFE = external dso_local unnamed_addr constant { [6 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3PiE10Camera5DoFC2EP10SDL_Window(ptr noundef nonnull align 8 dereferenceable(348) %0, ptr noundef %1) unnamed_addr #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.std::array.0", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3PiE6CameraC2EP10SDL_Window(ptr noundef nonnull align 8 dereferenceable(328) %6, ptr noundef %7)
  store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTVN3PiE10Camera5DoFE, i32 0, i32 0, i32 2), ptr %6, align 8, !tbaa !9
  %8 = getelementptr inbounds %"struct.PiE::Camera5DoF", ptr %6, i32 0, i32 1
  store float 0.000000e+00, ptr %8, align 8, !tbaa !11
  %9 = getelementptr inbounds %"struct.PiE::Camera5DoF", ptr %6, i32 0, i32 2
  store float 0.000000e+00, ptr %9, align 4, !tbaa !22
  %10 = getelementptr inbounds %"struct.PiE::Camera5DoF", ptr %6, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #4
  %11 = getelementptr inbounds %"struct.std::array.0", ptr %5, i32 0, i32 0
  store float 0.000000e+00, ptr %11, align 4, !tbaa !23
  %12 = getelementptr inbounds float, ptr %11, i64 1
  store float 0.000000e+00, ptr %12, align 4, !tbaa !23
  %13 = getelementptr inbounds float, ptr %11, i64 2
  store float 0.000000e+00, ptr %13, align 4, !tbaa !23
  call void @_ZN3PiE3VecIfLi3EEC2ERKSt5arrayIfLm3EE(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #4
  ret void
}

declare void @_ZN3PiE6CameraC2EP10SDL_Window(ptr noundef nonnull align 8 dereferenceable(328), ptr noundef) unnamed_addr #1

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

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

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

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" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !19, i64 328}
!12 = !{!"_ZTSN3PiE10Camera5DoFE", !13, i64 0, !19, i64 328, !19, i64 332, !20, i64 336}
!13 = !{!"_ZTSN3PiE6CameraE", !14, i64 8, !16, i64 48, !16, i64 112, !16, i64 176, !16, i64 240, !6, i64 304, !18, i64 312, !19, i64 316, !19, i64 320, !19, i64 324}
!14 = !{!"_ZTSSt5mutex", !15, i64 0}
!15 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!16 = !{!"_ZTSN3PiE6MatrixIfLi4ELi4EEE", !17, i64 0}
!17 = !{!"_ZTSSt5arrayIfLm16EE", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"float", !7, i64 0}
!20 = !{!"_ZTSN3PiE3VecIfLi3EEE", !21, i64 0}
!21 = !{!"_ZTSSt5arrayIfLm3EE", !7, i64 0}
!22 = !{!12, !19, i64 332}
!23 = !{!19, !19, 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.std::array.0" = type { [3 x float] }

@_ZTVN3PiE10Camera5DoFE = external dso_local unnamed_addr constant { [6 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3PiE10Camera5DoFC2EP10SDL_Window(ptr noundef nonnull align 8 dereferenceable(348) %0, ptr noundef %1) unnamed_addr #0 align 2 {
  %3 = alloca %"struct.std::array.0", align 8
  tail call void @_ZN3PiE6CameraC2EP10SDL_Window(ptr noundef nonnull align 8 dereferenceable(328) %0, ptr noundef %1)
  store ptr getelementptr inbounds inrange(-16, 32) (i8, ptr @_ZTVN3PiE10Camera5DoFE, i64 16), ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 328
  store <2 x float> zeroinitializer, ptr %4, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %0, i64 336
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #4
  store <2 x float> zeroinitializer, ptr %3, align 8, !tbaa !8
  %6 = getelementptr inbounds i8, ptr %3, i64 8
  store float 0.000000e+00, ptr %6, align 8, !tbaa !8
  call void @_ZN3PiE3VecIfLi3EEC2ERKSt5arrayIfLm3EE(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %3)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #4
  ret void
}

declare void @_ZN3PiE6CameraC2EP10SDL_Window(ptr noundef nonnull align 8 dereferenceable(328), ptr noundef) unnamed_addr #1

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

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

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

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" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!"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: EarlyCSEPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass