	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wfc_stream_await_buffer        ## -- Begin function wfc_stream_await_buffer
	.p2align	4, 0x90
_wfc_stream_await_buffer:               ## @wfc_stream_await_buffer
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	callq	_vcos_log_trace
	movl	%ebx, %edi
	callq	_wfc_stream_find_stream_ptr
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %r14
	movq	_WFC_STREAM_FLAGS_BUF_AVAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	(%r14), %edi
	callq	_vcos_verify
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_wfc_server_use_keep_alive
	leaq	L_.str.1(%rip), %rsi
	leaq	-44(%rbp), %r15
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_vcos_semaphore_create
	movq	%rax, %r12
	movq	_VCOS_SUCCESS@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	(%rax), %r12
	sete	%dil
	callq	_vcos_assert
	movq	%r12, %rdi
	callq	_vcos_unused
	movq	_wfc_client_stream_post_sem@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movq	%r15, %rdx
	callq	_wfc_server_stream_on_image_available
	movl	(%r13), %esi
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %edx
	callq	_vcos_log_trace
	movq	%r15, %rdi
	callq	_vcos_semaphore_wait
	movl	(%r13), %esi
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %edx
	callq	_vcos_log_trace
	movq	%r15, %rdi
	callq	_vcos_semaphore_delete
	xorl	%eax, %eax
	callq	_wfc_server_release_keep_alive
LBB0_3:
	movq	%r14, %rdi
	callq	_STREAM_UNLOCK
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: stream 0x%x"

	.comm	_VCOS_FUNCTION,4,2              ## @VCOS_FUNCTION
	.comm	_WFC_STREAM_FLAGS_BUF_AVAIL,4,2 ## @WFC_STREAM_FLAGS_BUF_AVAIL
L_.str.1:                               ## @.str.1
	.asciz	"WFC image available"

	.comm	_VCOS_SUCCESS,8,3               ## @VCOS_SUCCESS
	.comm	_wfc_client_stream_post_sem,4,2 ## @wfc_client_stream_post_sem
L_.str.2:                               ## @.str.2
	.asciz	"%s: pre async sem wait: stream: %X"

L_.str.3:                               ## @.str.3
	.asciz	"%s: post async sem wait: stream: %X"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wfc_stream_await_buffer        ; -- Begin function wfc_stream_await_buffer
	.p2align	2
_wfc_stream_await_buffer:               ; @wfc_stream_await_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
Lloh0:
	adrp	x22, _VCOS_FUNCTION@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VCOS_FUNCTION@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x19
	bl	_vcos_log_trace
	mov	x0, x19
	bl	_wfc_stream_find_stream_ptr
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0]
Lloh4:
	adrp	x9, _WFC_STREAM_FLAGS_BUF_AVAIL@GOTPAGE
Lloh5:
	ldr	x9, [x9, _WFC_STREAM_FLAGS_BUF_AVAIL@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	and	w0, w9, w8
	bl	_vcos_verify
	cbz	x0, LBB0_3
; %bb.2:
	bl	_wfc_server_use_keep_alive
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #12
	mov	w2, #0
	bl	_vcos_semaphore_create
	mov	x21, x0
Lloh9:
	adrp	x8, _VCOS_SUCCESS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VCOS_SUCCESS@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, eq
	bl	_vcos_assert
	mov	x0, x21
	bl	_vcos_unused
Lloh12:
	adrp	x8, _wfc_client_stream_post_sem@GOTPAGE
Lloh13:
	ldr	x8, [x8, _wfc_client_stream_post_sem@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_wfc_server_stream_on_image_available
	ldr	w1, [x22]
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_vcos_log_trace
	add	x0, sp, #12
	bl	_vcos_semaphore_wait
	ldr	w1, [x22]
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x2, x19
	bl	_vcos_log_trace
	add	x0, sp, #12
	bl	_vcos_semaphore_delete
	bl	_wfc_server_release_keep_alive
LBB0_3:
	mov	x0, x20
	bl	_STREAM_UNLOCK
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: stream 0x%x"

	.comm	_VCOS_FUNCTION,4,2              ; @VCOS_FUNCTION
	.comm	_WFC_STREAM_FLAGS_BUF_AVAIL,4,2 ; @WFC_STREAM_FLAGS_BUF_AVAIL
l_.str.1:                               ; @.str.1
	.asciz	"WFC image available"

	.comm	_VCOS_SUCCESS,8,3               ; @VCOS_SUCCESS
	.comm	_wfc_client_stream_post_sem,4,2 ; @wfc_client_stream_post_sem
l_.str.2:                               ; @.str.2
	.asciz	"%s: pre async sem wait: stream: %X"

l_.str.3:                               ; @.str.3
	.asciz	"%s: post async sem wait: stream: %X"

.subsections_via_symbols
