	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function celt_extract_collapse_mask
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_celt_extract_collapse_mask:            ## @celt_extract_collapse_mask
	.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	%edx, %ecx
	movl	$1, %edx
	cmpl	$2, %ecx
	jge	LBB0_1
LBB0_14:
	movl	%edx, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%esi, %eax
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	movslq	%eax, %rdx
	movl	%ecx, %r15d
	movl	%eax, %r9d
	andl	$-8, %r9d
	leaq	-8(%r9), %r10
	movq	%r10, %r11
	shrq	$3, %r11
	incq	%r11
	movq	%r11, %r14
	andq	$-2, %r14
	leaq	48(%rdi), %rbx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	leaq	(,%rdx,4), %r12
	xorl	%ecx, %ecx
	pxor	%xmm0, %xmm0
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [1,1,1,1]
	movq	%rdi, %r13
	xorl	%edx, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rcx
	addq	%r12, %rbx
	addq	%r12, %r13
	cmpq	%r15, %rcx
	je	LBB0_14
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##     Child Loop BB0_12 Depth 2
	testl	%eax, %eax
	jle	LBB0_13
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$8, %eax
	jae	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%esi, %esi
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movd	%edx, %xmm2
	movd	%ecx, %xmm3
	pmovzxdq	%xmm3, %xmm4                    ## xmm4 = xmm3[0],zero,xmm3[1],zero
	pxor	%xmm3, %xmm3
	testq	%r10, %r10
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rsi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	-48(%rbx,%rdx,4), %xmm5
	movdqu	-32(%rbx,%rdx,4), %xmm6
	movdqu	-16(%rbx,%rdx,4), %xmm7
	por	%xmm5, %xmm7
	movdqu	(%rbx,%rdx,4), %xmm5
	por	%xmm6, %xmm5
	pcmpeqd	%xmm0, %xmm7
	pandn	%xmm1, %xmm7
	pslld	%xmm4, %xmm7
	pcmpeqd	%xmm0, %xmm5
	pandn	%xmm1, %xmm5
	pslld	%xmm4, %xmm5
	por	%xmm7, %xmm2
	por	%xmm5, %xmm3
	addq	$16, %rdx
	addq	$-2, %rsi
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	testb	$1, %r11b
	je	LBB0_11
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rcx, %rsi
	imulq	-48(%rbp), %rsi                 ## 8-byte Folded Reload
	addq	%rsi, %rdx
	movdqu	(%rdi,%rdx,4), %xmm5
	movdqu	16(%rdi,%rdx,4), %xmm6
	pcmpeqd	%xmm0, %xmm5
	pandn	%xmm1, %xmm5
	pcmpeqd	%xmm0, %xmm6
	pandn	%xmm1, %xmm6
	pslld	%xmm4, %xmm5
	por	%xmm5, %xmm2
	pslld	%xmm4, %xmm6
	por	%xmm6, %xmm3
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	por	%xmm3, %xmm2
	pshufd	$238, %xmm2, %xmm3              ## xmm3 = xmm2[2,3,2,3]
	por	%xmm2, %xmm3
	pshufd	$85, %xmm3, %xmm2               ## xmm2 = xmm3[1,1,1,1]
	por	%xmm3, %xmm2
	movd	%xmm2, %edx
	movq	%r9, %rsi
	cmpq	%rax, %r9
	je	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	xorl	%r8d, %r8d
	cmpl	$0, (%r13,%rsi,4)
	setne	%r8b
	shll	%cl, %r8d
	orl	%r8d, %edx
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_12
	jmp	LBB0_13
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
	testb	$1, %r11b
	jne	LBB0_10
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_celt_extract_collapse_mask
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function celt_extract_collapse_mask
_celt_extract_collapse_mask:            ; @celt_extract_collapse_mask
	.cfi_startproc
; %bb.0:
	cmp	w2, #2
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #1
	ret
LBB0_2:
	mov	x9, #0
	mov	x10, #0
	mov	w8, #0
	sdiv	w11, w1, w2
	mov	x16, x11
	sxtw	x12, w16
	mov	w13, w2
	and	x14, x11, #0xfffffff0
	add	x15, x0, #32
	sbfiz	x16, x16, #2, #32
	movi.4s	v0, #1
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x10, x10, #1
	add	x15, x15, x16
	add	x9, x9, x12
	cmp	x10, x13
	b.eq	LBB0_12
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;     Child Loop BB0_11 Depth 2
	cmp	w12, #1
	b.lt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w12, #16
	b.hs	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x1, #0
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	movi.2d	v1, #0000000000000000
	mov.s	v1[0], w8
	dup.4s	v3, w10
	movi.2d	v2, #0000000000000000
	mov	x8, x14
	mov	x17, x15
	movi.2d	v4, #0000000000000000
	movi.2d	v5, #0000000000000000
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	q6, q7, [x17, #-32]
	ldp	q16, q17, [x17], #64
	cmeq.4s	v6, v6, #0
	bic.16b	v6, v0, v6
	cmeq.4s	v7, v7, #0
	bic.16b	v7, v0, v7
	cmeq.4s	v16, v16, #0
	bic.16b	v16, v0, v16
	cmeq.4s	v17, v17, #0
	bic.16b	v17, v0, v17
	ushl.4s	v6, v6, v3
	ushl.4s	v7, v7, v3
	ushl.4s	v16, v16, v3
	ushl.4s	v17, v17, v3
	orr.16b	v1, v6, v1
	orr.16b	v2, v7, v2
	orr.16b	v4, v16, v4
	orr.16b	v5, v17, v5
	subs	x8, x8, #16
	b.ne	LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	orr.16b	v1, v2, v1
	orr.16b	v1, v4, v1
	orr.16b	v1, v5, v1
	ext.16b	v2, v1, v1, #8
	orr.8b	v1, v1, v2
	fmov	w8, s1
	mov.s	w17, v1[1]
	orr	w8, w8, w17
	mov	x1, x14
	cmp	x14, x11
	b.eq	LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x17, x1, x9
	add	x17, x0, x17, lsl #2
	sub	x1, x11, x1
LBB0_11:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w2, [x17], #4
	cmp	w2, #0
	cset	w2, ne
	lsl	w2, w2, w10
	orr	w8, w2, w8
	subs	x1, x1, #1
	b.ne	LBB0_11
	b	LBB0_3
LBB0_12:
	mov	x0, x8
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_celt_extract_collapse_mask
.subsections_via_symbols
