	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aptx_quantize_difference
_aptx_quantize_difference:              ## @aptx_quantize_difference
	.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	%r8, %r14
	movl	%ecx, %ebx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	(%r8), %r15
	movl	%esi, %edi
	callq	_FFABS
	movl	%eax, %edi
	movl	$8388607, %esi                  ## imm = 0x7FFFFF
	callq	_FFMIN
	movl	%eax, %r12d
	movl	%eax, %edi
	sarl	$4, %edi
	movl	16(%r14), %ecx
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_aptx_bin_search
	movl	%eax, %r13d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %esi
	callq	_MULH
	movl	%eax, %edi
	movl	$7, %esi
	callq	_rshift32_clip24
                                        ## kill: def $eax killed $eax def $rax
	leal	-8388608(%rax), %edi
	movq	8(%r14), %rax
	movslq	%r13d, %r13
	movl	(%rax,%r13,4), %esi
	callq	_MUL64
	movl	%eax, %edi
	movl	$23, %esi
	callq	_rshift64
	movl	%eax, %r14d
	movl	(%r15,%r13,4), %eax
	movl	4(%r15,%r13,4), %ecx
	leal	(%rax,%rcx), %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	subl	%eax, %ecx
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%eax, %r15d
	orl	$1, %esi
	imull	%ecx, %esi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_MUL64
	addl	%r14d, %ebx
	movl	%ebx, %edi
	movl	$23, %esi
	callq	_av_clip_intp2
	movl	$32, %esi
	callq	_rshift64_clip24
	shll	$20, %r12d
	movl	%eax, %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_MUL64
	leal	-1(%r13), %ecx
	subl	%eax, %r12d
	movl	%ecx, %ebx
	cmovsl	%r13d, %ebx
	cmovsl	%ecx, %r13d
	movl	%r12d, %edi
	movl	$23, %esi
	callq	_rshift64
	movl	%eax, %edi
	callq	_FFABS
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 8(%rcx)
	xorl	%r15d, %r13d
	movl	%r13d, (%rcx)
	xorl	%r15d, %ebx
	movl	%ebx, 4(%rcx)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_aptx_quantize_difference
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aptx_quantize_difference
_aptx_quantize_difference:              ; @aptx_quantize_difference
	.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	x25, x4
	mov	x20, x3
	mov	x22, x2
	mov	x24, x1
	mov	x19, x0
	ldr	x26, [x4]
	mov	x0, x1
	bl	_FFABS
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w1, #8388607
	bl	_FFMIN
	mov	x23, x0
	asr	w0, w0, #4
	ldr	w3, [x25, #16]
	mov	x1, x20
	mov	x2, x26
	bl	_aptx_bin_search
	mov	x21, x0
	mov	x0, x22
	mov	x1, x22
	bl	_MULH
	mov	w1, #7
	bl	_rshift32_clip24
	sub	w0, w0, #2048, lsl #12          ; =8388608
	ldr	x8, [x25, #8]
	sbfiz	x27, x21, #2, #32
	ldr	w1, [x8, x27]
	bl	_MUL64
	mov	w1, #23
	bl	_rshift64
	mov	x25, x0
	add	x8, x26, x27
	ldp	w8, w9, [x8]
	add	w10, w8, w9
	cmp	w10, #0
	cinc	w26, w10, lt
	sub	w8, w9, w8
	asr	w24, w24, #31
	orr	w9, w24, #0x1
	mul	w1, w8, w9
	mov	x0, x22
	bl	_MUL64
	add	w0, w25, w26, asr #1
	mov	w1, #23
	bl	_av_clip_intp2
	mov	w1, #32
	bl	_rshift64_clip24
	lsl	w22, w23, #20
	mov	x1, x20
	bl	_MUL64
	sub	w20, w22, w0
	mov	x0, x20
	mov	w1, #23
	bl	_rshift64
	bl	_FFABS
	str	x0, [x19, #8]
	sub	w8, w21, #1
	cmp	w20, #0
	csel	w9, w21, w8, lt
	csel	w8, w8, w21, lt
	eor	w8, w8, w24
	eor	w9, w9, w24
	stp	w8, w9, [x19]
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_aptx_quantize_difference
.subsections_via_symbols
