	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wfc_stream_register_source_or_mask ## -- Begin function wfc_stream_register_source_or_mask
	.p2align	4, 0x90
_wfc_stream_register_source_or_mask:    ## @wfc_stream_register_source_or_mask
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	%edi, %r15d
	callq	_wfc_stream_find_stream_ptr
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %ecx
	xorl	%r8d, %r8d
	cmpl	$1, %r14d
	sbbl	%r8d, %r8d
	orl	$1, %r8d
	addl	%ecx, %r8d
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %edx
	callq	_vcos_log_trace
	movl	(%rbx), %eax
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	incl	%eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_STREAM_UNLOCK
	jmp	LBB0_7
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_4:
	xorl	%edi, %edi
	testl	%eax, %eax
	setg	%dil
	callq	_vcos_verify
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	decl	(%rbx)
LBB0_6:
	movq	%rbx, %rdi
	callq	_wfc_stream_destroy_if_ready
LBB0_7:
	movl	$1, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: stream 0x%x %d->%d"

	.comm	_VCOS_FUNCTION,4,2              ## @VCOS_FUNCTION
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wfc_stream_register_source_or_mask ; -- Begin function wfc_stream_register_source_or_mask
	.p2align	2
_wfc_stream_register_source_or_mask:    ; @wfc_stream_register_source_or_mask
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x21, x0
	bl	_wfc_stream_find_stream_ptr
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _VCOS_FUNCTION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VCOS_FUNCTION@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w3, [x0]
	sub	w8, w3, #1
	cmp	w20, #0
	csinc	w4, w8, w3, eq
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	bl	_vcos_log_trace
	ldr	w8, [x19]
	cbz	w20, LBB0_3
; %bb.2:
	add	w8, w8, #1
	str	w8, [x19]
	mov	x0, x19
	bl	_STREAM_UNLOCK
	b	LBB0_6
LBB0_3:
	cmp	w8, #0
	cset	w0, gt
	bl	_vcos_verify
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
LBB0_5:
	mov	x0, x19
	bl	_wfc_stream_destroy_if_ready
LBB0_6:
	mov	w0, #1
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: stream 0x%x %d->%d"

	.comm	_VCOS_FUNCTION,4,2              ; @VCOS_FUNCTION
.subsections_via_symbols
