	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function lms_adapt_bg
LCPI0_0:
	.long	16384                           ## 0x4000
	.long	16384                           ## 0x4000
	.long	16384                           ## 0x4000
	.long	16384                           ## 0x4000
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_lms_adapt_bg:                          ## @lms_adapt_bg
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %eax
	movl	%edx, %ecx
	shll	%cl, %eax
	negb	%cl
	sarl	%cl, %esi
	testl	%edx, %edx
	cmovgl	%eax, %esi
	movslq	(%rdi), %r15
	movl	4(%rdi), %r10d
	leal	-1(%r10), %r8d
	testq	%r15, %r15
	jle	LBB0_11
## %bb.1:
	movl	%r10d, %eax
	subl	%r15d, %eax
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	movslq	%r8d, %r8
	movslq	%eax, %r13
	cmpq	%r8, %r13
	movq	%r8, %rax
	cmovlq	%r13, %rax
	movq	8(%rcx), %r9
	negq	%rax
	leaq	(%r8,%rax), %r11
	incq	%r11
	cmpq	$8, %r11
	jb	LBB0_9
## %bb.2:
	cmpq	%r8, %r13
	movq	%r8, %rcx
	cmovlq	%r13, %rcx
	movq	%r8, %rax
	subq	%rcx, %rax
	movl	%r8d, %ecx
	subl	%eax, %ecx
	cmpl	%r8d, %ecx
	jg	LBB0_9
## %bb.3:
	shrq	$32, %rax
	jne	LBB0_9
## %bb.4:
	cmpq	%r8, %r13
	movq	%r8, %rax
	cmovlq	%r13, %rax
	leaq	(%r9,%rax,4), %rcx
	leaq	1(%r8), %rbx
	subq	%r13, %rbx
	leaq	(%rdx,%rbx,4), %rbx
	cmpq	%rbx, %rcx
	jae	LBB0_6
## %bb.5:
	leaq	(%r9,%r8,4), %rcx
	addq	$4, %rcx
	subq	%r13, %rax
	leaq	(%rdx,%rax,4), %rax
	cmpq	%rcx, %rax
	jb	LBB0_9
LBB0_6:
	movq	%r11, %r14
	andq	$-8, %r14
	movd	%esi, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	decl	%r15d
	movq	%r14, %r12
	negq	%r12
	leaq	(%r9,%r8,4), %rbx
	addq	$-12, %rbx
	subq	%r14, %r8
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [16384,16384,16384,16384]
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%r15,%rax), %ecx
	movslq	%ecx, %rcx
	movdqu	-28(%rdx,%rcx,4), %xmm2
	movdqu	-12(%rdx,%rcx,4), %xmm3
	pshufd	$27, %xmm3, %xmm3               ## xmm3 = xmm3[3,2,1,0]
	pshufd	$27, %xmm2, %xmm2               ## xmm2 = xmm2[3,2,1,0]
	pmulld	%xmm0, %xmm3
	pmulld	%xmm0, %xmm2
	paddd	%xmm1, %xmm3
	paddd	%xmm1, %xmm2
	psrad	$15, %xmm3
	psrad	$15, %xmm2
	movdqu	-16(%rbx,%rax,4), %xmm4
	movdqu	(%rbx,%rax,4), %xmm5
	pshufd	$27, %xmm3, %xmm3               ## xmm3 = xmm3[3,2,1,0]
	paddd	%xmm5, %xmm3
	movdqu	%xmm3, (%rbx,%rax,4)
	pshufd	$27, %xmm2, %xmm2               ## xmm2 = xmm2[3,2,1,0]
	paddd	%xmm4, %xmm2
	movdqu	%xmm2, -16(%rbx,%rax,4)
	addq	$-8, %rax
	cmpq	%rax, %r12
	jne	LBB0_7
## %bb.8:
	cmpq	%r14, %r11
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_11
LBB0_9:
	movl	%r15d, %eax
	subl	%r10d, %eax
	movq	%r8, %rcx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leal	(%rax,%rcx), %ebx
	movslq	%ebx, %rbx
	movl	(%rdx,%rbx,4), %ebx
	imull	%esi, %ebx
	addl	$16384, %ebx                    ## imm = 0x4000
	sarl	$15, %ebx
	addl	%ebx, (%r9,%rcx,4)
	leaq	-1(%rcx), %r8
	cmpq	%r13, %rcx
	movq	%r8, %rcx
	jg	LBB0_10
LBB0_11:
	testl	%r8d, %r8d
	js	LBB0_23
## %bb.12:
	movq	8(%rdi), %rax
	movq	16(%rdi), %r11
	movq	8(%rax), %rax
	movl	%r8d, %r14d
	cmpl	$7, %r8d
	jb	LBB0_18
## %bb.13:
	leaq	(%r15,%r14), %rdx
	leaq	(%r11,%rdx,4), %rcx
	addq	$4, %rcx
	cmpq	%rcx, %rax
	jae	LBB0_15
## %bb.14:
	leaq	(%rax,%r14,4), %rcx
	addq	$4, %rcx
	leaq	(%r11,%r15,4), %rdi
	cmpq	%rcx, %rdi
	jb	LBB0_18
LBB0_15:
	leaq	1(%r14), %r9
	movq	%r9, %r10
	andq	$-8, %r10
	movd	%esi, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movq	%r10, %rcx
	negq	%rcx
	leaq	(%r11,%rdx,4), %rbx
	addq	$-12, %rbx
	leaq	(%rax,%r14,4), %rdx
	addq	$-12, %rdx
	subq	%r10, %r14
	xorl	%edi, %edi
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [16384,16384,16384,16384]
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rbx,%rdi,4), %xmm2
	movdqu	(%rbx,%rdi,4), %xmm3
	pshufd	$27, %xmm3, %xmm3               ## xmm3 = xmm3[3,2,1,0]
	pshufd	$27, %xmm2, %xmm2               ## xmm2 = xmm2[3,2,1,0]
	pmulld	%xmm0, %xmm3
	pmulld	%xmm0, %xmm2
	paddd	%xmm1, %xmm3
	paddd	%xmm1, %xmm2
	psrad	$15, %xmm3
	psrad	$15, %xmm2
	movdqu	-16(%rdx,%rdi,4), %xmm4
	movdqu	(%rdx,%rdi,4), %xmm5
	pshufd	$27, %xmm3, %xmm3               ## xmm3 = xmm3[3,2,1,0]
	paddd	%xmm5, %xmm3
	movdqu	%xmm3, (%rdx,%rdi,4)
	pshufd	$27, %xmm2, %xmm2               ## xmm2 = xmm2[3,2,1,0]
	paddd	%xmm4, %xmm2
	movdqu	%xmm2, -16(%rdx,%rdi,4)
	addq	$-8, %rdi
	cmpq	%rdi, %rcx
	jne	LBB0_16
## %bb.17:
	cmpq	%r10, %r9
	je	LBB0_23
LBB0_18:
	movq	%r14, %rcx
	testb	$1, %r14b
	jne	LBB0_20
## %bb.19:
	leaq	(%r14,%r15), %rcx
	movl	(%r11,%rcx,4), %ecx
	imull	%esi, %ecx
	addl	$16384, %ecx                    ## imm = 0x4000
	sarl	$15, %ecx
	addl	%ecx, (%rax,%r14,4)
	leaq	-1(%r14), %rcx
LBB0_20:
	testq	%r14, %r14
	je	LBB0_23
## %bb.21:
	leaq	(%r11,%r15,4), %rdx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rcx,4), %edi
	imull	%esi, %edi
	addl	$16384, %edi                    ## imm = 0x4000
	sarl	$15, %edi
	addl	%edi, (%rax,%rcx,4)
	movl	-4(%rdx,%rcx,4), %edi
	imull	%esi, %edi
	addl	$16384, %edi                    ## imm = 0x4000
	sarl	$15, %edi
	addl	%edi, -4(%rax,%rcx,4)
	addq	$-2, %rcx
	cmpq	$-1, %rcx
	jne	LBB0_22
LBB0_23:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_lms_adapt_bg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lms_adapt_bg
_lms_adapt_bg:                          ; @lms_adapt_bg
	.cfi_startproc
; %bb.0:
	lsl	w8, w1, w2
	neg	w9, w2
	asr	w9, w1, w9
	cmp	w2, #0
	csel	w8, w8, w9, gt
	ldp	w9, w13, [x0]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	sub	w17, w13, #1
	cmp	w9, #1
	b.lt	LBB0_11
; %bb.1:
	sub	w15, w13, w9
	ldp	x11, x10, [x0, #8]
	ldr	x11, [x11, #8]
	sxtw	x16, w17
	sxtw	x12, w15
	cmp	x12, x16
	csel	x14, x12, x16, lt
	sub	x14, x16, x14
	add	x14, x14, #1
	cmp	x14, #16
	b.lo	LBB0_8
; %bb.2:
	cmp	x12, x16
	csel	x1, x12, x16, lt
	sub	x1, x16, x1
	sub	w2, w17, w1
	cmp	w2, w17
	lsr	x17, x1, #32
	ccmp	x17, #0, #0, le
	b.ne	LBB0_8
; %bb.3:
	cmp	x12, x16
	csel	x17, x12, x16, lt
	add	x2, x11, x17, lsl #2
	add	x1, x16, #1
                                        ; kill: def $w15 killed $w15 killed $x15 def $x15
	sxtw	x15, w15
	sub	x3, x1, x15
	add	x3, x10, x3, lsl #2
	cmp	x2, x3
	b.hs	LBB0_5
; %bb.4:
	add	x1, x11, x1, lsl #2
	sub	x15, x17, x15
	add	x15, x10, x15, lsl #2
	cmp	x15, x1
	b.lo	LBB0_8
LBB0_5:
	and	x17, x14, #0xfffffffffffffff0
	sub	x15, x16, x17
	dup.4s	v0, w8
	sub	w1, w9, #1
	add	x16, x11, x16, lsl #2
	sub	x16, x16, #28
	mov	x2, x17
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x3, x10, w1, sxtw #2
	ldur	q1, [x3, #-12]
	rev64.4s	v1, v1
	ext.16b	v1, v1, v1, #8
	ldur	q2, [x3, #-28]
	rev64.4s	v2, v2
	ext.16b	v2, v2, v2, #8
	ldur	q3, [x3, #-44]
	rev64.4s	v3, v3
	ext.16b	v3, v3, v3, #8
	ldur	q4, [x3, #-60]
	rev64.4s	v4, v4
	ext.16b	v4, v4, v4, #8
	movi.4s	v5, #64, lsl #8
	mla.4s	v5, v1, v0
	movi.4s	v1, #64, lsl #8
	mla.4s	v1, v2, v0
	movi.4s	v2, #64, lsl #8
	mla.4s	v2, v3, v0
	movi.4s	v3, #64, lsl #8
	mla.4s	v3, v4, v0
	sshr.4s	v4, v5, #15
	sshr.4s	v1, v1, #15
	sshr.4s	v2, v2, #15
	sshr.4s	v3, v3, #15
	ldp	q6, q5, [x16]
	ldp	q16, q7, [x16, #-32]
	rev64.4s	v4, v4
	ext.16b	v4, v4, v4, #8
	add.4s	v4, v5, v4
	rev64.4s	v1, v1
	ext.16b	v1, v1, v1, #8
	add.4s	v1, v6, v1
	stp	q1, q4, [x16]
	rev64.4s	v1, v2
	ext.16b	v1, v1, v1, #8
	add.4s	v1, v7, v1
	rev64.4s	v2, v3
	ext.16b	v2, v2, v2, #8
	add.4s	v2, v16, v2
	stp	q2, q1, [x16, #-32]
	sub	w1, w1, #16
	sub	x16, x16, #64
	sub	x2, x2, #16
	cbnz	x2, LBB0_6
; %bb.7:
	mov	x16, x15
	cmp	x14, x17
	b.eq	LBB0_10
LBB0_8:
	sub	w13, w9, w13
	orr	w14, wzr, #0x4000
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	w15, w13, w16
	ldr	w15, [x10, w15, sxtw #2]
	madd	w15, w15, w8, w14
	lsl	x17, x16, #2
	ldr	w1, [x11, x17]
	add	w15, w1, w15, asr #15
	str	w15, [x11, x17]
	sub	x15, x16, #1
	cmp	x16, x12
	mov	x16, x15
	b.gt	LBB0_9
LBB0_10:
	tbz	w15, #31, LBB0_12
	b	LBB0_19
LBB0_11:
	mov	x15, x17
	tbnz	w15, #31, LBB0_19
LBB0_12:
	ldp	x10, x12, [x0, #8]
	ldr	x10, [x10, #8]
	mov	w11, w15
	cmp	w15, #15
	b.lo	LBB0_17
; %bb.13:
	add	x15, x10, x11, lsl #2
	add	x13, x15, #4
	add	x14, x12, x9, lsl #2
	add	x16, x9, x11
	add	x16, x12, x16, lsl #2
	add	x17, x16, #4
	cmp	x10, x17
	ccmp	x14, x13, #2, lo
	b.lo	LBB0_17
; %bb.14:
	add	x13, x11, #1
	and	x14, x13, #0x1fffffff0
	sub	x11, x11, x14
	dup.4s	v0, w8
	sub	x15, x15, #28
	sub	x16, x16, #28
	mov	x17, x14
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldp	q2, q1, [x16]
	rev64.4s	v1, v1
	ext.16b	v1, v1, v1, #8
	rev64.4s	v2, v2
	ext.16b	v2, v2, v2, #8
	ldp	q4, q3, [x16, #-32]
	rev64.4s	v3, v3
	ext.16b	v3, v3, v3, #8
	rev64.4s	v4, v4
	ext.16b	v4, v4, v4, #8
	movi.4s	v5, #64, lsl #8
	mla.4s	v5, v1, v0
	movi.4s	v1, #64, lsl #8
	mla.4s	v1, v2, v0
	movi.4s	v2, #64, lsl #8
	mla.4s	v2, v3, v0
	movi.4s	v3, #64, lsl #8
	mla.4s	v3, v4, v0
	sshr.4s	v4, v5, #15
	sshr.4s	v1, v1, #15
	sshr.4s	v2, v2, #15
	sshr.4s	v3, v3, #15
	ldp	q6, q5, [x15]
	ldp	q16, q7, [x15, #-32]
	rev64.4s	v4, v4
	ext.16b	v4, v4, v4, #8
	add.4s	v4, v5, v4
	rev64.4s	v1, v1
	ext.16b	v1, v1, v1, #8
	add.4s	v1, v6, v1
	stp	q1, q4, [x15]
	rev64.4s	v1, v2
	ext.16b	v1, v1, v1, #8
	add.4s	v1, v7, v1
	rev64.4s	v2, v3
	ext.16b	v2, v2, v2, #8
	add.4s	v2, v16, v2
	stp	q2, q1, [x15, #-32]
	sub	x15, x15, #64
	sub	x16, x16, #64
	sub	x17, x17, #16
	cbnz	x17, LBB0_15
; %bb.16:
	cmp	x13, x14
	b.eq	LBB0_19
LBB0_17:
	add	x9, x12, x9, lsl #2
	orr	w12, wzr, #0x4000
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	lsl	x13, x11, #2
	ldr	w14, [x9, x13]
	ldr	w15, [x10, x13]
	madd	w14, w14, w8, w12
	add	w14, w15, w14, asr #15
	str	w14, [x10, x13]
	sub	x11, x11, #1
	cmn	x11, #1
	b.ne	LBB0_18
LBB0_19:
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_lms_adapt_bg
.subsections_via_symbols
