	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rice_count_exact
_rice_count_exact:                      ## @rice_count_exact
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testl	%esi, %esi
	jle	LBB0_1
## %bb.2:
	movl	%edx, %ecx
	leal	1(%rcx), %r8d
	movl	%esi, %r9d
	cmpl	$8, %esi
	jae	LBB0_4
## %bb.3:
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_1:
	xorl	%eax, %eax
	popq	%rbp
	retq
LBB0_4:
	movl	%r9d, %r10d
	andl	$-8, %r10d
	movd	%ecx, %xmm2
	movd	%r8d, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	(,%r9,4), %rax
	andq	$-32, %rax
	pxor	%xmm1, %xmm1
	xorl	%edx, %edx
	pcmpeqd	%xmm8, %xmm8
	pmovzxdq	%xmm2, %xmm4                    ## xmm4 = xmm2[0],zero,xmm2[1],zero
	pxor	%xmm2, %xmm2
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rdx), %xmm5
	movdqu	16(%rdi,%rdx), %xmm3
	paddd	%xmm5, %xmm5
	pxor	%xmm8, %xmm5
	paddd	%xmm3, %xmm3
	pxor	%xmm8, %xmm3
	movdqa	%xmm5, %xmm7
	psrad	$31, %xmm7
	movdqa	%xmm3, %xmm6
	psrad	$31, %xmm6
	pxor	%xmm5, %xmm7
	pxor	%xmm3, %xmm6
	psrad	%xmm4, %xmm7
	psrad	%xmm4, %xmm6
	paddd	%xmm0, %xmm1
	paddd	%xmm7, %xmm1
	paddd	%xmm0, %xmm2
	paddd	%xmm6, %xmm2
	addq	$32, %rdx
	cmpq	%rdx, %rax
	jne	LBB0_5
## %bb.6:
	paddd	%xmm1, %xmm2
	pshufd	$238, %xmm2, %xmm0              ## xmm0 = xmm2[2,3,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpq	%r9, %r10
	je	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%r10,4), %esi
	addl	%esi, %esi
	notl	%esi
	movl	%esi, %edx
	sarl	$31, %edx
	xorl	%esi, %edx
	sarl	%cl, %edx
	addl	%r8d, %eax
	addl	%edx, %eax
	incq	%r10
	cmpq	%r10, %r9
	jne	LBB0_7
LBB0_8:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_rice_count_exact
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rice_count_exact
_rice_count_exact:                      ; @rice_count_exact
	.cfi_startproc
; %bb.0:
	cmp	w1, #1
	b.lt	LBB0_3
; %bb.1:
	add	w9, w2, #1
	mov	w10, w1
	cmp	w1, #16
	b.hs	LBB0_4
; %bb.2:
	mov	x11, #0
	mov	w8, #0
	b	LBB0_7
LBB0_3:
	mov	w0, #0
	ret
LBB0_4:
	dup.4s	v3, w2
	dup.4s	v0, w9
	and	x11, x10, #0xfffffff0
	add	x8, x0, #32
	movi.2d	v2, #0000000000000000
	movi.2d	v1, #0xffffffffffffffff
	neg.4s	v3, v3
	mov	x12, x11
	movi.2d	v4, #0000000000000000
	movi.2d	v5, #0000000000000000
	movi.2d	v6, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q7, q16, [x8, #-32]
	ldp	q17, q18, [x8], #64
	shl.4s	v7, v7, #1
	mvn.16b	v19, v7
	shl.4s	v16, v16, #1
	mvn.16b	v20, v16
	shl.4s	v17, v17, #1
	mvn.16b	v21, v17
	shl.4s	v18, v18, #1
	mvn.16b	v22, v18
	cmlt.4s	v19, v19, #0
	cmlt.4s	v20, v20, #0
	cmlt.4s	v21, v21, #0
	cmlt.4s	v22, v22, #0
	eor3.16b	v7, v7, v1, v19
	eor3.16b	v16, v16, v1, v20
	eor3.16b	v17, v17, v1, v21
	eor3.16b	v18, v18, v1, v22
	sshl.4s	v7, v7, v3
	sshl.4s	v16, v16, v3
	sshl.4s	v17, v17, v3
	sshl.4s	v18, v18, v3
	add.4s	v2, v0, v2
	add.4s	v4, v0, v4
	add.4s	v5, v0, v5
	add.4s	v6, v0, v6
	add.4s	v2, v2, v7
	add.4s	v4, v4, v16
	add.4s	v5, v5, v17
	add.4s	v6, v6, v18
	subs	x12, x12, #16
	b.ne	LBB0_5
; %bb.6:
	add.4s	v0, v4, v2
	add.4s	v0, v5, v0
	add.4s	v0, v6, v0
	addv.4s	s0, v0
	fmov	w8, s0
	cmp	x11, x10
	b.eq	LBB0_9
LBB0_7:
	add	x12, x0, x11, lsl #2
	sub	x10, x10, x11
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x12], #4
	lsl	w11, w11, #1
	mvn	w13, w11
	eon	w11, w11, w13, asr #31
	asr	w11, w11, w2
	add	w8, w9, w8
	add	w8, w8, w11
	subs	x10, x10, #1
	b.ne	LBB0_8
LBB0_9:
	mov	x0, x8
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_rice_count_exact
.subsections_via_symbols
