	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function calc_active_inputs
LCPI0_0:
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_calc_active_inputs:                    ## @calc_active_inputs
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %r8d
	testl	%r8d, %r8d
	jle	LBB0_1
## %bb.2:
	movq	8(%rdi), %rdx
	movq	_INPUT_ON@GOTPCREL(%rip), %r9
	movl	(%r9), %r11d
	cmpl	$8, %r8d
	jae	LBB0_4
## %bb.3:
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	jmp	LBB0_11
LBB0_1:
	movl	$0, 16(%rdi)
	jmp	LBB0_17
LBB0_4:
	movl	%r8d, %ecx
	andl	$-8, %ecx
	movd	%r11d, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%rcx), %rax
	movq	%rax, %r10
	shrq	$3, %r10
	incq	%r10
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r10, %rsi
	andq	$-2, %rsi
	pxor	%xmm3, %xmm3
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [2,2,2,2]
	pxor	%xmm6, %xmm6
	pxor	%xmm5, %xmm5
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdx,%rax,4), %xmm7
	movdqu	16(%rdx,%rax,4), %xmm4
	movdqu	32(%rdx,%rax,4), %xmm1
	movdqu	48(%rdx,%rax,4), %xmm2
	pand	%xmm0, %xmm7
	pand	%xmm0, %xmm4
	pcmpeqd	%xmm3, %xmm7
	paddd	%xmm6, %xmm7
	pcmpeqd	%xmm3, %xmm4
	paddd	%xmm5, %xmm4
	pand	%xmm0, %xmm1
	pcmpeqd	%xmm3, %xmm1
	pand	%xmm0, %xmm2
	pcmpeqd	%xmm3, %xmm2
	paddd	%xmm8, %xmm1
	paddd	%xmm7, %xmm1
	paddd	%xmm8, %xmm2
	paddd	%xmm4, %xmm2
	addq	$16, %rax
	movdqa	%xmm1, %xmm6
	movdqa	%xmm2, %xmm5
	addq	$-2, %rsi
	jne	LBB0_7
## %bb.8:
	testb	$1, %r10b
	je	LBB0_10
LBB0_9:
	movdqu	(%rdx,%rax,4), %xmm3
	movdqu	16(%rdx,%rax,4), %xmm4
	pand	%xmm0, %xmm3
	pand	%xmm0, %xmm4
	pxor	%xmm0, %xmm0
	pcmpeqd	%xmm0, %xmm3
	paddd	%xmm3, %xmm1
	pcmpeqd	%xmm0, %xmm4
	paddd	%xmm4, %xmm2
	pcmpeqd	%xmm0, %xmm0
	psubd	%xmm0, %xmm1
	psubd	%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, %esi
	cmpq	%r8, %rcx
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rcx,4), %eax
	andl	%r11d, %eax
	cmpl	$1, %eax
	sbbl	$-1, %esi
	incq	%rcx
	cmpq	%rcx, %r8
	jne	LBB0_11
LBB0_12:
	movl	%esi, 16(%rdi)
	testl	%esi, %esi
	je	LBB0_17
## %bb.13:
	movq	24(%rdi), %rcx
	movq	_DURATION_FIRST@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_15
## %bb.14:
	movq	8(%rdi), %rax
	movl	(%r9), %edx
	testl	%edx, (%rax)
	je	LBB0_17
LBB0_15:
	movq	_DURATION_SHORTEST@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_18
## %bb.16:
	cmpl	%r8d, %esi
	je	LBB0_18
LBB0_17:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_18:
	popq	%rbp
	retq
LBB0_5:
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	pxor	%xmm2, %xmm2
	testb	$1, %r10b
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_INPUT_ON,4,2                   ## @INPUT_ON
	.comm	_DURATION_FIRST,8,3             ## @DURATION_FIRST
	.comm	_DURATION_SHORTEST,8,3          ## @DURATION_SHORTEST
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.no_dead_strip	_calc_active_inputs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_active_inputs
_calc_active_inputs:                    ; @calc_active_inputs
	.cfi_startproc
; %bb.0:
	ldr	w8, [x0]
	cmp	w8, #0
	b.le	LBB0_3
; %bb.1:
	ldr	x11, [x0, #8]
Lloh0:
	adrp	x9, _INPUT_ON@GOTPAGE
Lloh1:
	ldr	x9, [x9, _INPUT_ON@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w8, #16
	b.hs	LBB0_4
; %bb.2:
	mov	x12, #0
	mov	w13, #0
	b	LBB0_7
LBB0_3:
	str	wzr, [x0, #16]
	b	LBB0_14
LBB0_4:
	and	x12, x8, #0xfffffff0
	dup.4s	v0, w10
	add	x13, x11, #32
	movi.2d	v1, #0000000000000000
	mov	x14, x12
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
	movi.2d	v4, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q5, q6, [x13, #-32]
	ldp	q7, q16, [x13], #64
	cmtst.4s	v5, v0, v5
	cmtst.4s	v6, v0, v6
	cmtst.4s	v7, v0, v7
	cmtst.4s	v16, v0, v16
	sub.4s	v1, v1, v5
	sub.4s	v2, v2, v6
	sub.4s	v3, v3, v7
	sub.4s	v4, v4, v16
	subs	x14, x14, #16
	b.ne	LBB0_5
; %bb.6:
	add.4s	v0, v2, v1
	add.4s	v0, v3, v0
	add.4s	v0, v4, v0
	addv.4s	s0, v0
	fmov	w13, s0
	cmp	x12, x8
	b.eq	LBB0_9
LBB0_7:
	add	x11, x11, x12, lsl #2
	sub	x12, x8, x12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x11], #4
	tst	w10, w14
	cinc	w13, w13, ne
	subs	x12, x12, #1
	b.ne	LBB0_8
LBB0_9:
	str	w13, [x0, #16]
	cbz	w13, LBB0_14
; %bb.10:
	ldr	x10, [x0, #24]
Lloh2:
	adrp	x11, _DURATION_FIRST@GOTPAGE
Lloh3:
	ldr	x11, [x11, _DURATION_FIRST@GOTPAGEOFF]
Lloh4:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_12
; %bb.11:
	ldr	x11, [x0, #8]
	ldr	w11, [x11]
	ldr	w9, [x9]
	tst	w9, w11
	b.eq	LBB0_14
LBB0_12:
Lloh5:
	adrp	x9, _DURATION_SHORTEST@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DURATION_SHORTEST@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x10, x9
	ccmp	w13, w8, #4, eq
	b.ne	LBB0_14
; %bb.13:
	mov	w0, #0
	ret
LBB0_14:
Lloh8:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_INPUT_ON,4,2                   ; @INPUT_ON
	.comm	_DURATION_FIRST,8,3             ; @DURATION_FIRST
	.comm	_DURATION_SHORTEST,8,3          ; @DURATION_SHORTEST
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.no_dead_strip	_calc_active_inputs
.subsections_via_symbols
