; LLVM IR from flashlight/flashlight :: flashlight/pkg/speech/augmentation (GaussianNoise)

; 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.fl::pkg::speech::sfx::GaussianNoise" = type { %"class.fl::pkg::speech::sfx::SoundEffect", %"struct.fl::pkg::speech::sfx::GaussianNoise::Config", %"class.fl::pkg::speech::sfx::RandomNumberGenerator" }
%"class.fl::pkg::speech::sfx::SoundEffect" = type { ptr }
%"struct.fl::pkg::speech::sfx::GaussianNoise::Config" = type { float, double, double }
%"class.fl::pkg::speech::sfx::RandomNumberGenerator" = type { %"class.std::mersenne_twister_engine", %"class.std::uniform_real_distribution", %"class.std::normal_distribution" }
%"class.std::mersenne_twister_engine" = type { [312 x i64], i64 }
%"class.std::uniform_real_distribution" = type { %"struct.std::uniform_real_distribution<float>::param_type" }
%"struct.std::uniform_real_distribution<float>::param_type" = type { float, float }
%"class.std::normal_distribution" = type <{ %"struct.std::normal_distribution<float>::param_type", float, i8, [3 x i8] }>
%"struct.std::normal_distribution<float>::param_type" = type { float, float }

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2fl3pkg6speech3sfx13GaussianNoise5applyERSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(2560) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = getelementptr inbounds %"class.fl::pkg::speech::sfx::GaussianNoise", ptr %9, i32 0, i32 2
  %11 = call noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator6randomEv(ptr noundef nonnull align 8 dereferenceable(2528) %10)
  %12 = getelementptr inbounds %"class.fl::pkg::speech::sfx::GaussianNoise", ptr %9, i32 0, i32 1
  %13 = getelementptr inbounds %"struct.fl::pkg::speech::sfx::GaussianNoise::Config", ptr %12, i32 0, i32 0
  %14 = load float, ptr %13, align 8, !tbaa !9
  %15 = fcmp oge float %11, %14
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  br label %59

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noundef float @_ZN2fl3pkg6speech3sfx14rootMeanSquareERKSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(24) %18)
  store float %19, ptr %5, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %20 = getelementptr inbounds %"class.fl::pkg::speech::sfx::GaussianNoise", ptr %9, i32 0, i32 2
  %21 = getelementptr inbounds %"class.fl::pkg::speech::sfx::GaussianNoise", ptr %9, i32 0, i32 1
  %22 = getelementptr inbounds %"struct.fl::pkg::speech::sfx::GaussianNoise::Config", ptr %21, i32 0, i32 1
  %23 = load double, ptr %22, align 8, !tbaa !24
  %24 = fptrunc double %23 to float
  %25 = getelementptr inbounds %"class.fl::pkg::speech::sfx::GaussianNoise", ptr %9, i32 0, i32 1
  %26 = getelementptr inbounds %"struct.fl::pkg::speech::sfx::GaussianNoise::Config", ptr %25, i32 0, i32 2
  %27 = load double, ptr %26, align 8, !tbaa !25
  %28 = fptrunc double %27 to float
  %29 = call noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator7uniformEff(ptr noundef nonnull align 8 dereferenceable(2528) %20, float noundef %24, float noundef %28)
  store float %29, ptr %6, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %30 = load float, ptr %5, align 4, !tbaa !23
  %31 = fpext float %30 to double
  %32 = load float, ptr %6, align 4, !tbaa !23
  %33 = fpext float %32 to double
  %34 = fdiv double %33, 2.000000e+01
  %35 = call noundef double @_ZSt3powIidEN9__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 10, double noundef %34)
  %36 = fdiv double %31, %35
  %37 = fptrunc double %36 to float
  store float %37, ptr %7, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !26
  br label %38

38:                                               ; preds = %55, %17
  %39 = load i32, ptr %8, align 4, !tbaa !26
  %40 = sext i32 %39 to i64
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #5
  %43 = icmp ult i64 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %58

45:                                               ; preds = %38
  %46 = getelementptr inbounds %"class.fl::pkg::speech::sfx::GaussianNoise", ptr %9, i32 0, i32 2
  %47 = load float, ptr %7, align 4, !tbaa !23
  %48 = call noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator8gaussianEff(ptr noundef nonnull align 8 dereferenceable(2528) %46, float noundef 0.000000e+00, float noundef %47)
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = load i32, ptr %8, align 4, !tbaa !26
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %51) #5
  %53 = load float, ptr %52, align 4, !tbaa !23
  %54 = fadd float %53, %48
  store float %54, ptr %52, align 4, !tbaa !23
  br label %55

55:                                               ; preds = %45
  %56 = load i32, ptr %8, align 4, !tbaa !26
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %8, align 4, !tbaa !26
  br label %38, !llvm.loop !28

58:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %59

59:                                               ; preds = %58, %16
  ret void
}

declare noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator6randomEv(ptr noundef nonnull align 8 dereferenceable(2528)) #2

declare noundef float @_ZN2fl3pkg6speech3sfx14rootMeanSquareERKSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(24)) #2

declare noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator7uniformEff(ptr noundef nonnull align 8 dereferenceable(2528), float noundef, float noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIidEN9__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, double noundef) #3

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

declare noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator8gaussianEff(ptr noundef nonnull align 8 dereferenceable(2528), float noundef, float noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { 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 = { 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, !13, i64 8}
!10 = !{!"_ZTSN2fl3pkg6speech3sfx13GaussianNoiseE", !11, i64 0, !12, i64 8, !15, i64 32}
!11 = !{!"_ZTSN2fl3pkg6speech3sfx11SoundEffectE"}
!12 = !{!"_ZTSN2fl3pkg6speech3sfx13GaussianNoise6ConfigE", !13, i64 0, !14, i64 8, !14, i64 16}
!13 = !{!"float", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTSN2fl3pkg6speech3sfx21RandomNumberGeneratorE", !16, i64 0, !18, i64 2504, !20, i64 2512}
!16 = !{!"_ZTSSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EE", !7, i64 0, !17, i64 2496}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSSt25uniform_real_distributionIfE", !19, i64 0}
!19 = !{!"_ZTSNSt25uniform_real_distributionIfE10param_typeE", !13, i64 0, !13, i64 4}
!20 = !{!"_ZTSSt19normal_distributionIfE", !21, i64 0, !13, i64 8, !22, i64 12}
!21 = !{!"_ZTSNSt19normal_distributionIfE10param_typeE", !13, i64 0, !13, i64 4}
!22 = !{!"bool", !7, i64 0}
!23 = !{!13, !13, i64 0}
!24 = !{!10, !14, i64 16}
!25 = !{!10, !14, i64 24}
!26 = !{!27, !27, i64 0}
!27 = !{!"int", !7, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; 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 uwtable
define dso_local void @_ZN2fl3pkg6speech3sfx13GaussianNoise5applyERSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(2560) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = tail call noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator6randomEv(ptr noundef nonnull align 8 dereferenceable(2528) %3)
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load float, ptr %5, align 8, !tbaa !5
  %7 = fcmp ult float %4, %6
  br i1 %7, label %8, label %.loopexit

8:                                                ; preds = %2
  %9 = tail call noundef float @_ZN2fl3pkg6speech3sfx14rootMeanSquareERKSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load double, ptr %10, align 8, !tbaa !21
  %12 = fptrunc double %11 to float
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load double, ptr %13, align 8, !tbaa !22
  %15 = fptrunc double %14 to float
  %16 = tail call noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator7uniformEff(ptr noundef nonnull align 8 dereferenceable(2528) %3, float noundef %12, float noundef %15)
  %17 = fpext float %9 to double
  %18 = fpext float %16 to double
  %19 = fdiv double %18, 2.000000e+01
  %20 = tail call noundef double @_ZSt3powIidEN9__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 10, double noundef %19)
  %21 = fdiv double %17, %20
  %22 = fptrunc double %21 to float
  %23 = tail call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %.not = icmp eq i64 %23, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %8, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %8 ]
  %24 = tail call noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator8gaussianEff(ptr noundef nonnull align 8 dereferenceable(2528) %3, float noundef 0.000000e+00, float noundef %22)
  %25 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %26 = load float, ptr %25, align 4, !tbaa !23
  %27 = fadd float %24, %26
  store float %27, ptr %25, align 4, !tbaa !23
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = tail call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %29 = icmp ugt i64 %28, %indvars.iv.next
  br i1 %29, label %.lr.ph, label %.loopexit, !llvm.loop !24

.loopexit:                                        ; preds = %.lr.ph, %8, %2
  ret void
}

declare noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator6randomEv(ptr noundef nonnull align 8 dereferenceable(2528)) local_unnamed_addr #1

declare noundef float @_ZN2fl3pkg6speech3sfx14rootMeanSquareERKSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator7uniformEff(ptr noundef nonnull align 8 dereferenceable(2528), float noundef, float noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIidEN9__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, double noundef) local_unnamed_addr #2

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

declare noundef float @_ZN2fl3pkg6speech3sfx21RandomNumberGenerator8gaussianEff(ptr noundef nonnull align 8 dereferenceable(2528), float noundef, float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 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 = { 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 #3 = { 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, !9, i64 8}
!6 = !{!"_ZTSN2fl3pkg6speech3sfx13GaussianNoiseE", !7, i64 0, !8, i64 8, !13, i64 32}
!7 = !{!"_ZTSN2fl3pkg6speech3sfx11SoundEffectE"}
!8 = !{!"_ZTSN2fl3pkg6speech3sfx13GaussianNoise6ConfigE", !9, i64 0, !12, i64 8, !12, i64 16}
!9 = !{!"float", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"double", !10, i64 0}
!13 = !{!"_ZTSN2fl3pkg6speech3sfx21RandomNumberGeneratorE", !14, i64 0, !16, i64 2504, !18, i64 2512}
!14 = !{!"_ZTSSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EE", !10, i64 0, !15, i64 2496}
!15 = !{!"long", !10, i64 0}
!16 = !{!"_ZTSSt25uniform_real_distributionIfE", !17, i64 0}
!17 = !{!"_ZTSNSt25uniform_real_distributionIfE10param_typeE", !9, i64 0, !9, i64 4}
!18 = !{!"_ZTSSt19normal_distributionIfE", !19, i64 0, !9, i64 8, !20, i64 12}
!19 = !{!"_ZTSNSt19normal_distributionIfE10param_typeE", !9, i64 0, !9, i64 4}
!20 = !{!"bool", !10, i64 0}
!21 = !{!6, !12, i64 16}
!22 = !{!6, !12, i64 24}
!23 = !{!9, !9, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


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