	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function flexrm_sba_estimate_nonheader_desc_count
LCPI0_0:
	.quad	2                               ## 0x2
	.quad	2                               ## 0x2
LCPI0_1:
	.quad	1                               ## 0x1
	.quad	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_flexrm_sba_estimate_nonheader_desc_count: ## @flexrm_sba_estimate_nonheader_desc_count
	.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
	movq	(%rdi), %rsi
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.3:
	movq	8(%rdi), %rdx
	movq	_BRCM_SBA_CMD_TYPE_B@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_BRCM_SBA_CMD_TYPE_C@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_BRCM_SBA_CMD_HAS_RESP@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	movq	_BRCM_SBA_CMD_HAS_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r11d
	cmpq	$4, %rsi
	jae	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	LBB0_9
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_2
LBB0_5:
	movq	%rsi, %rcx
	andq	$-4, %rcx
	movd	%r9d, %xmm0
	pshufd	$80, %xmm0, %xmm0               ## xmm0 = xmm0[0,0,1,1]
	movd	%r8d, %xmm1
	pshufd	$80, %xmm1, %xmm9               ## xmm9 = xmm1[0,0,1,1]
	por	%xmm0, %xmm9
	movd	%r10d, %xmm0
	pshufd	$80, %xmm0, %xmm10              ## xmm10 = xmm0[0,0,1,1]
	movd	%r11d, %xmm0
	pshufd	$80, %xmm0, %xmm11              ## xmm11 = xmm0[0,0,1,1]
	pxor	%xmm3, %xmm3
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [2,2]
	movdqa	LCPI0_1(%rip), %xmm12           ## xmm12 = [1,1]
	pcmpeqd	%xmm13, %xmm13
	pxor	%xmm0, %xmm0
	pxor	%xmm7, %xmm7
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rax,4), %xmm1            ## xmm1 = mem[0],zero
	movq	8(%rdx,%rax,4), %xmm4           ## xmm4 = mem[0],zero
	movdqa	%xmm9, %xmm2
	pand	%xmm1, %xmm2
	movdqa	%xmm9, %xmm5
	pand	%xmm4, %xmm5
	pcmpeqd	%xmm3, %xmm2
	pmovsxdq	%xmm2, %xmm6
	paddq	%xmm0, %xmm6
	movdqa	%xmm10, %xmm0
	pand	%xmm1, %xmm0
	pcmpeqd	%xmm3, %xmm0
	pxor	%xmm13, %xmm0
	pmovzxdq	%xmm0, %xmm2                    ## xmm2 = xmm0[0],zero,xmm0[1],zero
	pand	%xmm12, %xmm2
	paddq	%xmm6, %xmm2
	pcmpeqd	%xmm3, %xmm5
	pmovsxdq	%xmm5, %xmm0
	paddq	%xmm7, %xmm0
	movdqa	%xmm10, %xmm5
	pand	%xmm4, %xmm5
	pcmpeqd	%xmm3, %xmm5
	pxor	%xmm13, %xmm5
	pmovzxdq	%xmm5, %xmm5                    ## xmm5 = xmm5[0],zero,xmm5[1],zero
	pand	%xmm12, %xmm5
	paddq	%xmm0, %xmm5
	pand	%xmm11, %xmm1
	pcmpeqd	%xmm3, %xmm1
	pxor	%xmm13, %xmm1
	pmovzxdq	%xmm1, %xmm0                    ## xmm0 = xmm1[0],zero,xmm1[1],zero
	pand	%xmm12, %xmm0
	pand	%xmm11, %xmm4
	pcmpeqd	%xmm3, %xmm4
	pxor	%xmm13, %xmm4
	pmovzxdq	%xmm4, %xmm7                    ## xmm7 = xmm4[0],zero,xmm4[1],zero
	pand	%xmm12, %xmm7
	paddq	%xmm8, %xmm0
	paddq	%xmm2, %xmm0
	paddq	%xmm8, %xmm7
	paddq	%xmm5, %xmm7
	addq	$4, %rax
	cmpq	%rax, %rcx
	jne	LBB0_6
## %bb.7:
	paddq	%xmm0, %xmm7
	pshufd	$238, %xmm7, %xmm0              ## xmm0 = xmm7[2,3,2,3]
	paddq	%xmm7, %xmm0
	movq	%xmm0, %rax
	jmp	LBB0_8
LBB0_2:
	popq	%rbx
	popq	%rbp
	retq
LBB0_8:
	cmpq	%rcx, %rsi
	je	LBB0_2
LBB0_9:
	movl	(%rdx,%rcx,4), %edi
	testl	%edi, %r9d
	jne	LBB0_12
## %bb.10:
	testl	%edi, %r8d
	je	LBB0_11
LBB0_12:
	addq	$2, %rax
LBB0_13:
	movl	%r10d, %ebx
	andl	%edi, %ebx
	cmpl	$1, %ebx
	sbbq	$-1, %rax
	andl	%r11d, %edi
	cmpl	$1, %edi
	sbbq	$-1, %rax
	incq	%rcx
	jmp	LBB0_8
LBB0_11:
	incq	%rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_BRCM_SBA_CMD_TYPE_B,4,2        ## @BRCM_SBA_CMD_TYPE_B
	.comm	_BRCM_SBA_CMD_TYPE_C,4,2        ## @BRCM_SBA_CMD_TYPE_C
	.comm	_BRCM_SBA_CMD_HAS_RESP,4,2      ## @BRCM_SBA_CMD_HAS_RESP
	.comm	_BRCM_SBA_CMD_HAS_OUTPUT,4,2    ## @BRCM_SBA_CMD_HAS_OUTPUT
	.no_dead_strip	_flexrm_sba_estimate_nonheader_desc_count
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flexrm_sba_estimate_nonheader_desc_count
_flexrm_sba_estimate_nonheader_desc_count: ; @flexrm_sba_estimate_nonheader_desc_count
	.cfi_startproc
; %bb.0:
	ldr	x12, [x0]
	cbz	x12, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _BRCM_SBA_CMD_TYPE_B@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BRCM_SBA_CMD_TYPE_B@GOTPAGEOFF]
	ldr	x13, [x0, #8]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _BRCM_SBA_CMD_TYPE_C@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BRCM_SBA_CMD_TYPE_C@GOTPAGEOFF]
Lloh5:
	adrp	x10, _BRCM_SBA_CMD_HAS_RESP@GOTPAGE
Lloh6:
	ldr	x10, [x10, _BRCM_SBA_CMD_HAS_RESP@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	ldr	w10, [x10]
Lloh9:
	adrp	x11, _BRCM_SBA_CMD_HAS_OUTPUT@GOTPAGE
Lloh10:
	ldr	x11, [x11, _BRCM_SBA_CMD_HAS_OUTPUT@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	cmp	x12, #8
	b.hs	LBB0_4
; %bb.2:
	mov	x0, #0
	mov	x14, #0
	b	LBB0_7
LBB0_3:
	mov	x0, #0
	ret
LBB0_4:
	dup.2s	v2, w8
	dup.2s	v3, w9
	and	x14, x12, #0xfffffffffffffff8
	dup.2s	v0, w10
	dup.2s	v1, w11
	add	x15, x13, #16
	movi.2d	v5, #0000000000000000
	orr.8b	v2, v2, v3
	mov	w16, #2
	dup.2d	v3, x16
	mov	w16, #1
	dup.2d	v4, x16
	mov	x16, x14
	movi.2d	v16, #0000000000000000
	movi.2d	v7, #0000000000000000
	movi.2d	v6, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	d17, d18, [x15, #-16]
	and.8b	v19, v2, v17
	and.8b	v20, v2, v18
	ldp	d21, d22, [x15], #32
	and.8b	v23, v2, v21
	and.8b	v24, v2, v22
	cmeq.2s	v19, v19, #0
	sshll.2d	v19, v19, #0
	cmeq.2s	v20, v20, #0
	sshll.2d	v20, v20, #0
	cmeq.2s	v23, v23, #0
	sshll.2d	v23, v23, #0
	cmeq.2s	v24, v24, #0
	sshll.2d	v24, v24, #0
	bsl.16b	v19, v4, v3
	add.2d	v5, v5, v19
	mov.16b	v19, v20
	bsl.16b	v19, v4, v3
	add.2d	v16, v16, v19
	mov.16b	v19, v23
	bsl.16b	v19, v4, v3
	add.2d	v7, v7, v19
	mov.16b	v19, v24
	bsl.16b	v19, v4, v3
	add.2d	v6, v6, v19
	cmtst.2s	v19, v0, v17
	ushll.2d	v19, v19, #0
	and.16b	v19, v19, v4
	cmtst.2s	v20, v0, v18
	ushll.2d	v20, v20, #0
	and.16b	v20, v20, v4
	cmtst.2s	v23, v0, v21
	ushll.2d	v23, v23, #0
	and.16b	v23, v23, v4
	cmtst.2s	v24, v0, v22
	ushll.2d	v24, v24, #0
	and.16b	v24, v24, v4
	add.2d	v5, v5, v19
	add.2d	v16, v16, v20
	add.2d	v7, v7, v23
	add.2d	v6, v6, v24
	cmtst.2s	v17, v1, v17
	ushll.2d	v17, v17, #0
	and.16b	v17, v17, v4
	cmtst.2s	v18, v1, v18
	ushll.2d	v18, v18, #0
	and.16b	v18, v18, v4
	cmtst.2s	v19, v1, v21
	ushll.2d	v19, v19, #0
	and.16b	v19, v19, v4
	cmtst.2s	v20, v1, v22
	ushll.2d	v20, v20, #0
	and.16b	v20, v20, v4
	add.2d	v5, v5, v17
	add.2d	v16, v16, v18
	add.2d	v7, v7, v19
	add.2d	v6, v6, v20
	subs	x16, x16, #8
	b.ne	LBB0_5
; %bb.6:
	add.2d	v0, v16, v5
	add.2d	v0, v7, v0
	add.2d	v0, v6, v0
	addp.2d	d0, v0
	fmov	x0, d0
	cmp	x12, x14
	b.eq	LBB0_9
LBB0_7:
	sub	x12, x12, x14
	add	x13, x13, x14, lsl #2
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x13], #4
	and	w15, w8, w14
	cmp	w15, #0
	and	w15, w9, w14
	ccmp	w15, #0, #0, eq
	add	x15, x0, #2
	csinc	x15, x15, x0, ne
	tst	w10, w14
	cinc	x15, x15, ne
	tst	w11, w14
	cinc	x0, x15, ne
	subs	x12, x12, #1
	b.ne	LBB0_8
LBB0_9:
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BRCM_SBA_CMD_TYPE_B,4,2        ; @BRCM_SBA_CMD_TYPE_B
	.comm	_BRCM_SBA_CMD_TYPE_C,4,2        ; @BRCM_SBA_CMD_TYPE_C
	.comm	_BRCM_SBA_CMD_HAS_RESP,4,2      ; @BRCM_SBA_CMD_HAS_RESP
	.comm	_BRCM_SBA_CMD_HAS_OUTPUT,4,2    ; @BRCM_SBA_CMD_HAS_OUTPUT
	.no_dead_strip	_flexrm_sba_estimate_nonheader_desc_count
.subsections_via_symbols
