; LLVM IR from clangen/musikcube :: src/plugins/stockencoders/FfmpegEncoder.ll (ZN13FfmpegEncoder15OpenOutputCodecEmmm)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, AVCodecID>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, AVCodecID>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, AVCodecID>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, AVCodecID>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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.0" = type { i8 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%class.FfmpegEncoder = type { %"class.musik::core::sdk::IBlockingEncoder", i8, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, %"class.std::__cxx11::basic_string", i32, i32 }
%"class.musik::core::sdk::IBlockingEncoder" = type { %"class.musik::core::sdk::IEncoder" }
%"class.musik::core::sdk::IEncoder" = type { ptr }
%struct.AVFormatContext = type { ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, ptr, i32, ptr, ptr, i64, i64, i64, i32, i32, i32, i64, i64, ptr, i32, i32, ptr, i32, i32, i32, i32, ptr, i64, i32, i32, %struct.AVIOInterruptCB, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, i32, ptr, ptr, i64, ptr, ptr, ptr }
%struct.AVIOInterruptCB = type { ptr, ptr }
%"struct.std::pair" = type <{ %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%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.6, ptr }
%union.anon.6 = type { i64 }
%struct.AVStream = type { ptr, i32, i32, ptr, ptr, %struct.AVRational, i64, i64, i64, i32, i32, %struct.AVRational, ptr, %struct.AVRational, %struct.AVPacket, ptr, i32, i32, %struct.AVRational, i32 }
%struct.AVPacket = type { ptr, i64, i64, ptr, i32, i32, i32, ptr, i32, i64, i64, ptr, ptr, %struct.AVRational }
%struct.AVOutputFormat = type { ptr, ptr, ptr, ptr, i32, i32, i32, i32, ptr, ptr }

@_ZL13formatToCodecB5cxx11 = external hidden global %"class.std::map", align 8
@.str.12 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN13FfmpegEncoder15OpenOutputCodecEmmm(ptr noundef nonnull align 8 dereferenceable(152) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator.0", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator.0", align 1
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator.0", align 1
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.std::__cxx11::basic_string", align 8
  %25 = alloca %"class.std::allocator.0", align 1
  %26 = alloca ptr, align 8
  %27 = alloca %"class.std::__cxx11::basic_string", align 8
  %28 = alloca %"class.std::allocator.0", align 1
  %29 = alloca %"class.std::__cxx11::basic_string", align 8
  %30 = alloca %"class.std::allocator.0", align 1
  %31 = alloca %"class.std::__cxx11::basic_string", align 8
  %32 = alloca %"class.std::allocator.0", align 1
  %33 = alloca i32, align 4
  %34 = alloca %"class.std::__cxx11::basic_string", align 8
  %35 = alloca %"class.std::allocator.0", align 1
  %36 = alloca %"class.std::__cxx11::basic_string", align 8
  %37 = alloca %"class.std::allocator.0", align 1
  %38 = alloca %"class.std::__cxx11::basic_string", align 8
  %39 = alloca %"class.std::allocator.0", align 1
  %40 = alloca %"class.std::__cxx11::basic_string", align 8
  %41 = alloca %"class.std::allocator.0", align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !9
  store i64 %3, ptr %9, align 8, !tbaa !9
  %42 = load ptr, ptr %6, align 8
  %43 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 8
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = icmp ne ptr %44, null
  br i1 %45, label %58, label %46

46:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef @.str.12, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %47 unwind label %49

47:                                               ; preds = %46
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %48 unwind label %53

48:                                               ; preds = %47
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  store i1 false, ptr %5, align 1
  br label %394

49:                                               ; preds = %46
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %12, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %13, align 4
  br label %57

53:                                               ; preds = %47
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %12, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  br label %57

57:                                               ; preds = %53, %49
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  br label %396

58:                                               ; preds = %4
  %59 = call ptr @avformat_alloc_context()
  %60 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 7
  store ptr %59, ptr %60, align 8, !tbaa !19
  %61 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 7
  %62 = load ptr, ptr %61, align 8, !tbaa !19
  %63 = icmp ne ptr %62, null
  br i1 %63, label %76, label %64

64:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %65 unwind label %67

65:                                               ; preds = %64
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %66 unwind label %71

66:                                               ; preds = %65
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #4
  store i1 false, ptr %5, align 1
  br label %394

67:                                               ; preds = %64
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %12, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %13, align 4
  br label %75

71:                                               ; preds = %65
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %12, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  br label %75

75:                                               ; preds = %71, %67
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #4
  br label %396

76:                                               ; preds = %58
  %77 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 14
  %78 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %77) #4
  %79 = icmp ne i64 %78, 0
  br i1 %79, label %87, label %80

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #4
  %81 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 14
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %16, ptr noundef @.str.14, ptr noundef nonnull align 8 dereferenceable(32) %81)
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %82 unwind label %83

82:                                               ; preds = %80
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #4
  store i1 false, ptr %5, align 1
  br label %394

83:                                               ; preds = %80
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %12, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #4
  br label %396

87:                                               ; preds = %76
  %88 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 14
  %89 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %88, i64 noundef 0)
  %90 = load i8, ptr %89, align 1, !tbaa !20
  %91 = sext i8 %90 to i32
  %92 = icmp eq i32 %91, 46
  br i1 %92, label %93, label %105

93:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #4
  %94 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 14
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %17, ptr noundef @.str.15, ptr noundef nonnull align 8 dereferenceable(32) %94)
  %95 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  %96 = invoke ptr @av_guess_format(ptr noundef null, ptr noundef %95, ptr noundef null)
          to label %97 unwind label %101

97:                                               ; preds = %93
  %98 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 7
  %99 = load ptr, ptr %98, align 8, !tbaa !19
  %100 = getelementptr inbounds %struct.AVFormatContext, ptr %99, i32 0, i32 2
  store ptr %96, ptr %100, align 8, !tbaa !21
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #4
  br label %105

101:                                              ; preds = %93
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %12, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #4
  br label %396

105:                                              ; preds = %97, %87
  %106 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 7
  %107 = load ptr, ptr %106, align 8, !tbaa !19
  %108 = getelementptr inbounds %struct.AVFormatContext, ptr %107, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !21
  %110 = icmp ne ptr %109, null
  br i1 %110, label %118, label %111

111:                                              ; preds = %105
  %112 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 14
  %113 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %112) #4
  %114 = call ptr @av_guess_format(ptr noundef null, ptr noundef null, ptr noundef %113)
  %115 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 7
  %116 = load ptr, ptr %115, align 8, !tbaa !19
  %117 = getelementptr inbounds %struct.AVFormatContext, ptr %116, i32 0, i32 2
  store ptr %114, ptr %117, align 8, !tbaa !21
  br label %118

118:                                              ; preds = %111, %105
  %119 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 7
  %120 = load ptr, ptr %119, align 8, !tbaa !19
  %121 = getelementptr inbounds %struct.AVFormatContext, ptr %120, i32 0, i32 2
  %122 = load ptr, ptr %121, align 8, !tbaa !21
  %123 = icmp ne ptr %122, null
  br i1 %123, label %136, label %124

124:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef @.str.16, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %125 unwind label %127

125:                                              ; preds = %124
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %126 unwind label %131

126:                                              ; preds = %125
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #4
  store i1 false, ptr %5, align 1
  br label %394

127:                                              ; preds = %124
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %12, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %13, align 4
  br label %135

131:                                              ; preds = %125
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %12, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #4
  br label %135

135:                                              ; preds = %131, %127
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #4
  br label %396

136:                                              ; preds = %118
  %137 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 8
  %138 = load ptr, ptr %137, align 8, !tbaa !11
  %139 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 7
  %140 = load ptr, ptr %139, align 8, !tbaa !19
  %141 = getelementptr inbounds %struct.AVFormatContext, ptr %140, i32 0, i32 4
  store ptr %138, ptr %141, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %142 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 14
  %143 = call ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDSt4lessIS5_ESaISt4pairIKS5_S6_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13formatToCodecB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %142)
  %144 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %20, i32 0, i32 0
  store ptr %143, ptr %144, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %145 = call ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDSt4lessIS5_ESaISt4pairIKS5_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13formatToCodecB5cxx11) #4
  %146 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %21, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  %147 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDEESC_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br i1 %147, label %148, label %155

148:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #4
  %149 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 14
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %22, ptr noundef @.str.17, ptr noundef nonnull align 8 dereferenceable(32) %149)
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %150 unwind label %151

150:                                              ; preds = %148
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %392

151:                                              ; preds = %148
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %12, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #4
  br label %393

155:                                              ; preds = %136
  %156 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #4
  %157 = getelementptr inbounds %"struct.std::pair", ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 8, !tbaa !27
  %159 = call ptr @avcodec_find_encoder(i32 noundef %158)
  %160 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 5
  store ptr %159, ptr %160, align 8, !tbaa !29
  %161 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 5
  %162 = load ptr, ptr %161, align 8, !tbaa !29
  %163 = icmp ne ptr %162, null
  br i1 %163, label %176, label %164

164:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef @.str.18, ptr noundef nonnull align 1 dereferenceable(1) %25)
          to label %165 unwind label %167

165:                                              ; preds = %164
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %24)
          to label %166 unwind label %171

166:                                              ; preds = %165
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %392

167:                                              ; preds = %164
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %12, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %13, align 4
  br label %175

171:                                              ; preds = %165
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %12, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #4
  br label %175

175:                                              ; preds = %171, %167
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #4
  br label %393

176:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %177 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 7
  %178 = load ptr, ptr %177, align 8, !tbaa !19
  %179 = call ptr @avformat_new_stream(ptr noundef %178, ptr noundef null)
  store ptr %179, ptr %26, align 8, !tbaa !5
  %180 = load ptr, ptr %26, align 8, !tbaa !5
  %181 = icmp ne ptr %180, null
  br i1 %181, label %194, label %182

182:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef @.str.19, ptr noundef nonnull align 1 dereferenceable(1) %28)
          to label %183 unwind label %185

183:                                              ; preds = %182
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %27)
          to label %184 unwind label %189

184:                                              ; preds = %183
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %390

185:                                              ; preds = %182
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %12, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %13, align 4
  br label %193

189:                                              ; preds = %183
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %12, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #4
  br label %193

193:                                              ; preds = %189, %185
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #4
  br label %391

194:                                              ; preds = %176
  %195 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 5
  %196 = load ptr, ptr %195, align 8, !tbaa !29
  %197 = call ptr @avcodec_alloc_context3(ptr noundef %196)
  %198 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  store ptr %197, ptr %198, align 8, !tbaa !30
  %199 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %200 = load ptr, ptr %199, align 8, !tbaa !30
  %201 = icmp ne ptr %200, null
  br i1 %201, label %214, label %202

202:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 32, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %29, ptr noundef @.str.20, ptr noundef nonnull align 1 dereferenceable(1) %30)
          to label %203 unwind label %205

203:                                              ; preds = %202
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %29)
          to label %204 unwind label %209

204:                                              ; preds = %203
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %390

205:                                              ; preds = %202
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %12, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %13, align 4
  br label %213

209:                                              ; preds = %203
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %12, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #4
  br label %213

213:                                              ; preds = %209, %205
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #4
  br label %391

214:                                              ; preds = %194
  %215 = load i64, ptr %8, align 8, !tbaa !9
  %216 = trunc i64 %215 to i32
  %217 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %218 = load ptr, ptr %217, align 8, !tbaa !30
  %219 = getelementptr inbounds %struct.AVCodecContext, ptr %218, i32 0, i32 72
  %220 = getelementptr inbounds %struct.AVChannelLayout, ptr %219, i32 0, i32 1
  store i32 %216, ptr %220, align 4, !tbaa !31
  %221 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %222 = load ptr, ptr %221, align 8, !tbaa !30
  %223 = getelementptr inbounds %struct.AVCodecContext, ptr %222, i32 0, i32 72
  %224 = getelementptr inbounds %struct.AVChannelLayout, ptr %223, i32 0, i32 0
  store i32 1, ptr %224, align 8, !tbaa !48
  %225 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 5
  %226 = load ptr, ptr %225, align 8, !tbaa !29
  %227 = load i64, ptr %7, align 8, !tbaa !9
  %228 = trunc i64 %227 to i32
  %229 = call noundef i32 @_ZL17resolveSampleRatePK7AVCodeci(ptr noundef %226, i32 noundef %228)
  %230 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %231 = load ptr, ptr %230, align 8, !tbaa !30
  %232 = getelementptr inbounds %struct.AVCodecContext, ptr %231, i32 0, i32 70
  store i32 %229, ptr %232, align 8, !tbaa !49
  %233 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 5
  %234 = load ptr, ptr %233, align 8, !tbaa !29
  %235 = call noundef i32 @_ZL19resolveSampleFormatPK7AVCodec(ptr noundef %234)
  %236 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %237 = load ptr, ptr %236, align 8, !tbaa !30
  %238 = getelementptr inbounds %struct.AVCodecContext, ptr %237, i32 0, i32 71
  store i32 %235, ptr %238, align 4, !tbaa !50
  %239 = load i64, ptr %9, align 8, !tbaa !9
  %240 = mul nsw i64 %239, 1000
  %241 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %242 = load ptr, ptr %241, align 8, !tbaa !30
  %243 = getelementptr inbounds %struct.AVCodecContext, ptr %242, i32 0, i32 9
  store i64 %240, ptr %243, align 8, !tbaa !51
  %244 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %245 = load ptr, ptr %244, align 8, !tbaa !30
  %246 = getelementptr inbounds %struct.AVCodecContext, ptr %245, i32 0, i32 102
  store i32 -2, ptr %246, align 4, !tbaa !52
  %247 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %248 = load ptr, ptr %247, align 8, !tbaa !30
  %249 = getelementptr inbounds %struct.AVCodecContext, ptr %248, i32 0, i32 71
  %250 = load i32, ptr %249, align 4, !tbaa !50
  %251 = icmp eq i32 %250, -1
  br i1 %251, label %252, label %264

252:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 32, ptr %31) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %32) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %31, ptr noundef @.str.21, ptr noundef nonnull align 1 dereferenceable(1) %32)
          to label %253 unwind label %255

253:                                              ; preds = %252
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %254 unwind label %259

254:                                              ; preds = %253
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %390

255:                                              ; preds = %252
  %256 = landingpad { ptr, i32 }
          cleanup
  %257 = extractvalue { ptr, i32 } %256, 0
  store ptr %257, ptr %12, align 8
  %258 = extractvalue { ptr, i32 } %256, 1
  store i32 %258, ptr %13, align 4
  br label %263

259:                                              ; preds = %253
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %12, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #4
  br label %263

263:                                              ; preds = %259, %255
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #4
  br label %391

264:                                              ; preds = %214
  %265 = load i64, ptr %7, align 8, !tbaa !9
  %266 = trunc i64 %265 to i32
  %267 = load ptr, ptr %26, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.AVStream, ptr %267, i32 0, i32 5
  %269 = getelementptr inbounds %struct.AVRational, ptr %268, i32 0, i32 1
  store i32 %266, ptr %269, align 4, !tbaa !53
  %270 = load ptr, ptr %26, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.AVStream, ptr %270, i32 0, i32 5
  %272 = getelementptr inbounds %struct.AVRational, ptr %271, i32 0, i32 0
  store i32 1, ptr %272, align 8, !tbaa !56
  %273 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 7
  %274 = load ptr, ptr %273, align 8, !tbaa !19
  %275 = getelementptr inbounds %struct.AVFormatContext, ptr %274, i32 0, i32 2
  %276 = load ptr, ptr %275, align 8, !tbaa !21
  %277 = getelementptr inbounds %struct.AVOutputFormat, ptr %276, i32 0, i32 7
  %278 = load i32, ptr %277, align 4, !tbaa !57
  %279 = and i32 %278, 64
  %280 = icmp ne i32 %279, 0
  br i1 %280, label %281, label %287

281:                                              ; preds = %264
  %282 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %283 = load ptr, ptr %282, align 8, !tbaa !30
  %284 = getelementptr inbounds %struct.AVCodecContext, ptr %283, i32 0, i32 10
  %285 = load i32, ptr %284, align 8, !tbaa !59
  %286 = or i32 %285, 4194304
  store i32 %286, ptr %284, align 8, !tbaa !59
  br label %287

287:                                              ; preds = %281, %264
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #4
  %288 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %289 = load ptr, ptr %288, align 8, !tbaa !30
  %290 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 5
  %291 = load ptr, ptr %290, align 8, !tbaa !29
  %292 = call i32 @avcodec_open2(ptr noundef %289, ptr noundef %291, ptr noundef null)
  store i32 %292, ptr %33, align 4, !tbaa !60
  %293 = load i32, ptr %33, align 4, !tbaa !60
  %294 = icmp slt i32 %293, 0
  br i1 %294, label %295, label %308

295:                                              ; preds = %287
  call void @llvm.lifetime.start.p0(i64 32, ptr %34) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %35) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %35) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %34, ptr noundef @.str.22, ptr noundef nonnull align 1 dereferenceable(1) %35)
          to label %296 unwind label %299

296:                                              ; preds = %295
  %297 = load i32, ptr %33, align 4, !tbaa !60
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %34, i32 noundef %297)
          to label %298 unwind label %303

298:                                              ; preds = %296
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %34) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %35) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %34) #4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %388

299:                                              ; preds = %295
  %300 = landingpad { ptr, i32 }
          cleanup
  %301 = extractvalue { ptr, i32 } %300, 0
  store ptr %301, ptr %12, align 8
  %302 = extractvalue { ptr, i32 } %300, 1
  store i32 %302, ptr %13, align 4
  br label %307

303:                                              ; preds = %296
  %304 = landingpad { ptr, i32 }
          cleanup
  %305 = extractvalue { ptr, i32 } %304, 0
  store ptr %305, ptr %12, align 8
  %306 = extractvalue { ptr, i32 } %304, 1
  store i32 %306, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %34) #4
  br label %307

307:                                              ; preds = %303, %299
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %35) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %34) #4
  br label %389

308:                                              ; preds = %287
  %309 = load ptr, ptr %26, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.AVStream, ptr %309, i32 0, i32 3
  %311 = load ptr, ptr %310, align 8, !tbaa !61
  %312 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %313 = load ptr, ptr %312, align 8, !tbaa !30
  %314 = call i32 @avcodec_parameters_from_context(ptr noundef %311, ptr noundef %313)
  store i32 %314, ptr %33, align 4, !tbaa !60
  %315 = load i32, ptr %33, align 4, !tbaa !60
  %316 = icmp slt i32 %315, 0
  br i1 %316, label %317, label %330

317:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 32, ptr %36) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %37) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %36, ptr noundef @.str.23, ptr noundef nonnull align 1 dereferenceable(1) %37)
          to label %318 unwind label %321

318:                                              ; preds = %317
  %319 = load i32, ptr %33, align 4, !tbaa !60
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %36, i32 noundef %319)
          to label %320 unwind label %325

320:                                              ; preds = %318
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %36) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %36) #4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %388

321:                                              ; preds = %317
  %322 = landingpad { ptr, i32 }
          cleanup
  %323 = extractvalue { ptr, i32 } %322, 0
  store ptr %323, ptr %12, align 8
  %324 = extractvalue { ptr, i32 } %322, 1
  store i32 %324, ptr %13, align 4
  br label %329

325:                                              ; preds = %318
  %326 = landingpad { ptr, i32 }
          cleanup
  %327 = extractvalue { ptr, i32 } %326, 0
  store ptr %327, ptr %12, align 8
  %328 = extractvalue { ptr, i32 } %326, 1
  store i32 %328, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %36) #4
  br label %329

329:                                              ; preds = %325, %321
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %37) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %36) #4
  br label %389

330:                                              ; preds = %308
  %331 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 12
  %332 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %333 = load ptr, ptr %332, align 8, !tbaa !30
  %334 = getelementptr inbounds %struct.AVCodecContext, ptr %333, i32 0, i32 72
  %335 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %336 = load ptr, ptr %335, align 8, !tbaa !30
  %337 = getelementptr inbounds %struct.AVCodecContext, ptr %336, i32 0, i32 71
  %338 = load i32, ptr %337, align 4, !tbaa !50
  %339 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %340 = load ptr, ptr %339, align 8, !tbaa !30
  %341 = getelementptr inbounds %struct.AVCodecContext, ptr %340, i32 0, i32 70
  %342 = load i32, ptr %341, align 8, !tbaa !49
  %343 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 6
  %344 = load ptr, ptr %343, align 8, !tbaa !30
  %345 = getelementptr inbounds %struct.AVCodecContext, ptr %344, i32 0, i32 72
  %346 = load i64, ptr %7, align 8, !tbaa !9
  %347 = trunc i64 %346 to i32
  %348 = call i32 @swr_alloc_set_opts2(ptr noundef %331, ptr noundef %334, i32 noundef %338, i32 noundef %342, ptr noundef %345, i32 noundef 3, i32 noundef %347, i32 noundef 0, ptr noundef null)
  %349 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 12
  %350 = load ptr, ptr %349, align 8, !tbaa !62
  %351 = call i32 @swr_init(ptr noundef %350)
  store i32 %351, ptr %33, align 4, !tbaa !60
  %352 = load i32, ptr %33, align 4, !tbaa !60
  %353 = icmp slt i32 %352, 0
  br i1 %353, label %354, label %367

354:                                              ; preds = %330
  call void @llvm.lifetime.start.p0(i64 32, ptr %38) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %39) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %39) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef @.str.24, ptr noundef nonnull align 1 dereferenceable(1) %39)
          to label %355 unwind label %358

355:                                              ; preds = %354
  %356 = load i32, ptr %33, align 4, !tbaa !60
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %38, i32 noundef %356)
          to label %357 unwind label %362

357:                                              ; preds = %355
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %38) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %39) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %38) #4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %388

358:                                              ; preds = %354
  %359 = landingpad { ptr, i32 }
          cleanup
  %360 = extractvalue { ptr, i32 } %359, 0
  store ptr %360, ptr %12, align 8
  %361 = extractvalue { ptr, i32 } %359, 1
  store i32 %361, ptr %13, align 4
  br label %366

362:                                              ; preds = %355
  %363 = landingpad { ptr, i32 }
          cleanup
  %364 = extractvalue { ptr, i32 } %363, 0
  store ptr %364, ptr %12, align 8
  %365 = extractvalue { ptr, i32 } %363, 1
  store i32 %365, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %38) #4
  br label %366

366:                                              ; preds = %362, %358
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %39) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %38) #4
  br label %389

367:                                              ; preds = %330
  %368 = load i64, ptr %8, align 8, !tbaa !9
  %369 = trunc i64 %368 to i32
  %370 = call ptr @av_audio_fifo_alloc(i32 noundef 3, i32 noundef %369, i32 noundef 1)
  %371 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 4
  store ptr %370, ptr %371, align 8, !tbaa !63
  %372 = getelementptr inbounds %class.FfmpegEncoder, ptr %42, i32 0, i32 4
  %373 = load ptr, ptr %372, align 8, !tbaa !63
  %374 = icmp ne ptr %373, null
  br i1 %374, label %387, label %375

375:                                              ; preds = %367
  call void @llvm.lifetime.start.p0(i64 32, ptr %40) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %41) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %41) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %40, ptr noundef @.str.25, ptr noundef nonnull align 1 dereferenceable(1) %41)
          to label %376 unwind label %378

376:                                              ; preds = %375
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %40)
          to label %377 unwind label %382

377:                                              ; preds = %376
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %40) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %41) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %41) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %40) #4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %388

378:                                              ; preds = %375
  %379 = landingpad { ptr, i32 }
          cleanup
  %380 = extractvalue { ptr, i32 } %379, 0
  store ptr %380, ptr %12, align 8
  %381 = extractvalue { ptr, i32 } %379, 1
  store i32 %381, ptr %13, align 4
  br label %386

382:                                              ; preds = %376
  %383 = landingpad { ptr, i32 }
          cleanup
  %384 = extractvalue { ptr, i32 } %383, 0
  store ptr %384, ptr %12, align 8
  %385 = extractvalue { ptr, i32 } %383, 1
  store i32 %385, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %40) #4
  br label %386

386:                                              ; preds = %382, %378
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %41) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %41) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %40) #4
  br label %389

387:                                              ; preds = %367
  store i1 true, ptr %5, align 1
  store i32 1, ptr %23, align 4
  br label %388

388:                                              ; preds = %387, %377, %357, %320, %298
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #4
  br label %390

389:                                              ; preds = %386, %366, %329, %307
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #4
  br label %391

390:                                              ; preds = %388, %254, %204, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  br label %392

391:                                              ; preds = %389, %263, %213, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  br label %393

392:                                              ; preds = %390, %166, %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %394

393:                                              ; preds = %391, %175, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %396

394:                                              ; preds = %392, %126, %82, %66, %48
  %395 = load i1, ptr %5, align 1
  ret i1 %395

396:                                              ; preds = %393, %135, %101, %83, %75, %57
  %397 = load ptr, ptr %12, align 8
  %398 = load i32, ptr %13, align 4
  %399 = insertvalue { ptr, i32 } poison, ptr %397, 0
  %400 = insertvalue { ptr, i32 } %399, i32 %398, 1
  resume { ptr, i32 } %400
}

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 #2 align 2

declare ptr @avformat_alloc_context() #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #1 align 2

declare ptr @av_guess_format(ptr noundef, ptr noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDSt4lessIS5_ESaISt4pairIKS5_S6_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDEESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDSt4lessIS5_ESaISt4pairIKS5_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

declare ptr @avcodec_find_encoder(i32 noundef) #3

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

declare ptr @avformat_new_stream(ptr noundef, ptr noundef) #3

declare ptr @avcodec_alloc_context3(ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL17resolveSampleRatePK7AVCodeci(ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL19resolveSampleFormatPK7AVCodec(ptr noundef) #1

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

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

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

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

declare i32 @swr_init(ptr noundef) #3

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

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

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


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, AVCodecID>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, AVCodecID>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, AVCodecID>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, AVCodecID>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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.0" = type { i8 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@_ZL13formatToCodecB5cxx11 = external hidden global %"class.std::map", align 8
@.str.12 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN13FfmpegEncoder15OpenOutputCodecEmmm(ptr noundef nonnull align 8 dereferenceable(152) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator.0", align 1
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator.0", align 1
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator.0", align 1
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator.0", align 1
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator.0", align 1
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::allocator.0", align 1
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"class.std::allocator.0", align 1
  %24 = alloca %"class.std::__cxx11::basic_string", align 8
  %25 = alloca %"class.std::allocator.0", align 1
  %26 = alloca %"class.std::__cxx11::basic_string", align 8
  %27 = alloca %"class.std::allocator.0", align 1
  %28 = alloca %"class.std::__cxx11::basic_string", align 8
  %29 = alloca %"class.std::allocator.0", align 1
  %30 = alloca %"class.std::__cxx11::basic_string", align 8
  %31 = alloca %"class.std::allocator.0", align 1
  %32 = getelementptr inbounds i8, ptr %0, i64 64
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %.not = icmp eq ptr %33, null
  br i1 %.not, label %34, label %42

34:                                               ; preds = %4
  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.12, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %35 unwind label %37

35:                                               ; preds = %34
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %36 unwind label %39

36:                                               ; preds = %35
  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 %233

37:                                               ; preds = %34
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %41

39:                                               ; preds = %35
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  br label %41

41:                                               ; preds = %39, %37
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %38, %37 ]
  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 %234

42:                                               ; preds = %4
  %43 = tail call ptr @avformat_alloc_context()
  %44 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %43, ptr %44, align 8, !tbaa !17
  %.not44 = icmp eq ptr %43, null
  br i1 %.not44, label %45, label %53

45:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %46 unwind label %48

46:                                               ; preds = %45
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %47 unwind label %50

47:                                               ; preds = %46
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  br label %233

48:                                               ; preds = %45
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

50:                                               ; preds = %46
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  br label %52

52:                                               ; preds = %50, %48
  %.pn45 = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  br label %234

53:                                               ; preds = %42
  %54 = getelementptr inbounds i8, ptr %0, i64 112
  %55 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %54) #4
  %.not47 = icmp eq i64 %55, 0
  br i1 %.not47, label %56, label %60

56:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #4
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull @.str.14, ptr noundef nonnull align 8 dereferenceable(32) %54)
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %57 unwind label %58

57:                                               ; preds = %56
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #4
  br label %233

58:                                               ; preds = %56
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #4
  br label %234

60:                                               ; preds = %53
  %61 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %54, i64 noundef 0)
  %62 = load i8, ptr %61, align 1, !tbaa !18
  %63 = icmp eq i8 %62, 46
  br i1 %63, label %64, label %72

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #4
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %10, ptr noundef nonnull @.str.15, ptr noundef nonnull align 8 dereferenceable(32) %54)
  %65 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  %66 = invoke ptr @av_guess_format(ptr noundef null, ptr noundef %65, ptr noundef null)
          to label %67 unwind label %70

67:                                               ; preds = %64
  %68 = load ptr, ptr %44, align 8, !tbaa !17
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  store ptr %66, ptr %69, align 8, !tbaa !19
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #4
  br label %72

70:                                               ; preds = %64
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #4
  br label %234

72:                                               ; preds = %67, %60
  %73 = load ptr, ptr %44, align 8, !tbaa !17
  %74 = getelementptr inbounds i8, ptr %73, i64 16
  %75 = load ptr, ptr %74, align 8, !tbaa !19
  %.not48 = icmp eq ptr %75, null
  br i1 %.not48, label %76, label %.thread

76:                                               ; preds = %72
  %77 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %54) #4
  %78 = call ptr @av_guess_format(ptr noundef null, ptr noundef null, ptr noundef %77)
  %79 = load ptr, ptr %44, align 8, !tbaa !17
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  store ptr %78, ptr %80, align 8, !tbaa !19
  %.not49 = icmp eq ptr %78, null
  br i1 %.not49, label %81, label %.thread

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull @.str.16, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %82 unwind label %84

82:                                               ; preds = %81
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %83 unwind label %86

83:                                               ; preds = %82
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #4
  br label %233

84:                                               ; preds = %81
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %88

86:                                               ; preds = %82
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #4
  br label %88

88:                                               ; preds = %86, %84
  %.pn50 = phi { ptr, i32 } [ %87, %86 ], [ %85, %84 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #4
  br label %234

.thread:                                          ; preds = %72, %76
  %89 = phi ptr [ %79, %76 ], [ %73, %72 ]
  %90 = load ptr, ptr %32, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %89, i64 32
  store ptr %90, ptr %91, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %92 = call ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDSt4lessIS5_ESaISt4pairIKS5_S6_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13formatToCodecB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %54)
  store ptr %92, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  %93 = call ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDSt4lessIS5_ESaISt4pairIKS5_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13formatToCodecB5cxx11) #4
  store ptr %93, ptr %14, align 8
  %94 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDEESC_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  br i1 %94, label %95, label %99

95:                                               ; preds = %.thread
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #4
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %15, ptr noundef nonnull @.str.17, ptr noundef nonnull align 8 dereferenceable(32) %54)
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %96 unwind label %97

96:                                               ; preds = %95
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #4
  br label %231

97:                                               ; preds = %95
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #4
  br label %232

99:                                               ; preds = %.thread
  %100 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  %101 = getelementptr inbounds i8, ptr %100, i64 32
  %102 = load i32, ptr %101, align 8, !tbaa !25
  %103 = call ptr @avcodec_find_encoder(i32 noundef %102)
  %104 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %103, ptr %104, align 8, !tbaa !27
  %.not52 = icmp eq ptr %103, null
  br i1 %.not52, label %105, label %113

105:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull @.str.18, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %106 unwind label %108

106:                                              ; preds = %105
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %107 unwind label %110

107:                                              ; preds = %106
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #4
  br label %231

108:                                              ; preds = %105
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %112

110:                                              ; preds = %106
  %111 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  br label %112

112:                                              ; preds = %110, %108
  %.pn53 = phi { ptr, i32 } [ %111, %110 ], [ %109, %108 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #4
  br label %232

113:                                              ; preds = %99
  %114 = load ptr, ptr %44, align 8, !tbaa !17
  %115 = call ptr @avformat_new_stream(ptr noundef %114, ptr noundef null)
  %.not55 = icmp eq ptr %115, null
  br i1 %.not55, label %116, label %124

116:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %18) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %19) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull @.str.19, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %117 unwind label %119

117:                                              ; preds = %116
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %118 unwind label %121

118:                                              ; preds = %117
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #4
  br label %231

119:                                              ; preds = %116
  %120 = landingpad { ptr, i32 }
          cleanup
  br label %123

121:                                              ; preds = %117
  %122 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #4
  br label %123

123:                                              ; preds = %121, %119
  %.pn56 = phi { ptr, i32 } [ %122, %121 ], [ %120, %119 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #4
  br label %232

124:                                              ; preds = %113
  %125 = load ptr, ptr %104, align 8, !tbaa !27
  %126 = call ptr @avcodec_alloc_context3(ptr noundef %125)
  %127 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %126, ptr %127, align 8, !tbaa !28
  %.not58 = icmp eq ptr %126, null
  br i1 %.not58, label %128, label %136

128:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %20) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %21) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull @.str.20, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %129 unwind label %131

129:                                              ; preds = %128
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %130 unwind label %133

130:                                              ; preds = %129
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #4
  br label %231

131:                                              ; preds = %128
  %132 = landingpad { ptr, i32 }
          cleanup
  br label %135

133:                                              ; preds = %129
  %134 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  br label %135

135:                                              ; preds = %133, %131
  %.pn59 = phi { ptr, i32 } [ %134, %133 ], [ %132, %131 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #4
  br label %232

136:                                              ; preds = %124
  %137 = trunc i64 %2 to i32
  %138 = getelementptr inbounds i8, ptr %126, i64 356
  store i32 %137, ptr %138, align 4, !tbaa !29
  %139 = getelementptr inbounds i8, ptr %126, i64 352
  store i32 1, ptr %139, align 8, !tbaa !46
  %140 = load ptr, ptr %104, align 8, !tbaa !27
  %141 = trunc i64 %1 to i32
  %142 = call noundef i32 @_ZL17resolveSampleRatePK7AVCodeci(ptr noundef %140, i32 noundef %141)
  %143 = load ptr, ptr %127, align 8, !tbaa !28
  %144 = getelementptr inbounds i8, ptr %143, i64 344
  store i32 %142, ptr %144, align 8, !tbaa !47
  %145 = load ptr, ptr %104, align 8, !tbaa !27
  %146 = call noundef i32 @_ZL19resolveSampleFormatPK7AVCodec(ptr noundef %145)
  %147 = load ptr, ptr %127, align 8, !tbaa !28
  %148 = getelementptr inbounds i8, ptr %147, i64 348
  store i32 %146, ptr %148, align 4, !tbaa !48
  %149 = mul nsw i64 %3, 1000
  %150 = getelementptr inbounds i8, ptr %147, i64 56
  store i64 %149, ptr %150, align 8, !tbaa !49
  %151 = getelementptr inbounds i8, ptr %147, i64 516
  store i32 -2, ptr %151, align 4, !tbaa !50
  %152 = icmp eq i32 %146, -1
  br i1 %152, label %153, label %161

153:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %22) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %23) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef nonnull @.str.21, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %154 unwind label %156

154:                                              ; preds = %153
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %155 unwind label %158

155:                                              ; preds = %154
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %23) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %22) #4
  br label %231

156:                                              ; preds = %153
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %160

158:                                              ; preds = %154
  %159 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #4
  br label %160

160:                                              ; preds = %158, %156
  %.pn72 = phi { ptr, i32 } [ %159, %158 ], [ %157, %156 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %23) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %22) #4
  br label %232

161:                                              ; preds = %136
  %162 = getelementptr inbounds i8, ptr %115, i64 32
  %163 = getelementptr inbounds i8, ptr %115, i64 36
  store i32 %141, ptr %163, align 4, !tbaa !51
  store i32 1, ptr %162, align 8, !tbaa !54
  %164 = load ptr, ptr %44, align 8, !tbaa !17
  %165 = getelementptr inbounds i8, ptr %164, i64 16
  %166 = load ptr, ptr %165, align 8, !tbaa !19
  %167 = getelementptr inbounds i8, ptr %166, i64 44
  %168 = load i32, ptr %167, align 4, !tbaa !55
  %169 = and i32 %168, 64
  %.not61 = icmp eq i32 %169, 0
  br i1 %.not61, label %174, label %170

170:                                              ; preds = %161
  %171 = getelementptr inbounds i8, ptr %147, i64 64
  %172 = load i32, ptr %171, align 8, !tbaa !57
  %173 = or i32 %172, 4194304
  store i32 %173, ptr %171, align 8, !tbaa !57
  br label %174

174:                                              ; preds = %170, %161
  %175 = load ptr, ptr %104, align 8, !tbaa !27
  %176 = call i32 @avcodec_open2(ptr noundef nonnull %147, ptr noundef %175, ptr noundef null)
  %177 = icmp slt i32 %176, 0
  br i1 %177, label %178, label %186

178:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %24) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %25) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef nonnull @.str.22, ptr noundef nonnull align 1 dereferenceable(1) %25)
          to label %179 unwind label %181

179:                                              ; preds = %178
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %24, i32 noundef %176)
          to label %180 unwind label %183

180:                                              ; preds = %179
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %25) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %24) #4
  br label %231

181:                                              ; preds = %178
  %182 = landingpad { ptr, i32 }
          cleanup
  br label %185

183:                                              ; preds = %179
  %184 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #4
  br label %185

185:                                              ; preds = %183, %181
  %.pn69 = phi { ptr, i32 } [ %184, %183 ], [ %182, %181 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %25) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %24) #4
  br label %232

186:                                              ; preds = %174
  %187 = getelementptr inbounds i8, ptr %115, i64 16
  %188 = load ptr, ptr %187, align 8, !tbaa !58
  %189 = load ptr, ptr %127, align 8, !tbaa !28
  %190 = call i32 @avcodec_parameters_from_context(ptr noundef %188, ptr noundef %189)
  %191 = icmp slt i32 %190, 0
  br i1 %191, label %192, label %200

192:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %26) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %27) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull @.str.23, ptr noundef nonnull align 1 dereferenceable(1) %27)
          to label %193 unwind label %195

193:                                              ; preds = %192
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %26, i32 noundef %190)
          to label %194 unwind label %197

194:                                              ; preds = %193
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %27) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %26) #4
  br label %231

195:                                              ; preds = %192
  %196 = landingpad { ptr, i32 }
          cleanup
  br label %199

197:                                              ; preds = %193
  %198 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #4
  br label %199

199:                                              ; preds = %197, %195
  %.pn67 = phi { ptr, i32 } [ %198, %197 ], [ %196, %195 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %27) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %26) #4
  br label %232

200:                                              ; preds = %186
  %201 = getelementptr inbounds i8, ptr %0, i64 96
  %202 = load ptr, ptr %127, align 8, !tbaa !28
  %203 = getelementptr inbounds i8, ptr %202, i64 352
  %204 = getelementptr inbounds i8, ptr %202, i64 348
  %205 = load i32, ptr %204, align 4, !tbaa !48
  %206 = getelementptr inbounds i8, ptr %202, i64 344
  %207 = load i32, ptr %206, align 8, !tbaa !47
  %208 = call i32 @swr_alloc_set_opts2(ptr noundef nonnull %201, ptr noundef nonnull %203, i32 noundef %205, i32 noundef %207, ptr noundef nonnull %203, i32 noundef 3, i32 noundef %141, i32 noundef 0, ptr noundef null)
  %209 = load ptr, ptr %201, align 8, !tbaa !59
  %210 = call i32 @swr_init(ptr noundef %209)
  %211 = icmp slt i32 %210, 0
  br i1 %211, label %212, label %220

212:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %28) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %29) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef nonnull @.str.24, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %213 unwind label %215

213:                                              ; preds = %212
  invoke void @_ZL10logAvErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef %210)
          to label %214 unwind label %217

214:                                              ; preds = %213
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %28) #4
  br label %231

215:                                              ; preds = %212
  %216 = landingpad { ptr, i32 }
          cleanup
  br label %219

217:                                              ; preds = %213
  %218 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #4
  br label %219

219:                                              ; preds = %217, %215
  %.pn65 = phi { ptr, i32 } [ %218, %217 ], [ %216, %215 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %28) #4
  br label %232

220:                                              ; preds = %200
  %221 = call ptr @av_audio_fifo_alloc(i32 noundef 3, i32 noundef %137, i32 noundef 1)
  %222 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %221, ptr %222, align 8, !tbaa !60
  %.not62 = icmp eq ptr %221, null
  br i1 %.not62, label %223, label %231

223:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %30) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %31) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %31) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %30, ptr noundef nonnull @.str.25, ptr noundef nonnull align 1 dereferenceable(1) %31)
          to label %224 unwind label %226

224:                                              ; preds = %223
  invoke void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %30)
          to label %225 unwind label %228

225:                                              ; preds = %224
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %30) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %31) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %31) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %30) #4
  br label %231

226:                                              ; preds = %223
  %227 = landingpad { ptr, i32 }
          cleanup
  br label %230

228:                                              ; preds = %224
  %229 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %30) #4
  br label %230

230:                                              ; preds = %228, %226
  %.pn63 = phi { ptr, i32 } [ %229, %228 ], [ %227, %226 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %31) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %31) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %30) #4
  br label %232

231:                                              ; preds = %118, %130, %155, %220, %225, %214, %194, %180, %107, %96
  %.2 = phi i1 [ false, %96 ], [ false, %107 ], [ false, %155 ], [ false, %130 ], [ false, %118 ], [ false, %180 ], [ false, %194 ], [ false, %214 ], [ false, %225 ], [ true, %220 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  br label %233

232:                                              ; preds = %123, %135, %160, %230, %219, %199, %185, %112, %97
  %.pn75 = phi { ptr, i32 } [ %98, %97 ], [ %.pn53, %112 ], [ %.pn72, %160 ], [ %.pn59, %135 ], [ %.pn56, %123 ], [ %.pn69, %185 ], [ %.pn67, %199 ], [ %.pn65, %219 ], [ %.pn63, %230 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  br label %234

233:                                              ; preds = %231, %83, %57, %47, %36
  %.3 = phi i1 [ %.2, %231 ], [ false, %83 ], [ false, %57 ], [ false, %47 ], [ false, %36 ]
  ret i1 %.3

234:                                              ; preds = %232, %88, %70, %58, %52, %41
  %.pn75.pn = phi { ptr, i32 } [ %.pn75, %232 ], [ %.pn50, %88 ], [ %71, %70 ], [ %59, %58 ], [ %.pn45, %52 ], [ %.pn, %41 ]
  resume { ptr, i32 } %.pn75.pn
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL8logErrorRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 #2 align 2

declare ptr @avformat_alloc_context() local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #1 align 2

declare ptr @av_guess_format(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDSt4lessIS5_ESaISt4pairIKS5_S6_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDEESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDSt4lessIS5_ESaISt4pairIKS5_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

declare ptr @avcodec_find_encoder(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE9AVCodecIDEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

declare ptr @avformat_new_stream(ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @avcodec_alloc_context3(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL17resolveSampleRatePK7AVCodeci(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL19resolveSampleFormatPK7AVCodec(ptr noundef) local_unnamed_addr #1

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

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

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

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

declare i32 @swr_init(ptr noundef) local_unnamed_addr #3

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

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

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


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass