	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function countchar
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_countchar:                             ## @countchar
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testl	%edx, %edx
	jle	LBB0_1
## %bb.2:
	movl	%edx, %r9d
	cmpl	$8, %edx
	jae	LBB0_4
## %bb.3:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_1:
	xorl	%eax, %eax
	popq	%rbp
	retq
LBB0_4:
	movl	%r9d, %edx
	andl	$-8, %edx
	movzbl	%sil, %eax
	movd	%eax, %xmm0
	punpcklbw	%xmm0, %xmm0            ## xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
	pshuflw	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0,4,5,6,7]
	leaq	-8(%rdx), %rax
	movq	%rax, %r8
	shrq	$3, %r8
	incq	%r8
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r8, %rcx
	andq	$-2, %rcx
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm3            ## xmm3 = [1,1,1,1]
	pxor	%xmm2, %xmm2
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movd	(%rdi,%rax), %xmm4              ## xmm4 = mem[0],zero,zero,zero
	movd	4(%rdi,%rax), %xmm5             ## xmm5 = mem[0],zero,zero,zero
	pcmpeqb	%xmm0, %xmm4
	pmovzxbd	%xmm4, %xmm4                    ## xmm4 = xmm4[0],zero,zero,zero,xmm4[1],zero,zero,zero,xmm4[2],zero,zero,zero,xmm4[3],zero,zero,zero
	pand	%xmm3, %xmm4
	paddd	%xmm1, %xmm4
	pcmpeqb	%xmm0, %xmm5
	pmovzxbd	%xmm5, %xmm5                    ## xmm5 = xmm5[0],zero,zero,zero,xmm5[1],zero,zero,zero,xmm5[2],zero,zero,zero,xmm5[3],zero,zero,zero
	pand	%xmm3, %xmm5
	paddd	%xmm2, %xmm5
	movd	8(%rdi,%rax), %xmm1             ## xmm1 = mem[0],zero,zero,zero
	movd	12(%rdi,%rax), %xmm2            ## xmm2 = mem[0],zero,zero,zero
	pcmpeqb	%xmm0, %xmm1
	pmovzxbd	%xmm1, %xmm1                    ## xmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero
	pand	%xmm3, %xmm1
	paddd	%xmm4, %xmm1
	pcmpeqb	%xmm0, %xmm2
	pmovzxbd	%xmm2, %xmm2                    ## xmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero
	pand	%xmm3, %xmm2
	paddd	%xmm5, %xmm2
	addq	$16, %rax
	addq	$-2, %rcx
	jne	LBB0_7
## %bb.8:
	testb	$1, %r8b
	je	LBB0_10
LBB0_9:
	movd	(%rdi,%rax), %xmm3              ## xmm3 = mem[0],zero,zero,zero
	movd	4(%rdi,%rax), %xmm4             ## xmm4 = mem[0],zero,zero,zero
	pcmpeqb	%xmm0, %xmm3
	pmovzxbd	%xmm3, %xmm3                    ## xmm3 = xmm3[0],zero,zero,zero,xmm3[1],zero,zero,zero,xmm3[2],zero,zero,zero,xmm3[3],zero,zero,zero
	movdqa	LCPI0_0(%rip), %xmm5            ## xmm5 = [1,1,1,1]
	pand	%xmm5, %xmm3
	paddd	%xmm3, %xmm1
	pcmpeqb	%xmm0, %xmm4
	pmovzxbd	%xmm4, %xmm0                    ## xmm0 = xmm4[0],zero,zero,zero,xmm4[1],zero,zero,zero,xmm4[2],zero,zero,zero,xmm4[3],zero,zero,zero
	pand	%xmm5, %xmm0
	paddd	%xmm0, %xmm2
LBB0_10:
	paddd	%xmm2, %xmm1
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpq	%r9, %rdx
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	xorl	%ecx, %ecx
	cmpb	%sil, (%rdi,%rdx)
	sete	%cl
	addl	%ecx, %eax
	incq	%rdx
	cmpq	%rdx, %r9
	jne	LBB0_11
LBB0_12:
	popq	%rbp
	retq
LBB0_5:
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	pxor	%xmm2, %xmm2
	testb	$1, %r8b
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_countchar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function countchar
_countchar:                             ; @countchar
	.cfi_startproc
; %bb.0:
	cmp	w2, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w9, w2
	cmp	w2, #8
	b.hs	LBB0_4
; %bb.2:
	mov	x10, #0
	mov	w8, #0
	b	LBB0_13
LBB0_3:
	mov	w0, #0
	ret
LBB0_4:
	cmp	w2, #32
	b.hs	LBB0_6
; %bb.5:
	mov	w8, #0
	mov	x10, #0
	b	LBB0_10
LBB0_6:
	dup.16b	v1, w1
	movi.2d	v0, #0000000000000000
	and	x10, x9, #0xffffffe0
	movi.4s	v2, #1
	add	x8, x0, #16
	movi.2d	v4, #0000000000000000
	mov	x11, x10
	movi.2d	v3, #0000000000000000
	movi.2d	v5, #0000000000000000
	movi.2d	v6, #0000000000000000
	movi.2d	v16, #0000000000000000
	movi.2d	v7, #0000000000000000
	movi.2d	v17, #0000000000000000
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q18, q19, [x8, #-16]
	cmeq.16b	v18, v18, v1
	ushll.8h	v20, v18, #0
	ushll.4s	v21, v20, #0
	and.16b	v21, v21, v2
	ushll2.4s	v20, v20, #0
	and.16b	v20, v20, v2
	ushll2.8h	v18, v18, #0
	ushll.4s	v22, v18, #0
	and.16b	v22, v22, v2
	ushll2.4s	v18, v18, #0
	and.16b	v18, v18, v2
	cmeq.16b	v19, v19, v1
	ushll.8h	v23, v19, #0
	ushll.4s	v24, v23, #0
	and.16b	v24, v24, v2
	ushll2.4s	v23, v23, #0
	and.16b	v23, v23, v2
	ushll2.8h	v19, v19, #0
	ushll.4s	v25, v19, #0
	and.16b	v25, v25, v2
	ushll2.4s	v19, v19, #0
	and.16b	v19, v19, v2
	add.4s	v5, v5, v18
	add.4s	v3, v3, v22
	add.4s	v4, v4, v20
	add.4s	v0, v0, v21
	add.4s	v17, v17, v19
	add.4s	v7, v7, v25
	add.4s	v16, v16, v23
	add.4s	v6, v6, v24
	add	x8, x8, #32
	subs	x11, x11, #32
	b.ne	LBB0_7
; %bb.8:
	add.4s	v1, v16, v4
	add.4s	v2, v17, v5
	add.4s	v0, v6, v0
	add.4s	v3, v7, v3
	add.4s	v0, v0, v3
	add.4s	v1, v1, v2
	add.4s	v0, v0, v1
	addv.4s	s0, v0
	fmov	w8, s0
	cmp	x10, x9
	b.eq	LBB0_15
; %bb.9:
	tst	x9, #0x18
	b.eq	LBB0_13
LBB0_10:
	mov	x11, x10
	and	x10, x9, #0xfffffff8
	movi.2d	v0, #0000000000000000
	mov.s	v0[0], w8
	movi.2d	v1, #0000000000000000
	dup.8b	v2, w1
	add	x8, x0, x11
	sub	x11, x11, x10
	movi.4s	v3, #1
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	d4, [x8], #8
	cmeq.8b	v4, v4, v2
	ushll.8h	v4, v4, #0
	ushll.4s	v5, v4, #0
	and.16b	v5, v5, v3
	ushll2.4s	v4, v4, #0
	and.16b	v4, v4, v3
	add.4s	v1, v1, v4
	add.4s	v0, v0, v5
	adds	x11, x11, #8
	b.ne	LBB0_11
; %bb.12:
	add.4s	v0, v0, v1
	addv.4s	s0, v0
	fmov	w8, s0
	cmp	x10, x9
	b.eq	LBB0_15
LBB0_13:
	add	x11, x0, x10
	sub	x9, x9, x10
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w10, [x11], #1
	cmp	w10, w1, uxtb
	cinc	w8, w8, eq
	subs	x9, x9, #1
	b.ne	LBB0_14
LBB0_15:
	mov	x0, x8
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_countchar
.subsections_via_symbols
