	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wfc_client_ipc_sendwait        ## -- Begin function wfc_client_ipc_sendwait
	.p2align	4, 0x90
_wfc_client_ipc_sendwait:               ## @wfc_client_ipc_sendwait
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_VCOS_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rdi, -64(%rbp)
	movq	%rsi, -56(%rbp)
	xorl	%edi, %edi
	cmpq	$16, %rsi
	setae	%dil
	callq	_vcos_assert
	movq	%r12, %rdi
	callq	_vcos_assert
	movq	_wfc_client_ipc@GOTPCREL(%rip), %r14
	movl	4(%r14), %edi
	callq	_vcos_verify
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_WFC_IPC_MSG_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	%r14, %rdi
	callq	_wfc_client_ipc_get_waiter
	movq	%rax, %r13
	movq	%r12, 16(%rax)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	%rax, (%r13)
	movq	%r13, (%rbx)
	xorl	%eax, %eax
	callq	_wfc_client_ipc_use_keep_alive
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rdx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_vcos_log_trace
	movl	(%r14), %edi
	leaq	-64(%rbp), %rsi
	movl	$1, %edx
	callq	_vchiq_queue_message
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.4:
	movq	%r13, %rdi
	addq	$8, %rdi
	callq	_vcos_semaphore_wait
	movl	(%rbx), %esi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edx
	movl	(%r13), %ecx
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_vcos_log_trace
	movq	(%r13), %rax
	movq	%rax, (%rbx)
	jmp	LBB0_5
LBB0_1:
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_VCOS_ALERT
	movq	_VCOS_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_6
LBB0_3:
	movl	(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	movq	%rax, %rdx
	callq	_vcos_log_error
	movq	_VCOS_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_5:
	movq	_wfc_client_ipc@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	callq	_wfc_client_ipc_release_waiter
	xorl	%eax, %eax
	callq	_wfc_client_ipc_release_keep_alive
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_VCOS_SUCCESS,4,2               ## @VCOS_SUCCESS
	.comm	_wfc_client_ipc,8,2             ## @wfc_client_ipc
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: client uninitialised"

	.comm	_VCOS_FUNCTION,4,2              ## @VCOS_FUNCTION
	.comm	_VCOS_EINVAL,4,2                ## @VCOS_EINVAL
	.comm	_WFC_IPC_MSG_MAGIC,4,2          ## @WFC_IPC_MSG_MAGIC
L_.str.1:                               ## @.str.1
	.asciz	"%s: wait %p, reply to %p"

	.comm	_VCHIQ_SUCCESS,8,3              ## @VCHIQ_SUCCESS
L_.str.2:                               ## @.str.2
	.asciz	"%s: failed to queue, 0x%x"

	.comm	_VCOS_ENXIO,4,2                 ## @VCOS_ENXIO
L_.str.3:                               ## @.str.3
	.asciz	"%s: got reply (len %i/%i)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wfc_client_ipc_sendwait        ; -- Begin function wfc_client_ipc_sendwait
	.p2align	2
_wfc_client_ipc_sendwait:               ; @wfc_client_ipc_sendwait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x3
	mov	x22, x2
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _VCOS_SUCCESS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VCOS_SUCCESS@GOTPAGEOFF]
	str	x8, [sp, #40]
Lloh5:
	ldr	w19, [x9]
	stp	x0, x1, [sp, #24]
	cmp	x1, #15
	cset	w0, hi
	bl	_vcos_assert
	mov	x0, x22
	bl	_vcos_assert
Lloh6:
	adrp	x24, _wfc_client_ipc@GOTPAGE
Lloh7:
	ldr	x24, [x24, _wfc_client_ipc@GOTPAGEOFF]
	ldr	w0, [x24, #4]
	bl	_vcos_verify
	cbz	w0, LBB0_3
; %bb.1:
Lloh8:
	adrp	x8, _WFC_IPC_MSG_MAGIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WFC_IPC_MSG_MAGIC@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x23, #8]
	mov	x0, x24
	bl	_wfc_client_ipc_get_waiter
	mov	x21, x0
	str	x22, [x0, #16]
	ldr	x8, [x20]
	str	x8, [x0]
	str	x0, [x23]
	bl	_wfc_client_ipc_use_keep_alive
Lloh11:
	adrp	x23, _VCOS_FUNCTION@GOTPAGE
Lloh12:
	ldr	x23, [x23, _VCOS_FUNCTION@GOTPAGEOFF]
	ldr	w1, [x23]
	stp	x21, x22, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_vcos_log_trace
	ldr	w0, [x24]
	add	x1, sp, #24
	mov	w2, #1
	bl	_vchiq_queue_message
Lloh15:
	adrp	x8, _VCHIQ_SUCCESS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VCHIQ_SUCCESS@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:
	add	x0, x21, #8
	bl	_vcos_semaphore_wait
	ldr	w1, [x23]
	ldr	x8, [x20]
	ldr	x9, [x21]
	stp	x8, x9, [sp]
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_vcos_log_trace
	ldr	x8, [x21]
	str	x8, [x20]
	b	LBB0_5
LBB0_3:
Lloh20:
	adrp	x8, _VCOS_FUNCTION@GOTPAGE
Lloh21:
	ldr	x8, [x8, _VCOS_FUNCTION@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	bl	_VCOS_ALERT
Lloh25:
	adrp	x8, _VCOS_EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _VCOS_EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w19, [x8]
	b	LBB0_6
LBB0_4:
	mov	x2, x0
	ldr	w1, [x23]
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_vcos_log_error
Lloh30:
	adrp	x8, _VCOS_ENXIO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _VCOS_ENXIO@GOTPAGEOFF]
Lloh32:
	ldr	w19, [x8]
LBB0_5:
Lloh33:
	adrp	x0, _wfc_client_ipc@GOTPAGE
Lloh34:
	ldr	x0, [x0, _wfc_client_ipc@GOTPAGEOFF]
	mov	x1, x21
	bl	_wfc_client_ipc_release_waiter
	bl	_wfc_client_ipc_release_keep_alive
LBB0_6:
	ldr	x8, [sp, #40]
Lloh35:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh36:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_VCOS_SUCCESS,4,2               ; @VCOS_SUCCESS
	.comm	_wfc_client_ipc,8,2             ; @wfc_client_ipc
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: client uninitialised"

	.comm	_VCOS_FUNCTION,4,2              ; @VCOS_FUNCTION
	.comm	_VCOS_EINVAL,4,2                ; @VCOS_EINVAL
	.comm	_WFC_IPC_MSG_MAGIC,4,2          ; @WFC_IPC_MSG_MAGIC
l_.str.1:                               ; @.str.1
	.asciz	"%s: wait %p, reply to %p"

	.comm	_VCHIQ_SUCCESS,8,3              ; @VCHIQ_SUCCESS
l_.str.2:                               ; @.str.2
	.asciz	"%s: failed to queue, 0x%x"

	.comm	_VCOS_ENXIO,4,2                 ; @VCOS_ENXIO
l_.str.3:                               ; @.str.3
	.asciz	"%s: got reply (len %i/%i)"

.subsections_via_symbols
