	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_overlay_num_free_overlays  ## -- Begin function vmw_overlay_num_free_overlays
	.p2align	4, 0x90
_vmw_overlay_num_free_overlays:         ## @vmw_overlay_num_free_overlays
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %r14
	callq	_vmw_overlay_available
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_VMW_MAX_NUM_STREAMS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_3
## %bb.4:
	movq	8(%r14), %rcx
	cmpl	$8, %eax
	jae	LBB0_6
## %bb.5:
	xorl	%edx, %edx
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_6:
	movl	%eax, %edx
	andl	$-8, %edx
	leaq	-8(%rdx), %rsi
	movq	%rsi, %rbx
	shrq	$3, %rbx
	incq	%rbx
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.8:
	movq	%rbx, %rsi
	andq	$-2, %rsi
	pxor	%xmm2, %xmm2
	xorl	%edi, %edi
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rcx,%rdi,4), %xmm3
	movdqu	16(%rcx,%rdi,4), %xmm4
	movdqu	32(%rcx,%rdi,4), %xmm5
	movdqu	48(%rcx,%rdi,4), %xmm6
	pcmpeqd	%xmm2, %xmm3
	psubd	%xmm3, %xmm0
	pcmpeqd	%xmm2, %xmm4
	psubd	%xmm4, %xmm1
	pcmpeqd	%xmm2, %xmm5
	psubd	%xmm5, %xmm0
	pcmpeqd	%xmm2, %xmm6
	psubd	%xmm6, %xmm1
	addq	$16, %rdi
	addq	$-2, %rsi
	jne	LBB0_9
## %bb.10:
	testb	$1, %bl
	je	LBB0_12
LBB0_11:
	movdqu	(%rcx,%rdi,4), %xmm2
	movdqu	16(%rcx,%rdi,4), %xmm3
	pxor	%xmm4, %xmm4
	pcmpeqd	%xmm4, %xmm2
	psubd	%xmm2, %xmm0
	pcmpeqd	%xmm4, %xmm3
	psubd	%xmm3, %xmm1
LBB0_12:
	paddd	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddd	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebx
	cmpq	%rax, %rdx
	je	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$1, (%rcx,%rdx,4)
	adcl	$0, %ebx
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_13
LBB0_14:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_15:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	testb	$1, %bl
	jne	LBB0_11
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_VMW_MAX_NUM_STREAMS,4,2        ## @VMW_MAX_NUM_STREAMS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_overlay_num_free_overlays  ; -- Begin function vmw_overlay_num_free_overlays
	.p2align	2
_vmw_overlay_num_free_overlays:         ; @vmw_overlay_num_free_overlays
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x19, [x0]
	bl	_vmw_overlay_available
	cbz	w0, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_mutex_lock
Lloh0:
	adrp	x8, _VMW_MAX_NUM_STREAMS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VMW_MAX_NUM_STREAMS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	ldr	x9, [x19, #8]
	cmp	w8, #16
	b.hs	LBB0_6
; %bb.3:
	mov	x10, #0
	mov	w20, #0
	b	LBB0_9
LBB0_4:
	mov	w20, #0
	b	LBB0_12
LBB0_5:
	mov	w20, #0
	b	LBB0_11
LBB0_6:
	and	x10, x8, #0xfffffff0
	add	x11, x9, #32
	movi.2d	v0, #0000000000000000
	mov	x12, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11], #64
	cmeq.4s	v4, v4, #0
	cmeq.4s	v5, v5, #0
	cmeq.4s	v6, v6, #0
	cmeq.4s	v7, v7, #0
	sub.4s	v0, v0, v4
	sub.4s	v1, v1, v5
	sub.4s	v2, v2, v6
	sub.4s	v3, v3, v7
	subs	x12, x12, #16
	b.ne	LBB0_7
; %bb.8:
	add.4s	v0, v1, v0
	add.4s	v0, v2, v0
	add.4s	v0, v3, v0
	addv.4s	s0, v0
	fmov	w20, s0
	cmp	x10, x8
	b.eq	LBB0_11
LBB0_9:
	add	x9, x9, x10, lsl #2
	sub	x8, x8, x10
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9], #4
	cmp	w10, #0
	cinc	w20, w20, eq
	subs	x8, x8, #1
	b.ne	LBB0_10
LBB0_11:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VMW_MAX_NUM_STREAMS,4,2        ; @VMW_MAX_NUM_STREAMS
.subsections_via_symbols
