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

; 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.Point3d = type { i8, i8, i8 }
%class.Animation_Fade = type <{ %class.AnimationBase.base, [3 x i8], i32, %struct.Point3d, i8, i32, [4 x i8], double, i32, [4 x i8], double, i32, [4 x i8], double, %"class.std::vector", double, double, %struct.Point3d, %struct.Point3d, [2 x i8], double, double, i32, i8, [3 x i8], double, i32, [4 x i8], double, i32, [4 x i8], double, i32, [4 x i8] }>
%class.AnimationBase.base = type <{ ptr, i32, i8 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Point3d, std::allocator<Point3d>>::_Vector_impl" }
%"struct.std::_Vector_base<Point3d, std::allocator<Point3d>>::_Vector_impl" = type { %"struct.std::_Vector_base<Point3d, std::allocator<Point3d>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Point3d, std::allocator<Point3d>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16Animation_BreathC2Ev(ptr noundef nonnull align 8 dereferenceable(188) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.Point3d, align 1
  %4 = alloca %struct.Point3d, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @_ZN14Animation_FadeC2Ev(ptr noundef nonnull align 8 dereferenceable(188) %5)
  store ptr getelementptr inbounds inrange(-16, 64) ({ [10 x ptr] }, ptr @_ZTV16Animation_Breath, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 3, ptr %3) #4
  %6 = getelementptr inbounds %struct.Point3d, ptr %3, i32 0, i32 0
  store i8 -1, ptr %6, align 1, !tbaa !11
  %7 = getelementptr inbounds %struct.Point3d, ptr %3, i32 0, i32 1
  store i8 -1, ptr %7, align 1, !tbaa !13
  %8 = getelementptr inbounds %struct.Point3d, ptr %3, i32 0, i32 2
  store i8 -1, ptr %8, align 1, !tbaa !14
  %9 = getelementptr inbounds %class.Animation_Fade, ptr %5, i32 0, i32 18
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %9, ptr align 1 %3, i64 3, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 3, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 3, ptr %4) #4
  %10 = getelementptr inbounds %struct.Point3d, ptr %4, i32 0, i32 0
  store i8 50, ptr %10, align 1, !tbaa !11
  %11 = getelementptr inbounds %struct.Point3d, ptr %4, i32 0, i32 1
  store i8 50, ptr %11, align 1, !tbaa !13
  %12 = getelementptr inbounds %struct.Point3d, ptr %4, i32 0, i32 2
  store i8 50, ptr %12, align 1, !tbaa !14
  %13 = getelementptr inbounds %class.Animation_Fade, ptr %5, i32 0, i32 17
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 1 %4, i64 3, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 3, ptr %4) #4
  %14 = getelementptr inbounds %class.Animation_Fade, ptr %5, i32 0, i32 15
  store double 3.000000e+03, ptr %14, align 8, !tbaa !17
  %15 = getelementptr inbounds %class.Animation_Fade, ptr %5, i32 0, i32 16
  store double 1.000000e+03, ptr %15, align 8, !tbaa !27
  %16 = getelementptr inbounds %class.Animation_Fade, ptr %5, i32 0, i32 20
  store double 5.000000e+01, ptr %16, align 8, !tbaa !28
  %17 = getelementptr inbounds %class.Animation_Fade, ptr %5, i32 0, i32 21
  store double 2.500000e+02, ptr %17, align 8, !tbaa !29
  %18 = getelementptr inbounds %class.Animation_Fade, ptr %5, i32 0, i32 22
  store i32 0, ptr %18, align 8, !tbaa !30
  %19 = getelementptr inbounds %class.Animation_Fade, ptr %5, i32 0, i32 23
  store i8 1, ptr %19, align 4, !tbaa !31
  ret void
}

declare void @_ZN14Animation_FadeC2Ev(ptr noundef nonnull align 8 dereferenceable(188)) 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: 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) #3

; 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 0}
!12 = !{!"_ZTS7Point3d", !7, i64 0, !7, i64 1, !7, i64 2}
!13 = !{!12, !7, i64 1}
!14 = !{!12, !7, i64 2}
!15 = !{i64 0, i64 1, !16, i64 1, i64 1, !16, i64 2, i64 1, !16}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !22, i64 96}
!18 = !{!"_ZTS14Animation_Fade", !19, i64 0, !20, i64 16, !12, i64 20, !20, i64 24, !22, i64 32, !20, i64 40, !22, i64 48, !20, i64 56, !22, i64 64, !23, i64 72, !22, i64 96, !22, i64 104, !12, i64 112, !12, i64 115, !22, i64 120, !22, i64 128, !20, i64 136, !21, i64 140, !22, i64 144, !20, i64 152, !22, i64 160, !20, i64 168, !22, i64 176, !20, i64 184}
!19 = !{!"_ZTS13AnimationBase", !20, i64 8, !21, i64 12}
!20 = !{!"int", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = !{!"_ZTSSt6vectorI7Point3dSaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseI7Point3dSaIS0_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseI7Point3dSaIS0_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseI7Point3dSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!18, !22, i64 104}
!28 = !{!18, !22, i64 120}
!29 = !{!18, !22, i64 128}
!30 = !{!18, !20, i64 136}
!31 = !{!18, !21, i64 140}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16Animation_BreathC2Ev(ptr noundef nonnull align 8 dereferenceable(188) %0) unnamed_addr #0 align 2 {
  tail call void @_ZN14Animation_FadeC2Ev(ptr noundef nonnull align 8 dereferenceable(188) %0)
  store ptr getelementptr inbounds inrange(-16, 64) (i8, ptr @_ZTV16Animation_Breath, i64 16), ptr %0, align 8, !tbaa !5
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 116
  store i8 -1, ptr %.sroa.42.0..sroa_idx, align 4, !tbaa !8
  %.sroa.53.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 117
  store i8 -1, ptr %.sroa.53.0..sroa_idx, align 1, !tbaa !8
  %2 = getelementptr inbounds i8, ptr %0, i64 112
  store <4 x i8> <i8 50, i8 50, i8 50, i8 -1>, ptr %2, align 8, !tbaa !8
  %3 = getelementptr inbounds i8, ptr %0, i64 96
  store <2 x double> <double 3.000000e+03, double 1.000000e+03>, ptr %3, align 8, !tbaa !10
  %4 = getelementptr inbounds i8, ptr %0, i64 120
  store <2 x double> <double 5.000000e+01, double 2.500000e+02>, ptr %4, align 8, !tbaa !10
  %5 = getelementptr inbounds i8, ptr %0, i64 136
  store i32 0, ptr %5, align 8, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %0, i64 140
  store i8 1, ptr %6, align 4, !tbaa !23
  ret void
}

declare void @_ZN14Animation_FadeC2Ev(ptr noundef nonnull align 8 dereferenceable(188)) unnamed_addr #1

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

!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 = !{!"omnipotent char", !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !9, i64 0}
!12 = !{!13, !15, i64 136}
!13 = !{!"_ZTS14Animation_Fade", !14, i64 0, !15, i64 16, !17, i64 20, !15, i64 24, !11, i64 32, !15, i64 40, !11, i64 48, !15, i64 56, !11, i64 64, !18, i64 72, !11, i64 96, !11, i64 104, !17, i64 112, !17, i64 115, !11, i64 120, !11, i64 128, !15, i64 136, !16, i64 140, !11, i64 144, !15, i64 152, !11, i64 160, !15, i64 168, !11, i64 176, !15, i64 184}
!14 = !{!"_ZTS13AnimationBase", !15, i64 8, !16, i64 12}
!15 = !{!"int", !9, i64 0}
!16 = !{!"bool", !9, i64 0}
!17 = !{!"_ZTS7Point3d", !9, i64 0, !9, i64 1, !9, i64 2}
!18 = !{!"_ZTSSt6vectorI7Point3dSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseI7Point3dSaIS0_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI7Point3dSaIS0_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseI7Point3dSaIS0_EE17_Vector_impl_dataE", !22, i64 0, !22, i64 8, !22, i64 16}
!22 = !{!"any pointer", !9, i64 0}
!23 = !{!13, !16, i64 140}


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