	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_one_scale
_calc_one_scale:                        ## @calc_one_scale
	.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
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r12
	xorl	%edi, %edi
	testl	%esi, %esi
	setle	%dil
	callq	_av_assert0
	xorl	%edi, %edi
	cmpl	$-2047, %ebx                    ## imm = 0xF801
	setge	%dil
	callq	_av_assert0
	movq	(%r12), %rax
	negl	%ebx
	movslq	%ebx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movslq	%r15d, %rbx
	movl	$64, %r12d
	movl	$127, %edi
	movq	_scalefactor_inv@GOTPCREL(%rip), %rsi
	movq	_stepsize_inv@GOTPCREL(%rip), %r8
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %r8
	movq	_scalefactor_inv@GOTPCREL(%rip), %rsi
	movq	%r14, %rbx
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%r12d, %eax
	shrl	%eax
	cmpl	$1, %r12d
	movl	%eax, %r12d
	jbe	LBB0_6
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rsi), %rax
	movl	%edi, %r13d
	subl	%r12d, %r13d
	movslq	%r13d, %r15
	movq	(%r8), %rcx
	movl	(%rcx,%rbx,8), %edx
	addl	(%rax,%r15,8), %edx
	cmpl	$18, %edx
	jl	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	movl	4(%rax,%r15,8), %edi
	movl	4(%rcx,%rbx,8), %esi
	movq	%r8, %r14
	callq	_mul32
	movq	_scalefactor_inv@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%r15,8), %ecx
	movq	%r14, %r15
	movq	(%r14), %rdx
	movl	(%rdx,%rbx,8), %edx
	leal	-17(%rcx,%rdx), %esi
	movq	_ff_dca_quant_levels@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rbx, %r14
	movl	(%rcx,%rbx,4), %ecx
	movl	%ecx, %edx
	decl	%edx
	shrl	$31, %edx
	leal	(%rcx,%rdx), %ebx
	decl	%ebx
	sarl	%ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rax, %rdx
	callq	_quantize_value
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	cmpl	%eax, %ebx
	jl	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, %edi
	jmp	LBB0_4
LBB0_6:
	cmpl	$124, %edi
	movl	$124, %eax
	cmovll	%edi, %eax
	movq	(%rsi), %rcx
	movslq	%eax, %r12
	movl	4(%rcx,%r12,8), %edi
	movq	(%r8), %rax
	movq	%rsi, %r14
	movl	4(%rax,%rbx,8), %esi
	movq	%r8, %r15
	callq	_mul32
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, 8(%rdi)
	movq	(%r14), %rcx
	movl	(%rcx,%r12,8), %ecx
	movq	(%r15), %rdx
	movl	(%rdx,%rbx,8), %edx
	leal	-17(%rcx,%rdx), %esi
	movl	%esi, (%rdi)
	movq	_ff_dca_quant_levels@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rbx,4), %ecx
	movl	%ecx, %edx
	decl	%edx
	shrl	$31, %edx
	leal	(%rcx,%rdx), %ebx
	decl	%ebx
	sarl	%ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rax, %rdx
	callq	_quantize_value
	xorl	%edi, %edi
	cmpl	%eax, %ebx
	setge	%dil
	callq	_av_assert0
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_scalefactor_inv,8,3            ## @scalefactor_inv
	.comm	_stepsize_inv,8,3               ## @stepsize_inv
	.comm	_ff_dca_quant_levels,8,3        ## @ff_dca_quant_levels
	.no_dead_strip	_calc_one_scale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_one_scale
_calc_one_scale:                        ; @calc_one_scale
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	str	x3, [sp, #8]                    ; 8-byte Folded Spill
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	cmp	w1, #1
	cset	w0, lt
	bl	_av_assert0
	cmn	w20, #2048
	cset	w0, gt
	bl	_av_assert0
	ldr	x8, [x22]
	neg	w9, w20
	ldr	w20, [x8, w9, sxtw #2]
	sxtw	x22, w21
	mov	w21, #64
Lloh0:
	adrp	x26, _scalefactor_inv@GOTPAGE
Lloh1:
	ldr	x26, [x26, _scalefactor_inv@GOTPAGEOFF]
	mov	w27, #127
Lloh2:
	adrp	x24, _stepsize_inv@GOTPAGE
Lloh3:
	ldr	x24, [x24, _stepsize_inv@GOTPAGEOFF]
	lsl	x25, x22, #3
Lloh4:
	adrp	x23, _ff_dca_quant_levels@GOTPAGE
Lloh5:
	ldr	x23, [x23, _ff_dca_quant_levels@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	lsr	w8, w21, #1
	cmp	w21, #1
	mov	x21, x8
	b.ls	LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	sub	w10, w27, w21
	sbfiz	x9, x10, #3, #32
	ldr	w11, [x8, x9]
	ldr	x9, [x24]
	ldr	w12, [x9, x25]
	add	w11, w12, w11
	cmp	w11, #18
	b.lt	LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sxtw	x28, w10
	lsl	x19, x28, #3
	add	x8, x8, x19
	ldr	w0, [x8, #4]
	add	x8, x9, x25
	ldr	w1, [x8, #4]
	bl	_mul32
	mov	x2, x0
	ldr	x8, [x26]
	ldr	w8, [x8, x19]
	ldr	x9, [x24]
	ldr	w9, [x9, x25]
	add	w8, w8, w9
	sub	w1, w8, #17
	ldr	x8, [x23]
	ldr	w8, [x8, x22, lsl #2]
	sub	w9, w8, #1
	cmp	w9, #0
	csel	w19, w8, w9, lt
	mov	x0, x20
	bl	_quantize_value
	cmp	w0, w19, asr #1
	csel	w27, w27, w28, gt
	b	LBB0_1
LBB0_4:
	mov	w8, #124
	cmp	w27, #124
	csel	w21, w27, w8, lt
	ldr	x8, [x26]
	sbfiz	x19, x21, #3, #32
	add	x8, x8, x19
	ldr	w0, [x8, #4]
	ldr	x8, [x24]
	add	x8, x8, x25
	ldr	w1, [x8, #4]
	bl	_mul32
	mov	x2, x0
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	str	x0, [x10, #8]
	ldr	x8, [x26]
	ldr	w8, [x8, x19]
	ldr	x9, [x24]
	ldr	w9, [x9, x25]
	add	w8, w8, w9
	sub	w8, w8, #17
	str	w8, [x10]
	ldr	x8, [x23]
	ldr	w8, [x8, x22, lsl #2]
	sub	w9, w8, #1
	cmp	w9, #0
	csel	w19, w8, w9, lt
	ldr	x1, [x10]
	mov	x0, x20
	bl	_quantize_value
	cmp	w0, w19, asr #1
	cset	w0, le
	bl	_av_assert0
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_scalefactor_inv,8,3            ; @scalefactor_inv
	.comm	_stepsize_inv,8,3               ; @stepsize_inv
	.comm	_ff_dca_quant_levels,8,3        ; @ff_dca_quant_levels
	.no_dead_strip	_calc_one_scale
.subsections_via_symbols
