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

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.5" = type { i8 }
%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 }
%struct.AVCodecContext = type { ptr, i32, i32, ptr, i32, i32, ptr, ptr, ptr, i64, i32, i32, ptr, i32, %struct.AVRational, %struct.AVRational, %struct.AVRational, i32, i32, i32, i32, i32, i32, %struct.AVRational, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, float, float, float, float, float, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.AVChannelLayout, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, i32, float, float, i32, i32, i32, i32, i32, ptr, i64, i64, float, float, i32, i32, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, [8 x i64], i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i64, i32, i32, i64, ptr, i64, ptr, i32, ptr, i32 }
%struct.AVRational = type { i32, i32 }
%struct.AVChannelLayout = type { i32, i32, %union.anon.8, ptr }
%union.anon.8 = type { i64 }
%struct.AVFrame = type { [8 x ptr], [8 x i32], ptr, i32, i32, i32, i32, i32, i32, %struct.AVRational, i64, i64, %struct.AVRational, i32, ptr, i32, i32, i32, i32, i32, [8 x ptr], ptr, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i64, i64, ptr, i32, i32, ptr, ptr, i64, i64, i64, i64, ptr, %struct.AVChannelLayout, i64 }

@.str.14 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

; 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
declare dso_local noundef zeroext i1 @_ZN13FfmpegDecoder19InitializeResamplerEv(ptr noundef nonnull align 8 dereferenceable(106)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN13FfmpegDecoder25DrainResamplerToFifoQueueEv(ptr noundef nonnull align 8 dereferenceable(106)) #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN13FfmpegDecoder24ReadSendAndReceivePacketEP8AVPacket(ptr noundef nonnull align 8 dereferenceable(106) %0, ptr noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator.5", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.5", align 1
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #4
  store i8 0, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %16 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 5
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call i32 @avcodec_send_packet(ptr noundef %17, ptr noundef %18)
  store i32 %19, ptr %7, align 4, !tbaa !16
  br label %20

20:                                               ; preds = %126, %2
  %21 = load i32, ptr %7, align 4, !tbaa !16
  %22 = icmp sge i32 %21, 0
  br i1 %22, label %23, label %127

23:                                               ; preds = %20
  %24 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 6
  %25 = load ptr, ptr %24, align 8, !tbaa !17
  %26 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 5
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = getelementptr inbounds %struct.AVCodecContext, ptr %27, i32 0, i32 71
  %29 = load i32, ptr %28, align 4, !tbaa !18
  %30 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 5
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = getelementptr inbounds %struct.AVCodecContext, ptr %31, i32 0, i32 70
  %33 = load i32, ptr %32, align 8, !tbaa !37
  %34 = call noundef ptr @_ZN13FfmpegDecoder10AllocFrameEP7AVFrame14AVSampleFormatii(ptr noundef nonnull align 8 dereferenceable(106) %15, ptr noundef %25, i32 noundef %29, i32 noundef %33, i32 noundef -1)
  %35 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 6
  store ptr %34, ptr %35, align 8, !tbaa !17
  %36 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 5
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 6
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %40 = call i32 @avcodec_receive_frame(ptr noundef %37, ptr noundef %39)
  store i32 %40, ptr %7, align 4, !tbaa !16
  %41 = load i32, ptr %7, align 4, !tbaa !16
  %42 = icmp sge i32 %41, 0
  br i1 %42, label %43, label %126

43:                                               ; preds = %23
  %44 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 7
  %45 = load ptr, ptr %44, align 8, !tbaa !38
  %46 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 9
  %47 = load i32, ptr %46, align 8, !tbaa !39
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %49, label %52

49:                                               ; preds = %43
  %50 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 9
  %51 = load i32, ptr %50, align 8, !tbaa !39
  br label %55

52:                                               ; preds = %43
  %53 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 12
  %54 = load i32, ptr %53, align 8, !tbaa !40
  br label %55

55:                                               ; preds = %52, %49
  %56 = phi i32 [ %51, %49 ], [ %54, %52 ]
  %57 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 6
  %58 = load ptr, ptr %57, align 8, !tbaa !17
  %59 = getelementptr inbounds %struct.AVFrame, ptr %58, i32 0, i32 5
  %60 = load i32, ptr %59, align 8, !tbaa !41
  %61 = call noundef ptr @_ZN13FfmpegDecoder10AllocFrameEP7AVFrame14AVSampleFormatii(ptr noundef nonnull align 8 dereferenceable(106) %15, ptr noundef %45, i32 noundef 3, i32 noundef %56, i32 noundef %60)
  %62 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 7
  store ptr %61, ptr %62, align 8, !tbaa !38
  %63 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 8
  %64 = load ptr, ptr %63, align 8, !tbaa !44
  %65 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 7
  %66 = load ptr, ptr %65, align 8, !tbaa !38
  %67 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 6
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %69 = call i32 @swr_convert_frame(ptr noundef %64, ptr noundef %66, ptr noundef %68)
  store i32 %69, ptr %7, align 4, !tbaa !16
  %70 = load i32, ptr %7, align 4, !tbaa !16
  %71 = icmp slt i32 %70, 0
  br i1 %71, label %72, label %93

72:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef @.str.14, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %73 unwind label %84

73:                                               ; preds = %72
  %74 = load i32, ptr %7, align 4, !tbaa !16
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %74)
          to label %75 unwind label %88

75:                                               ; preds = %73
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  %76 = call noundef zeroext i1 @_ZN13FfmpegDecoder19InitializeResamplerEv(ptr noundef nonnull align 8 dereferenceable(106) %15)
  %77 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 8
  %78 = load ptr, ptr %77, align 8, !tbaa !44
  %79 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 7
  %80 = load ptr, ptr %79, align 8, !tbaa !38
  %81 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 6
  %82 = load ptr, ptr %81, align 8, !tbaa !17
  %83 = call i32 @swr_convert_frame(ptr noundef %78, ptr noundef %80, ptr noundef %82)
  store i32 %83, ptr %7, align 4, !tbaa !16
  br label %93

84:                                               ; preds = %72
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %10, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %11, align 4
  br label %92

88:                                               ; preds = %73
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %10, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  br label %92

92:                                               ; preds = %88, %84
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  br label %132

93:                                               ; preds = %75, %55
  %94 = load i32, ptr %7, align 4, !tbaa !16
  %95 = icmp sge i32 %94, 0
  br i1 %95, label %96, label %125

96:                                               ; preds = %93
  %97 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 3
  %98 = load ptr, ptr %97, align 8, !tbaa !45
  %99 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 7
  %100 = load ptr, ptr %99, align 8, !tbaa !38
  %101 = getelementptr inbounds %struct.AVFrame, ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !46
  %103 = getelementptr inbounds %class.FfmpegDecoder, ptr %15, i32 0, i32 7
  %104 = load ptr, ptr %103, align 8, !tbaa !38
  %105 = getelementptr inbounds %struct.AVFrame, ptr %104, i32 0, i32 5
  %106 = load i32, ptr %105, align 8, !tbaa !41
  %107 = call i32 @av_audio_fifo_write(ptr noundef %98, ptr noundef %102, i32 noundef %106)
  store i32 %107, ptr %7, align 4, !tbaa !16
  %108 = load i32, ptr %7, align 4, !tbaa !16
  %109 = icmp slt i32 %108, 0
  br i1 %109, label %110, label %123

110:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.15, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %111 unwind label %114

111:                                              ; preds = %110
  %112 = load i32, ptr %7, align 4, !tbaa !16
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef %112)
          to label %113 unwind label %118

113:                                              ; preds = %111
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %130

114:                                              ; preds = %110
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %10, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %11, align 4
  br label %122

118:                                              ; preds = %111
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %10, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  br label %122

122:                                              ; preds = %118, %114
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  br label %132

123:                                              ; preds = %96
  %124 = call noundef zeroext i1 @_ZN13FfmpegDecoder25DrainResamplerToFifoQueueEv(ptr noundef nonnull align 8 dereferenceable(106) %15)
  store i8 1, ptr %6, align 1, !tbaa !9
  br label %125

125:                                              ; preds = %123, %93
  br label %126

126:                                              ; preds = %125, %23
  br label %20, !llvm.loop !47

127:                                              ; preds = %20
  %128 = load i8, ptr %6, align 1, !tbaa !9, !range !49, !noundef !50
  %129 = trunc i8 %128 to i1
  store i1 %129, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %130

130:                                              ; preds = %127, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  %131 = load i1, ptr %3, align 1
  ret i1 %131

132:                                              ; preds = %122, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr %10, align 8
  %135 = load i32, ptr %11, align 4
  %136 = insertvalue { ptr, i32 } poison, ptr %134, 0
  %137 = insertvalue { ptr, i32 } %136, i32 %135, 1
  resume { ptr, i32 } %137
}

declare i32 @avcodec_send_packet(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN13FfmpegDecoder10AllocFrameEP7AVFrame14AVSampleFormatii(ptr noundef nonnull align 8 dereferenceable(106), ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1 align 2

declare i32 @avcodec_receive_frame(ptr noundef, ptr noundef) #3

declare i32 @swr_convert_frame(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @av_audio_fifo_write(ptr noundef, ptr noundef, i32 noundef) #3

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 = { 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 #3 = { "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 #4 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !6, i64 40}
!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, !10, i64 76, !14, i64 80, !14, i64 84, !14, i64 88, !14, i64 92, !15, i64 96, !10, i64 104, !10, i64 105}
!13 = !{!"_ZTSN5musik4core3sdk8IDecoderE"}
!14 = !{!"int", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!14, !14, i64 0}
!17 = !{!12, !6, i64 48}
!18 = !{!19, !32, i64 348}
!19 = !{!"_ZTS14AVCodecContext", !6, i64 0, !14, i64 8, !20, i64 12, !6, i64 16, !21, i64 24, !14, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !22, i64 56, !14, i64 64, !14, i64 68, !6, i64 72, !14, i64 80, !23, i64 84, !23, i64 92, !23, i64 100, !14, i64 108, !14, i64 112, !14, i64 116, !14, i64 120, !14, i64 124, !14, i64 128, !23, i64 132, !24, i64 140, !24, i64 144, !25, i64 148, !26, i64 152, !27, i64 156, !28, i64 160, !29, i64 164, !30, i64 168, !14, i64 172, !14, i64 176, !14, i64 180, !6, i64 184, !6, i64 192, !14, i64 200, !31, i64 204, !31, i64 208, !31, i64 212, !31, i64 216, !31, i64 220, !31, i64 224, !31, i64 228, !31, i64 232, !31, i64 236, !14, i64 240, !14, i64 244, !14, i64 248, !14, i64 252, !14, i64 256, !14, i64 260, !14, i64 264, !14, i64 268, !14, i64 272, !14, i64 276, !14, i64 280, !14, i64 284, !6, i64 288, !6, i64 296, !6, i64 304, !14, i64 312, !14, i64 316, !14, i64 320, !14, i64 324, !14, i64 328, !14, i64 332, !14, i64 336, !14, i64 340, !14, i64 344, !32, i64 348, !33, i64 352, !14, i64 376, !14, i64 380, !14, i64 384, !35, i64 388, !32, i64 392, !14, i64 396, !14, i64 400, !14, i64 404, !6, i64 408, !14, i64 416, !14, i64 420, !14, i64 424, !31, i64 428, !31, i64 432, !14, i64 436, !14, i64 440, !14, i64 444, !14, i64 448, !14, i64 452, !6, i64 456, !22, i64 464, !22, i64 472, !31, i64 480, !31, i64 484, !14, i64 488, !14, i64 492, !6, i64 496, !6, i64 504, !14, i64 512, !14, i64 516, !14, i64 520, !14, i64 524, !14, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !14, i64 568, !14, i64 572, !7, i64 576, !14, i64 640, !14, i64 644, !14, i64 648, !14, i64 652, !14, i64 656, !14, i64 660, !14, i64 664, !6, i64 672, !6, i64 680, !14, i64 688, !14, i64 692, !14, i64 696, !36, i64 700, !36, i64 704, !36, i64 708, !14, i64 712, !14, i64 716, !14, i64 720, !14, i64 724, !6, i64 728, !6, i64 736, !14, i64 744, !14, i64 748, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !14, i64 784, !14, i64 788, !22, i64 792, !14, i64 800, !14, i64 804, !22, i64 808, !6, i64 816, !22, i64 824, !6, i64 832, !14, i64 840, !6, i64 848, !14, i64 856}
!20 = !{!"_ZTS11AVMediaType", !7, i64 0}
!21 = !{!"_ZTS9AVCodecID", !7, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTS10AVRational", !14, i64 0, !14, i64 4}
!24 = !{!"_ZTS13AVPixelFormat", !7, i64 0}
!25 = !{!"_ZTS16AVColorPrimaries", !7, i64 0}
!26 = !{!"_ZTS29AVColorTransferCharacteristic", !7, i64 0}
!27 = !{!"_ZTS12AVColorSpace", !7, i64 0}
!28 = !{!"_ZTS12AVColorRange", !7, i64 0}
!29 = !{!"_ZTS16AVChromaLocation", !7, i64 0}
!30 = !{!"_ZTS12AVFieldOrder", !7, i64 0}
!31 = !{!"float", !7, i64 0}
!32 = !{!"_ZTS14AVSampleFormat", !7, i64 0}
!33 = !{!"_ZTS15AVChannelLayout", !34, i64 0, !14, i64 4, !7, i64 8, !6, i64 16}
!34 = !{!"_ZTS14AVChannelOrder", !7, i64 0}
!35 = !{!"_ZTS18AVAudioServiceType", !7, i64 0}
!36 = !{!"_ZTS9AVDiscard", !7, i64 0}
!37 = !{!19, !14, i64 344}
!38 = !{!12, !6, i64 56}
!39 = !{!12, !14, i64 72}
!40 = !{!12, !14, i64 80}
!41 = !{!42, !14, i64 112}
!42 = !{!"_ZTS7AVFrame", !7, i64 0, !7, i64 64, !6, i64 96, !14, i64 104, !14, i64 108, !14, i64 112, !14, i64 116, !14, i64 120, !43, i64 124, !23, i64 128, !22, i64 136, !22, i64 144, !23, i64 152, !14, i64 160, !6, i64 168, !14, i64 176, !14, i64 180, !14, i64 184, !14, i64 188, !14, i64 192, !7, i64 200, !6, i64 264, !14, i64 272, !6, i64 280, !14, i64 288, !14, i64 292, !28, i64 296, !25, i64 300, !26, i64 304, !27, i64 308, !29, i64 312, !22, i64 320, !22, i64 328, !6, i64 336, !14, i64 344, !14, i64 348, !6, i64 352, !6, i64 360, !22, i64 368, !22, i64 376, !22, i64 384, !22, i64 392, !6, i64 400, !33, i64 408, !22, i64 432}
!43 = !{!"_ZTS13AVPictureType", !7, i64 0}
!44 = !{!12, !6, i64 64}
!45 = !{!12, !6, i64 24}
!46 = !{!42, !6, i64 96}
!47 = distinct !{!47, !48}
!48 = !{!"llvm.loop.mustprogress"}
!49 = !{i8 0, i8 2}
!50 = !{}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.5" = type { i8 }

@.str.14 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN13FfmpegDecoder19InitializeResamplerEv(ptr noundef nonnull align 8 dereferenceable(106)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN13FfmpegDecoder25DrainResamplerToFifoQueueEv(ptr noundef nonnull align 8 dereferenceable(106)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN13FfmpegDecoder24ReadSendAndReceivePacketEP8AVPacket(ptr noundef nonnull align 8 dereferenceable(106) %0, ptr noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator.5", align 1
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator.5", align 1
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call i32 @avcodec_send_packet(ptr noundef %8, ptr noundef %1)
  %10 = icmp sgt i32 %9, -1
  br i1 %10, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %2
  %11 = getelementptr inbounds i8, ptr %0, i64 48
  %12 = getelementptr inbounds i8, ptr %0, i64 56
  %13 = getelementptr inbounds i8, ptr %0, i64 72
  %14 = getelementptr inbounds i8, ptr %0, i64 80
  %15 = getelementptr inbounds i8, ptr %0, i64 64
  %16 = getelementptr inbounds i8, ptr %0, i64 24
  %17 = load ptr, ptr %11, align 8, !tbaa !14
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 348
  %20 = load i32, ptr %19, align 4, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %18, i64 344
  %22 = load i32, ptr %21, align 8, !tbaa !34
  %23 = tail call noundef ptr @_ZN13FfmpegDecoder10AllocFrameEP7AVFrame14AVSampleFormatii(ptr noundef nonnull align 8 dereferenceable(106) %0, ptr noundef %17, i32 noundef %20, i32 noundef %22, i32 noundef -1)
  store ptr %23, ptr %11, align 8, !tbaa !14
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = tail call i32 @avcodec_receive_frame(ptr noundef %24, ptr noundef %23)
  %26 = icmp sgt i32 %25, -1
  br i1 %26, label %27, label %.loopexit

27:                                               ; preds = %.lr.ph
  %28 = load ptr, ptr %12, align 8, !tbaa !35
  %29 = load i32, ptr %13, align 8, !tbaa !36
  %30 = icmp sgt i32 %29, 0
  %31 = load i32, ptr %14, align 8
  %32 = select i1 %30, i32 %29, i32 %31
  %33 = load ptr, ptr %11, align 8, !tbaa !14
  %34 = getelementptr inbounds i8, ptr %33, i64 112
  %35 = load i32, ptr %34, align 8, !tbaa !37
  %36 = tail call noundef ptr @_ZN13FfmpegDecoder10AllocFrameEP7AVFrame14AVSampleFormatii(ptr noundef nonnull align 8 dereferenceable(106) %0, ptr noundef %28, i32 noundef 3, i32 noundef %32, i32 noundef %35)
  store ptr %36, ptr %12, align 8, !tbaa !35
  %37 = load ptr, ptr %15, align 8, !tbaa !40
  %38 = load ptr, ptr %11, align 8, !tbaa !14
  %39 = tail call i32 @swr_convert_frame(ptr noundef %37, ptr noundef %36, ptr noundef %38)
  %40 = icmp slt i32 %39, 0
  br i1 %40, label %41, label %.thread.peel

41:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.14, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %42 unwind label %.loopexit.split-lp

42:                                               ; preds = %41
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %39)
          to label %43 unwind label %.loopexit.split-lp52

43:                                               ; preds = %42
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  %44 = call noundef zeroext i1 @_ZN13FfmpegDecoder19InitializeResamplerEv(ptr noundef nonnull align 8 dereferenceable(106) %0)
  %45 = load ptr, ptr %15, align 8, !tbaa !40
  %46 = load ptr, ptr %12, align 8, !tbaa !35
  %47 = load ptr, ptr %11, align 8, !tbaa !14
  %48 = call i32 @swr_convert_frame(ptr noundef %45, ptr noundef %46, ptr noundef %47)
  %49 = icmp sgt i32 %48, -1
  br i1 %49, label %.thread.peel, label %.loopexit

.thread.peel:                                     ; preds = %43, %27
  %50 = load ptr, ptr %16, align 8, !tbaa !41
  %51 = load ptr, ptr %12, align 8, !tbaa !35
  %52 = getelementptr inbounds i8, ptr %51, i64 96
  %53 = load ptr, ptr %52, align 8, !tbaa !42
  %54 = getelementptr inbounds i8, ptr %51, i64 112
  %55 = load i32, ptr %54, align 8, !tbaa !37
  %56 = call i32 @av_audio_fifo_write(ptr noundef %50, ptr noundef %53, i32 noundef %55)
  %57 = icmp slt i32 %56, 0
  br i1 %57, label %.loopexit56, label %.peel.next

.peel.next:                                       ; preds = %.thread.peel
  %58 = call noundef zeroext i1 @_ZN13FfmpegDecoder25DrainResamplerToFifoQueueEv(ptr noundef nonnull align 8 dereferenceable(106) %0)
  br label %59

59:                                               ; preds = %110, %.peel.next
  %60 = load ptr, ptr %11, align 8, !tbaa !14
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 348
  %63 = load i32, ptr %62, align 4, !tbaa !15
  %64 = getelementptr inbounds i8, ptr %61, i64 344
  %65 = load i32, ptr %64, align 8, !tbaa !34
  %66 = call noundef ptr @_ZN13FfmpegDecoder10AllocFrameEP7AVFrame14AVSampleFormatii(ptr noundef nonnull align 8 dereferenceable(106) %0, ptr noundef %60, i32 noundef %63, i32 noundef %65, i32 noundef -1)
  store ptr %66, ptr %11, align 8, !tbaa !14
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = call i32 @avcodec_receive_frame(ptr noundef %67, ptr noundef %66)
  %69 = icmp sgt i32 %68, -1
  br i1 %69, label %70, label %.loopexit

70:                                               ; preds = %59
  %71 = load ptr, ptr %12, align 8, !tbaa !35
  %72 = load i32, ptr %13, align 8, !tbaa !36
  %73 = icmp sgt i32 %72, 0
  %74 = load i32, ptr %14, align 8
  %75 = select i1 %73, i32 %72, i32 %74
  %76 = load ptr, ptr %11, align 8, !tbaa !14
  %77 = getelementptr inbounds i8, ptr %76, i64 112
  %78 = load i32, ptr %77, align 8, !tbaa !37
  %79 = call noundef ptr @_ZN13FfmpegDecoder10AllocFrameEP7AVFrame14AVSampleFormatii(ptr noundef nonnull align 8 dereferenceable(106) %0, ptr noundef %71, i32 noundef 3, i32 noundef %75, i32 noundef %78)
  store ptr %79, ptr %12, align 8, !tbaa !35
  %80 = load ptr, ptr %15, align 8, !tbaa !40
  %81 = load ptr, ptr %11, align 8, !tbaa !14
  %82 = call i32 @swr_convert_frame(ptr noundef %80, ptr noundef %79, ptr noundef %81)
  %83 = icmp slt i32 %82, 0
  br i1 %83, label %84, label %.thread

84:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.14, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %85 unwind label %.loopexit50

85:                                               ; preds = %84
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %82)
          to label %88 unwind label %.loopexit51

.loopexit50:                                      ; preds = %84
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %87

.loopexit.split-lp:                               ; preds = %41
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %87

.loopexit51:                                      ; preds = %85
  %lpad.loopexit53 = landingpad { ptr, i32 }
          cleanup
  br label %86

.loopexit.split-lp52:                             ; preds = %42
  %lpad.loopexit.split-lp54 = landingpad { ptr, i32 }
          cleanup
  br label %86

86:                                               ; preds = %.loopexit.split-lp52, %.loopexit51
  %lpad.phi55 = phi { ptr, i32 } [ %lpad.loopexit53, %.loopexit51 ], [ %lpad.loopexit.split-lp54, %.loopexit.split-lp52 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  br label %87

87:                                               ; preds = %.loopexit50, %.loopexit.split-lp, %86
  %.pn = phi { ptr, i32 } [ %lpad.phi55, %86 ], [ %lpad.loopexit, %.loopexit50 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  br label %112

88:                                               ; preds = %85
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  %89 = call noundef zeroext i1 @_ZN13FfmpegDecoder19InitializeResamplerEv(ptr noundef nonnull align 8 dereferenceable(106) %0)
  %90 = load ptr, ptr %15, align 8, !tbaa !40
  %91 = load ptr, ptr %12, align 8, !tbaa !35
  %92 = load ptr, ptr %11, align 8, !tbaa !14
  %93 = call i32 @swr_convert_frame(ptr noundef %90, ptr noundef %91, ptr noundef %92)
  %94 = icmp sgt i32 %93, -1
  br i1 %94, label %.thread, label %.loopexit

.thread:                                          ; preds = %70, %88
  %95 = load ptr, ptr %16, align 8, !tbaa !41
  %96 = load ptr, ptr %12, align 8, !tbaa !35
  %97 = getelementptr inbounds i8, ptr %96, i64 96
  %98 = load ptr, ptr %97, align 8, !tbaa !42
  %99 = getelementptr inbounds i8, ptr %96, i64 112
  %100 = load i32, ptr %99, align 8, !tbaa !37
  %101 = call i32 @av_audio_fifo_write(ptr noundef %95, ptr noundef %98, i32 noundef %100)
  %102 = icmp slt i32 %101, 0
  br i1 %102, label %.loopexit56, label %110

.loopexit56:                                      ; preds = %.thread, %.thread.peel
  %.lcssa = phi i32 [ %56, %.thread.peel ], [ %101, %.thread ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.15, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %103 unwind label %105

103:                                              ; preds = %.loopexit56
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %.lcssa)
          to label %104 unwind label %107

104:                                              ; preds = %103
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  br label %.loopexit

105:                                              ; preds = %.loopexit56
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %109

107:                                              ; preds = %103
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  br label %109

109:                                              ; preds = %107, %105
  %.pn28 = phi { ptr, i32 } [ %108, %107 ], [ %106, %105 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  br label %112

110:                                              ; preds = %.thread
  %111 = call noundef zeroext i1 @_ZN13FfmpegDecoder25DrainResamplerToFifoQueueEv(ptr noundef nonnull align 8 dereferenceable(106) %0)
  br label %59, !llvm.loop !43

.loopexit:                                        ; preds = %.lr.ph, %43, %59, %88, %2, %104
  %.020 = phi i1 [ false, %104 ], [ false, %2 ], [ false, %.lr.ph ], [ false, %43 ], [ true, %59 ], [ true, %88 ]
  ret i1 %.020

112:                                              ; preds = %109, %87
  %.pn28.pn = phi { ptr, i32 } [ %.pn28, %109 ], [ %.pn, %87 ]
  resume { ptr, i32 } %.pn28.pn
}

declare i32 @avcodec_send_packet(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN13FfmpegDecoder10AllocFrameEP7AVFrame14AVSampleFormatii(ptr noundef nonnull align 8 dereferenceable(106), ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

declare i32 @avcodec_receive_frame(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @swr_convert_frame(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @av_audio_fifo_write(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress 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 = { 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 #3 = { "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 #4 = { 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, !8, i64 40}
!6 = !{!"_ZTS13FfmpegDecoder", !7, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !11, i64 72, !12, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !13, i64 96, !12, i64 104, !12, i64 105}
!7 = !{!"_ZTSN5musik4core3sdk8IDecoderE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"double", !9, i64 0}
!14 = !{!6, !8, i64 48}
!15 = !{!16, !29, i64 348}
!16 = !{!"_ZTS14AVCodecContext", !8, i64 0, !11, i64 8, !17, i64 12, !8, i64 16, !18, i64 24, !11, i64 28, !8, i64 32, !8, i64 40, !8, i64 48, !19, i64 56, !11, i64 64, !11, i64 68, !8, i64 72, !11, i64 80, !20, i64 84, !20, i64 92, !20, i64 100, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !20, i64 132, !21, i64 140, !21, i64 144, !22, i64 148, !23, i64 152, !24, i64 156, !25, i64 160, !26, i64 164, !27, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !8, i64 184, !8, i64 192, !11, i64 200, !28, i64 204, !28, i64 208, !28, i64 212, !28, i64 216, !28, i64 220, !28, i64 224, !28, i64 228, !28, i64 232, !28, i64 236, !11, i64 240, !11, i64 244, !11, i64 248, !11, i64 252, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !11, i64 284, !8, i64 288, !8, i64 296, !8, i64 304, !11, i64 312, !11, i64 316, !11, i64 320, !11, i64 324, !11, i64 328, !11, i64 332, !11, i64 336, !11, i64 340, !11, i64 344, !29, i64 348, !30, i64 352, !11, i64 376, !11, i64 380, !11, i64 384, !32, i64 388, !29, i64 392, !11, i64 396, !11, i64 400, !11, i64 404, !8, i64 408, !11, i64 416, !11, i64 420, !11, i64 424, !28, i64 428, !28, i64 432, !11, i64 436, !11, i64 440, !11, i64 444, !11, i64 448, !11, i64 452, !8, i64 456, !19, i64 464, !19, i64 472, !28, i64 480, !28, i64 484, !11, i64 488, !11, i64 492, !8, i64 496, !8, i64 504, !11, i64 512, !11, i64 516, !11, i64 520, !11, i64 524, !11, i64 528, !8, i64 536, !8, i64 544, !8, i64 552, !8, i64 560, !11, i64 568, !11, i64 572, !9, i64 576, !11, i64 640, !11, i64 644, !11, i64 648, !11, i64 652, !11, i64 656, !11, i64 660, !11, i64 664, !8, i64 672, !8, i64 680, !11, i64 688, !11, i64 692, !11, i64 696, !33, i64 700, !33, i64 704, !33, i64 708, !11, i64 712, !11, i64 716, !11, i64 720, !11, i64 724, !8, i64 728, !8, i64 736, !11, i64 744, !11, i64 748, !8, i64 752, !8, i64 760, !8, i64 768, !8, i64 776, !11, i64 784, !11, i64 788, !19, i64 792, !11, i64 800, !11, i64 804, !19, i64 808, !8, i64 816, !19, i64 824, !8, i64 832, !11, i64 840, !8, i64 848, !11, i64 856}
!17 = !{!"_ZTS11AVMediaType", !9, i64 0}
!18 = !{!"_ZTS9AVCodecID", !9, i64 0}
!19 = !{!"long", !9, i64 0}
!20 = !{!"_ZTS10AVRational", !11, i64 0, !11, i64 4}
!21 = !{!"_ZTS13AVPixelFormat", !9, i64 0}
!22 = !{!"_ZTS16AVColorPrimaries", !9, i64 0}
!23 = !{!"_ZTS29AVColorTransferCharacteristic", !9, i64 0}
!24 = !{!"_ZTS12AVColorSpace", !9, i64 0}
!25 = !{!"_ZTS12AVColorRange", !9, i64 0}
!26 = !{!"_ZTS16AVChromaLocation", !9, i64 0}
!27 = !{!"_ZTS12AVFieldOrder", !9, i64 0}
!28 = !{!"float", !9, i64 0}
!29 = !{!"_ZTS14AVSampleFormat", !9, i64 0}
!30 = !{!"_ZTS15AVChannelLayout", !31, i64 0, !11, i64 4, !9, i64 8, !8, i64 16}
!31 = !{!"_ZTS14AVChannelOrder", !9, i64 0}
!32 = !{!"_ZTS18AVAudioServiceType", !9, i64 0}
!33 = !{!"_ZTS9AVDiscard", !9, i64 0}
!34 = !{!16, !11, i64 344}
!35 = !{!6, !8, i64 56}
!36 = !{!6, !11, i64 72}
!37 = !{!38, !11, i64 112}
!38 = !{!"_ZTS7AVFrame", !9, i64 0, !9, i64 64, !8, i64 96, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !39, i64 124, !20, i64 128, !19, i64 136, !19, i64 144, !20, i64 152, !11, i64 160, !8, i64 168, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !9, i64 200, !8, i64 264, !11, i64 272, !8, i64 280, !11, i64 288, !11, i64 292, !25, i64 296, !22, i64 300, !23, i64 304, !24, i64 308, !26, i64 312, !19, i64 320, !19, i64 328, !8, i64 336, !11, i64 344, !11, i64 348, !8, i64 352, !8, i64 360, !19, i64 368, !19, i64 376, !19, i64 384, !19, i64 392, !8, i64 400, !30, i64 408, !19, i64 432}
!39 = !{!"_ZTS13AVPictureType", !9, i64 0}
!40 = !{!6, !8, i64 64}
!41 = !{!6, !8, i64 24}
!42 = !{!38, !8, i64 96}
!43 = distinct !{!43, !44, !45}
!44 = !{!"llvm.loop.mustprogress"}
!45 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass