	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aptx_encode_samples
_aptx_encode_samples:                   ## @aptx_encode_samples
	.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	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	_NB_CHANNELS@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_3
## %bb.1:
	movq	%rsi, %r14
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	addq	%r12, %rdi
	movl	8(%r15), %edx
	movq	%r14, %rsi
	callq	_aptx_encode_channel
	incq	%rbx
	movslq	(%r13), %rax
	addq	$4, %r12
	addq	$16, %r14
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_3:
	movq	(%r15), %rdi
	leaq	12(%r15), %rsi
	callq	_aptx_insert_sync
	cmpl	$0, (%r13)
	jle	LBB0_9
## %bb.4:
	xorl	%r14d, %r14d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r15), %rdi
	addq	%r14, %rdi
	callq	_aptx_pack_codeword
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_AV_WB16
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%r12
	movq	_NB_CHANNELS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$3, %r13
	addq	$4, %r14
	addq	$8, %rbx
	cmpq	%rax, %r12
	jge	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	addq	%r14, %rdi
	movl	8(%r15), %esi
	callq	_aptx_invert_quantize_and_prediction
	cmpl	$0, 8(%r15)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%r13d, %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rdi
	addq	%r14, %rdi
	callq	_aptxhd_pack_codeword
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_AV_WB24
	jmp	LBB0_8
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NB_CHANNELS,4,2                ## @NB_CHANNELS
	.no_dead_strip	_aptx_encode_samples
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aptx_encode_samples
_aptx_encode_samples:                   ; @aptx_encode_samples
	.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, x2
	mov	x20, x0
Lloh0:
	adrp	x23, _NB_CHANNELS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _NB_CHANNELS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x21, x1
	mov	x22, #0
	mov	x24, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	add	x0, x8, x22
	ldr	w2, [x20, #8]
	mov	x1, x21
	bl	_aptx_encode_channel
	add	x24, x24, #1
	ldrsw	x8, [x23]
	add	x22, x22, #4
	add	x21, x21, #16
	cmp	x24, x8
	b.lt	LBB0_2
LBB0_3:
	mov	x1, x20
	ldr	x0, [x1], #12
	bl	_aptx_insert_sync
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.4:
	mov	x24, #0
	mov	x25, #0
	mov	x26, #0
	mov	x21, x19
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x20]
	add	x0, x8, x24
	bl	_aptx_pack_codeword
	mov	x1, x0
	mov	x0, x21
	bl	_AV_WB16
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x23]
	add	x25, x25, #3
	add	x24, x24, #4
	add	x21, x21, #8
	cmp	x26, x8
	b.ge	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	add	x0, x8, x24
	ldr	w1, [x20, #8]
	bl	_aptx_invert_quantize_and_prediction
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x19, w25, uxtw #2
	ldr	x8, [x20]
	add	x0, x8, x24
	bl	_aptxhd_pack_codeword
	mov	x1, x0
	mov	x0, x22
	bl	_AV_WB24
	b	LBB0_6
LBB0_9:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_NB_CHANNELS,4,2                ; @NB_CHANNELS
	.no_dead_strip	_aptx_encode_samples
.subsections_via_symbols
