	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vchi_msg_dequeue               ## -- Begin function vchi_msg_dequeue
	.p2align	4, 0x90
_vchi_msg_dequeue:                      ## @vchi_msg_dequeue
	.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	%r8, %r13
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %r15
	callq	_find_service_by_handle
	movq	_VCHI_FLAGS_NONE@GOTPCREL(%rip), %rcx
	cmpq	%r13, (%rcx)
	sete	%cl
	movq	_VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE@GOTPCREL(%rip), %r14
	cmpq	%r13, (%r14)
	movq	%rax, %rbx
	sete	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_vcos_assert
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.1:
	cmpq	$0, (%rbx)
	js	LBB0_6
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_vcos_log_error
	movq	(%rbx), %rdx
	cmpq	%r12, %rdx
	jle	LBB0_7
## %bb.3:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rax
	movl	$-1, %ebx
	cmpq	(%rax), %rcx
	je	LBB0_9
## %bb.4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$-1, %ebx
	movl	$-1, %edx
	callq	_fprintf
	jmp	LBB0_9
LBB0_5:
	movq	_VCHIQ_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_9
LBB0_6:
	xorl	%eax, %eax
	cmpq	%r13, (%r14)
	movl	12(%rbx), %ecx
	movl	%ecx, -56(%rbp)
	sete	%al
	movl	%eax, -80(%rbp)
	movq	%r12, -64(%rbp)
	movq	%r15, -72(%rbp)
	movl	8(%rbx), %edi
	movq	_VCHIQ_IOC_DEQUEUE_MESSAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	callq	_ioctl
	movl	%eax, %esi
	callq	_RETRY
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	jmp	LBB0_8
LBB0_7:
	movl	16(%rbx), %esi
	movq	%r15, %rdi
	callq	_memcpy
	movq	(%rbx), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	$-1, (%rbx)
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VCHI_FLAGS_NONE,8,3            ## @VCHI_FLAGS_NONE
	.comm	_VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE,8,3 ## @VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE
	.comm	_VCHIQ_ERROR,4,2                ## @VCHIQ_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vchi_msg_dequeue -> using peek buffer\n"

	.comm	_VCHIQ_IOC_DEQUEUE_MESSAGE,4,2  ## @VCHIQ_IOC_DEQUEUE_MESSAGE
	.comm	_errno,8,3                      ## @errno
	.comm	_EWOULDBLOCK,8,3                ## @EWOULDBLOCK
	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"vchi_msg_dequeue -> %d(%d)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vchi_msg_dequeue               ; -- Begin function vchi_msg_dequeue
	.p2align	2
_vchi_msg_dequeue:                      ; @vchi_msg_dequeue
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x23, x4
	mov	x19, x3
	mov	x22, x2
	mov	x21, x1
	bl	_find_service_by_handle
	mov	x20, x0
Lloh0:
	adrp	x8, _VCHI_FLAGS_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VCHI_FLAGS_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x23
Lloh3:
	adrp	x24, _VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE@GOTPAGEOFF]
	ldr	x8, [x24]
	ccmp	x8, x23, #4, ne
	cset	w0, eq
	bl	_vcos_assert
	cbz	x20, LBB0_5
; %bb.1:
	ldr	x8, [x20]
	tbnz	x8, #63, LBB0_6
; %bb.2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_vcos_log_error
	ldr	x2, [x20]
	cmp	x2, x22
	b.le	LBB0_7
; %bb.3:
Lloh7:
	adrp	x8, _errno@GOTPAGE
Lloh8:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh9:
	ldr	x3, [x8]
Lloh10:
	adrp	x8, _EWOULDBLOCK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EWOULDBLOCK@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x3, x8
	b.ne	LBB0_8
; %bb.4:
	mov	w21, #-1
	b	LBB0_9
LBB0_5:
Lloh13:
	adrp	x8, _VCHIQ_ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _VCHIQ_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
	b	LBB0_9
LBB0_6:
	ldr	w8, [x20, #12]
	str	w8, [sp, #24]
	ldr	x8, [x24]
	cmp	x8, x23
	cset	w8, eq
	str	w8, [sp]
	stp	x21, x22, [sp, #8]
	ldr	w0, [x20, #8]
Lloh16:
	adrp	x8, _VCHIQ_IOC_DEQUEUE_MESSAGE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VCHIQ_IOC_DEQUEUE_MESSAGE@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_ioctl
	mov	x1, x0
	bl	_RETRY
	mov	w21, #0
	str	xzr, [x19]
	b	LBB0_9
LBB0_7:
	ldr	w1, [x20, #16]
	mov	x0, x21
	bl	_memcpy
	mov	w21, #0
	ldr	x8, [x20]
	str	x8, [x19]
	mov	x8, #-1
	str	x8, [x20]
	b	LBB0_9
LBB0_8:
Lloh19:
	adrp	x8, _stderr@GOTPAGE
Lloh20:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w21, #-1
	mov	w2, #-1
	bl	_fprintf
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_VCHI_FLAGS_NONE,8,3            ; @VCHI_FLAGS_NONE
	.comm	_VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE,8,3 ; @VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE
	.comm	_VCHIQ_ERROR,4,2                ; @VCHIQ_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vchi_msg_dequeue -> using peek buffer\n"

	.comm	_VCHIQ_IOC_DEQUEUE_MESSAGE,4,2  ; @VCHIQ_IOC_DEQUEUE_MESSAGE
	.comm	_errno,8,3                      ; @errno
	.comm	_EWOULDBLOCK,8,3                ; @EWOULDBLOCK
	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"vchi_msg_dequeue -> %d(%d)\n"

.subsections_via_symbols
