; LLVM IR from awawa-dev/HyperHDR :: sources/effects/Animation_RainbowSwirl.ll (ZN22Animation_RainbowSwirlC2Ev)

; 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.Animation_Swirl = type { %class.AnimationBase.base, %struct.Point2d, %struct.Point2d, i32, i32, i8, i32, i32, %"class.std::vector", %"class.std::vector", double, i8, double, double, i8, %"class.std::vector.0", i8, i8, double, double, i8, %"class.std::vector.0" }
%class.AnimationBase.base = type <{ ptr, i32, i8 }>
%struct.Point2d = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Animation_Swirl::SwirlGradient, std::allocator<Animation_Swirl::SwirlGradient>>::_Vector_impl" }
%"struct.std::_Vector_base<Animation_Swirl::SwirlGradient, std::allocator<Animation_Swirl::SwirlGradient>>::_Vector_impl" = type { %"struct.std::_Vector_base<Animation_Swirl::SwirlGradient, std::allocator<Animation_Swirl::SwirlGradient>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Animation_Swirl::SwirlGradient, std::allocator<Animation_Swirl::SwirlGradient>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Animation_Swirl::SwirlColor, std::allocator<Animation_Swirl::SwirlColor>>::_Vector_impl" }
%"struct.std::_Vector_base<Animation_Swirl::SwirlColor, std::allocator<Animation_Swirl::SwirlColor>>::_Vector_impl" = type { %"struct.std::_Vector_base<Animation_Swirl::SwirlColor, std::allocator<Animation_Swirl::SwirlColor>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Animation_Swirl::SwirlColor, std::allocator<Animation_Swirl::SwirlColor>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZTV22Animation_RainbowSwirl = external dso_local unnamed_addr constant { [10 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN22Animation_RainbowSwirlC2Ev(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 @_ZN15Animation_SwirlC2Ev(ptr noundef nonnull align 8 dereferenceable(224) %3)
  store ptr getelementptr inbounds inrange(-16, 64) ({ [10 x ptr] }, ptr @_ZTV22Animation_RainbowSwirl, i32 0, i32 0, i32 2), ptr %3, align 8, !tbaa !9
  %4 = getelementptr inbounds %class.Animation_Swirl, ptr %3, i32 0, i32 15
  call void @_ZNSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  %5 = getelementptr inbounds %class.Animation_Swirl, ptr %3, i32 0, i32 21
  call void @_ZNSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  %6 = getelementptr inbounds %class.Animation_Swirl, ptr %3, i32 0, i32 10
  store double 2.000000e+01, ptr %6, align 8, !tbaa !11
  %7 = getelementptr inbounds %class.Animation_Swirl, ptr %3, i32 0, i32 12
  store double 5.000000e-01, ptr %7, align 8, !tbaa !26
  %8 = getelementptr inbounds %class.Animation_Swirl, ptr %3, i32 0, i32 13
  store double 5.000000e-01, ptr %8, align 8, !tbaa !27
  %9 = getelementptr inbounds %class.Animation_Swirl, ptr %3, i32 0, i32 11
  store i8 0, ptr %9, align 8, !tbaa !28
  %10 = getelementptr inbounds %class.Animation_Swirl, ptr %3, i32 0, i32 14
  store i8 0, ptr %10, align 8, !tbaa !29
  %11 = getelementptr inbounds %class.Animation_Swirl, ptr %3, i32 0, i32 16
  store i8 0, ptr %11, align 8, !tbaa !30
  ret void
}

declare void @_ZN15Animation_SwirlC2Ev(ptr noundef nonnull align 8 dereferenceable(224)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 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 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 #3 = { 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, !21, i64 104}
!12 = !{!"_ZTS15Animation_Swirl", !13, i64 0, !16, i64 16, !16, i64 24, !14, i64 32, !14, i64 36, !15, i64 40, !14, i64 44, !14, i64 48, !17, i64 56, !17, i64 80, !21, i64 104, !15, i64 112, !21, i64 120, !21, i64 128, !15, i64 136, !22, i64 144, !15, i64 168, !15, i64 169, !21, i64 176, !21, i64 184, !15, i64 192, !22, i64 200}
!13 = !{!"_ZTS13AnimationBase", !14, i64 8, !15, i64 12}
!14 = !{!"int", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTS7Point2d", !14, i64 0, !14, i64 4}
!17 = !{!"_ZTSSt6vectorIN15Animation_Swirl13SwirlGradientESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"double", !7, i64 0}
!22 = !{!"_ZTSSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!12, !21, i64 120}
!27 = !{!12, !21, i64 128}
!28 = !{!12, !15, i64 112}
!29 = !{!12, !15, i64 136}
!30 = !{!12, !15, i64 168}


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

@_ZTV22Animation_RainbowSwirl = external dso_local unnamed_addr constant { [10 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN22Animation_RainbowSwirlC2Ev(ptr noundef nonnull align 8 dereferenceable(224) %0) unnamed_addr #0 align 2 {
  tail call void @_ZN15Animation_SwirlC2Ev(ptr noundef nonnull align 8 dereferenceable(224) %0)
  store ptr getelementptr inbounds inrange(-16, 64) (i8, ptr @_ZTV22Animation_RainbowSwirl, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 144
  tail call void @_ZNSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %3 = getelementptr inbounds i8, ptr %0, i64 200
  tail call void @_ZNSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #3
  %4 = getelementptr inbounds i8, ptr %0, i64 104
  store double 2.000000e+01, ptr %4, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %0, i64 120
  store <2 x double> <double 5.000000e-01, double 5.000000e-01>, ptr %5, align 8, !tbaa !25
  %6 = getelementptr inbounds i8, ptr %0, i64 112
  store i8 0, ptr %6, align 8, !tbaa !26
  %7 = getelementptr inbounds i8, ptr %0, i64 136
  store i8 0, ptr %7, align 8, !tbaa !27
  %8 = getelementptr inbounds i8, ptr %0, i64 168
  store i8 0, ptr %8, align 8, !tbaa !28
  ret void
}

declare void @_ZN15Animation_SwirlC2Ev(ptr noundef nonnull align 8 dereferenceable(224)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 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 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 #3 = { 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, !20, i64 104}
!9 = !{!"_ZTS15Animation_Swirl", !10, i64 0, !14, i64 16, !14, i64 24, !11, i64 32, !11, i64 36, !13, i64 40, !11, i64 44, !11, i64 48, !15, i64 56, !15, i64 80, !20, i64 104, !13, i64 112, !20, i64 120, !20, i64 128, !13, i64 136, !21, i64 144, !13, i64 168, !13, i64 169, !20, i64 176, !20, i64 184, !13, i64 192, !21, i64 200}
!10 = !{!"_ZTS13AnimationBase", !11, i64 8, !13, i64 12}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"bool", !12, i64 0}
!14 = !{!"_ZTS7Point2d", !11, i64 0, !11, i64 4}
!15 = !{!"_ZTSSt6vectorIN15Animation_Swirl13SwirlGradientESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !12, i64 0}
!20 = !{!"double", !12, i64 0}
!21 = !{!"_ZTSSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!25 = !{!20, !20, i64 0}
!26 = !{!9, !13, i64 112}
!27 = !{!9, !13, i64 136}
!28 = !{!9, !13, i64 168}


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