	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function ffmpeg_init_audio
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_ffmpeg_init_audio:                     ## @ffmpeg_init_audio
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_config_get_ptr
	movq	80(%r13), %rdi
	cmpb	$0, (%rdi)
	movq	%rax, %r15
	leaq	L_.str(%rip), %rbx
	cmoveq	%rbx, %rdi
	callq	_avcodec_find_encoder_by_name
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	leaq	24(%r13), %r12
	movq	%rax, 72(%r13)
	movq	%rax, %rdi
	callq	_avcodec_alloc_context3
	movq	%rax, 56(%r13)
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 56(%rax)
	movl	8(%r13), %ecx
	movl	%ecx, (%rax)
	cmpl	$2, %ecx
	jl	LBB0_3
## %bb.4:
	movq	_AV_CH_LAYOUT_STEREO@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_1:
	movq	80(%r13), %rax
	cmpb	$0, (%rax)
	cmovneq	%rax, %rbx
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	callq	_RARCH_ERR
	jmp	LBB0_19
LBB0_3:
	movq	_AV_CH_LAYOUT_MONO@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rcx), %ecx
	movl	%ecx, 52(%rax)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ffmpeg_audio_resolve_format
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_ffmpeg_audio_resolve_sample_rate
	movl	88(%r13), %eax
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	cvtsi2sd	%eax, %xmm1
	movapd	%xmm1, %xmm2
	divsd	16(%r13), %xmm2
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm2, 24(%r13)
	movq	56(%r13), %rcx
	movl	%eax, 4(%rcx)
	movl	$1000000, %edi                  ## imm = 0xF4240
	callq	_av_d2q
	movq	56(%r13), %rcx
	movq	%rax, 40(%rcx)
	leaq	68(%r13), %rdi
	leaq	64(%r13), %rsi
	movl	(%r15), %edx
	movq	_RESAMPLER_QUALITY_DONTCARE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movsd	24(%r13), %xmm0                 ## xmm0 = mem[0],zero
	callq	_retro_resampler_realloc
	cmpq	$0, 120(%r13)
	je	LBB0_10
LBB0_9:
	movq	_AV_CODEC_FLAG_QSCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	56(%r13), %rdi
	orl	%eax, 12(%rdi)
	movl	112(%r13), %eax
	movl	%eax, 32(%rdi)
	jmp	LBB0_12
LBB0_7:
	movq	_AV_SAMPLE_FMT_S16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	56(%r13), %rcx
	movl	%eax, 48(%rcx)
	movsd	16(%r13), %xmm0                 ## xmm0 = mem[0],zero
	callq	_roundf
	movq	56(%r13), %rcx
	movl	%eax, 4(%rcx)
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	divsd	16(%r13), %xmm0
	movl	$1000000, %edi                  ## imm = 0xF4240
	callq	_av_d2q
	movq	56(%r13), %rcx
	movq	%rax, 40(%rcx)
	cmpq	$0, 120(%r13)
	jne	LBB0_9
LBB0_10:
	movq	56(%r13), %rdi
	movq	104(%r13), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%rax, 24(%rdi)
LBB0_12:
	movq	_FF_COMPLIANCE_EXPERIMENTAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rdi)
	movq	(%r13), %rax
	movq	(%rax), %rax
	movq	_AVFMT_GLOBALHEADER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_14
## %bb.13:
	movq	_AV_CODEC_FLAG_GLOBAL_HEADER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%rdi)
LBB0_14:
	leaq	96(%r13), %rdx
	movq	96(%r13), %rax
	testq	%rax, %rax
	cmoveq	%rax, %rdx
	movq	%r14, %rsi
	callq	_avcodec_open2
	xorl	%r12d, %r12d
	testq	%rax, %rax
	jne	LBB0_19
## %bb.15:
	movq	56(%r13), %rax
	movl	8(%rax), %edi
	testl	%edi, %edi
	jne	LBB0_17
## %bb.16:
	movl	$1024, 8(%rax)                  ## imm = 0x400
	movl	$1024, %edi                     ## imm = 0x400
LBB0_17:
	imull	(%rax), %edi
	imull	32(%r13), %edi
	callq	_av_malloc
	movq	%rax, 48(%r13)
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movq	_AV_INPUT_BUFFER_MIN_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 36(%r13)
	callq	_av_malloc
	movq	%rax, 40(%r13)
	xorl	%r12d, %r12d
	testq	%rax, %rax
	setne	%r12b
LBB0_19:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"flac"

L_.str.1:                               ## @.str.1
	.asciz	"[FFmpeg]: Cannot find acodec %s.\n"

	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CH_LAYOUT_STEREO,4,2        ## @AV_CH_LAYOUT_STEREO
	.comm	_AV_CH_LAYOUT_MONO,4,2          ## @AV_CH_LAYOUT_MONO
	.comm	_RESAMPLER_QUALITY_DONTCARE,4,2 ## @RESAMPLER_QUALITY_DONTCARE
	.comm	_AV_SAMPLE_FMT_S16,4,2          ## @AV_SAMPLE_FMT_S16
	.comm	_AV_CODEC_FLAG_QSCALE,4,2       ## @AV_CODEC_FLAG_QSCALE
	.comm	_FF_COMPLIANCE_EXPERIMENTAL,4,2 ## @FF_COMPLIANCE_EXPERIMENTAL
	.comm	_AVFMT_GLOBALHEADER,4,2         ## @AVFMT_GLOBALHEADER
	.comm	_AV_CODEC_FLAG_GLOBAL_HEADER,4,2 ## @AV_CODEC_FLAG_GLOBAL_HEADER
	.comm	_AV_INPUT_BUFFER_MIN_SIZE,4,2   ## @AV_INPUT_BUFFER_MIN_SIZE
	.no_dead_strip	_ffmpeg_init_audio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ffmpeg_init_audio
_ffmpeg_init_audio:                     ; @ffmpeg_init_audio
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	bl	_config_get_ptr
	mov	x21, x0
	ldr	x8, [x19, #80]
	ldrb	w9, [x8]
Lloh0:
	adrp	x22, l_.str@PAGE
Lloh1:
	add	x22, x22, l_.str@PAGEOFF
	cmp	w9, #0
	csel	x0, x22, x8, eq
	bl	_avcodec_find_encoder_by_name
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	add	x22, x19, #24
	str	x0, [x19, #72]
	bl	_avcodec_alloc_context3
	str	x0, [x19, #56]
Lloh2:
	adrp	x8, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x0, #56]
	ldr	w8, [x19, #8]
	str	w8, [x0]
Lloh5:
	adrp	x9, _AV_CH_LAYOUT_STEREO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AV_CH_LAYOUT_STEREO@GOTPAGEOFF]
Lloh7:
	adrp	x10, _AV_CH_LAYOUT_MONO@GOTPAGE
Lloh8:
	ldr	x10, [x10, _AV_CH_LAYOUT_MONO@GOTPAGEOFF]
	cmp	w8, #1
	csel	x8, x9, x10, gt
	ldr	w8, [x8]
	str	w8, [x0, #52]
	mov	x0, x22
	mov	x1, x20
	bl	_ffmpeg_audio_resolve_format
	mov	x0, x19
	mov	x1, x20
	bl	_ffmpeg_audio_resolve_sample_rate
	ldr	w8, [x19, #88]
	cbz	w8, LBB0_5
; %bb.2:
	scvtf	d0, w8
	ldr	d1, [x19, #16]
	fdiv	d1, d0, d1
	str	d1, [x19, #24]
	ldr	x9, [x19, #56]
	str	w8, [x9, #4]
	fmov	d1, #1.00000000
	fdiv	d0, d1, d0
	mov	w0, #16960
	movk	w0, #15, lsl #16
	bl	_av_d2q
	ldr	x8, [x19, #56]
	str	x0, [x8, #40]
	add	x0, x19, #68
	add	x1, x19, #64
	ldr	w2, [x21]
Lloh9:
	adrp	x8, _RESAMPLER_QUALITY_DONTCARE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RESAMPLER_QUALITY_DONTCARE@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	ldr	d0, [x19, #24]
	bl	_retro_resampler_realloc
	ldr	x8, [x19, #120]
	cbz	x8, LBB0_6
LBB0_3:
Lloh12:
	adrp	x8, _AV_CODEC_FLAG_QSCALE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_CODEC_FLAG_QSCALE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	x0, [x19, #56]
	ldr	w9, [x0, #12]
	orr	w8, w9, w8
	str	w8, [x0, #12]
	ldr	w8, [x19, #112]
	str	w8, [x0, #32]
	b	LBB0_8
LBB0_4:
	ldr	x8, [x19, #80]
	ldrb	w9, [x8]
	cmp	w9, #0
	csel	x1, x22, x8, eq
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_ERR
	mov	w0, #0
	b	LBB0_16
LBB0_5:
Lloh17:
	adrp	x8, _AV_SAMPLE_FMT_S16@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_SAMPLE_FMT_S16@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	x9, [x19, #56]
	str	w8, [x9, #48]
	ldr	d0, [x19, #16]
	bl	_roundf
	ldr	x8, [x19, #56]
	str	w0, [x8, #4]
	ldr	d0, [x19, #16]
	fmov	d1, #1.00000000
	fdiv	d0, d1, d0
	mov	w0, #16960
	movk	w0, #15, lsl #16
	bl	_av_d2q
	ldr	x8, [x19, #56]
	str	x0, [x8, #40]
	ldr	x8, [x19, #120]
	cbnz	x8, LBB0_3
LBB0_6:
	ldr	x8, [x19, #104]
	ldr	x0, [x19, #56]
	cbz	x8, LBB0_8
; %bb.7:
	str	x8, [x0, #24]
LBB0_8:
Lloh20:
	adrp	x8, _FF_COMPLIANCE_EXPERIMENTAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FF_COMPLIANCE_EXPERIMENTAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	w8, [x8]
Lloh23:
	adrp	x9, _AVFMT_GLOBALHEADER@GOTPAGE
Lloh24:
	ldr	x9, [x9, _AVFMT_GLOBALHEADER@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh26:
	adrp	x8, _AV_CODEC_FLAG_GLOBAL_HEADER@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AV_CODEC_FLAG_GLOBAL_HEADER@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	ldr	w9, [x0, #12]
	orr	w8, w9, w8
	str	w8, [x0, #12]
LBB0_10:
	mov	x8, x19
	ldr	x9, [x8, #96]!
	cmp	x9, #0
	csel	x2, xzr, x8, eq
	mov	x1, x20
	bl	_avcodec_open2
	cbz	x0, LBB0_12
; %bb.11:
	mov	w0, #0
	b	LBB0_16
LBB0_12:
	ldr	x8, [x19, #56]
	ldr	w9, [x8, #8]
	cbnz	w9, LBB0_14
; %bb.13:
	mov	w9, #1024
	str	w9, [x8, #8]
LBB0_14:
	ldr	w8, [x8]
	mul	w8, w8, w9
	ldr	w9, [x19, #32]
	mul	w0, w8, w9
	bl	_av_malloc
	str	x0, [x19, #48]
	cbz	x0, LBB0_16
; %bb.15:
Lloh29:
	adrp	x8, _AV_INPUT_BUFFER_MIN_SIZE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AV_INPUT_BUFFER_MIN_SIZE@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	str	w0, [x19, #36]
	bl	_av_malloc
	str	x0, [x19, #40]
	cmp	x0, #0
	cset	w0, ne
LBB0_16:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"flac"

l_.str.1:                               ; @.str.1
	.asciz	"[FFmpeg]: Cannot find acodec %s.\n"

	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CH_LAYOUT_STEREO,4,2        ; @AV_CH_LAYOUT_STEREO
	.comm	_AV_CH_LAYOUT_MONO,4,2          ; @AV_CH_LAYOUT_MONO
	.comm	_RESAMPLER_QUALITY_DONTCARE,4,2 ; @RESAMPLER_QUALITY_DONTCARE
	.comm	_AV_SAMPLE_FMT_S16,4,2          ; @AV_SAMPLE_FMT_S16
	.comm	_AV_CODEC_FLAG_QSCALE,4,2       ; @AV_CODEC_FLAG_QSCALE
	.comm	_FF_COMPLIANCE_EXPERIMENTAL,4,2 ; @FF_COMPLIANCE_EXPERIMENTAL
	.comm	_AVFMT_GLOBALHEADER,4,2         ; @AVFMT_GLOBALHEADER
	.comm	_AV_CODEC_FLAG_GLOBAL_HEADER,4,2 ; @AV_CODEC_FLAG_GLOBAL_HEADER
	.comm	_AV_INPUT_BUFFER_MIN_SIZE,4,2   ; @AV_INPUT_BUFFER_MIN_SIZE
	.no_dead_strip	_ffmpeg_init_audio
.subsections_via_symbols
