; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/audiosource/vic/soloud_vic.ll (ZN6SoLoud3Vic8setModelEi)

; 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::Vic" = type { %"class.SoLoud::AudioSource", i32, [4 x float], [4 x i8], [8192 x i8] }
%"class.SoLoud::AudioSource" = type { ptr, i32, float, float, i32, i32, float, float, float, i32, float, [8 x ptr], ptr, ptr, ptr, i32, double }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6SoLoud3Vic8setModelEi(ptr noundef nonnull align 8 dereferenceable(8368) %0, i32 noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %5 = load ptr, ptr %3, align 8
  %6 = load i32, ptr %4, align 4, !tbaa !9
  %7 = getelementptr inbounds %"class.SoLoud::Vic", ptr %5, i32 0, i32 1
  store i32 %6, ptr %7, align 8, !tbaa !11
  %8 = load i32, ptr %4, align 4, !tbaa !9
  switch i32 %8, label %27 [
    i32 0, label %9
    i32 1, label %18
  ]

9:                                                ; preds = %2
  %10 = getelementptr inbounds %"class.SoLoud::Vic", ptr %5, i32 0, i32 2
  %11 = getelementptr inbounds [4 x float], ptr %10, i64 0, i64 0
  store float 4.329000e+03, ptr %11, align 4, !tbaa !16
  %12 = getelementptr inbounds %"class.SoLoud::Vic", ptr %5, i32 0, i32 2
  %13 = getelementptr inbounds [4 x float], ptr %12, i64 0, i64 1
  store float 8.659000e+03, ptr %13, align 4, !tbaa !16
  %14 = getelementptr inbounds %"class.SoLoud::Vic", ptr %5, i32 0, i32 2
  %15 = getelementptr inbounds [4 x float], ptr %14, i64 0, i64 2
  store float 1.732000e+04, ptr %15, align 4, !tbaa !16
  %16 = getelementptr inbounds %"class.SoLoud::Vic", ptr %5, i32 0, i32 2
  %17 = getelementptr inbounds [4 x float], ptr %16, i64 0, i64 3
  store float 3.464000e+04, ptr %17, align 4, !tbaa !16
  br label %27

18:                                               ; preds = %2
  %19 = getelementptr inbounds %"class.SoLoud::Vic", ptr %5, i32 0, i32 2
  %20 = getelementptr inbounds [4 x float], ptr %19, i64 0, i64 0
  store float 3.995000e+03, ptr %20, align 4, !tbaa !16
  %21 = getelementptr inbounds %"class.SoLoud::Vic", ptr %5, i32 0, i32 2
  %22 = getelementptr inbounds [4 x float], ptr %21, i64 0, i64 1
  store float 7.990000e+03, ptr %22, align 4, !tbaa !16
  %23 = getelementptr inbounds %"class.SoLoud::Vic", ptr %5, i32 0, i32 2
  %24 = getelementptr inbounds [4 x float], ptr %23, i64 0, i64 2
  store float 1.598000e+04, ptr %24, align 4, !tbaa !16
  %25 = getelementptr inbounds %"class.SoLoud::Vic", ptr %5, i32 0, i32 2
  %26 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 3
  store float 3.196000e+04, ptr %26, align 4, !tbaa !16
  br label %27

27:                                               ; preds = %18, %9, %2
  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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 152}
!12 = !{!"_ZTSN6SoLoud3VicE", !13, i64 0, !10, i64 152, !7, i64 156, !7, i64 172, !7, i64 176}
!13 = !{!"_ZTSN6SoLoud11AudioSourceE", !10, i64 8, !14, i64 12, !14, i64 16, !10, i64 20, !10, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !10, i64 40, !14, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !10, i64 136, !15, i64 144}
!14 = !{!"float", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!14, !14, i64 0}


; 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 @_ZN6SoLoud3Vic8setModelEi(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8368) %0, i32 noundef %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 152
  store i32 %1, ptr %3, align 8, !tbaa !5
  switch i32 %1, label %7 [
    i32 0, label %.sink.split
    i32 1, label %4
  ]

4:                                                ; preds = %2
  br label %.sink.split

.sink.split:                                      ; preds = %2, %4
  %5 = phi <4 x float> [ <float 3.995000e+03, float 7.990000e+03, float 1.598000e+04, float 3.196000e+04>, %4 ], [ <float 4.329000e+03, float 8.659000e+03, float 1.732000e+04, float 3.464000e+04>, %2 ]
  %6 = getelementptr inbounds i8, ptr %0, i64 156
  store <4 x float> %5, ptr %6, align 4, !tbaa !14
  br label %7

7:                                                ; preds = %.sink.split, %2
  ret void
}

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

!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 = !{!"_ZTSN6SoLoud3VicE", !7, i64 0, !8, i64 152, !9, i64 156, !9, i64 172, !9, i64 176}
!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 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass