	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aptx_encode_frame
_aptx_encode_frame:                     ## @aptx_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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r15
	leaq	4(%r15), %r14
	movq	%r14, %rdi
	movq	%rdx, %rsi
	callq	_ff_af_queue_add
	testl	%eax, %eax
	js	LBB0_9
## %bb.1:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r14d
	movq	%r15, -104(%rbp)                ## 8-byte Spill
	imull	(%r15), %r14d
	leal	3(%r14), %edx
	testl	%r14d, %r14d
	cmovnsl	%r14d, %edx
	sarl	$2, %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	xorl	%ecx, %ecx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_9
## %bb.2:
	cmpl	$4, %r14d
	jl	LBB0_8
## %bb.3:
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_NB_CHANNELS@GOTPCREL(%rip), %r14
	xorl	%r15d, %r15d
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-120(%rbp), %r15                ## 8-byte Reload
	movslq	%r15d, %r15
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	movq	8(%r13), %rdx
	addq	%r15, %rdx
	movq	-104(%rbp), %r14                ## 8-byte Reload
	movq	%r14, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_aptx_encode_samples
	movq	-112(%rbp), %rsp                ## 8-byte Reload
	addl	(%r14), %r15d
	addq	$4, -64(%rbp)                   ## 8-byte Folded Spill
	cmpl	-52(%rbp), %r15d                ## 4-byte Folded Reload
	movq	_NB_CHANNELS@GOTPCREL(%rip), %r14
	jge	LBB0_8
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	%r15, -120(%rbp)                ## 8-byte Spill
	movq	%rsp, -112(%rbp)                ## 8-byte Spill
	movl	(%r14), %eax
	shlq	$4, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -72(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r14)
	jle	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %r15                 ## 8-byte Reload
                                        ## kill: def $r15d killed $r15d killed $r15 def $r15
	andl	$1073741820, %r15d              ## imm = 0x3FFFFFFC
	shlq	$2, %r15
	leaq	4(%r15), %rax
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	leaq	8(%r15), %rax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	leaq	12(%r15), %r13
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	12(%rax), %r12
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rbx), %rax
	leaq	(,%r15,4), %rdi
	addq	(%rax,%r14,8), %rdi
	callq	_AV_RN32A
	sarl	$8, %eax
	movl	%eax, -12(%r12)
	movq	8(%rbx), %rax
	movq	-136(%rbp), %rcx                ## 8-byte Reload
	leaq	(,%rcx,4), %rdi
	addq	(%rax,%r14,8), %rdi
	callq	_AV_RN32A
	sarl	$8, %eax
	movl	%eax, -8(%r12)
	movq	8(%rbx), %rax
	movq	-128(%rbp), %rcx                ## 8-byte Reload
	leaq	(,%rcx,4), %rdi
	addq	(%rax,%r14,8), %rdi
	callq	_AV_RN32A
	sarl	$8, %eax
	movl	%eax, -4(%r12)
	movq	8(%rbx), %rax
	leaq	(,%r13,4), %rdi
	addq	(%rax,%r14,8), %rdi
	callq	_AV_RN32A
	sarl	$8, %eax
	movl	%eax, (%r12)
	incq	%r14
	movq	_NB_CHANNELS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$16, %r12
	cmpq	%rax, %r14
	jl	LBB0_6
	jmp	LBB0_7
LBB0_8:
	movl	(%rbx), %esi
	leaq	4(%r13), %rdx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rcx
	callq	_ff_af_queue_remove
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	xorl	%eax, %eax
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_11
## %bb.10:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NB_CHANNELS,4,2                ## @NB_CHANNELS
	.no_dead_strip	_aptx_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aptx_encode_frame
_aptx_encode_frame:                     ; @aptx_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
	sub	sp, sp, #80
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x25, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	x24, [x0]
	add	x23, x24, #4
	mov	x0, x23
	mov	x1, x2
	bl	_ff_af_queue_add
	tbnz	w0, #31, LBB0_9
; %bb.1:
	ldr	w8, [x24]
	ldr	w9, [x21]
	mul	w19, w9, w8
	add	w8, w19, #3
	cmp	w19, #0
	csel	w8, w8, w19, lt
	asr	w2, w8, #2
	mov	x0, x25
	mov	x1, x22
	stur	w2, [x29, #-116]                ; 4-byte Folded Spill
	mov	w3, #0
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_9
; %bb.2:
	stp	x23, x20, [x29, #-152]          ; 16-byte Folded Spill
	cmp	w19, #4
	b.lt	LBB0_8
; %bb.3:
	stur	xzr, [x29, #-96]                ; 8-byte Folded Spill
	mov	w27, #0
Lloh3:
	adrp	x28, _NB_CHANNELS@GOTPAGE
Lloh4:
	ldr	x28, [x28, _NB_CHANNELS@GOTPAGEOFF]
	stp	x24, x22, [x29, #-136]          ; 16-byte Folded Spill
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldp	x24, x22, [x29, #-136]          ; 16-byte Folded Reload
	ldr	x8, [x22, #8]
	add	x2, x8, w27, sxtw
	mov	x0, x24
	ldur	x1, [x29, #-104]                ; 8-byte Folded Reload
	bl	_aptx_encode_samples
	ldur	x8, [x29, #-112]                ; 8-byte Folded Reload
	mov	sp, x8
	ldr	w8, [x24]
	ldur	x9, [x29, #-96]                 ; 8-byte Folded Reload
	add	x9, x9, #4
	stur	x9, [x29, #-96]                 ; 8-byte Folded Spill
	add	w27, w8, w27
	ldur	w8, [x29, #-116]                ; 4-byte Folded Reload
	cmp	w27, w8
	b.ge	LBB0_8
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	x8, sp
	stur	x8, [x29, #-112]                ; 8-byte Folded Spill
	ldr	w8, [x28]
	lsl	x8, x8, #4
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x8, x9, x8
	stur	x8, [x29, #-104]                ; 8-byte Folded Spill
	mov	sp, x8
	ldr	w8, [x28]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x22, #0
	ldur	x8, [x29, #-96]                 ; 8-byte Folded Reload
	lsl	w8, w8, #2
	and	x20, x8, #0xfffffff0
	orr	x24, x20, #0x4
	orr	x23, x20, #0x8
	orr	x19, x20, #0xc
	ldur	x8, [x29, #-104]                ; 8-byte Folded Reload
	add	x25, x8, #8
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x21, #8]
	lsl	x26, x22, #3
	ldr	x8, [x8, x26]
	add	x0, x8, x20, lsl #2
	bl	_AV_RN32A
	asr	w8, w0, #8
	stur	w8, [x25, #-8]
	ldr	x8, [x21, #8]
	ldr	x8, [x8, x26]
	add	x0, x8, x24, lsl #2
	bl	_AV_RN32A
	asr	w8, w0, #8
	stur	w8, [x25, #-4]
	ldr	x8, [x21, #8]
	ldr	x8, [x8, x26]
	add	x0, x8, x23, lsl #2
	bl	_AV_RN32A
	asr	w8, w0, #8
	str	w8, [x25]
	ldr	x8, [x21, #8]
	ldr	x8, [x8, x26]
	add	x0, x8, x19, lsl #2
	bl	_AV_RN32A
	asr	w8, w0, #8
	str	w8, [x25, #4]
	add	x22, x22, #1
	ldrsw	x8, [x28]
	add	x25, x25, #16
	cmp	x22, x8
	b.lt	LBB0_7
	b	LBB0_4
LBB0_8:
	ldr	w1, [x21]
	add	x2, x22, #4
	ldur	x0, [x29, #-152]                ; 8-byte Folded Reload
	mov	x3, x22
	bl	_ff_af_queue_remove
	mov	w0, #0
	mov	w8, #1
	ldur	x9, [x29, #-144]                ; 8-byte Folded Reload
	str	w8, [x9]
LBB0_9:
	ldur	x8, [x29, #-88]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	sub	sp, x29, #80
	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_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_NB_CHANNELS,4,2                ; @NB_CHANNELS
	.no_dead_strip	_aptx_encode_frame
.subsections_via_symbols
