	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fill_peek_buf
_fill_peek_buf:                         ## @fill_peek_buf
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	_VCHI_FLAGS_NONE@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	sete	%al
	movq	_VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE@GOTPCREL(%rip), %r12
	cmpq	%rsi, (%r12)
	movq	%rdi, %r14
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_vcos_assert
	xorl	%ebx, %ebx
	cmpl	$0, (%r14)
	jns	LBB0_5
## %bb.1:
	movq	8(%r14), %rax
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	xorl	%eax, %eax
	callq	_alloc_msgbuf
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_3
LBB0_4:
	movl	16(%r14), %ecx
	movl	%ecx, -36(%rbp)
	xorl	%ecx, %ecx
	cmpq	%r15, (%r12)
	sete	%cl
	movl	%ecx, -56(%rbp)
	movq	_MSGBUF_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -40(%rbp)
	movq	%rax, -48(%rbp)
	movl	4(%r14), %edi
	movq	_VCHIQ_IOC_DEQUEUE_MESSAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	callq	_ioctl
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_RETRY
	movl	$0, (%r14)
LBB0_5:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	$-1, %ebx
	jmp	LBB0_5
	.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	_MSGBUF_SIZE,4,2                ## @MSGBUF_SIZE
	.comm	_VCHIQ_IOC_DEQUEUE_MESSAGE,4,2  ## @VCHIQ_IOC_DEQUEUE_MESSAGE
	.no_dead_strip	_fill_peek_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fill_peek_buf
_fill_peek_buf:                         ; @fill_peek_buf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
Lloh0:
	adrp	x8, _VCHI_FLAGS_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VCHI_FLAGS_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
Lloh3:
	adrp	x21, _VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE@GOTPAGEOFF]
	ldr	x8, [x21]
	ccmp	x8, x1, #4, ne
	cset	w0, eq
	bl	_vcos_assert
	ldr	w8, [x19]
	tbnz	w8, #31, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_5
LBB0_2:
	ldr	x0, [x19, #8]
	cbnz	x0, LBB0_4
; %bb.3:
	bl	_alloc_msgbuf
	str	x0, [x19, #8]
	cbz	x0, LBB0_6
LBB0_4:
	ldr	w8, [x19, #16]
	ldr	x9, [x21]
	cmp	x9, x20
	cset	w9, eq
	str	w9, [sp, #8]
Lloh5:
	adrp	x9, _MSGBUF_SIZE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MSGBUF_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #24]
	str	x0, [sp, #16]
	ldr	w0, [x19, #4]
Lloh8:
	adrp	x8, _VCHIQ_IOC_DEQUEUE_MESSAGE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VCHIQ_IOC_DEQUEUE_MESSAGE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_ioctl
	mov	x1, x0
	mov	w0, #0
	bl	_RETRY
	mov	w0, #0
	str	wzr, [x19]
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_6:
	mov	w0, #-1
	b	LBB0_5
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.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	_MSGBUF_SIZE,4,2                ; @MSGBUF_SIZE
	.comm	_VCHIQ_IOC_DEQUEUE_MESSAGE,4,2  ; @VCHIQ_IOC_DEQUEUE_MESSAGE
	.no_dead_strip	_fill_peek_buf
.subsections_via_symbols
