	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function count_channels
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_count_channels:                        ## @count_channels
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	testl	%esi, %esi
	jle	LBB0_1
## %bb.2:
	movq	_TYPE_CPE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_AAC_CHANNEL_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_AAC_CHANNEL_CC@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%esi, %edx
	xorl	%r10d, %r10d
	cmpl	$8, %esi
	jae	LBB0_4
## %bb.3:
	xorl	%r11d, %r11d
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_4:
	movl	%edx, %r11d
	andl	$-8, %r11d
	movd	%r8d, %xmm0
	pshufd	$0, %xmm0, %xmm10               ## xmm10 = xmm0[0,0,0,0]
	movd	%r9d, %xmm1
	pshufd	$0, %xmm1, %xmm11               ## xmm11 = xmm1[0,0,0,0]
	movd	%ebx, %xmm2
	pshufd	$0, %xmm2, %xmm12               ## xmm12 = xmm2[0,0,0,0]
	leaq	(,%rdx,4), %rax
	andq	$-32, %rax
	leaq	(%rax,%rax,2), %rax
	pxor	%xmm3, %xmm3
	xorl	%esi, %esi
	movdqa	LCPI0_0(%rip), %xmm9            ## xmm9 = [1,1,1,1]
	pcmpeqd	%xmm8, %xmm8
	pxor	%xmm4, %xmm4
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movd	(%rdi,%rsi), %xmm6              ## xmm6 = mem[0],zero,zero,zero
	pinsrd	$1, 12(%rdi,%rsi), %xmm6
	pinsrd	$2, 24(%rdi,%rsi), %xmm6
	pinsrd	$3, 36(%rdi,%rsi), %xmm6
	movd	48(%rdi,%rsi), %xmm5            ## xmm5 = mem[0],zero,zero,zero
	pinsrd	$1, 60(%rdi,%rsi), %xmm5
	pinsrd	$2, 72(%rdi,%rsi), %xmm5
	pinsrd	$3, 84(%rdi,%rsi), %xmm5
	movd	8(%rdi,%rsi), %xmm0             ## xmm0 = mem[0],zero,zero,zero
	pinsrd	$1, 20(%rdi,%rsi), %xmm0
	pinsrd	$2, 32(%rdi,%rsi), %xmm0
	pinsrd	$3, 44(%rdi,%rsi), %xmm0
	movd	56(%rdi,%rsi), %xmm7            ## xmm7 = mem[0],zero,zero,zero
	pinsrd	$1, 68(%rdi,%rsi), %xmm7
	pinsrd	$2, 80(%rdi,%rsi), %xmm7
	pinsrd	$3, 92(%rdi,%rsi), %xmm7
	pcmpeqd	%xmm10, %xmm6
	movdqa	%xmm9, %xmm1
	psubd	%xmm6, %xmm1
	pcmpeqd	%xmm10, %xmm5
	movdqa	%xmm9, %xmm6
	psubd	%xmm5, %xmm6
	movdqa	%xmm0, %xmm5
	pcmpeqd	%xmm11, %xmm5
	movdqa	%xmm7, %xmm2
	pcmpeqd	%xmm11, %xmm2
	pcmpeqd	%xmm12, %xmm0
	pxor	%xmm8, %xmm0
	pandn	%xmm0, %xmm5
	pand	%xmm1, %xmm5
	paddd	%xmm5, %xmm3
	pcmpeqd	%xmm12, %xmm7
	pxor	%xmm8, %xmm7
	pandn	%xmm7, %xmm2
	pand	%xmm6, %xmm2
	paddd	%xmm2, %xmm4
	addq	$96, %rsi
	cmpq	%rsi, %rax
	jne	LBB0_5
## %bb.6:
	paddd	%xmm3, %xmm4
	pshufd	$238, %xmm4, %xmm0              ## xmm0 = xmm4[2,3,2,3]
	paddd	%xmm4, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpq	%rdx, %r11
	je	LBB0_9
LBB0_7:
	leaq	(%r11,%r11,2), %rsi
	leaq	(%rdi,%rsi,4), %rsi
	addq	$8, %rsi
	subq	%r11, %rdx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %edi
	xorl	%ecx, %ecx
	cmpl	%r8d, -8(%rsi)
	sete	%cl
	incl	%ecx
	cmpl	%ebx, %edi
	cmovel	%r10d, %ecx
	cmpl	%r9d, %edi
	cmovel	%r10d, %ecx
	addl	%ecx, %eax
	addq	$12, %rsi
	decq	%rdx
	jne	LBB0_8
LBB0_9:
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TYPE_CPE,4,2                   ## @TYPE_CPE
	.comm	_AAC_CHANNEL_OFF,4,2            ## @AAC_CHANNEL_OFF
	.comm	_AAC_CHANNEL_CC,4,2             ## @AAC_CHANNEL_CC
	.no_dead_strip	_count_channels
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function count_channels
_count_channels:                        ; @count_channels
	.cfi_startproc
; %bb.0:
	stp	d13, d12, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	d11, d10, [sp, #16]             ; 16-byte Folded Spill
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	.cfi_offset b8, -8
	.cfi_offset b9, -16
	.cfi_offset b10, -24
	.cfi_offset b11, -32
	.cfi_offset b12, -40
	.cfi_offset b13, -48
	cmp	w1, #1
	b.lt	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _TYPE_CPE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TYPE_CPE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
Lloh3:
	adrp	x8, _AAC_CHANNEL_OFF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AAC_CHANNEL_OFF@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x8]
Lloh6:
	adrp	x8, _AAC_CHANNEL_CC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AAC_CHANNEL_CC@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x8]
	mov	w12, w1
	cmp	w1, #16
	b.hs	LBB0_4
; %bb.2:
	mov	x13, #0
	mov	w8, #0
	b	LBB0_7
LBB0_3:
	mov	w8, #0
	b	LBB0_9
LBB0_4:
	dup.4s	v0, w9
	dup.4s	v1, w10
	dup.4s	v2, w11
	and	x13, x12, #0xfffffff0
	add	x8, x0, #96
	movi.2d	v3, #0000000000000000
	movi.4s	v4, #1
	movi.4s	v5, #2
	mov	x14, x13
	movi.2d	v6, #0000000000000000
	movi.2d	v7, #0000000000000000
	movi.2d	v16, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	x15, x8, #96
	sub	x16, x8, #48
	ld3.4s	{ v17, v18, v19 }, [x15]
	ld3.4s	{ v20, v21, v22 }, [x16]
	mov	x15, x8
	ld3.4s	{ v23, v24, v25 }, [x15], #48
	ld3.4s	{ v26, v27, v28 }, [x15]
	cmeq.4s	v29, v17, v0
	cmeq.4s	v30, v20, v0
	cmeq.4s	v31, v23, v0
	cmeq.4s	v8, v26, v0
	bsl.16b	v29, v5, v4
	bsl.16b	v30, v5, v4
	bsl.16b	v31, v5, v4
	bsl.16b	v8, v5, v4
	cmeq.4s	v9, v19, v1
	mvn.16b	v9, v9
	cmeq.4s	v10, v22, v1
	mvn.16b	v10, v10
	cmeq.4s	v11, v25, v1
	mvn.16b	v11, v11
	cmeq.4s	v12, v28, v1
	mvn.16b	v12, v12
	cmeq.4s	v17, v19, v2
	cmeq.4s	v18, v22, v2
	cmeq.4s	v19, v25, v2
	cmeq.4s	v20, v28, v2
	bic.16b	v17, v9, v17
	bic.16b	v18, v10, v18
	bic.16b	v19, v11, v19
	bic.16b	v20, v12, v20
	and.16b	v17, v29, v17
	and.16b	v18, v30, v18
	and.16b	v19, v31, v19
	and.16b	v20, v8, v20
	add.4s	v3, v17, v3
	add.4s	v6, v18, v6
	add.4s	v7, v19, v7
	add.4s	v16, v20, v16
	add	x8, x8, #192
	subs	x14, x14, #16
	b.ne	LBB0_5
; %bb.6:
	add.4s	v0, v6, v3
	add.4s	v0, v7, v0
	add.4s	v0, v16, v0
	addv.4s	s0, v0
	fmov	w8, s0
	cmp	x13, x12
	b.eq	LBB0_9
LBB0_7:
	mov	w14, #12
	madd	x14, x13, x14, x0
	add	x14, x14, #8
	sub	x12, x12, x13
	mov	w13, #1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w15, [x14, #-8]
	ldr	w16, [x14], #12
	cmp	w15, w9
	cinc	w15, w13, eq
	cmp	w16, w11
	ccmp	w16, w10, #4, ne
	csel	w15, w15, wzr, ne
	add	w8, w15, w8
	subs	x12, x12, #1
	b.ne	LBB0_8
LBB0_9:
	mov	x0, x8
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #16]             ; 16-byte Folded Reload
	ldp	d13, d12, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_TYPE_CPE,4,2                   ; @TYPE_CPE
	.comm	_AAC_CHANNEL_OFF,4,2            ; @AAC_CHANNEL_OFF
	.comm	_AAC_CHANNEL_CC,4,2             ; @AAC_CHANNEL_CC
	.no_dead_strip	_count_channels
.subsections_via_symbols
