	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function celt_quant_final
LCPI0_0:
	.long	0x3f000000                      ## float 0.5
LCPI0_1:
	.long	0x38800000                      ## float 6.10351563E-5
	.section	__TEXT,__literal8,8byte_literals
	.p2align	2
LCPI0_2:
	.long	0x3f800000                      ## float 1
	.long	0xbf800000                      ## float -1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_celt_quant_final:                      ## @celt_quant_final
	.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, %r15
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	(%rdx), %ecx
	movl	4(%rdx), %eax
	cmpl	%eax, %ecx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	jge	LBB0_5
## %bb.1:
	movslq	%ecx, %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	movslq	4(%r15), %rax
	cmpq	%rax, %r13
	jge	LBB0_4
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_20 Depth 2
	movq	8(%r15), %rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_opus_rc_tell
	subq	%rax, %rbx
	movq	16(%r15), %rcx
	cmpq	%rcx, %rbx
	jl	LBB0_3
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	24(%r15), %rax
	cmpl	$0, (%rax,%r13,4)
	jne	LBB0_22
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	32(%r15), %rax
	movl	(%rax,%r13,4), %eax
	movq	_CELT_MAX_FINE_BITS@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jge	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	testq	%rcx, %rcx
	jle	LBB0_22
## %bb.19:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %r14d
	.p2align	4, 0x90
LBB0_20:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	40(%rcx), %r15
	movb	$13, %cl
	subb	%al, %cl
	movl	$1, %eax
	shll	%cl, %eax
	movq	-8(%r15,%r14,8), %rcx
	xorps	%xmm1, %xmm1
	cvtsi2ss	%eax, %xmm1
	movss	(%rcx,%r13,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -48(%rbp)                ## 4-byte Spill
	mulss	LCPI0_0(%rip), %xmm1
	mulss	LCPI0_1(%rip), %xmm1
	movss	%xmm1, -44(%rbp)                ## 4-byte Spill
	addss	%xmm1, %xmm0
	callq	_FFABS
	movq	%rax, %r12
	movss	-48(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	subss	-44(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_FFABS
	xorl	%ebx, %ebx
	cmpq	%rax, %r12
	setl	%bl
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_ff_opus_rc_put_raw
	movq	-8(%r15,%r14,8), %rax
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movss	(%rax,%r13,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	leaq	LCPI0_2(%rip), %rcx
	movss	-44(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	mulss	(%rcx,%rbx,4), %xmm1
	subss	%xmm1, %xmm0
	movss	%xmm0, (%rax,%r13,4)
	cmpq	%r14, 16(%r15)
	jle	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=2
	movq	32(%r15), %rax
	movl	(%rax,%r13,4), %eax
	incq	%r14
	jmp	LBB0_20
LBB0_3:
	movl	4(%r15), %eax
LBB0_4:
	movl	(%r15), %ecx
LBB0_5:
	cmpl	%eax, %ecx
	jge	LBB0_15
## %bb.6:
	movslq	%ecx, %r13
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%r13
	movslq	4(%r15), %rax
	cmpq	%rax, %r13
	jge	LBB0_15
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movq	8(%r15), %rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_opus_rc_tell
	subq	%rax, %rbx
	movq	16(%r15), %rcx
	cmpq	%rcx, %rbx
	jl	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	24(%r15), %rax
	cmpl	$1, (%rax,%r13,4)
	jne	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	32(%r15), %rax
	movl	(%rax,%r13,4), %eax
	movq	_CELT_MAX_FINE_BITS@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jge	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	testq	%rcx, %rcx
	jle	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	$1, %r14d
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	40(%rcx), %r15
	movb	$13, %cl
	subb	%al, %cl
	movl	$1, %eax
	shll	%cl, %eax
	movq	-8(%r15,%r14,8), %rcx
	xorps	%xmm1, %xmm1
	cvtsi2ss	%eax, %xmm1
	movss	(%rcx,%r13,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -48(%rbp)                ## 4-byte Spill
	mulss	LCPI0_0(%rip), %xmm1
	mulss	LCPI0_1(%rip), %xmm1
	movss	%xmm1, -44(%rbp)                ## 4-byte Spill
	addss	%xmm1, %xmm0
	callq	_FFABS
	movq	%rax, %r12
	movss	-48(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	subss	-44(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_FFABS
	xorl	%ebx, %ebx
	cmpq	%rax, %r12
	setl	%bl
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_ff_opus_rc_put_raw
	movq	-8(%r15,%r14,8), %rax
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movss	(%rax,%r13,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	leaq	LCPI0_2(%rip), %rcx
	movss	-44(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	mulss	(%rcx,%rbx,4), %xmm1
	subss	%xmm1, %xmm0
	movss	%xmm0, (%rax,%r13,4)
	cmpq	%r14, 16(%r15)
	jle	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	movq	32(%r15), %rax
	movl	(%rax,%r13,4), %eax
	incq	%r14
	jmp	LBB0_12
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CELT_MAX_FINE_BITS,4,2         ## @CELT_MAX_FINE_BITS
	.no_dead_strip	_celt_quant_final
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function celt_quant_final
_celt_quant_final:                      ; @celt_quant_final
	.cfi_startproc
; %bb.0:
	stp	d13, d12, [sp, #-144]!          ; 16-byte Folded Spill
	.cfi_def_cfa_offset 144
	stp	d11, d10, [sp, #16]             ; 16-byte Folded Spill
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	.cfi_offset b10, -120
	.cfi_offset b11, -128
	.cfi_offset b12, -136
	.cfi_offset b13, -144
	mov	x19, x2
	mov	x20, x1
	ldp	w9, w8, [x2]
	cmp	w9, w8
	b.ge	LBB0_11
; %bb.1:
	sxtw	x22, w9
	mov	w25, #1
	fmov	s8, #0.50000000
	mov	w26, #947912704
	fmov	s9, #1.00000000
	fmov	s10, #-1.00000000
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x19, #4]
	cmp	x22, x8
	b.ge	LBB0_10
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	ldr	x21, [x19, #8]
	mov	x0, x20
	bl	_opus_rc_tell
	ldr	x9, [x19, #16]
	sub	x8, x21, x0
	cmp	x8, x9
	b.lt	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #24]
	ldr	w8, [x8, x22, lsl #2]
	cbnz	w8, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #32]
	ldr	w8, [x8, x22, lsl #2]
Lloh0:
	adrp	x10, _CELT_MAX_FINE_BITS@GOTPAGE
Lloh1:
	ldr	x10, [x10, _CELT_MAX_FINE_BITS@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	cmp	w8, w10
	ccmp	x9, #1, #8, lt
	b.lt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x27, #0
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x28, [x19, #40]
	lsl	x23, x27, #3
	ldr	x9, [x28, x23]
	lsl	x24, x22, #2
	ldr	s11, [x9, x24]
	mov	w9, #13
	sub	w8, w9, w8
	lsl	w8, w25, w8
	scvtf	s0, w8
	fmul	s0, s0, s8
	fmov	s1, w26
	fmul	s12, s0, s1
	fadd	s0, s11, s12
	bl	_FFABS
	mov	x21, x0
	fsub	s0, s11, s12
	bl	_FFABS
	cmp	x21, x0
	cset	w1, lt
	fcsel	s11, s10, s9, lt
	mov	x0, x20
	mov	w2, #1
	bl	_ff_opus_rc_put_raw
	ldr	x8, [x28, x23]
	ldr	s0, [x8, x24]
	fmsub	s0, s12, s11, s0
	str	s0, [x8, x24]
	add	x27, x27, #1
	ldr	x8, [x19, #16]
	cmp	x8, x27
	b.le	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x19, #32]
	ldr	w8, [x8, x22, lsl #2]
	b	LBB0_7
LBB0_9:
	ldr	w8, [x19, #4]
LBB0_10:
	ldr	w9, [x19]
LBB0_11:
	cmp	w9, w8
	b.ge	LBB0_20
; %bb.12:
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	sxtw	x22, w9
	mov	w25, #1
	fmov	s8, #0.50000000
	mov	w26, #947912704
	fmov	s9, #1.00000000
	fmov	s10, #-1.00000000
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x19, #4]
	cmp	x22, x8
	b.ge	LBB0_20
LBB0_14:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	ldr	x21, [x19, #8]
	mov	x0, x20
	bl	_opus_rc_tell
	ldr	x9, [x19, #16]
	sub	x8, x21, x0
	cmp	x8, x9
	b.lt	LBB0_20
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x19, #24]
	ldr	w8, [x8, x22, lsl #2]
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x19, #32]
	ldr	w8, [x8, x22, lsl #2]
Lloh3:
	adrp	x10, _CELT_MAX_FINE_BITS@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CELT_MAX_FINE_BITS@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w8, w10
	ccmp	x9, #1, #8, lt
	b.lt	LBB0_13
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x27, #0
LBB0_18:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x28, [x19, #40]
	lsl	x23, x27, #3
	ldr	x9, [x28, x23]
	lsl	x24, x22, #2
	ldr	s11, [x9, x24]
	mov	w9, #13
	sub	w8, w9, w8
	lsl	w8, w25, w8
	scvtf	s0, w8
	fmul	s0, s0, s8
	fmov	s1, w26
	fmul	s12, s0, s1
	fadd	s0, s11, s12
	bl	_FFABS
	mov	x21, x0
	fsub	s0, s11, s12
	bl	_FFABS
	cmp	x21, x0
	cset	w1, lt
	fcsel	s11, s10, s9, lt
	mov	x0, x20
	mov	w2, #1
	bl	_ff_opus_rc_put_raw
	ldr	x8, [x28, x23]
	ldr	s0, [x8, x24]
	fmsub	s0, s12, s11, s0
	str	s0, [x8, x24]
	add	x27, x27, #1
	ldr	x8, [x19, #16]
	cmp	x8, x27
	b.le	LBB0_13
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=2
	ldr	x8, [x19, #32]
	ldr	w8, [x8, x22, lsl #2]
	b	LBB0_18
LBB0_20:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #16]             ; 16-byte Folded Reload
	ldp	d13, d12, [sp], #144            ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CELT_MAX_FINE_BITS,4,2         ; @CELT_MAX_FINE_BITS
	.no_dead_strip	_celt_quant_final
.subsections_via_symbols
