	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opus_encode_frame
_opus_encode_frame:                     ## @opus_encode_frame
	.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
	movq	%rcx, %r12
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	8(%rdi), %r15
	testq	%rdx, %rdx
	je	LBB0_3
## %bb.1:
	leaq	8(%r15), %rdi
	movq	%r14, %rsi
	callq	_ff_af_queue_add
	testl	%eax, %eax
	js	LBB0_22
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	36(%r15), %rbx
	movq	%r14, %rdi
	callq	_av_frame_clone
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_ff_bufqueue_add
	jmp	LBB0_5
LBB0_3:
	leaq	32(%r15), %rdi
	callq	_ff_opus_psy_signal_eof
	xorl	%eax, %eax
	cmpl	$0, 8(%r15)
	je	LBB0_22
## %bb.4:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r13)
	je	LBB0_22
LBB0_5:
	leaq	32(%r15), %rbx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ff_opus_psy_process
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_22
## %bb.6:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	4(%r15), %edi
	callq	_OPUS_BLOCK_SIZE
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testq	%r14, %r14
	jne	LBB0_11
## %bb.7:
	movq	40(%r15), %rcx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	(%rcx)
	movl	%eax, %ebx
	imull	(%r15), %ebx
	subl	36(%r15), %ebx
	jl	LBB0_11
## %bb.8:
	leaq	36(%r15), %r14
	incl	%ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_spawn_empty_frame
	testq	%rax, %rax
	je	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ff_bufqueue_add
	decl	%ebx
	jne	LBB0_9
LBB0_11:
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_12
## %bb.18:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	24(%r15), %rdx
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rsi
	addq	%r12, %rsi
	addq	%r12, %rdx
	movq	%r15, %rdi
	movl	%ebx, %ecx
	callq	_celt_encode_frame
	movq	24(%r15), %rdx
	movl	(%rdx,%r12), %eax
	sarl	$3, %eax
	addl	%eax, %r14d
	incq	%rbx
	movslq	(%r15), %rax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jl	LBB0_19
## %bb.13:
	addl	$2, %r14d
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_12:
	movl	$2, %r14d
LBB0_14:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leal	(%r14,%rax,2), %edx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_22
## %bb.15:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_opus_packet_assembler
	movq	16(%r15), %rdx
	movq	24(%r15), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_ff_opus_psy_postencode_update
	leaq	8(%r15), %rdi
	movl	(%r15), %esi
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	imull	%r14d, %esi
	leaq	4(%rbx), %rdx
	movq	%rbx, %rcx
	callq	_ff_af_queue_remove
	movl	(%r15), %eax
	imull	%r14d, %eax
	cmpl	(%rbx), %eax
	jle	LBB0_21
## %bb.16:
	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_17
## %bb.20:
	imull	(%r15), %r14d
	addq	$16, %rax
	subl	(%rbx), %r14d
	addl	$120, %r14d
	movq	%rax, %rdi
	movl	%r14d, %esi
	callq	_AV_WL32
LBB0_21:
	movl	$1, (%r12)
	xorl	%eax, %eax
LBB0_22:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_PKT_DATA_SKIP_SAMPLES,4,2   ## @AV_PKT_DATA_SKIP_SAMPLES
	.no_dead_strip	_opus_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opus_encode_frame
_opus_encode_frame:                     ; @opus_encode_frame
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x25, x2
	mov	x20, x1
	mov	x23, x0
	ldr	x21, [x0, #8]
	cbz	x2, LBB0_3
; %bb.1:
	add	x0, x21, #8
	mov	x1, x25
	bl	_ff_af_queue_add
	tbnz	w0, #31, LBB0_7
; %bb.2:
	add	x22, x21, #36
	mov	x0, x25
	bl	_av_frame_clone
	mov	x2, x0
	mov	x0, x23
	mov	x1, x22
	bl	_ff_bufqueue_add
	b	LBB0_5
LBB0_3:
	add	x0, x21, #32
	bl	_ff_opus_psy_signal_eof
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_6
; %bb.4:
	ldr	w8, [x23]
	cbz	w8, LBB0_6
LBB0_5:
	add	x24, x21, #32
	mov	x0, x24
	mov	x1, x21
	bl	_ff_opus_psy_process
	cbz	x0, LBB0_8
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	w0, [x21, #4]
	bl	_OPUS_BLOCK_SIZE
	mov	x22, x0
	cbnz	x25, LBB0_13
; %bb.9:
	ldr	w8, [x21]
	ldr	x9, [x21, #40]
	ldr	w9, [x9]
	sdiv	w9, w22, w9
	mul	w8, w9, w8
	mov	x25, x21
	ldr	w9, [x25, #36]!
	subs	w8, w8, w9
	b.lt	LBB0_13
; %bb.10:
	add	w26, w8, #1
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_spawn_empty_frame
	cbz	x0, LBB0_23
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x2, x0
	mov	x0, x23
	mov	x1, x25
	bl	_ff_bufqueue_add
	subs	w26, w26, #1
	b.ne	LBB0_11
LBB0_13:
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_17
; %bb.14:
	mov	x27, #0
	mov	x25, #0
	mov	w26, #0
	ldr	x8, [x21, #24]
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x21, #16]
	add	x1, x9, x27
	add	x2, x8, x27
	mov	x0, x21
	mov	x3, x25
	bl	_celt_encode_frame
	ldr	x8, [x21, #24]
	ldr	w9, [x8, x27]
	add	w26, w26, w9, asr #3
	add	x25, x25, #1
	ldrsw	x9, [x21]
	add	x27, x27, #4
	cmp	x25, x9
	b.lt	LBB0_15
; %bb.16:
	add	w8, w26, #2
	b	LBB0_18
LBB0_17:
	mov	w8, #2
LBB0_18:
	add	w2, w8, w9, lsl #1
	mov	x0, x23
	mov	x1, x20
	mov	w3, #0
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_7
; %bb.19:
	mov	x0, x21
	mov	x1, x20
	bl	_opus_packet_assembler
	ldp	x2, x1, [x21, #16]
	mov	x0, x24
	bl	_ff_opus_psy_postencode_update
	add	x0, x21, #8
	ldr	w8, [x21]
	mul	w1, w8, w22
	add	x2, x20, #4
	mov	x3, x20
	bl	_ff_af_queue_remove
	ldr	w8, [x21]
	mul	w8, w8, w22
	ldr	w9, [x20]
	cmp	w8, w9
	b.le	LBB0_22
; %bb.20:
Lloh0:
	adrp	x8, _AV_PKT_DATA_SKIP_SAMPLES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_PKT_DATA_SKIP_SAMPLES@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #10
	bl	_av_packet_new_side_data
	cbz	x0, LBB0_23
; %bb.21:
	add	x0, x0, #16
	ldr	w8, [x21]
	ldr	w9, [x20]
	neg	w9, w9
	madd	w8, w8, w22, w9
	add	w1, w8, #120
	bl	_AV_WL32
LBB0_22:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_7
LBB0_23:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_PKT_DATA_SKIP_SAMPLES,4,2   ; @AV_PKT_DATA_SKIP_SAMPLES
	.no_dead_strip	_opus_encode_frame
.subsections_via_symbols
