; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/audiosource/sfxr/soloud_sfxr.ll (ZN6SoLoud4Sfxr11resetParamsEv)

; 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.SoLoud::Sfxr" = type { %"class.SoLoud::AudioSource", %"struct.SoLoud::SfxrParams", %"class.SoLoud::Misc::Prg" }
%"class.SoLoud::AudioSource" = type { ptr, i32, float, float, i32, i32, float, float, float, i32, float, [8 x ptr], ptr, ptr, ptr, i32, double }
%"struct.SoLoud::SfxrParams" = type { i32, float, float, float, float, float, float, float, float, float, float, float, float, float, i8, float, float, float, float, float, float, float, float, float, float, float, float }
%"class.SoLoud::Misc::Prg" = type { [16 x i32], i32 }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6SoLoud4Sfxr11resetParamsEv(ptr noundef nonnull align 8 dereferenceable(328) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %5 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %4, i32 0, i32 0
  store i32 0, ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %7 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %6, i32 0, i32 1
  store float 0x3FD3333340000000, ptr %7, align 4, !tbaa !18
  %8 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %9 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %8, i32 0, i32 2
  store float 0.000000e+00, ptr %9, align 8, !tbaa !19
  %10 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %11 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %10, i32 0, i32 3
  store float 0.000000e+00, ptr %11, align 4, !tbaa !20
  %12 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %13 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %12, i32 0, i32 4
  store float 0.000000e+00, ptr %13, align 8, !tbaa !21
  %14 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %15 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %14, i32 0, i32 5
  store float 0.000000e+00, ptr %15, align 4, !tbaa !22
  %16 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %17 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %16, i32 0, i32 6
  store float 0.000000e+00, ptr %17, align 8, !tbaa !23
  %18 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %19 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %18, i32 0, i32 7
  store float 0.000000e+00, ptr %19, align 4, !tbaa !24
  %20 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %21 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %20, i32 0, i32 8
  store float 0.000000e+00, ptr %21, align 8, !tbaa !25
  %22 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %23 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %22, i32 0, i32 9
  store float 0.000000e+00, ptr %23, align 4, !tbaa !26
  %24 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %25 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %24, i32 0, i32 10
  store float 0.000000e+00, ptr %25, align 8, !tbaa !27
  %26 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %27 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %26, i32 0, i32 11
  store float 0x3FD3333340000000, ptr %27, align 4, !tbaa !28
  %28 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %29 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %28, i32 0, i32 12
  store float 0x3FD99999A0000000, ptr %29, align 8, !tbaa !29
  %30 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %31 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %30, i32 0, i32 13
  store float 0.000000e+00, ptr %31, align 4, !tbaa !30
  %32 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %33 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %32, i32 0, i32 14
  store i8 0, ptr %33, align 8, !tbaa !31
  %34 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %35 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %34, i32 0, i32 15
  store float 0.000000e+00, ptr %35, align 4, !tbaa !32
  %36 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %37 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %36, i32 0, i32 16
  store float 1.000000e+00, ptr %37, align 8, !tbaa !33
  %38 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %39 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %38, i32 0, i32 17
  store float 0.000000e+00, ptr %39, align 4, !tbaa !34
  %40 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %41 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %40, i32 0, i32 18
  store float 0.000000e+00, ptr %41, align 8, !tbaa !35
  %42 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %43 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %42, i32 0, i32 19
  store float 0.000000e+00, ptr %43, align 4, !tbaa !36
  %44 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %45 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %44, i32 0, i32 20
  store float 0.000000e+00, ptr %45, align 8, !tbaa !37
  %46 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %47 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %46, i32 0, i32 21
  store float 0.000000e+00, ptr %47, align 4, !tbaa !38
  %48 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %49 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %48, i32 0, i32 22
  store float 0.000000e+00, ptr %49, align 8, !tbaa !39
  %50 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %51 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %50, i32 0, i32 23
  store float 0.000000e+00, ptr %51, align 4, !tbaa !40
  %52 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %53 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %52, i32 0, i32 24
  store float 0.000000e+00, ptr %53, align 8, !tbaa !41
  %54 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %55 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %54, i32 0, i32 25
  store float 0x3FA99999A0000000, ptr %55, align 4, !tbaa !42
  %56 = getelementptr inbounds %"class.SoLoud::Sfxr", ptr %3, i32 0, i32 1
  %57 = getelementptr inbounds %"struct.SoLoud::SfxrParams", ptr %56, i32 0, i32 26
  store float 5.000000e-01, ptr %57, align 8, !tbaa !43
  ret void
}

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

!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, !12, i64 152}
!10 = !{!"_ZTSN6SoLoud4SfxrE", !11, i64 0, !15, i64 152, !17, i64 260}
!11 = !{!"_ZTSN6SoLoud11AudioSourceE", !12, i64 8, !13, i64 12, !13, i64 16, !12, i64 20, !12, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !12, i64 40, !13, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !12, i64 136, !14, i64 144}
!12 = !{!"int", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTSN6SoLoud10SfxrParamsE", !12, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !16, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSN6SoLoud4Misc3PrgE", !7, i64 0, !12, i64 64}
!18 = !{!10, !13, i64 156}
!19 = !{!10, !13, i64 160}
!20 = !{!10, !13, i64 164}
!21 = !{!10, !13, i64 168}
!22 = !{!10, !13, i64 172}
!23 = !{!10, !13, i64 176}
!24 = !{!10, !13, i64 180}
!25 = !{!10, !13, i64 184}
!26 = !{!10, !13, i64 188}
!27 = !{!10, !13, i64 192}
!28 = !{!10, !13, i64 196}
!29 = !{!10, !13, i64 200}
!30 = !{!10, !13, i64 204}
!31 = !{!10, !16, i64 208}
!32 = !{!10, !13, i64 212}
!33 = !{!10, !13, i64 216}
!34 = !{!10, !13, i64 220}
!35 = !{!10, !13, i64 224}
!36 = !{!10, !13, i64 228}
!37 = !{!10, !13, i64 232}
!38 = !{!10, !13, i64 236}
!39 = !{!10, !13, i64 240}
!40 = !{!10, !13, i64 244}
!41 = !{!10, !13, i64 248}
!42 = !{!10, !13, i64 252}
!43 = !{!10, !13, i64 256}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @_ZN6SoLoud4Sfxr11resetParamsEv(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(328) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 152
  store i32 0, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 156
  store float 0x3FD3333340000000, ptr %3, align 4, !tbaa !17
  %4 = getelementptr inbounds i8, ptr %0, i64 160
  %5 = getelementptr inbounds i8, ptr %0, i64 196
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(36) %4, i8 0, i64 36, i1 false)
  store <2 x float> <float 0x3FD3333340000000, float 0x3FD99999A0000000>, ptr %5, align 4, !tbaa !18
  %6 = getelementptr inbounds i8, ptr %0, i64 204
  store float 0.000000e+00, ptr %6, align 4, !tbaa !19
  %7 = getelementptr inbounds i8, ptr %0, i64 208
  store i8 0, ptr %7, align 8, !tbaa !20
  %8 = getelementptr inbounds i8, ptr %0, i64 212
  store <2 x float> <float 0.000000e+00, float 1.000000e+00>, ptr %8, align 4, !tbaa !18
  %9 = getelementptr inbounds i8, ptr %0, i64 220
  %10 = getelementptr inbounds i8, ptr %0, i64 252
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %9, i8 0, i64 32, i1 false)
  store <2 x float> <float 0x3FA99999A0000000, float 5.000000e-01>, ptr %10, align 4, !tbaa !18
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !8, i64 152}
!6 = !{!"_ZTSN6SoLoud4SfxrE", !7, i64 0, !14, i64 152, !16, i64 260}
!7 = !{!"_ZTSN6SoLoud11AudioSourceE", !8, i64 8, !11, i64 12, !11, i64 16, !8, i64 20, !8, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !11, i64 44, !9, i64 48, !12, i64 112, !12, i64 120, !12, i64 128, !8, i64 136, !13, i64 144}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"double", !9, i64 0}
!14 = !{!"_ZTSN6SoLoud10SfxrParamsE", !8, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !15, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104}
!15 = !{!"bool", !9, i64 0}
!16 = !{!"_ZTSN6SoLoud4Misc3PrgE", !9, i64 0, !8, i64 64}
!17 = !{!6, !11, i64 156}
!18 = !{!11, !11, i64 0}
!19 = !{!6, !11, i64 204}
!20 = !{!6, !15, i64 208}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass