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

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

@_ZTVN6SoLoud19AudioSourceInstanceE = external dso_local unnamed_addr constant { [9 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 uwtable
define dso_local void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496) %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, 56) ({ [9 x ptr] }, ptr @_ZTVN6SoLoud19AudioSourceInstanceE, i32 0, i32 0, i32 2), ptr %4, align 8, !tbaa !9
  %5 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 15
  call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %5)
  %6 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 16
  call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %6)
  %7 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 17
  call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %7)
  %8 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 18
  call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %8)
  %9 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 19
  call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %9)
  %10 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 1
  store i32 0, ptr %10, align 8, !tbaa !11
  %11 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 3
  store i32 0, ptr %11, align 8, !tbaa !17
  %12 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 4
  store float 0.000000e+00, ptr %12, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !19
  br label %13

13:                                               ; preds = %21, %1
  %14 = load i32, ptr %3, align 4, !tbaa !19
  %15 = icmp slt i32 %14, 8
  br i1 %15, label %16, label %24

16:                                               ; preds = %13
  %17 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 5
  %18 = load i32, ptr %3, align 4, !tbaa !19
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [8 x float], ptr %17, i64 0, i64 %19
  store float 1.000000e+00, ptr %20, align 4, !tbaa !20
  br label %21

21:                                               ; preds = %16
  %22 = load i32, ptr %3, align 4, !tbaa !19
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %3, align 4, !tbaa !19
  br label %13, !llvm.loop !21

24:                                               ; preds = %13
  %25 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 6
  store float 1.000000e+00, ptr %25, align 8, !tbaa !23
  %26 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 8
  store float 4.410000e+04, ptr %26, align 8, !tbaa !24
  %27 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 9
  store float 4.410000e+04, ptr %27, align 4, !tbaa !25
  %28 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 11
  store float 1.000000e+00, ptr %28, align 4, !tbaa !26
  %29 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 13
  store double 0.000000e+00, ptr %29, align 8, !tbaa !27
  %30 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 14
  store double 0.000000e+00, ptr %30, align 8, !tbaa !28
  %31 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 22
  store i32 0, ptr %31, align 4, !tbaa !29
  %32 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 20
  store i32 0, ptr %32, align 8, !tbaa !30
  %33 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 10
  store i32 1, ptr %33, align 8, !tbaa !31
  %34 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 23
  store i32 -1, ptr %34, align 8, !tbaa !32
  %35 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 2
  store i32 0, ptr %35, align 4, !tbaa !33
  %36 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 29
  store double 0.000000e+00, ptr %36, align 8, !tbaa !34
  store i32 0, ptr %3, align 4, !tbaa !19
  br label %37

37:                                               ; preds = %45, %24
  %38 = load i32, ptr %3, align 4, !tbaa !19
  %39 = icmp slt i32 %38, 8
  br i1 %39, label %40, label %48

40:                                               ; preds = %37
  %41 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 24
  %42 = load i32, ptr %3, align 4, !tbaa !19
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [8 x ptr], ptr %41, i64 0, i64 %43
  store ptr null, ptr %44, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %40
  %46 = load i32, ptr %3, align 4, !tbaa !19
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %3, align 4, !tbaa !19
  br label %37, !llvm.loop !35

48:                                               ; preds = %37
  store i32 0, ptr %3, align 4, !tbaa !19
  br label %49

49:                                               ; preds = %57, %48
  %50 = load i32, ptr %3, align 4, !tbaa !19
  %51 = icmp slt i32 %50, 8
  br i1 %51, label %52, label %60

52:                                               ; preds = %49
  %53 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 21
  %54 = load i32, ptr %3, align 4, !tbaa !19
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [8 x float], ptr %53, i64 0, i64 %55
  store float 0.000000e+00, ptr %56, align 4, !tbaa !20
  br label %57

57:                                               ; preds = %52
  %58 = load i32, ptr %3, align 4, !tbaa !19
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !19
  br label %49, !llvm.loop !36

60:                                               ; preds = %49
  %61 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 25
  %62 = getelementptr inbounds [2 x ptr], ptr %61, i64 0, i64 0
  store ptr null, ptr %62, align 8, !tbaa !5
  %63 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 25
  %64 = getelementptr inbounds [2 x ptr], ptr %63, i64 0, i64 1
  store ptr null, ptr %64, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 26
  store i32 0, ptr %65, align 8, !tbaa !37
  %66 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 27
  store i32 0, ptr %66, align 4, !tbaa !38
  %67 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 28
  store i32 0, ptr %67, align 8, !tbaa !39
  %68 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 7
  store float 0.000000e+00, ptr %68, align 4, !tbaa !40
  %69 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %4, i32 0, i32 12
  store float 1.000000e+00, ptr %69, align 8, !tbaa !41
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

declare void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 #3 = { 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, !13, i64 8}
!12 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !13, i64 8, !13, i64 12, !13, i64 16, !14, i64 20, !7, i64 24, !14, i64 56, !14, i64 60, !14, i64 64, !14, i64 68, !13, i64 72, !14, i64 76, !14, i64 80, !15, i64 88, !15, i64 96, !16, i64 104, !16, i64 152, !16, i64 200, !16, i64 248, !16, i64 296, !13, i64 344, !7, i64 348, !13, i64 380, !13, i64 384, !7, i64 392, !7, i64 456, !13, i64 472, !13, i64 476, !13, i64 480, !15, i64 488}
!13 = !{!"int", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTSN6SoLoud5FaderE", !14, i64 0, !14, i64 4, !14, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !14, i64 40, !13, i64 44}
!17 = !{!12, !13, i64 16}
!18 = !{!12, !14, i64 20}
!19 = !{!13, !13, i64 0}
!20 = !{!14, !14, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!12, !14, i64 56}
!24 = !{!12, !14, i64 64}
!25 = !{!12, !14, i64 68}
!26 = !{!12, !14, i64 76}
!27 = !{!12, !15, i64 88}
!28 = !{!12, !15, i64 96}
!29 = !{!12, !13, i64 380}
!30 = !{!12, !13, i64 344}
!31 = !{!12, !13, i64 72}
!32 = !{!12, !13, i64 384}
!33 = !{!12, !13, i64 12}
!34 = !{!12, !15, i64 488}
!35 = distinct !{!35, !22}
!36 = distinct !{!36, !22}
!37 = !{!12, !13, i64 472}
!38 = !{!12, !13, i64 476}
!39 = !{!12, !13, i64 480}
!40 = !{!12, !14, i64 60}
!41 = !{!12, !14, i64 80}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496) %0) unnamed_addr #0 align 2 {
.preheader:
  store ptr getelementptr inbounds inrange(-16, 56) (i8, ptr @_ZTVN6SoLoud19AudioSourceInstanceE, i64 16), ptr %0, align 8, !tbaa !5
  %1 = getelementptr inbounds i8, ptr %0, i64 104
  tail call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %2 = getelementptr inbounds i8, ptr %0, i64 152
  tail call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2)
  %3 = getelementptr inbounds i8, ptr %0, i64 200
  tail call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 248
  tail call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 296
  tail call void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 0, ptr %6, align 8, !tbaa !8
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 0, ptr %7, align 8, !tbaa !15
  %8 = getelementptr inbounds i8, ptr %0, i64 20
  store <4 x float> <float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, ptr %8, align 4, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %0, i64 36
  store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, ptr %9, align 4, !tbaa !16
  %10 = getelementptr inbounds i8, ptr %0, i64 52
  %11 = getelementptr inbounds i8, ptr %0, i64 68
  store float 4.410000e+04, ptr %11, align 4, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %0, i64 76
  %13 = getelementptr inbounds i8, ptr %0, i64 88
  %14 = getelementptr inbounds i8, ptr %0, i64 380
  store i32 0, ptr %14, align 4, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %0, i64 344
  store i32 0, ptr %15, align 8, !tbaa !19
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %13, i8 0, i64 16, i1 false)
  store i32 1, ptr %16, align 8, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %0, i64 384
  store i32 -1, ptr %17, align 8, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 0, ptr %18, align 4, !tbaa !22
  %19 = getelementptr inbounds i8, ptr %0, i64 488
  store double 0.000000e+00, ptr %19, align 8, !tbaa !23
  %20 = getelementptr inbounds i8, ptr %0, i64 392
  %21 = getelementptr inbounds i8, ptr %0, i64 348
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %21, i8 0, i64 32, i1 false), !tbaa !16
  store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 4.410000e+04>, ptr %10, align 4, !tbaa !16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %20, i8 0, i64 92, i1 false)
  store <2 x float> <float 1.000000e+00, float 1.000000e+00>, ptr %12, align 4, !tbaa !16
  ret void
}

declare void @_ZN6SoLoud5FaderC1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1

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

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

!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, !10, i64 8}
!9 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !10, i64 8, !10, i64 12, !10, i64 16, !12, i64 20, !11, i64 24, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !10, i64 72, !12, i64 76, !12, i64 80, !13, i64 88, !13, i64 96, !14, i64 104, !14, i64 152, !14, i64 200, !14, i64 248, !14, i64 296, !10, i64 344, !11, i64 348, !10, i64 380, !10, i64 384, !11, i64 392, !11, i64 456, !10, i64 472, !10, i64 476, !10, i64 480, !13, i64 488}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"float", !11, i64 0}
!13 = !{!"double", !11, i64 0}
!14 = !{!"_ZTSN6SoLoud5FaderE", !12, i64 0, !12, i64 4, !12, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !12, i64 40, !10, i64 44}
!15 = !{!9, !10, i64 16}
!16 = !{!12, !12, i64 0}
!17 = !{!9, !12, i64 68}
!18 = !{!9, !10, i64 380}
!19 = !{!9, !10, i64 344}
!20 = !{!9, !10, i64 72}
!21 = !{!9, !10, i64 384}
!22 = !{!9, !10, i64 12}
!23 = !{!9, !13, i64 488}


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