	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc_vchi_msg_bulk_read
_vc_vchi_msg_bulk_read:                 ## @vc_vchi_msg_bulk_read
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	_FILESERV_MAX_BULK@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	%rdx, (%rax)
	setge	%dil
	callq	_vcos_verify
	movl	$-1, %ecx
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	movq	%rbx, %rdi
	callq	_VCHI_BULK_ALIGN_NBYTES
	movq	_vc_filesys_client@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	incl	%ecx
	andl	$2147483647, %ecx               ## imm = 0x7FFFFFFF
	movl	%ecx, (%r14)
	movl	%ecx, (%r13)
	movq	%r12, 8(%r13)
	movq	16(%r13), %rcx
	movq	%r15, 16(%rcx)
	movq	%rax, %r15
	movq	%rax, 24(%rcx)
	movl	4(%r14), %edi
	movq	_VCHI_FLAGS_BLOCK_UNTIL_QUEUED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$24, %edx
	movq	%r13, %rsi
	xorl	%r8d, %r8d
	callq	_vchi_msg_queue
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:
	leaq	8(%r14), %rdi
	callq	_vcos_event_wait
	movq	_VCOS_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	movq	8(%r13), %rax
	movq	_FILESERV_RESP_ERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.8:
	movq	16(%r13), %rax
	movq	(%rax), %r12
	xorl	%edi, %edi
	movq	_FILESERV_MAX_BULK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	setle	%dil
	callq	_vcos_verify
	testl	%eax, %eax
	je	LBB0_6
## %bb.9:
	movq	8(%r13), %rax
	movq	_FILESERV_RESP_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.10:
	movq	_FILESERV_MAX_DATA@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	(%rax), %r12
	setle	%dil
	callq	_vcos_verify
	testl	%eax, %eax
	movl	$-1, %ecx
	je	LBB0_7
## %bb.11:
	movq	24(%r13), %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_memcpy
	movl	%r12d, %ecx
	jmp	LBB0_7
LBB0_6:
	movl	$-1, %ecx
LBB0_7:
	movl	%ecx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_FILESERV_BULK_WRITE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$-1, %ecx
	jne	LBB0_7
## %bb.14:
	movq	16(%r13), %rax
	movq	8(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	addq	%r15, %rax
	movq	%r12, %rdx
	subq	%rax, %rdx
	movl	4(%r14), %edi
	movq	_VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %r14
	movq	%rbx, %rsi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	xorl	%r8d, %r8d
	callq	_vchi_bulk_queue_receive
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_vcos_verify
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_17
## %bb.15:
	testq	%rdx, %rdx
	je	LBB0_17
## %bb.16:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%r14,%rax,4), %rdi
	shlq	$2, %r15
	addq	24(%r13), %r15
	movq	%r15, %rsi
	callq	_memcpy
LBB0_17:
	cmpl	$1, %ebx
	movl	$0, %ecx
	sbbl	%ecx, %ecx
	orl	%r12d, %ecx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_FILESERV_MAX_BULK,8,3          ## @FILESERV_MAX_BULK
	.comm	_vc_filesys_client,12,2         ## @vc_filesys_client
	.comm	_VCHI_FLAGS_BLOCK_UNTIL_QUEUED,4,2 ## @VCHI_FLAGS_BLOCK_UNTIL_QUEUED
	.comm	_VCOS_SUCCESS,8,3               ## @VCOS_SUCCESS
	.comm	_FILESERV_RESP_ERROR,8,3        ## @FILESERV_RESP_ERROR
	.comm	_FILESERV_RESP_OK,8,3           ## @FILESERV_RESP_OK
	.comm	_FILESERV_MAX_DATA,8,3          ## @FILESERV_MAX_DATA
	.comm	_FILESERV_BULK_WRITE,8,3        ## @FILESERV_BULK_WRITE
	.comm	_VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE,4,2 ## @VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE
	.no_dead_strip	_vc_vchi_msg_bulk_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc_vchi_msg_bulk_read
_vc_vchi_msg_bulk_read:                 ; @vc_vchi_msg_bulk_read
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x3
	mov	x21, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _FILESERV_MAX_BULK@GOTPAGE
Lloh1:
	ldr	x24, [x24, _FILESERV_MAX_BULK@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x8, x2
	cset	w0, ge
	bl	_vcos_verify
	cbz	w0, LBB0_13
; %bb.1:
	mov	x0, x19
	bl	_VCHI_BULK_ALIGN_NBYTES
	mov	x22, x0
Lloh2:
	adrp	x25, _vc_filesys_client@GOTPAGE
Lloh3:
	ldr	x25, [x25, _vc_filesys_client@GOTPAGEOFF]
	ldp	w8, w0, [x25]
	add	w8, w8, #1
	and	w8, w8, #0x7fffffff
	str	w8, [x25]
	str	w8, [x20]
	str	x23, [x20, #8]
	ldr	x8, [x20, #16]
	stp	x21, x22, [x8, #16]
Lloh4:
	adrp	x8, _VCHI_FLAGS_BLOCK_UNTIL_QUEUED@GOTPAGE
Lloh5:
	ldr	x8, [x8, _VCHI_FLAGS_BLOCK_UNTIL_QUEUED@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	x1, x20
	mov	w2, #24
	mov	x4, #0
	bl	_vchi_msg_queue
	cbnz	x0, LBB0_13
; %bb.2:
	add	x0, x25, #8
	bl	_vcos_event_wait
Lloh7:
	adrp	x8, _VCOS_SUCCESS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VCOS_SUCCESS@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.3:
	ldr	x8, [x20, #8]
Lloh10:
	adrp	x9, _FILESERV_RESP_ERROR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _FILESERV_RESP_ERROR@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_13
; %bb.4:
	ldr	x8, [x20, #16]
	ldr	x21, [x8]
	ldr	x8, [x24]
	cmp	x21, x8
	cset	w0, le
	bl	_vcos_verify
	cbz	w0, LBB0_13
; %bb.5:
	ldr	x8, [x20, #8]
Lloh13:
	adrp	x9, _FILESERV_RESP_OK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _FILESERV_RESP_OK@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
Lloh16:
	adrp	x8, _FILESERV_MAX_DATA@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FILESERV_MAX_DATA@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cmp	x21, x8
	cset	w0, le
	bl	_vcos_verify
	cbz	w0, LBB0_13
; %bb.7:
	ldr	x1, [x20, #24]
	mov	x0, x19
	mov	x2, x21
	bl	_memcpy
	b	LBB0_14
LBB0_8:
Lloh19:
	adrp	x9, _FILESERV_BULK_WRITE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _FILESERV_BULK_WRITE@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.9:
	ldr	x8, [x20, #16]
	ldr	x23, [x8, #8]
	add	x8, x22, x23
	sub	x24, x21, x8
	ldr	w0, [x25, #4]
Lloh22:
	adrp	x8, _VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x8]
	mov	x1, x19
	mov	x2, x24
	mov	x4, #0
	bl	_vchi_bulk_queue_receive
	cmp	x0, #0
	cset	w0, eq
	bl	_vcos_verify
	mov	x25, x0
	cbz	w0, LBB0_12
; %bb.10:
	cbz	x23, LBB0_12
; %bb.11:
	add	x0, x19, x24, lsl #2
	ldr	x8, [x20, #24]
	add	x1, x8, x22, lsl #2
	mov	x2, x23
	bl	_memcpy
LBB0_12:
	cmp	w25, #0
	csinv	w21, w21, wzr, ne
	b	LBB0_14
LBB0_13:
	mov	w21, #-1
LBB0_14:
	mov	x0, x21
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_FILESERV_MAX_BULK,8,3          ; @FILESERV_MAX_BULK
	.comm	_vc_filesys_client,12,2         ; @vc_filesys_client
	.comm	_VCHI_FLAGS_BLOCK_UNTIL_QUEUED,4,2 ; @VCHI_FLAGS_BLOCK_UNTIL_QUEUED
	.comm	_VCOS_SUCCESS,8,3               ; @VCOS_SUCCESS
	.comm	_FILESERV_RESP_ERROR,8,3        ; @FILESERV_RESP_ERROR
	.comm	_FILESERV_RESP_OK,8,3           ; @FILESERV_RESP_OK
	.comm	_FILESERV_MAX_DATA,8,3          ; @FILESERV_MAX_DATA
	.comm	_FILESERV_BULK_WRITE,8,3        ; @FILESERV_BULK_WRITE
	.comm	_VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE,4,2 ; @VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE
	.no_dead_strip	_vc_vchi_msg_bulk_read
.subsections_via_symbols
