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

; 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 nounwind uwtable
define dso_local void @_ZN6SoLoud13VizsnInstance9slideTickEv(ptr noundef nonnull align 8 dereferenceable(13520) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %5

5:                                                ; preds = %54, %1
  %6 = load i32, ptr %3, align 4, !tbaa !9
  %7 = icmp slt i32 %6, 10
  br i1 %7, label %8, label %57

8:                                                ; preds = %5
  %9 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %4, i32 0, i32 4
  %10 = getelementptr inbounds %"struct.SoLoud::VizsnBank", ptr %9, i32 0, i32 0
  %11 = load i32, ptr %3, align 4, !tbaa !9
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [10 x %"struct.SoLoud::VizsnResonator"], ptr %10, i64 0, i64 %12
  %14 = getelementptr inbounds %"struct.SoLoud::VizsnResonator", ptr %13, i32 0, i32 0
  %15 = load float, ptr %14, align 4, !tbaa !11
  %16 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %4, i32 0, i32 2
  %17 = getelementptr inbounds %"struct.SoLoud::VizsnBank", ptr %16, i32 0, i32 0
  %18 = load i32, ptr %3, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [10 x %"struct.SoLoud::VizsnResonator"], ptr %17, i64 0, i64 %19
  %21 = getelementptr inbounds %"struct.SoLoud::VizsnResonator", ptr %20, i32 0, i32 0
  %22 = load float, ptr %21, align 4, !tbaa !11
  %23 = fadd float %22, %15
  store float %23, ptr %21, align 4, !tbaa !11
  %24 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %4, i32 0, i32 4
  %25 = getelementptr inbounds %"struct.SoLoud::VizsnBank", ptr %24, i32 0, i32 0
  %26 = load i32, ptr %3, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [10 x %"struct.SoLoud::VizsnResonator"], ptr %25, i64 0, i64 %27
  %29 = getelementptr inbounds %"struct.SoLoud::VizsnResonator", ptr %28, i32 0, i32 1
  %30 = load float, ptr %29, align 4, !tbaa !14
  %31 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %4, i32 0, i32 2
  %32 = getelementptr inbounds %"struct.SoLoud::VizsnBank", ptr %31, i32 0, i32 0
  %33 = load i32, ptr %3, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [10 x %"struct.SoLoud::VizsnResonator"], ptr %32, i64 0, i64 %34
  %36 = getelementptr inbounds %"struct.SoLoud::VizsnResonator", ptr %35, i32 0, i32 1
  %37 = load float, ptr %36, align 4, !tbaa !14
  %38 = fadd float %37, %30
  store float %38, ptr %36, align 4, !tbaa !14
  %39 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %4, i32 0, i32 4
  %40 = getelementptr inbounds %"struct.SoLoud::VizsnBank", ptr %39, i32 0, i32 0
  %41 = load i32, ptr %3, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [10 x %"struct.SoLoud::VizsnResonator"], ptr %40, i64 0, i64 %42
  %44 = getelementptr inbounds %"struct.SoLoud::VizsnResonator", ptr %43, i32 0, i32 2
  %45 = load float, ptr %44, align 4, !tbaa !15
  %46 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %4, i32 0, i32 2
  %47 = getelementptr inbounds %"struct.SoLoud::VizsnBank", ptr %46, i32 0, i32 0
  %48 = load i32, ptr %3, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [10 x %"struct.SoLoud::VizsnResonator"], ptr %47, i64 0, i64 %49
  %51 = getelementptr inbounds %"struct.SoLoud::VizsnResonator", ptr %50, i32 0, i32 2
  %52 = load float, ptr %51, align 4, !tbaa !15
  %53 = fadd float %52, %45
  store float %53, ptr %51, align 4, !tbaa !15
  br label %54

54:                                               ; preds = %8
  %55 = load i32, ptr %3, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %3, align 4, !tbaa !9
  br label %5, !llvm.loop !16

57:                                               ; preds = %5
  %58 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %4, i32 0, i32 4
  %59 = getelementptr inbounds %"struct.SoLoud::VizsnBank", ptr %58, i32 0, i32 1
  %60 = load float, ptr %59, align 8, !tbaa !18
  %61 = getelementptr inbounds %"class.SoLoud::VizsnInstance", ptr %4, i32 0, i32 2
  %62 = getelementptr inbounds %"struct.SoLoud::VizsnBank", ptr %61, i32 0, i32 1
  %63 = load float, ptr %62, align 8, !tbaa !24
  %64 = fadd float %63, %60
  store float %64, ptr %62, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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, !13, i64 0}
!12 = !{!"_ZTSN6SoLoud14VizsnResonatorE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = !{!12, !13, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !13, i64 1152}
!19 = !{!"_ZTSN6SoLoud13VizsnInstanceE", !20, i64 0, !6, i64 496, !23, i64 504, !23, i64 728, !23, i64 952, !10, i64 1176, !10, i64 1180, !10, i64 1184, !7, i64 1188, !10, i64 5284, !10, i64 5288, !13, i64 5292, !6, i64 5296, !7, i64 5304, !10, i64 13496, !10, i64 13500, !10, i64 13504, !10, i64 13508, !10, i64 13512, !13, i64 13516}
!20 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 20, !7, i64 24, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !10, i64 72, !13, i64 76, !13, i64 80, !21, i64 88, !21, i64 96, !22, i64 104, !22, i64 152, !22, i64 200, !22, i64 248, !22, i64 296, !10, i64 344, !7, i64 348, !10, i64 380, !10, i64 384, !7, i64 392, !7, i64 456, !10, i64 472, !10, i64 476, !10, i64 480, !21, i64 488}
!21 = !{!"double", !7, i64 0}
!22 = !{!"_ZTSN6SoLoud5FaderE", !13, i64 0, !13, i64 4, !13, i64 8, !21, i64 16, !21, i64 24, !21, i64 32, !13, i64 40, !10, i64 44}
!23 = !{!"_ZTSN6SoLoud9VizsnBankE", !7, i64 0, !13, i64 200, !13, i64 204, !13, i64 208, !13, i64 212, !13, i64 216, !13, i64 220}
!24 = !{!19, !13, i64 704}


; 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: readwrite) uwtable
define dso_local void @_ZN6SoLoud13VizsnInstance9slideTickEv(ptr nocapture noundef nonnull align 8 dereferenceable(13520) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 952
  %3 = getelementptr inbounds i8, ptr %0, i64 504
  %4 = load <2 x float>, ptr %2, align 8, !tbaa !5
  %5 = load <2 x float>, ptr %3, align 8, !tbaa !5
  %6 = fadd <2 x float> %4, %5
  store <2 x float> %6, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 960
  %8 = load float, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %0, i64 512
  %10 = load float, ptr %9, align 8, !tbaa !9
  %11 = fadd float %8, %10
  store float %11, ptr %9, align 8, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %0, i64 972
  %13 = getelementptr inbounds i8, ptr %0, i64 524
  %14 = load <2 x float>, ptr %12, align 4, !tbaa !5
  %15 = load <2 x float>, ptr %13, align 4, !tbaa !5
  %16 = fadd <2 x float> %14, %15
  store <2 x float> %16, ptr %13, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 980
  %18 = load float, ptr %17, align 4, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %0, i64 532
  %20 = load float, ptr %19, align 4, !tbaa !9
  %21 = fadd float %18, %20
  store float %21, ptr %19, align 4, !tbaa !9
  %22 = getelementptr inbounds i8, ptr %0, i64 992
  %23 = getelementptr inbounds i8, ptr %0, i64 544
  %24 = load <2 x float>, ptr %22, align 8, !tbaa !5
  %25 = load <2 x float>, ptr %23, align 8, !tbaa !5
  %26 = fadd <2 x float> %24, %25
  store <2 x float> %26, ptr %23, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 1000
  %28 = load float, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %0, i64 552
  %30 = load float, ptr %29, align 8, !tbaa !9
  %31 = fadd float %28, %30
  store float %31, ptr %29, align 8, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %0, i64 1012
  %33 = getelementptr inbounds i8, ptr %0, i64 564
  %34 = load <2 x float>, ptr %32, align 4, !tbaa !5
  %35 = load <2 x float>, ptr %33, align 4, !tbaa !5
  %36 = fadd <2 x float> %34, %35
  store <2 x float> %36, ptr %33, align 4, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %0, i64 1020
  %38 = load float, ptr %37, align 4, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %0, i64 572
  %40 = load float, ptr %39, align 4, !tbaa !9
  %41 = fadd float %38, %40
  store float %41, ptr %39, align 4, !tbaa !9
  %42 = getelementptr inbounds i8, ptr %0, i64 1032
  %43 = getelementptr inbounds i8, ptr %0, i64 584
  %44 = load <2 x float>, ptr %42, align 8, !tbaa !5
  %45 = load <2 x float>, ptr %43, align 8, !tbaa !5
  %46 = fadd <2 x float> %44, %45
  store <2 x float> %46, ptr %43, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %0, i64 1040
  %48 = load float, ptr %47, align 8, !tbaa !9
  %49 = getelementptr inbounds i8, ptr %0, i64 592
  %50 = load float, ptr %49, align 8, !tbaa !9
  %51 = fadd float %48, %50
  store float %51, ptr %49, align 8, !tbaa !9
  %52 = getelementptr inbounds i8, ptr %0, i64 1052
  %53 = getelementptr inbounds i8, ptr %0, i64 604
  %54 = load <2 x float>, ptr %52, align 4, !tbaa !5
  %55 = load <2 x float>, ptr %53, align 4, !tbaa !5
  %56 = fadd <2 x float> %54, %55
  store <2 x float> %56, ptr %53, align 4, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %0, i64 1060
  %58 = load float, ptr %57, align 4, !tbaa !9
  %59 = getelementptr inbounds i8, ptr %0, i64 612
  %60 = load float, ptr %59, align 4, !tbaa !9
  %61 = fadd float %58, %60
  store float %61, ptr %59, align 4, !tbaa !9
  %62 = getelementptr inbounds i8, ptr %0, i64 1072
  %63 = getelementptr inbounds i8, ptr %0, i64 624
  %64 = load <2 x float>, ptr %62, align 8, !tbaa !5
  %65 = load <2 x float>, ptr %63, align 8, !tbaa !5
  %66 = fadd <2 x float> %64, %65
  store <2 x float> %66, ptr %63, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %0, i64 1080
  %68 = load float, ptr %67, align 8, !tbaa !9
  %69 = getelementptr inbounds i8, ptr %0, i64 632
  %70 = load float, ptr %69, align 8, !tbaa !9
  %71 = fadd float %68, %70
  store float %71, ptr %69, align 8, !tbaa !9
  %72 = getelementptr inbounds i8, ptr %0, i64 1092
  %73 = getelementptr inbounds i8, ptr %0, i64 644
  %74 = load <2 x float>, ptr %72, align 4, !tbaa !5
  %75 = load <2 x float>, ptr %73, align 4, !tbaa !5
  %76 = fadd <2 x float> %74, %75
  store <2 x float> %76, ptr %73, align 4, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %0, i64 1100
  %78 = load float, ptr %77, align 4, !tbaa !9
  %79 = getelementptr inbounds i8, ptr %0, i64 652
  %80 = load float, ptr %79, align 4, !tbaa !9
  %81 = fadd float %78, %80
  store float %81, ptr %79, align 4, !tbaa !9
  %82 = getelementptr inbounds i8, ptr %0, i64 1112
  %83 = getelementptr inbounds i8, ptr %0, i64 664
  %84 = load <2 x float>, ptr %82, align 8, !tbaa !5
  %85 = load <2 x float>, ptr %83, align 8, !tbaa !5
  %86 = fadd <2 x float> %84, %85
  store <2 x float> %86, ptr %83, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %0, i64 1120
  %88 = load float, ptr %87, align 8, !tbaa !9
  %89 = getelementptr inbounds i8, ptr %0, i64 672
  %90 = load float, ptr %89, align 8, !tbaa !9
  %91 = fadd float %88, %90
  store float %91, ptr %89, align 8, !tbaa !9
  %92 = getelementptr inbounds i8, ptr %0, i64 1132
  %93 = getelementptr inbounds i8, ptr %0, i64 684
  %94 = load <2 x float>, ptr %92, align 4, !tbaa !5
  %95 = load <2 x float>, ptr %93, align 4, !tbaa !5
  %96 = fadd <2 x float> %94, %95
  store <2 x float> %96, ptr %93, align 4, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %0, i64 1140
  %98 = load float, ptr %97, align 4, !tbaa !9
  %99 = getelementptr inbounds i8, ptr %0, i64 692
  %100 = load float, ptr %99, align 4, !tbaa !9
  %101 = fadd float %98, %100
  store float %101, ptr %99, align 4, !tbaa !9
  %102 = getelementptr inbounds i8, ptr %0, i64 1152
  %103 = load float, ptr %102, align 8, !tbaa !11
  %104 = getelementptr inbounds i8, ptr %0, i64 704
  %105 = load float, ptr %104, align 8, !tbaa !19
  %106 = fadd float %103, %105
  store float %106, ptr %104, align 8, !tbaa !19
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTSN6SoLoud14VizsnResonatorE", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16}
!11 = !{!12, !6, i64 1152}
!12 = !{!"_ZTSN6SoLoud13VizsnInstanceE", !13, i64 0, !17, 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, !6, i64 5292, !17, i64 5296, !7, i64 5304, !14, i64 13496, !14, i64 13500, !14, i64 13504, !14, i64 13508, !14, i64 13512, !6, i64 13516}
!13 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !14, i64 8, !14, i64 12, !14, i64 16, !6, i64 20, !7, i64 24, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !14, i64 72, !6, i64 76, !6, i64 80, !15, i64 88, !15, i64 96, !16, i64 104, !16, i64 152, !16, i64 200, !16, i64 248, !16, 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, !15, i64 488}
!14 = !{!"int", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTSN6SoLoud5FaderE", !6, i64 0, !6, i64 4, !6, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !6, i64 40, !14, i64 44}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"_ZTSN6SoLoud9VizsnBankE", !7, i64 0, !6, i64 200, !6, i64 204, !6, i64 208, !6, i64 212, !6, i64 216, !6, i64 220}
!19 = !{!12, !6, i64 704}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass