; LLVM IR from Lut1n/ImpGears :: src/OGLPlugin/RenderToCubeMap.ll (ZN3imp15RenderToCubeMapD2Ev)

; 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.imp::RenderToCubeMap" = type <{ %"class.imp::Object", ptr, %"class.std::shared_ptr.3", %"class.std::shared_ptr.6", %"class.std::shared_ptr", %"class.imp::Matrix4", %"class.std::shared_ptr.9", %"class.std::shared_ptr.12", [6 x %"class.imp::Vec3"], [6 x %"class.imp::Vec3"], [6 x %"class.std::shared_ptr.15"], %"class.imp::Vec2", float, [4 x i8] }>
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr.0" }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.3" = type { %"class.std::__shared_ptr.4" }
%"class.std::__shared_ptr.4" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.6" = type { %"class.std::__shared_ptr.7" }
%"class.std::__shared_ptr.7" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.imp::Matrix4" = type { %"class.imp::Matrix" }
%"class.imp::Matrix" = type { %"class.imp::Object", [16 x float] }
%"class.std::shared_ptr.9" = type { %"class.std::__shared_ptr.10" }
%"class.std::__shared_ptr.10" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.12" = type { %"class.std::__shared_ptr.13" }
%"class.std::__shared_ptr.13" = type { ptr, %"class.std::__shared_count" }
%"class.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.std::shared_ptr.15" = type { %"class.std::__shared_ptr.16" }
%"class.std::__shared_ptr.16" = type { ptr, %"class.std::__shared_count" }
%"class.imp::Vec2" = type { %"class.imp::Vec.18" }
%"class.imp::Vec.18" = type { %"class.imp::Object", [2 x float] }

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

; Function Attrs: nounwind
declare void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3imp15RenderToCubeMapD2Ev(ptr noundef nonnull align 8 dereferenceable(812) %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
  store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTVN3imp15RenderToCubeMapE, i32 0, i32 0, i32 2), ptr %3, align 8, !tbaa !9
  %4 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 11
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #2
  %5 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 10
  %6 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %5, i32 0, i32 0
  %7 = getelementptr inbounds %"class.std::shared_ptr.15", ptr %6, i64 6
  br label %8

8:                                                ; preds = %8, %1
  %9 = phi ptr [ %7, %1 ], [ %10, %8 ]
  %10 = getelementptr inbounds %"class.std::shared_ptr.15", ptr %9, i64 -1
  call void @_ZNSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #2
  %11 = icmp eq ptr %10, %6
  br i1 %11, label %12, label %8

12:                                               ; preds = %8
  %13 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 9
  %14 = getelementptr inbounds [6 x %"class.imp::Vec3"], ptr %13, i32 0, i32 0
  %15 = getelementptr inbounds %"class.imp::Vec3", ptr %14, i64 6
  br label %16

16:                                               ; preds = %16, %12
  %17 = phi ptr [ %15, %12 ], [ %18, %16 ]
  %18 = getelementptr inbounds %"class.imp::Vec3", ptr %17, i64 -1
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %18) #2
  %19 = icmp eq ptr %18, %14
  br i1 %19, label %20, label %16

20:                                               ; preds = %16
  %21 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 8
  %22 = getelementptr inbounds [6 x %"class.imp::Vec3"], ptr %21, i32 0, i32 0
  %23 = getelementptr inbounds %"class.imp::Vec3", ptr %22, i64 6
  br label %24

24:                                               ; preds = %24, %20
  %25 = phi ptr [ %23, %20 ], [ %26, %24 ]
  %26 = getelementptr inbounds %"class.imp::Vec3", ptr %25, i64 -1
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %26) #2
  %27 = icmp eq ptr %26, %22
  br i1 %27, label %28, label %24

28:                                               ; preds = %24
  %29 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 7
  call void @_ZNSt12__shared_ptrIN3imp5StateELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %29) #2
  %30 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 6
  call void @_ZNSt12__shared_ptrIN3imp6CameraELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %30) #2
  %31 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 5
  call void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88) %31) #2
  %32 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 4
  call void @_ZNSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %32) #2
  %33 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 3
  call void @_ZNSt12__shared_ptrIN3imp11RenderQueueELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %33) #2
  %34 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %3, i32 0, i32 2
  call void @_ZNSt12__shared_ptrIN3imp5GraphELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %34) #2
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #2
  ret void
}

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

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

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

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

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

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

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


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

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

; Function Attrs: nounwind
declare void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3imp15RenderToCubeMapD2Ev(ptr noundef nonnull align 8 dereferenceable(812) %0) unnamed_addr #1 align 2 {
.preheader11.preheader:
  store ptr getelementptr inbounds inrange(-16, 24) (i8, ptr @_ZTVN3imp15RenderToCubeMapE, i64 16), ptr %0, align 8, !tbaa !5
  %1 = getelementptr inbounds i8, ptr %0, i64 776
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #2
  %.ptr1 = getelementptr inbounds i8, ptr %0, i64 760
  tail call void @_ZNSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr1) #2
  %.ptr1.1 = getelementptr inbounds i8, ptr %0, i64 744
  tail call void @_ZNSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr1.1) #2
  %.ptr1.2 = getelementptr inbounds i8, ptr %0, i64 728
  tail call void @_ZNSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr1.2) #2
  %.ptr1.3 = getelementptr inbounds i8, ptr %0, i64 712
  tail call void @_ZNSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr1.3) #2
  %.ptr1.4 = getelementptr inbounds i8, ptr %0, i64 696
  tail call void @_ZNSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr1.4) #2
  %.ptr1.5 = getelementptr inbounds i8, ptr %0, i64 680
  tail call void @_ZNSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr1.5) #2
  %.ptr5 = getelementptr inbounds i8, ptr %0, i64 640
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr5) #2
  %.ptr5.1 = getelementptr inbounds i8, ptr %0, i64 600
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr5.1) #2
  %.ptr5.2 = getelementptr inbounds i8, ptr %0, i64 560
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr5.2) #2
  %.ptr5.3 = getelementptr inbounds i8, ptr %0, i64 520
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr5.3) #2
  %.ptr5.4 = getelementptr inbounds i8, ptr %0, i64 480
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr5.4) #2
  %.ptr5.5 = getelementptr inbounds i8, ptr %0, i64 440
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr5.5) #2
  %.ptr9 = getelementptr inbounds i8, ptr %0, i64 400
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr9) #2
  %.ptr9.1 = getelementptr inbounds i8, ptr %0, i64 360
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr9.1) #2
  %.ptr9.2 = getelementptr inbounds i8, ptr %0, i64 320
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr9.2) #2
  %.ptr9.3 = getelementptr inbounds i8, ptr %0, i64 280
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr9.3) #2
  %.ptr9.4 = getelementptr inbounds i8, ptr %0, i64 240
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr9.4) #2
  %.ptr9.5 = getelementptr inbounds i8, ptr %0, i64 200
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %.ptr9.5) #2
  %2 = getelementptr inbounds i8, ptr %0, i64 184
  tail call void @_ZNSt12__shared_ptrIN3imp5StateELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #2
  %3 = getelementptr inbounds i8, ptr %0, i64 168
  tail call void @_ZNSt12__shared_ptrIN3imp6CameraELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #2
  %4 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88) %4) #2
  %5 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @_ZNSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #2
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZNSt12__shared_ptrIN3imp11RenderQueueELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #2
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @_ZNSt12__shared_ptrIN3imp5GraphELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #2
  tail call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #2
  ret void
}

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

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

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,InstCombinePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass