; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/audiosource/vizsn (soloud_vizsn)

; 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::VizsnInstance" = type { %"class.SoLoud::AudioSourceInstance", ptr, %"struct.SoLoud::VizsnBank", %"struct.SoLoud::VizsnBank", %"struct.SoLoud::VizsnBank", i32, i32, i32, [1024 x i32], i32, i32, float, ptr, [2048 x float], i32, i32, i32, i32, i32, float }
%"class.SoLoud::AudioSourceInstance" = type { ptr, i32, i32, i32, float, [8 x float], float, float, float, float, i32, float, float, double, double, %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", i32, [8 x float], i32, i32, [8 x ptr], [2 x ptr], i32, i32, i32, double }
%"class.SoLoud::Fader" = type { float, float, float, double, double, double, float, i32 }
%"struct.SoLoud::VizsnBank" = type { [10 x %"struct.SoLoud::VizsnResonator"], float, float, float, float, float, float }
%"struct.SoLoud::VizsnResonator" = type { float, float, float, float, float }
%"class.SoLoud::Vizsn" = type { %"class.SoLoud::AudioSource", ptr }
%"class.SoLoud::AudioSource" = type { ptr, i32, float, float, i32, i32, float, float, float, i32, float, [8 x ptr], ptr, ptr, ptr, i32, double }

@_ZTVN6SoLoud13VizsnInstanceE = external dso_local unnamed_addr constant { [9 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud13VizsnInstanceC2EPNS_5VizsnE(ptr noundef nonnull align 8 dereferenceable(13520) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  call void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496) %7)
  store ptr getelementptr inbounds inrange(-16, 56) ({ [9 x ptr] }, ptr @_ZTVN6SoLoud13VizsnInstanceE, i32 0, i32 0, i32 2), ptr %7, align 8, !tbaa !9
  %8 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 2
  invoke void @_ZN6SoLoud9VizsnBankC1Ev(ptr noundef nonnull align 4 dereferenceable(224) %8)
          to label %9 unwind label %37

9:                                                ; preds = %2
  %10 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 3
  invoke void @_ZN6SoLoud9VizsnBankC1Ev(ptr noundef nonnull align 4 dereferenceable(224) %10)
          to label %11 unwind label %37

11:                                               ; preds = %9
  %12 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 4
  invoke void @_ZN6SoLoud9VizsnBankC1Ev(ptr noundef nonnull align 4 dereferenceable(224) %12)
          to label %13 unwind label %37

13:                                               ; preds = %11
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 1
  store ptr %14, ptr %15, align 8, !tbaa !11
  %16 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 9
  store i32 0, ptr %16, align 4, !tbaa !19
  %17 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 10
  store i32 6, ptr %17, align 8, !tbaa !20
  %18 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 8
  %19 = getelementptr inbounds [1024 x i32], ptr %18, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 4 %19, i8 0, i64 4096, i1 false)
  %20 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 11
  store float 8.000000e+02, ptr %20, align 4, !tbaa !21
  %21 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds %"class.SoLoud::Vizsn", ptr %22, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !22
  %25 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 12
  store ptr %24, ptr %25, align 8, !tbaa !25
  %26 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 14
  store i32 0, ptr %26, align 8, !tbaa !26
  %27 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 15
  store i32 0, ptr %27, align 4, !tbaa !27
  %28 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 16
  store i32 0, ptr %28, align 8, !tbaa !28
  %29 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 17
  store i32 100, ptr %29, align 4, !tbaa !29
  %30 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 18
  store i32 -1, ptr %30, align 8, !tbaa !30
  %31 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 19
  store float 0.000000e+00, ptr %31, align 4, !tbaa !31
  %32 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 5
  store i32 0, ptr %32, align 8, !tbaa !32
  %33 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 6
  store i32 0, ptr %33, align 4, !tbaa !33
  %34 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 7
  store i32 0, ptr %34, align 8, !tbaa !34
  %35 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %7, i32 0, i32 13
  %36 = getelementptr inbounds [2048 x float], ptr %35, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %36, i8 0, i64 8192, i1 false)
  ret void

37:                                               ; preds = %11, %9, %2
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %5, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %6, align 4
  call void @_ZN6SoLoud19AudioSourceInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(496) %7) #4
  br label %41

41:                                               ; preds = %37
  %42 = load ptr, ptr %5, align 8
  %43 = load i32, ptr %6, align 4
  %44 = insertvalue { ptr, i32 } poison, ptr %42, 0
  %45 = insertvalue { ptr, i32 } %44, i32 %43, 1
  resume { ptr, i32 } %45
}

declare void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN6SoLoud19AudioSourceInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(496)) unnamed_addr #3

declare void @_ZN6SoLoud9VizsnBankC1Ev(ptr)

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 nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #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, !6, i64 496}
!12 = !{!"_ZTSN6SoLoud13VizsnInstanceE", !13, i64 0, !6, i64 496, !18, i64 504, !18, i64 728, !18, i64 952, !14, i64 1176, !14, i64 1180, !14, i64 1184, !7, i64 1188, !14, i64 5284, !14, i64 5288, !15, i64 5292, !6, i64 5296, !7, i64 5304, !14, i64 13496, !14, i64 13500, !14, i64 13504, !14, i64 13508, !14, i64 13512, !15, i64 13516}
!13 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !14, i64 8, !14, i64 12, !14, i64 16, !15, i64 20, !7, i64 24, !15, i64 56, !15, i64 60, !15, i64 64, !15, i64 68, !14, i64 72, !15, i64 76, !15, i64 80, !16, i64 88, !16, i64 96, !17, i64 104, !17, i64 152, !17, i64 200, !17, i64 248, !17, i64 296, !14, i64 344, !7, i64 348, !14, i64 380, !14, i64 384, !7, i64 392, !7, i64 456, !14, i64 472, !14, i64 476, !14, i64 480, !16, i64 488}
!14 = !{!"int", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTSN6SoLoud5FaderE", !15, i64 0, !15, i64 4, !15, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !15, i64 40, !14, i64 44}
!18 = !{!"_ZTSN6SoLoud9VizsnBankE", !7, i64 0, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220}
!19 = !{!12, !14, i64 5284}
!20 = !{!12, !14, i64 5288}
!21 = !{!12, !15, i64 5292}
!22 = !{!23, !6, i64 152}
!23 = !{!"_ZTSN6SoLoud5VizsnE", !24, i64 0, !6, i64 152}
!24 = !{!"_ZTSN6SoLoud11AudioSourceE", !14, i64 8, !15, i64 12, !15, i64 16, !14, i64 20, !14, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !14, i64 40, !15, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !16, i64 144}
!25 = !{!12, !6, i64 5296}
!26 = !{!12, !14, i64 13496}
!27 = !{!12, !14, i64 13500}
!28 = !{!12, !14, i64 13504}
!29 = !{!12, !14, i64 13508}
!30 = !{!12, !14, i64 13512}
!31 = !{!12, !15, i64 13516}
!32 = !{!12, !14, i64 1176}
!33 = !{!12, !14, i64 1180}
!34 = !{!12, !14, i64 1184}


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

@_ZTVN6SoLoud13VizsnInstanceE = external dso_local unnamed_addr constant { [9 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud13VizsnInstanceC2EPNS_5VizsnE(ptr noundef nonnull align 8 dereferenceable(13520) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496) %0)
  store ptr getelementptr inbounds inrange(-16, 56) (i8, ptr @_ZTVN6SoLoud13VizsnInstanceE, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 504
  invoke void @_ZN6SoLoud9VizsnBankC1Ev(ptr noundef nonnull align 4 dereferenceable(224) %3)
          to label %4 unwind label %24

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 728
  invoke void @_ZN6SoLoud9VizsnBankC1Ev(ptr noundef nonnull align 4 dereferenceable(224) %5)
          to label %6 unwind label %24

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %0, i64 952
  invoke void @_ZN6SoLoud9VizsnBankC1Ev(ptr noundef nonnull align 4 dereferenceable(224) %7)
          to label %8 unwind label %24

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 496
  store ptr %1, ptr %9, align 8, !tbaa !8
  %10 = getelementptr inbounds i8, ptr %0, i64 5284
  store i32 0, ptr %10, align 4, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %0, i64 5288
  store i32 6, ptr %11, align 8, !tbaa !19
  %12 = getelementptr inbounds i8, ptr %0, i64 1188
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(4096) %12, i8 0, i64 4096, i1 false)
  %13 = getelementptr inbounds i8, ptr %0, i64 5292
  store float 8.000000e+02, ptr %13, align 4, !tbaa !20
  %14 = getelementptr inbounds i8, ptr %1, i64 152
  %15 = load ptr, ptr %14, align 8, !tbaa !21
  %16 = getelementptr inbounds i8, ptr %0, i64 5296
  store ptr %15, ptr %16, align 8, !tbaa !24
  %17 = getelementptr inbounds i8, ptr %0, i64 13496
  store <4 x i32> <i32 0, i32 0, i32 0, i32 100>, ptr %17, align 8, !tbaa !25
  %18 = getelementptr inbounds i8, ptr %0, i64 13512
  store i32 -1, ptr %18, align 8, !tbaa !26
  %19 = getelementptr inbounds i8, ptr %0, i64 13516
  store float 0.000000e+00, ptr %19, align 4, !tbaa !27
  %20 = getelementptr inbounds i8, ptr %0, i64 1176
  store i32 0, ptr %20, align 8, !tbaa !28
  %21 = getelementptr inbounds i8, ptr %0, i64 1180
  store i32 0, ptr %21, align 4, !tbaa !29
  %22 = getelementptr inbounds i8, ptr %0, i64 1184
  store i32 0, ptr %22, align 8, !tbaa !30
  %23 = getelementptr inbounds i8, ptr %0, i64 5304
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(8192) %23, i8 0, i64 8192, i1 false)
  ret void

24:                                               ; preds = %6, %4, %2
  %25 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN6SoLoud19AudioSourceInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(496) %0) #4
  resume { ptr, i32 } %25
}

declare void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN6SoLoud19AudioSourceInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(496)) unnamed_addr #3

declare void @_ZN6SoLoud9VizsnBankC1Ev(ptr) local_unnamed_addr

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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !16, i64 496}
!9 = !{!"_ZTSN6SoLoud13VizsnInstanceE", !10, i64 0, !16, i64 496, !17, i64 504, !17, i64 728, !17, i64 952, !11, i64 1176, !11, i64 1180, !11, i64 1184, !12, i64 1188, !11, i64 5284, !11, i64 5288, !13, i64 5292, !16, i64 5296, !12, i64 5304, !11, i64 13496, !11, i64 13500, !11, i64 13504, !11, i64 13508, !11, i64 13512, !13, i64 13516}
!10 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !11, i64 8, !11, i64 12, !11, i64 16, !13, i64 20, !12, i64 24, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !11, i64 72, !13, i64 76, !13, i64 80, !14, i64 88, !14, i64 96, !15, i64 104, !15, i64 152, !15, i64 200, !15, i64 248, !15, i64 296, !11, i64 344, !12, i64 348, !11, i64 380, !11, i64 384, !12, i64 392, !12, i64 456, !11, i64 472, !11, i64 476, !11, i64 480, !14, i64 488}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"float", !12, i64 0}
!14 = !{!"double", !12, i64 0}
!15 = !{!"_ZTSN6SoLoud5FaderE", !13, i64 0, !13, i64 4, !13, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !13, i64 40, !11, i64 44}
!16 = !{!"any pointer", !12, i64 0}
!17 = !{!"_ZTSN6SoLoud9VizsnBankE", !12, i64 0, !13, i64 200, !13, i64 204, !13, i64 208, !13, i64 212, !13, i64 216, !13, i64 220}
!18 = !{!9, !11, i64 5284}
!19 = !{!9, !11, i64 5288}
!20 = !{!9, !13, i64 5292}
!21 = !{!22, !16, i64 152}
!22 = !{!"_ZTSN6SoLoud5VizsnE", !23, i64 0, !16, i64 152}
!23 = !{!"_ZTSN6SoLoud11AudioSourceE", !11, i64 8, !13, i64 12, !13, i64 16, !11, i64 20, !11, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !11, i64 40, !13, i64 44, !12, i64 48, !16, i64 112, !16, i64 120, !16, i64 128, !11, i64 136, !14, i64 144}
!24 = !{!9, !16, i64 5296}
!25 = !{!11, !11, i64 0}
!26 = !{!9, !11, i64 13512}
!27 = !{!9, !13, i64 13516}
!28 = !{!9, !11, i64 1176}
!29 = !{!9, !11, i64 1180}
!30 = !{!9, !11, i64 1184}


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