	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wfc_stream_create_for_context_nbufs ## -- Begin function wfc_stream_create_for_context_nbufs
	.p2align	4, 0x90
_wfc_stream_create_for_context_nbufs:   ## @wfc_stream_create_for_context_nbufs
	.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	%ecx, %r12d
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	_WFC_INVALID_HANDLE@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	%r15, (%rax)
	setne	%dil
	callq	_vcos_verify
	testl	%eax, %eax
	je	LBB0_8
## %bb.1:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, %rdi
	callq	_wfc_stream_find_stream_ptr
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movl	(%r13), %r14d
	movq	%r13, %rdi
	callq	_STREAM_UNLOCK
	movq	_WFC_STREAM_FLAGS_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	%edx, %r14d
	je	LBB0_5
## %bb.3:
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %ecx
	callq	_vcos_log_error
	jmp	LBB0_8
LBB0_4:
	movq	_WFC_STREAM_FLAGS_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_wfc_stream_create
	testq	%rax, %rax
	jne	LBB0_8
LBB0_5:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edx
	movl	%r12d, %ecx
	callq	_wfc_server_stream_allocate_images
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_9
## %bb.6:
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %edx
	movq	%r15, %rcx
	movl	%ebx, %r8d
	movl	%r14d, %r9d
	callq	_vcos_log_warn
	testq	%r13, %r13
	jne	LBB0_8
## %bb.7:
	movq	%r15, %rdi
	callq	_wfc_stream_destroy
LBB0_8:
	movl	$1, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WFC_INVALID_HANDLE,8,3         ## @WFC_INVALID_HANDLE
	.comm	_WFC_STREAM_FLAGS_NONE,4,2      ## @WFC_STREAM_FLAGS_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: stream flags mismatch (expected 0x%x, got 0x%x)"

	.comm	_VCOS_FUNCTION,4,2              ## @VCOS_FUNCTION
L_.str.1:                               ## @.str.1
	.asciz	"%s: failed to allocate %u buffers for stream %X size %ux%u"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wfc_stream_create_for_context_nbufs ; -- Begin function wfc_stream_create_for_context_nbufs
	.p2align	2
_wfc_stream_create_for_context_nbufs:   ; @wfc_stream_create_for_context_nbufs
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _WFC_INVALID_HANDLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WFC_INVALID_HANDLE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x0
	cset	w0, ne
	bl	_vcos_verify
	cbz	w0, LBB0_9
; %bb.1:
	mov	x0, x19
	bl	_wfc_stream_find_stream_ptr
	mov	x23, x0
	cbz	x0, LBB0_4
; %bb.2:
	ldr	w24, [x23]
	mov	x0, x23
	bl	_STREAM_UNLOCK
Lloh3:
	adrp	x8, _WFC_STREAM_FLAGS_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WFC_STREAM_FLAGS_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	cmp	w24, w2
	b.eq	LBB0_5
; %bb.3:
Lloh6:
	adrp	x8, _VCOS_FUNCTION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VCOS_FUNCTION@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x24
	bl	_vcos_log_error
	b	LBB0_9
LBB0_4:
Lloh11:
	adrp	x8, _WFC_STREAM_FLAGS_NONE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WFC_STREAM_FLAGS_NONE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wfc_stream_create
	cbnz	x0, LBB0_9
LBB0_5:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	x3, x22
	bl	_wfc_server_stream_allocate_images
	cbz	w0, LBB0_7
; %bb.6:
	mov	w0, #0
	b	LBB0_10
LBB0_7:
Lloh14:
	adrp	x8, _VCOS_FUNCTION@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VCOS_FUNCTION@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x22
	mov	x3, x19
	mov	x4, x21
	mov	x5, x20
	bl	_vcos_log_warn
	cbnz	x23, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_wfc_stream_destroy
LBB0_9:
	mov	w0, #1
LBB0_10:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_WFC_INVALID_HANDLE,8,3         ; @WFC_INVALID_HANDLE
	.comm	_WFC_STREAM_FLAGS_NONE,4,2      ; @WFC_STREAM_FLAGS_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: stream flags mismatch (expected 0x%x, got 0x%x)"

	.comm	_VCOS_FUNCTION,4,2              ; @VCOS_FUNCTION
l_.str.1:                               ; @.str.1
	.asciz	"%s: failed to allocate %u buffers for stream %X size %ux%u"

.subsections_via_symbols
