; LLVM IR from clangen/musikcube :: src/plugins/ffmpegdecoder/FfmpegDecoder.ll (ZN13FfmpegDecoderC2Ev)

; 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.FfmpegDecoder = type <{ %"class.musik::core::sdk::IDecoder", ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i8, [3 x i8], i32, i32, i32, i32, double, i8, i8, [6 x i8] }>
%"class.musik::core::sdk::IDecoder" = type { ptr }

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN13FfmpegDecoderC2Ev(ptr noundef nonnull align 8 dereferenceable(106) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  call void @_ZN5musik4core3sdk8IDecoderC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #2
  store ptr getelementptr inbounds inrange(-16, 56) ({ [9 x ptr] }, ptr @_ZTV13FfmpegDecoder, i32 0, i32 0, i32 2), ptr %3, align 8, !tbaa !9
  %4 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 9
  store i32 -1, ptr %4, align 8, !tbaa !11
  %5 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 10
  store i8 0, ptr %5, align 4, !tbaa !17
  %6 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 17
  store i8 0, ptr %6, align 8, !tbaa !18
  %7 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 18
  store i8 0, ptr %7, align 1, !tbaa !19
  %8 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 1
  store ptr null, ptr %8, align 8, !tbaa !20
  %9 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 14
  store i32 -1, ptr %9, align 8, !tbaa !21
  %10 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 16
  store double -1.000000e+00, ptr %10, align 8, !tbaa !22
  %11 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 2
  store ptr null, ptr %11, align 8, !tbaa !23
  %12 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 4
  store ptr null, ptr %12, align 8, !tbaa !24
  %13 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 5
  store ptr null, ptr %13, align 8, !tbaa !25
  %14 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 6
  store ptr null, ptr %14, align 8, !tbaa !26
  %15 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 7
  store ptr null, ptr %15, align 8, !tbaa !27
  %16 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 8
  store ptr null, ptr %16, align 8, !tbaa !28
  %17 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 3
  store ptr null, ptr %17, align 8, !tbaa !29
  %18 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 9
  store i32 -1, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 12
  store i32 0, ptr %19, align 8, !tbaa !30
  %20 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 15
  store i32 0, ptr %20, align 4, !tbaa !31
  %21 = getelementptr inbounds %class.FfmpegDecoder, ptr %3, i32 0, i32 13
  store i32 0, ptr %21, align 4, !tbaa !32
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5musik4core3sdk8IDecoderC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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 = { inlinehint 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, !14, i64 72}
!12 = !{!"_ZTS13FfmpegDecoder", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !14, i64 72, !15, i64 76, !14, i64 80, !14, i64 84, !14, i64 88, !14, i64 92, !16, i64 96, !15, i64 104, !15, i64 105}
!13 = !{!"_ZTSN5musik4core3sdk8IDecoderE"}
!14 = !{!"int", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!12, !15, i64 76}
!18 = !{!12, !15, i64 104}
!19 = !{!12, !15, i64 105}
!20 = !{!12, !6, i64 8}
!21 = !{!12, !14, i64 88}
!22 = !{!12, !16, i64 96}
!23 = !{!12, !6, i64 16}
!24 = !{!12, !6, i64 32}
!25 = !{!12, !6, i64 40}
!26 = !{!12, !6, i64 48}
!27 = !{!12, !6, i64 56}
!28 = !{!12, !6, i64 64}
!29 = !{!12, !6, i64 24}
!30 = !{!12, !14, i64 80}
!31 = !{!12, !14, i64 92}
!32 = !{!12, !14, i64 84}


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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN13FfmpegDecoderC2Ev(ptr noundef nonnull align 8 dereferenceable(106) %0) unnamed_addr #0 align 2 {
  tail call void @_ZN5musik4core3sdk8IDecoderC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #3
  store ptr getelementptr inbounds inrange(-16, 56) (i8, ptr @_ZTV13FfmpegDecoder, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 72
  %3 = getelementptr inbounds i8, ptr %0, i64 76
  store i8 0, ptr %3, align 4, !tbaa !8
  %4 = getelementptr inbounds i8, ptr %0, i64 104
  store i8 0, ptr %4, align 8, !tbaa !16
  %5 = getelementptr inbounds i8, ptr %0, i64 105
  store i8 0, ptr %5, align 1, !tbaa !17
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr null, ptr %6, align 8, !tbaa !18
  %7 = getelementptr inbounds i8, ptr %0, i64 96
  store double -1.000000e+00, ptr %7, align 8, !tbaa !19
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %8, i8 0, i64 56, i1 false)
  store i32 -1, ptr %2, align 8, !tbaa !20
  %9 = getelementptr inbounds i8, ptr %0, i64 80
  store <4 x i32> <i32 0, i32 0, i32 -1, i32 0>, ptr %9, align 8, !tbaa !21
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5musik4core3sdk8IDecoderC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; 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 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 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !14, i64 76}
!9 = !{!"_ZTS13FfmpegDecoder", !10, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !13, i64 72, !14, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !15, i64 96, !14, i64 104, !14, i64 105}
!10 = !{!"_ZTSN5musik4core3sdk8IDecoderE"}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"int", !12, i64 0}
!14 = !{!"bool", !12, i64 0}
!15 = !{!"double", !12, i64 0}
!16 = !{!9, !14, i64 104}
!17 = !{!9, !14, i64 105}
!18 = !{!9, !11, i64 8}
!19 = !{!9, !15, i64 96}
!20 = !{!9, !13, i64 72}
!21 = !{!13, !13, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,InstCombinePass,MemCpyOptPass,SLPVectorizerPass,SROAPass,TailCallElimPass