	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_dither_alloc                ## -- Begin function ff_dither_alloc
	.p2align	4, 0x90
_ff_dither_alloc:                       ## @ff_dither_alloc
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movl	%r8d, %r12d
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %ebx
	movq	%rdi, %r13
	movl	%esi, %r15d
	movl	%esi, %edi
	callq	_av_get_packed_sample_fmt
	movq	_AV_SAMPLE_FMT_S16@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movl	%ebx, %edi
	callq	_av_get_bytes_per_sample
	cmpl	$2, %eax
	jg	LBB0_3
LBB0_2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_av_get_sample_fmt_name
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_av_get_sample_fmt_name
	leaq	L_.str(%rip), %rdx
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%ebx, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_26
LBB0_3:
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	$96, %edi
	callq	_av_mallocz
	movq	%rax, -72(%rbp)
	testq	%rax, %rax
	je	LBB0_25
## %bb.4:
	movq	%rax, %r12
	movl	%r14d, (%rax)
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.5:
	leaq	8(%r13), %rax
	movq	%rax, 88(%r12)
LBB0_6:
	movq	(%r13), %rsi
	movq	_AV_RESAMPLE_DITHER_TRIANGULAR_NS@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rsi
	jne	LBB0_10
## %bb.7:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	$44100, %eax                    ## imm = 0xAC44
	je	LBB0_10
## %bb.8:
	cmpl	$48000, %eax                    ## imm = 0xBB80
	je	LBB0_10
## %bb.9:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_AV_RESAMPLE_DITHER_TRIANGULAR_HP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rsi, (%r13)
LBB0_10:
	movq	%rsi, 8(%r12)
	movq	%r12, %rdi
	addq	$80, %rdi
	callq	_dither_init
	movq	8(%r12), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_12
## %bb.11:
	cmpl	$48000, -44(%rbp)               ## 4-byte Folded Reload
                                        ## imm = 0xBB80
	movq	_ns_44_coef_b@GOTPCREL(%rip), %rax
	cmoveq	_ns_48_coef_b@GOTPCREL(%rip), %rax
	movq	_ns_44_coef_a@GOTPCREL(%rip), %rcx
	cmoveq	_ns_48_coef_a@GOTPCREL(%rip), %rcx
	movl	(%rax), %eax
	movl	%eax, 76(%r12)
	movl	(%rcx), %eax
	movl	%eax, 72(%r12)
LBB0_12:
	movq	_AV_SAMPLE_FMT_S16P@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	cmpl	%r15d, %edx
	je	LBB0_15
## %bb.13:
	leaq	L_.str.2(%rip), %rcx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$1024, %esi                     ## imm = 0x400
	callq	_ff_audio_data_alloc
	movq	%rax, 64(%r12)
	testq	%rax, %rax
	je	LBB0_24
## %bb.14:
	movl	(%rbx), %edx
	movq	%r13, %rdi
	movl	%r15d, %esi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	xorl	%r9d, %r9d
	callq	_ff_audio_convert_alloc
	movq	%rax, 56(%r12)
	testq	%rax, %rax
	je	LBB0_24
LBB0_15:
	movq	_AV_SAMPLE_FMT_FLTP@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	cmpl	-60(%rbp), %edx                 ## 4-byte Folded Reload
	jne	LBB0_17
## %bb.16:
	cmpl	$0, (%r12)
	je	LBB0_20
LBB0_17:
	leaq	L_.str.3(%rip), %rcx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$1024, %esi                     ## imm = 0x400
	callq	_ff_audio_data_alloc
	movq	%rax, 48(%r12)
	testq	%rax, %rax
	je	LBB0_24
## %bb.18:
	movl	(%rbx), %esi
	cmpl	-60(%rbp), %esi                 ## 4-byte Folded Reload
	je	LBB0_20
## %bb.19:
	movl	(%r12), %r9d
	movq	%r13, %rdi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_ff_audio_convert_alloc
	movq	%rax, 40(%r12)
	testq	%rax, %rax
	je	LBB0_24
LBB0_20:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(,%rax,8), %edi
	callq	_av_mallocz
	movq	%rax, 32(%r12)
	testq	%rax, %rax
	je	LBB0_24
## %bb.21:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, 16(%r12)
	movq	_MUTE_THRESHOLD_SEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	imull	%ebx, %edi
	callq	_lrintf
	movl	%eax, 20(%r12)
	shll	$2, %eax
	movl	%eax, 24(%r12)
	leaq	-64(%rbp), %rdi
	movl	$12648430, %esi                 ## imm = 0xC0FFEE
	callq	_av_lfg_init
	testl	%r14d, %r14d
	jle	LBB0_26
## %bb.22:
	movl	%ebx, %r15d
	shrl	$31, %r15d
	addl	%ebx, %r15d
	sarl	%r15d
	movl	%r14d, %eax
	shlq	$3, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %r13
	leaq	(%r14,%r13), %rbx
	movl	24(%r12), %eax
	incl	%eax
	movl	%eax, (%r13,%r14)
	leaq	-64(%rbp), %rdi
	callq	_av_lfg_get
	movl	%eax, 4(%r13,%r14)
	movl	$32768, %edi                    ## imm = 0x8000
	movl	%r15d, %esi
	callq	_FFMAX
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_generate_dither_noise
	addq	$8, %r14
	cmpq	%r14, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_23
	jmp	LBB0_26
LBB0_24:
	leaq	-72(%rbp), %rdi
	callq	_ff_dither_free
LBB0_25:
	xorl	%r12d, %r12d
LBB0_26:
	movq	%r12, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_SAMPLE_FMT_S16,8,3          ## @AV_SAMPLE_FMT_S16
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dithering %s to %s is not supported\n"

	.comm	_AV_RESAMPLE_DITHER_TRIANGULAR_NS,8,3 ## @AV_RESAMPLE_DITHER_TRIANGULAR_NS
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
L_.str.1:                               ## @.str.1
	.asciz	"sample rate must be 48000 or 44100 Hz for triangular_ns dither. using triangular_hp instead.\n"

	.comm	_AV_RESAMPLE_DITHER_TRIANGULAR_HP,8,3 ## @AV_RESAMPLE_DITHER_TRIANGULAR_HP
	.comm	_ns_48_coef_b,4,2               ## @ns_48_coef_b
	.comm	_ns_48_coef_a,4,2               ## @ns_48_coef_a
	.comm	_ns_44_coef_b,4,2               ## @ns_44_coef_b
	.comm	_ns_44_coef_a,4,2               ## @ns_44_coef_a
	.comm	_AV_SAMPLE_FMT_S16P,4,2         ## @AV_SAMPLE_FMT_S16P
L_.str.2:                               ## @.str.2
	.asciz	"dither s16 buffer"

	.comm	_AV_SAMPLE_FMT_FLTP,4,2         ## @AV_SAMPLE_FMT_FLTP
L_.str.3:                               ## @.str.3
	.asciz	"dither flt buffer"

	.comm	_MUTE_THRESHOLD_SEC,4,2         ## @MUTE_THRESHOLD_SEC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_dither_alloc                ; -- Begin function ff_dither_alloc
	.p2align	2
_ff_dither_alloc:                       ; @ff_dither_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x25, x5
	mov	x21, x4
	mov	x20, x3
	mov	x23, x2
	mov	x24, x1
	mov	x22, x0
	mov	x0, x1
	bl	_av_get_packed_sample_fmt
Lloh0:
	adrp	x8, _AV_SAMPLE_FMT_S16@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_SAMPLE_FMT_S16@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x23
	bl	_av_get_bytes_per_sample
	cmp	w0, #2
	b.gt	LBB0_5
LBB0_2:
Lloh3:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w19, [x8]
	mov	x0, x23
	bl	_av_get_sample_fmt_name
	mov	x20, x0
	mov	x0, x24
	bl	_av_get_sample_fmt_name
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x20, x0, [sp]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	mov	x1, x19
	bl	_av_log
LBB0_3:
	mov	x19, #0
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_5:
	mov	w0, #96
	bl	_av_mallocz
	mov	x19, x0
	str	x0, [sp, #16]
	cbz	x0, LBB0_4
; %bb.6:
	str	w25, [x19]
	cbz	w25, LBB0_8
; %bb.7:
	add	x8, x22, #8
	str	x8, [x19, #88]
LBB0_8:
	ldr	x1, [x22]
Lloh8:
	adrp	x25, _AV_RESAMPLE_DITHER_TRIANGULAR_NS@GOTPAGE
Lloh9:
	ldr	x25, [x25, _AV_RESAMPLE_DITHER_TRIANGULAR_NS@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x1, x8
	mov	w8, #44100
	ccmp	w21, w8, #4, eq
	mov	w8, #48000
	ccmp	w21, w8, #4, ne
	b.ne	LBB0_24
LBB0_9:
	str	x1, [x19, #8]
	add	x0, x19, #80
	bl	_dither_init
	ldr	x8, [x19, #8]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
Lloh10:
	adrp	x8, _ns_48_coef_b@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ns_48_coef_b@GOTPAGEOFF]
Lloh12:
	adrp	x9, _ns_44_coef_b@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ns_44_coef_b@GOTPAGEOFF]
	mov	w10, #48000
	cmp	w21, w10
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _ns_48_coef_a@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ns_48_coef_a@GOTPAGEOFF]
	str	w8, [x19, #76]
Lloh16:
	adrp	x8, _ns_44_coef_a@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ns_44_coef_a@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	str	w8, [x19, #72]
LBB0_11:
Lloh18:
	adrp	x25, _AV_SAMPLE_FMT_S16P@GOTPAGE
Lloh19:
	ldr	x25, [x25, _AV_SAMPLE_FMT_S16P@GOTPAGEOFF]
	ldr	w2, [x25]
	cmp	w2, w24
	b.eq	LBB0_14
; %bb.12:
Lloh20:
	adrp	x3, l_.str.2@PAGE
Lloh21:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	w1, #1024
	bl	_ff_audio_data_alloc
	str	x0, [x19, #64]
	cbz	x0, LBB0_23
; %bb.13:
	ldr	w2, [x25]
	mov	x0, x22
	mov	x1, x24
	mov	x3, x20
	mov	x4, x21
	mov	w5, #0
	bl	_ff_audio_convert_alloc
	str	x0, [x19, #56]
	cbz	x0, LBB0_23
LBB0_14:
Lloh22:
	adrp	x24, _AV_SAMPLE_FMT_FLTP@GOTPAGE
Lloh23:
	ldr	x24, [x24, _AV_SAMPLE_FMT_FLTP@GOTPAGEOFF]
	ldr	w2, [x24]
	cmp	w2, w23
	b.ne	LBB0_16
; %bb.15:
	ldr	w8, [x19]
	cbz	w8, LBB0_19
LBB0_16:
Lloh24:
	adrp	x3, l_.str.3@PAGE
Lloh25:
	add	x3, x3, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	w1, #1024
	bl	_ff_audio_data_alloc
	str	x0, [x19, #48]
	cbz	x0, LBB0_23
; %bb.17:
	ldr	w1, [x24]
	cmp	w1, w23
	b.eq	LBB0_19
; %bb.18:
	ldr	w5, [x19]
	mov	x0, x22
	mov	x2, x23
	mov	x3, x20
	mov	x4, x21
	bl	_ff_audio_convert_alloc
	str	x0, [x19, #40]
	cbz	x0, LBB0_23
LBB0_19:
	lsl	w0, w20, #3
	bl	_av_mallocz
	str	x0, [x19, #32]
	cbz	x0, LBB0_23
; %bb.20:
	str	w20, [x19, #16]
Lloh26:
	adrp	x8, _MUTE_THRESHOLD_SEC@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MUTE_THRESHOLD_SEC@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	mul	w0, w8, w21
	bl	_lrintf
	lsl	w8, w0, #2
	stp	w0, w8, [x19, #20]
	add	x0, sp, #28
	mov	w1, #65518
	movk	w1, #192, lsl #16
	bl	_av_lfg_init
	cmp	w20, #1
	b.lt	LBB0_4
; %bb.21:
	mov	x22, #0
	cmp	w21, #0
	cinc	w8, w21, lt
	asr	w21, w8, #1
	mov	w8, w20
	lsl	x23, x8, #3
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	add	x20, x8, x22
	ldr	w8, [x19, #24]
	add	w8, w8, #1
	str	w8, [x20]
	add	x0, sp, #28
	bl	_av_lfg_get
	str	w0, [x20, #4]
	mov	w0, #32768
	mov	x1, x21
	bl	_FFMAX
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_generate_dither_noise
	add	x22, x22, #8
	cmp	x23, x22
	b.ne	LBB0_22
	b	LBB0_4
LBB0_23:
	add	x0, sp, #16
	bl	_ff_dither_free
	b	LBB0_3
LBB0_24:
Lloh29:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x2, l_.str.1@PAGE
Lloh33:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_av_log
Lloh34:
	adrp	x8, _AV_RESAMPLE_DITHER_TRIANGULAR_HP@GOTPAGE
Lloh35:
	ldr	x8, [x8, _AV_RESAMPLE_DITHER_TRIANGULAR_HP@GOTPAGEOFF]
Lloh36:
	ldr	x1, [x8]
	str	x1, [x22]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_SAMPLE_FMT_S16,8,3          ; @AV_SAMPLE_FMT_S16
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dithering %s to %s is not supported\n"

	.comm	_AV_RESAMPLE_DITHER_TRIANGULAR_NS,8,3 ; @AV_RESAMPLE_DITHER_TRIANGULAR_NS
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
l_.str.1:                               ; @.str.1
	.asciz	"sample rate must be 48000 or 44100 Hz for triangular_ns dither. using triangular_hp instead.\n"

	.comm	_AV_RESAMPLE_DITHER_TRIANGULAR_HP,8,3 ; @AV_RESAMPLE_DITHER_TRIANGULAR_HP
	.comm	_ns_48_coef_b,4,2               ; @ns_48_coef_b
	.comm	_ns_48_coef_a,4,2               ; @ns_48_coef_a
	.comm	_ns_44_coef_b,4,2               ; @ns_44_coef_b
	.comm	_ns_44_coef_a,4,2               ; @ns_44_coef_a
	.comm	_AV_SAMPLE_FMT_S16P,4,2         ; @AV_SAMPLE_FMT_S16P
l_.str.2:                               ; @.str.2
	.asciz	"dither s16 buffer"

	.comm	_AV_SAMPLE_FMT_FLTP,4,2         ; @AV_SAMPLE_FMT_FLTP
l_.str.3:                               ; @.str.3
	.asciz	"dither flt buffer"

	.comm	_MUTE_THRESHOLD_SEC,4,2         ; @MUTE_THRESHOLD_SEC
.subsections_via_symbols
