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

; 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::AudioSource" = type { ptr, i32, float, float, i32, i32, float, float, float, i32, float, [8 x ptr], ptr, ptr, ptr, i32, double }

@_ZTVN6SoLoud11AudioSourceE = external dso_local unnamed_addr constant { [6 x ptr] }, align 8

; 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 @_ZN6SoLoud11AudioSourceC2Ev(ptr noundef nonnull align 8 dereferenceable(152) %0) unnamed_addr #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
  store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTVN6SoLoud11AudioSourceE, i32 0, i32 0, i32 2), ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %5

5:                                                ; preds = %13, %1
  %6 = load i32, ptr %3, align 4, !tbaa !11
  %7 = icmp slt i32 %6, 8
  br i1 %7, label %8, label %16

8:                                                ; preds = %5
  %9 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 11
  %10 = load i32, ptr %3, align 4, !tbaa !11
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [8 x ptr], ptr %9, i64 0, i64 %11
  store ptr null, ptr %12, align 8, !tbaa !5
  br label %13

13:                                               ; preds = %8
  %14 = load i32, ptr %3, align 4, !tbaa !11
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr %3, align 4, !tbaa !11
  br label %5, !llvm.loop !13

16:                                               ; preds = %5
  %17 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 1
  store i32 0, ptr %17, align 8, !tbaa !15
  %18 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 2
  store float 4.410000e+04, ptr %18, align 4, !tbaa !19
  %19 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 5
  store i32 0, ptr %19, align 8, !tbaa !20
  %20 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 12
  store ptr null, ptr %20, align 8, !tbaa !21
  %21 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 4
  store i32 1, ptr %21, align 4, !tbaa !22
  %22 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 6
  store float 1.000000e+00, ptr %22, align 4, !tbaa !23
  %23 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 7
  store float 1.000000e+06, ptr %23, align 8, !tbaa !24
  %24 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 8
  store float 1.000000e+00, ptr %24, align 4, !tbaa !25
  %25 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 9
  store i32 0, ptr %25, align 8, !tbaa !26
  %26 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 10
  store float 1.000000e+00, ptr %26, align 4, !tbaa !27
  %27 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 13
  store ptr null, ptr %27, align 8, !tbaa !28
  %28 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 14
  store ptr null, ptr %28, align 8, !tbaa !29
  %29 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 15
  store i32 0, ptr %29, align 8, !tbaa !30
  %30 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 3
  store float 1.000000e+00, ptr %30, align 8, !tbaa !31
  %31 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %4, i32 0, i32 16
  store double 0.000000e+00, ptr %31, align 8, !tbaa !32
  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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !12, i64 8}
!16 = !{!"_ZTSN6SoLoud11AudioSourceE", !12, i64 8, !17, i64 12, !17, i64 16, !12, i64 20, !12, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !12, i64 40, !17, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !12, i64 136, !18, i64 144}
!17 = !{!"float", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!16, !17, i64 12}
!20 = !{!16, !12, i64 24}
!21 = !{!16, !6, i64 112}
!22 = !{!16, !12, i64 20}
!23 = !{!16, !17, i64 28}
!24 = !{!16, !17, i64 32}
!25 = !{!16, !17, i64 36}
!26 = !{!16, !12, i64 40}
!27 = !{!16, !17, i64 44}
!28 = !{!16, !6, i64 120}
!29 = !{!16, !6, i64 128}
!30 = !{!16, !12, i64 136}
!31 = !{!16, !17, i64 16}
!32 = !{!16, !18, i64 144}


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

@_ZTVN6SoLoud11AudioSourceE = external dso_local unnamed_addr constant { [6 x ptr] }, align 8

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @_ZN6SoLoud11AudioSourceC2Ev(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(152) %0) unnamed_addr #0 align 2 {
  store ptr getelementptr inbounds inrange(-16, 32) (i8, ptr @_ZTVN6SoLoud11AudioSourceE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %2, i8 0, i64 64, i1 false), !tbaa !8
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 0, ptr %3, align 8, !tbaa !11
  %4 = getelementptr inbounds i8, ptr %0, i64 12
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 0, ptr %5, align 8, !tbaa !16
  %6 = getelementptr inbounds i8, ptr %0, i64 112
  store ptr null, ptr %6, align 8, !tbaa !17
  %7 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 1, ptr %7, align 4, !tbaa !18
  %8 = getelementptr inbounds i8, ptr %0, i64 28
  store <2 x float> <float 1.000000e+00, float 1.000000e+06>, ptr %8, align 4, !tbaa !19
  %9 = getelementptr inbounds i8, ptr %0, i64 36
  store float 1.000000e+00, ptr %9, align 4, !tbaa !20
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 0, ptr %10, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %0, i64 44
  store float 1.000000e+00, ptr %11, align 4, !tbaa !22
  %12 = getelementptr inbounds i8, ptr %0, i64 120
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %12, i8 0, i64 20, i1 false)
  store <2 x float> <float 4.410000e+04, float 1.000000e+00>, ptr %4, align 4, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %0, i64 144
  store double 0.000000e+00, ptr %13, align 8, !tbaa !23
  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, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"_ZTSN6SoLoud11AudioSourceE", !13, i64 8, !14, i64 12, !14, i64 16, !13, i64 20, !13, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !13, i64 40, !14, i64 44, !10, i64 48, !9, i64 112, !9, i64 120, !9, i64 128, !13, i64 136, !15, i64 144}
!13 = !{!"int", !10, i64 0}
!14 = !{!"float", !10, i64 0}
!15 = !{!"double", !10, i64 0}
!16 = !{!12, !13, i64 24}
!17 = !{!12, !9, i64 112}
!18 = !{!12, !13, i64 20}
!19 = !{!14, !14, i64 0}
!20 = !{!12, !14, i64 36}
!21 = !{!12, !13, i64 40}
!22 = !{!12, !14, i64 44}
!23 = !{!12, !15, i64 144}


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