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

; 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.Point2d = type { i32, i32 }
%class.Animation_Waves = type { %class.AnimationBase.base, %struct.Point2d, %"class.std::vector", i32, %"class.std::vector.0", i64, double, i8, double, double, i8, i32, %"class.std::vector.5" }
%class.AnimationBase.base = type <{ ptr, i32, i8 }>
%"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<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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 }

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

; 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) #1

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

declare void @_ZN13AnimationBase12SetSleepTimeEi(ptr noundef nonnull align 8 dereferenceable(13), i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN15Animation_Waves8getPointERK10HyperImagebdd(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(27), i1 noundef zeroext, double noundef, double noundef) #3 align 2

declare noundef i32 @_ZNK10HyperImage5widthEv(ptr noundef nonnull align 8 dereferenceable(27)) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.round.f64(double) #4

declare noundef i32 @_ZNK10HyperImage6heightEv(ptr noundef nonnull align 8 dereferenceable(27)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN15Animation_Waves8getSTimeEiid(ptr noundef nonnull align 8 dereferenceable(152), i32 noundef, i32 noundef, double noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN15Animation_Waves4InitER10HyperImagei(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef nonnull align 8 dereferenceable(27) %1, i32 noundef %2) unnamed_addr #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.Point2d, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN10HyperImage6resizeEii(ptr noundef nonnull align 8 dereferenceable(27) %16, i32 noundef 80, i32 noundef 45)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 10
  %19 = load i8, ptr %18, align 8, !tbaa !11, !range !30, !noundef !31
  %20 = trunc i8 %19 to i1
  %21 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 8
  %22 = load double, ptr %21, align 8, !tbaa !32
  %23 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 9
  %24 = load double, ptr %23, align 8, !tbaa !33
  %25 = call i64 @_ZN15Animation_Waves8getPointERK10HyperImagebdd(ptr noundef nonnull align 8 dereferenceable(152) %15, ptr noundef nonnull align 8 dereferenceable(27) %17, i1 noundef zeroext %20, double noundef %22, double noundef %24)
  store i64 %25, ptr %7, align 4
  %26 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !34
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %27 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 8
  %28 = load double, ptr %27, align 8, !tbaa !32
  store double %28, ptr %8, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %29 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 9
  %30 = load double, ptr %29, align 8, !tbaa !33
  %31 = fadd double 0.000000e+00, %30
  store double %31, ptr %9, align 8, !tbaa !35
  %32 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 8
  %33 = load double, ptr %32, align 8, !tbaa !32
  %34 = fcmp olt double %33, 5.000000e-01
  br i1 %34, label %35, label %39

35:                                               ; preds = %3
  %36 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 8
  %37 = load double, ptr %36, align 8, !tbaa !32
  %38 = fsub double 1.000000e+00, %37
  store double %38, ptr %8, align 8, !tbaa !35
  br label %39

39:                                               ; preds = %35, %3
  %40 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 9
  %41 = load double, ptr %40, align 8, !tbaa !33
  %42 = fcmp olt double %41, 5.000000e-01
  br i1 %42, label %43, label %47

43:                                               ; preds = %39
  %44 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 9
  %45 = load double, ptr %44, align 8, !tbaa !33
  %46 = fsub double 1.000000e+00, %45
  store double %46, ptr %9, align 8, !tbaa !35
  br label %47

47:                                               ; preds = %43, %39
  %48 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store double 1.000000e+01, ptr %10, align 8, !tbaa !35
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %50 = load double, ptr %49, align 8, !tbaa !35
  %51 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 6
  store double %50, ptr %51, align 8, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %52 = load i32, ptr %6, align 4, !tbaa !9
  %53 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 6
  %54 = load double, ptr %53, align 8, !tbaa !36
  %55 = fptosi double %54 to i32
  %56 = call noundef i32 @_ZN15Animation_Waves8getSTimeEiid(ptr noundef nonnull align 8 dereferenceable(152) %15, i32 noundef %52, i32 noundef %55, double noundef 3.600000e+02)
  call void @_ZN13AnimationBase12SetSleepTimeEi(ptr noundef nonnull align 8 dereferenceable(13) %15, i32 noundef %56)
  %57 = load double, ptr %8, align 8, !tbaa !35
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = call noundef i32 @_ZNK10HyperImage5widthEv(ptr noundef nonnull align 8 dereferenceable(27) %58)
  %60 = call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef %59, i32 noundef 2)
  %61 = load double, ptr %9, align 8, !tbaa !35
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = call noundef i32 @_ZNK10HyperImage6heightEv(ptr noundef nonnull align 8 dereferenceable(27) %62)
  %64 = call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef %63, i32 noundef 2)
  %65 = fmul double %61, %64
  %66 = call double @llvm.fmuladd.f64(double %57, double %60, double %65)
  %67 = call double @sqrt(double noundef %66) #8
  %68 = call double @llvm.round.f64(double %67)
  %69 = fptosi double %68 to i32
  %70 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 3
  store i32 %69, ptr %70, align 8, !tbaa !37
  %71 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 3
  %72 = load i32, ptr %71, align 8, !tbaa !37
  %73 = sitofp i32 %72 to double
  %74 = fmul double %73, 1.300000e+00
  %75 = fptosi double %74 to i32
  %76 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 3
  store i32 %75, ptr %76, align 8, !tbaa !37
  %77 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 12
  %78 = call noundef i64 @_ZNKSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #8
  %79 = icmp ugt i64 %78, 0
  br i1 %79, label %80, label %104

80:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %81 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 12
  %82 = call noundef i64 @_ZNKSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #8
  %83 = udiv i64 255, %82
  %84 = trunc i64 %83 to i32
  store i32 %84, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %100, %80
  %86 = load i32, ptr %13, align 4, !tbaa !9
  %87 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 12
  %88 = call noundef i64 @_ZNKSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %87) #8
  %89 = trunc i64 %88 to i32
  %90 = icmp slt i32 %86, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %103

92:                                               ; preds = %85
  %93 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #8
  %94 = load i32, ptr %11, align 4, !tbaa !9
  %95 = srem i32 %94, 256
  %96 = trunc i32 %95 to i8
  store i8 %96, ptr %14, align 1, !tbaa !38
  call void @_ZNSt6vectorIhSaIhEE9push_backEOh(ptr noundef nonnull align 8 dereferenceable(24) %93, ptr noundef nonnull align 1 dereferenceable(1) %14)
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #8
  %97 = load i32, ptr %12, align 4, !tbaa !9
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = add nsw i32 %98, %97
  store i32 %99, ptr %11, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %92
  %101 = load i32, ptr %13, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %13, align 4, !tbaa !9
  br label %85, !llvm.loop !39

103:                                              ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %104

104:                                              ; preds = %103, %47
  %105 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 11
  %106 = load i32, ptr %105, align 4, !tbaa !41
  %107 = mul nsw i32 %106, 1000
  store i32 %107, ptr %105, align 4, !tbaa !41
  %108 = call noundef i64 @_ZN13InternalClock3nowEv()
  %109 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 11
  %110 = load i32, ptr %109, align 4, !tbaa !41
  %111 = sext i32 %110 to i64
  %112 = add nsw i64 %108, %111
  %113 = getelementptr inbounds %class.Animation_Waves, ptr %15, i32 0, i32 5
  store i64 %112, ptr %113, align 8, !tbaa !42
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  ret void
}

declare void @_ZN10HyperImage6resizeEii(ptr noundef nonnull align 8 dereferenceable(27), i32 noundef, i32 noundef) #2

; Function Attrs: nounwind
declare double @sqrt(double noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, i32 noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE9push_backEOh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) #3 align 2

declare noundef i64 @_ZN13InternalClock3nowEv() #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !14, i64 120}
!12 = !{!"_ZTS15Animation_Waves", !13, i64 0, !15, i64 16, !16, i64 24, !10, i64 48, !20, i64 56, !24, i64 80, !25, i64 88, !14, i64 96, !25, i64 104, !25, i64 112, !14, i64 120, !10, i64 124, !26, i64 128}
!13 = !{!"_ZTS13AnimationBase", !10, i64 8, !14, i64 12}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTS7Point2d", !10, i64 0, !10, i64 4}
!16 = !{!"_ZTSSt6vectorIN15Animation_Swirl13SwirlGradientESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTSSt6vectorIhSaIhEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"long long", !7, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = !{!"_ZTSSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!12, !25, i64 104}
!33 = !{!12, !25, i64 112}
!34 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!35 = !{!25, !25, i64 0}
!36 = !{!12, !25, i64 88}
!37 = !{!12, !10, i64 48}
!38 = !{!7, !7, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!12, !10, i64 124}
!42 = !{!12, !24, i64 80}


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

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

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

declare void @_ZN13AnimationBase12SetSleepTimeEi(ptr noundef nonnull align 8 dereferenceable(13), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN15Animation_Waves8getPointERK10HyperImagebdd(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(27), i1 noundef zeroext, double noundef, double noundef) local_unnamed_addr #2 align 2

declare noundef i32 @_ZNK10HyperImage5widthEv(ptr noundef nonnull align 8 dereferenceable(27)) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.round.f64(double) #3

declare noundef i32 @_ZNK10HyperImage6heightEv(ptr noundef nonnull align 8 dereferenceable(27)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN15Animation_Waves8getSTimeEiid(ptr noundef nonnull align 8 dereferenceable(152), i32 noundef, i32 noundef, double noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN15Animation_Waves4InitER10HyperImagei(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef nonnull align 8 dereferenceable(27) %1, i32 noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca double, align 8
  %5 = alloca i8, align 1
  tail call void @_ZN10HyperImage6resizeEii(ptr noundef nonnull align 8 dereferenceable(27) %1, i32 noundef 80, i32 noundef 45)
  %6 = getelementptr inbounds i8, ptr %0, i64 120
  %7 = load i8, ptr %6, align 8, !tbaa !5, !range !28, !noundef !29
  %8 = trunc nuw i8 %7 to i1
  %9 = getelementptr inbounds i8, ptr %0, i64 104
  %10 = load double, ptr %9, align 8, !tbaa !30
  %11 = getelementptr inbounds i8, ptr %0, i64 112
  %12 = load double, ptr %11, align 8, !tbaa !31
  %13 = tail call i64 @_ZN15Animation_Waves8getPointERK10HyperImagebdd(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef nonnull align 8 dereferenceable(27) %1, i1 noundef zeroext %8, double noundef %10, double noundef %12)
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %13, ptr %14, align 8
  %15 = load double, ptr %9, align 8, !tbaa !30
  %16 = load double, ptr %11, align 8, !tbaa !31
  %17 = fadd double %16, 0.000000e+00
  %18 = fcmp olt double %15, 5.000000e-01
  %19 = fsub double 1.000000e+00, %15
  %.012 = select i1 %18, double %19, double %15
  %20 = fcmp olt double %16, 5.000000e-01
  %21 = fsub double 1.000000e+00, %16
  %.014 = select i1 %20, double %21, double %17
  %22 = getelementptr inbounds i8, ptr %0, i64 88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store double 1.000000e+01, ptr %4, align 8, !tbaa !32
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %24 = load double, ptr %23, align 8, !tbaa !32
  store double %24, ptr %22, align 8, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %25 = fptosi double %24 to i32
  %26 = call noundef i32 @_ZN15Animation_Waves8getSTimeEiid(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 noundef %2, i32 noundef %25, double noundef 3.600000e+02)
  call void @_ZN13AnimationBase12SetSleepTimeEi(ptr noundef nonnull align 8 dereferenceable(13) %0, i32 noundef %26)
  %27 = call noundef i32 @_ZNK10HyperImage5widthEv(ptr noundef nonnull align 8 dereferenceable(27) %1)
  %28 = call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef %27, i32 noundef 2)
  %29 = call noundef i32 @_ZNK10HyperImage6heightEv(ptr noundef nonnull align 8 dereferenceable(27) %1)
  %30 = call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef %29, i32 noundef 2)
  %31 = fmul double %.014, %30
  %32 = call double @llvm.fmuladd.f64(double %.012, double %28, double %31)
  %33 = call double @sqrt(double noundef %32) #7
  %34 = call double @llvm.round.f64(double %33)
  %35 = fptosi double %34 to i32
  %36 = getelementptr inbounds i8, ptr %0, i64 48
  %37 = sitofp i32 %35 to double
  %38 = fmul double %37, 1.300000e+00
  %39 = fptosi double %38 to i32
  store i32 %39, ptr %36, align 8, !tbaa !34
  %40 = getelementptr inbounds i8, ptr %0, i64 128
  %41 = call noundef i64 @_ZNKSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  %.not = icmp eq i64 %41, 0
  br i1 %.not, label %.loopexit, label %42

42:                                               ; preds = %3
  %43 = call noundef i64 @_ZNKSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  %44 = udiv i64 255, %43
  %45 = trunc nuw i64 %44 to i8
  %46 = call noundef i64 @_ZNKSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  %47 = trunc i64 %46 to i32
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %42
  %49 = getelementptr inbounds i8, ptr %0, i64 56
  br label %50

50:                                               ; preds = %.lr.ph, %50
  %.018 = phi i32 [ 0, %.lr.ph ], [ %52, %50 ]
  %.01317 = phi i8 [ 0, %.lr.ph ], [ %51, %50 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  store i8 %.01317, ptr %5, align 1, !tbaa !35
  call void @_ZNSt6vectorIhSaIhEE9push_backEOh(ptr noundef nonnull align 8 dereferenceable(24) %49, ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  %51 = add i8 %.01317, %45
  %52 = add nuw nsw i32 %.018, 1
  %53 = call noundef i64 @_ZNKSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  %54 = trunc i64 %53 to i32
  %55 = icmp slt i32 %52, %54
  br i1 %55, label %50, label %.loopexit, !llvm.loop !36

.loopexit:                                        ; preds = %50, %42, %3
  %56 = getelementptr inbounds i8, ptr %0, i64 124
  %57 = load i32, ptr %56, align 4, !tbaa !38
  %58 = mul nsw i32 %57, 1000
  store i32 %58, ptr %56, align 4, !tbaa !38
  %59 = call noundef i64 @_ZN13InternalClock3nowEv()
  %60 = load i32, ptr %56, align 4, !tbaa !38
  %61 = sext i32 %60 to i64
  %62 = add nsw i64 %59, %61
  %63 = getelementptr inbounds i8, ptr %0, i64 80
  store i64 %62, ptr %63, align 8, !tbaa !39
  ret void
}

declare void @_ZN10HyperImage6resizeEii(ptr noundef nonnull align 8 dereferenceable(27), i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE9push_backEOh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

declare noundef i64 @_ZN13InternalClock3nowEv() local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(write) "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 #6 = { 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 #7 = { 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, !11, i64 120}
!6 = !{!"_ZTS15Animation_Waves", !7, i64 0, !12, i64 16, !13, i64 24, !8, i64 48, !18, i64 56, !22, i64 80, !23, i64 88, !11, i64 96, !23, i64 104, !23, i64 112, !11, i64 120, !8, i64 124, !24, i64 128}
!7 = !{!"_ZTS13AnimationBase", !8, i64 8, !11, i64 12}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!"_ZTS7Point2d", !8, i64 0, !8, i64 4}
!13 = !{!"_ZTSSt6vectorIN15Animation_Swirl13SwirlGradientESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl13SwirlGradientESaIS1_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"any pointer", !9, i64 0}
!18 = !{!"_ZTSSt6vectorIhSaIhEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!22 = !{!"long long", !9, i64 0}
!23 = !{!"double", !9, i64 0}
!24 = !{!"_ZTSSt6vectorIN15Animation_Swirl10SwirlColorESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN15Animation_Swirl10SwirlColorESaIS1_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!6, !23, i64 104}
!31 = !{!6, !23, i64 112}
!32 = !{!23, !23, i64 0}
!33 = !{!6, !23, i64 88}
!34 = !{!6, !8, i64 48}
!35 = !{!9, !9, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!6, !8, i64 124}
!39 = !{!6, !22, i64 80}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass