; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/core (soloud_audiosource)

; 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::AudioSourceInstance3dData" = type <{ [3 x float], [3 x float], float, float, float, i32, float, [4 x i8], ptr, ptr, i32, float, float, [8 x float], i32, i32, [4 x i8] }>

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6SoLoud25AudioSourceInstance3dDataC2Ev(ptr noundef nonnull align 8 dereferenceable(116) %0) unnamed_addr #0 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
  %5 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 5
  store i32 0, ptr %5, align 4, !tbaa !9
  %6 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 4
  store float 1.000000e+00, ptr %6, align 8, !tbaa !13
  %7 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 6
  store float 1.000000e+00, ptr %7, align 8, !tbaa !14
  %8 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 3
  store float 1.000000e+06, ptr %8, align 4, !tbaa !15
  %9 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 2
  store float 0.000000e+00, ptr %9, align 8, !tbaa !16
  %10 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 0
  %11 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 0
  store float 0.000000e+00, ptr %11, align 8, !tbaa !17
  %12 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 0
  %13 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 1
  store float 0.000000e+00, ptr %13, align 4, !tbaa !17
  %14 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 0
  %15 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 2
  store float 0.000000e+00, ptr %15, align 8, !tbaa !17
  %16 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 1
  %17 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 0
  store float 0.000000e+00, ptr %17, align 4, !tbaa !17
  %18 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 1
  %19 = getelementptr inbounds [3 x float], ptr %18, i64 0, i64 1
  store float 0.000000e+00, ptr %19, align 4, !tbaa !17
  %20 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 1
  %21 = getelementptr inbounds [3 x float], ptr %20, i64 0, i64 2
  store float 0.000000e+00, ptr %21, align 4, !tbaa !17
  %22 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 12
  store float 0.000000e+00, ptr %22, align 8, !tbaa !18
  %23 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 8
  store ptr null, ptr %23, align 8, !tbaa !19
  %24 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 10
  store i32 0, ptr %24, align 8, !tbaa !20
  %25 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 9
  store ptr null, ptr %25, align 8, !tbaa !21
  %26 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 11
  store float 0.000000e+00, ptr %26, align 4, !tbaa !22
  %27 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 14
  store i32 0, ptr %27, align 4, !tbaa !23
  %28 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 15
  store i32 0, ptr %28, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 0, ptr %3, align 4, !tbaa !25
  br label %29

29:                                               ; preds = %38, %1
  %30 = load i32, ptr %3, align 4, !tbaa !25
  %31 = icmp slt i32 %30, 8
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  br label %41

33:                                               ; preds = %29
  %34 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %4, i32 0, i32 13
  %35 = load i32, ptr %3, align 4, !tbaa !25
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [8 x float], ptr %34, i64 0, i64 %36
  store float 0.000000e+00, ptr %37, align 4, !tbaa !17
  br label %38

38:                                               ; preds = %33
  %39 = load i32, ptr %3, align 4, !tbaa !25
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %3, align 4, !tbaa !25
  br label %29, !llvm.loop !26

41:                                               ; preds = %32
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !12, i64 36}
!10 = !{!"_ZTSN6SoLoud25AudioSourceInstance3dDataE", !7, i64 0, !7, i64 12, !11, i64 24, !11, i64 28, !11, i64 32, !12, i64 36, !11, i64 40, !6, i64 48, !6, i64 56, !12, i64 64, !11, i64 68, !11, i64 72, !7, i64 76, !12, i64 108, !12, i64 112}
!11 = !{!"float", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !11, i64 32}
!14 = !{!10, !11, i64 40}
!15 = !{!10, !11, i64 28}
!16 = !{!10, !11, i64 24}
!17 = !{!11, !11, i64 0}
!18 = !{!10, !11, i64 72}
!19 = !{!10, !6, i64 48}
!20 = !{!10, !12, i64 64}
!21 = !{!10, !6, i64 56}
!22 = !{!10, !11, i64 68}
!23 = !{!10, !12, i64 108}
!24 = !{!10, !12, i64 112}
!25 = !{!12, !12, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"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 nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @_ZN6SoLoud25AudioSourceInstance3dDataC2Ev(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(116) %0) unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 36
  store i32 0, ptr %2, align 4, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 40
  store float 1.000000e+00, ptr %3, align 8, !tbaa !12
  %4 = getelementptr inbounds i8, ptr %0, i64 28
  store <2 x float> <float 1.000000e+06, float 1.000000e+00>, ptr %4, align 4, !tbaa !13
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %0, i8 0, i64 28, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(68) %5, i8 0, i64 68, i1 false)
  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, !10, i64 36}
!6 = !{!"_ZTSN6SoLoud25AudioSourceInstance3dDataE", !7, i64 0, !7, i64 12, !9, i64 24, !9, i64 28, !9, i64 32, !10, i64 36, !9, i64 40, !11, i64 48, !11, i64 56, !10, i64 64, !9, i64 68, !9, i64 72, !7, i64 76, !10, i64 108, !10, i64 112}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"float", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!6, !9, i64 40}
!13 = !{!9, !9, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass