	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libopus_encode
_libopus_encode:                        ## @libopus_encode
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	(%rdi), %rdi
	movq	16(%r13), %r15
	callq	_av_get_bytes_per_sample
	movl	8(%r13), %ebx
	imull	%eax, %ebx
	testq	%r14, %r14
	je	LBB0_7
## %bb.1:
	movl	%eax, %r12d
	leaq	8(%r15), %rdi
	movq	%r14, %rsi
	callq	_ff_af_queue_add
	testl	%eax, %eax
	js	LBB0_20
## %bb.2:
	movq	32(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.3:
	movq	24(%r15), %rdi
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	movl	8(%r13), %ecx
	movl	(%r14), %r8d
	movq	%rdi, %r14
	movl	%r12d, %r9d
	callq	_libopus_copy_samples_with_channel_map
	jmp	LBB0_11
LBB0_7:
	xorl	%eax, %eax
	cmpl	$0, 16(%r15)
	je	LBB0_20
## %bb.8:
	cmpl	$0, 12(%r15)
	jne	LBB0_10
## %bb.9:
	cmpl	$0, 8(%r15)
	je	LBB0_20
LBB0_10:
	movq	24(%r15), %r14
	imull	4(%r15), %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_memset
	jmp	LBB0_11
LBB0_4:
	movl	(%r14), %edx
	cmpl	4(%r15), %edx
	jge	LBB0_6
## %bb.5:
	movq	24(%r15), %rcx
	movq	8(%r14), %rax
	movq	%rcx, %r14
	movq	(%rax), %rsi
	imull	%ebx, %edx
	movq	%rcx, %rdi
	callq	_memcpy
	jmp	LBB0_11
LBB0_6:
	movq	8(%r14), %rax
	movq	(%rax), %r14
LBB0_11:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	imull	$7657, (%r15), %edx             ## imm = 0x1DE9
	movq	%r13, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_20
## %bb.12:
	movq	(%r13), %rax
	movq	_AV_SAMPLE_FMT_FLT@GOTPCREL(%rip), %rcx
	movl	20(%r15), %edi
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.13:
	movl	4(%r15), %edx
	movl	8(%rbx), %r8d
	movl	12(%rbx), %ecx
	movq	%r14, %rsi
	callq	_opus_multistream_encode_float
	jmp	LBB0_15
LBB0_14:
	movl	4(%r15), %edx
	movl	8(%rbx), %r8d
	movl	12(%rbx), %ecx
	movq	%r14, %rsi
	callq	_opus_multistream_encode
LBB0_15:
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_21
## %bb.16:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_av_shrink_packet
	leaq	8(%r15), %rdi
	movl	4(%r15), %esi
	leaq	4(%rbx), %rdx
	movq	%rbx, %rcx
	callq	_ff_af_queue_remove
	movl	4(%r15), %r14d
	subl	(%rbx), %r14d
	jle	LBB0_19
## %bb.17:
	movq	_AV_PKT_DATA_SKIP_SAMPLES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$10, %edx
	callq	_av_packet_new_side_data
	testq	%rax, %rax
	je	LBB0_22
## %bb.18:
	addq	$16, %rax
	movq	%rax, %rdi
	movl	%r14d, %esi
	callq	_AV_WL32
LBB0_19:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	xorl	%eax, %eax
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r12d, %edi
	callq	_opus_strerror
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%eax, %ecx
	callq	_av_log
	movl	%r12d, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ff_opus_error_to_averror       ## TAILCALL
LBB0_22:
	movq	%rbx, %rdi
	callq	_av_packet_unref
	movq	%rbx, %rdi
	callq	_av_free
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_SAMPLE_FMT_FLT,8,3          ## @AV_SAMPLE_FMT_FLT
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error encoding frame: %s\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AV_PKT_DATA_SKIP_SAMPLES,4,2   ## @AV_PKT_DATA_SKIP_SAMPLES
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_libopus_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function libopus_encode
_libopus_encode:                        ; @libopus_encode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x3
	mov	x23, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x25, [x0, #16]
	ldr	x0, [x0]
	bl	_av_get_bytes_per_sample
	ldr	w8, [x21, #8]
	mul	w26, w8, w0
	cbz	x23, LBB0_4
; %bb.1:
	mov	x24, x0
	add	x0, x25, #8
	mov	x1, x23
	bl	_ff_af_queue_add
	tbnz	w0, #31, LBB0_19
; %bb.2:
	ldr	x2, [x25, #32]
	cbz	x2, LBB0_9
; %bb.3:
	ldr	x22, [x25, #24]
	ldr	x8, [x23, #8]
	ldr	x1, [x8]
	ldr	w3, [x21, #8]
	ldr	w4, [x23]
	mov	x0, x22
	mov	x5, x24
	bl	_libopus_copy_samples_with_channel_map
	b	LBB0_12
LBB0_4:
	ldr	w8, [x25, #16]
	cbz	w8, LBB0_8
; %bb.5:
	ldr	w8, [x25, #12]
	cbnz	w8, LBB0_7
; %bb.6:
	ldr	w8, [x25, #8]
	cbz	w8, LBB0_8
LBB0_7:
	ldr	x22, [x25, #24]
	ldr	w8, [x25, #4]
	mul	w2, w8, w26
	mov	x0, x22
	mov	w1, #0
	bl	_memset
	b	LBB0_12
LBB0_8:
	mov	w0, #0
	b	LBB0_19
LBB0_9:
	ldr	w8, [x23]
	ldr	w9, [x25, #4]
	cmp	w8, w9
	b.ge	LBB0_11
; %bb.10:
	ldr	x22, [x25, #24]
	ldr	x9, [x23, #8]
	ldr	x1, [x9]
	mul	w2, w8, w26
	mov	x0, x22
	bl	_memcpy
	b	LBB0_12
LBB0_11:
	ldr	x8, [x23, #8]
	ldr	x22, [x8]
LBB0_12:
	ldr	w8, [x25]
	mov	w9, #7657
	mul	w2, w8, w9
	mov	x0, x21
	mov	x1, x20
	mov	w3, #0
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_19
; %bb.13:
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _AV_SAMPLE_FMT_FLT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AV_SAMPLE_FMT_FLT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w0, [x25, #20]
	cmp	x8, x9
	b.ne	LBB0_20
; %bb.14:
	ldr	w2, [x25, #4]
	ldp	w4, w3, [x20, #8]
	mov	x1, x22
	bl	_opus_multistream_encode_float
	mov	x22, x0
	tbnz	w0, #31, LBB0_21
LBB0_15:
	mov	x0, x20
	mov	x1, x22
	bl	_av_shrink_packet
	add	x0, x25, #8
	ldr	w1, [x25, #4]
	add	x2, x20, #4
	mov	x3, x20
	bl	_ff_af_queue_remove
	ldr	w8, [x25, #4]
	ldr	w9, [x20]
	sub	w21, w8, w9
	cmp	w21, #1
	b.lt	LBB0_18
; %bb.16:
Lloh3:
	adrp	x8, _AV_PKT_DATA_SKIP_SAMPLES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_PKT_DATA_SKIP_SAMPLES@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #10
	bl	_av_packet_new_side_data
	cbz	x0, LBB0_22
; %bb.17:
	add	x0, x0, #16
	mov	x1, x21
	bl	_AV_WL32
LBB0_18:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19]
LBB0_19:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_20:
	ldr	w2, [x25, #4]
	ldp	w4, w3, [x20, #8]
	mov	x1, x22
	bl	_opus_multistream_encode
	mov	x22, x0
	tbz	w0, #31, LBB0_15
LBB0_21:
Lloh6:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w19, [x8]
	mov	x0, x22
	bl	_opus_strerror
	mov	x3, x0
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	mov	x1, x19
	bl	_av_log
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ff_opus_error_to_averror
LBB0_22:
	mov	x0, x20
	bl	_av_packet_unref
	mov	x0, x20
	bl	_av_free
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_SAMPLE_FMT_FLT,8,3          ; @AV_SAMPLE_FMT_FLT
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error encoding frame: %s\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AV_PKT_DATA_SKIP_SAMPLES,4,2   ; @AV_PKT_DATA_SKIP_SAMPLES
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_libopus_encode
.subsections_via_symbols
