	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function venus_read_queue
_venus_read_queue:                      ## @venus_read_queue
	.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
	cmpq	$0, (%rsi)
	je	LBB0_5
## %bb.1:
	movq	%rsi, %r13
	movq	8(%rsi), %r14
	testq	%r14, %r14
	je	LBB0_5
## %bb.2:
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	4(%r14), %r15d
	movl	12(%r14), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	8(%r14), %r12d
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_rmb
	movq	%r15, %r8
	movq	_HFI_CTRL_TO_HOST_MSG_Q@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	testl	%edx, (%rax)
	setne	%cl
	cmpl	%r12d, %r8d
	jne	LBB0_4
## %bb.3:
	movl	%ecx, 16(%r14)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	xorl	%eax, %eax
	callq	_wmb
	movq	_ENODATA@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	(%r13), %rbx
	leal	(,%r8,4), %eax
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %eax
	cmpl	$3, %eax
	ja	LBB0_8
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_6:
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %edx
	andl	$-4, %edx
	movq	_IFACEQ_VAR_HUGE_PKT_SIZE@GOTPCREL(%rip), %rdi
	cmpl	(%rdi), %edx
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	jg	LBB0_12
## %bb.9:
	cmpl	%edi, %r8d
	jg	LBB0_12
## %bb.10:
	leaq	(%rbx,%rsi,4), %rsi
	sarl	$2, %eax
	addl	%eax, %r8d
	movl	%r8d, %r15d
	subl	%edi, %r15d
	jge	LBB0_13
## %bb.11:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%r8, %r13
	callq	_memcpy
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_12:
	movl	8(%r14), %r13d
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_13:
	subl	%r15d, %eax
	shll	$2, %eax
	movslq	%eax, %rbx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_memcpy
	addq	%r12, %rbx
	movq	(%r13), %rsi
	leal	(,%r15,4), %edx
	movq	%rbx, %rdi
	callq	_memcpy
	xorl	%ebx, %ebx
	movl	%r15d, %r13d
LBB0_14:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_rmb
	movl	%r13d, 4(%r14)
	xorl	%eax, %eax
	callq	_wmb
	movl	4(%r14), %eax
	cmpl	8(%r14), %eax
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	cmovnel	%r15d, %r13d
	xorl	%eax, %eax
	callq	_rmb
	movl	%r13d, 16(%r14)
	xorl	%eax, %eax
	cmpq	$0, 24(%r14)
	setne	%al
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_mb
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_venus_dump_packet
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HFI_CTRL_TO_HOST_MSG_Q,4,2     ## @HFI_CTRL_TO_HOST_MSG_Q
	.comm	_ENODATA,4,2                    ## @ENODATA
	.comm	_IFACEQ_VAR_HUGE_PKT_SIZE,4,2   ## @IFACEQ_VAR_HUGE_PKT_SIZE
	.comm	_EBADMSG,4,2                    ## @EBADMSG
	.no_dead_strip	_venus_read_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function venus_read_queue
_venus_read_queue:                      ; @venus_read_queue
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x8, [x1]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x22, x1
	ldr	x24, [x1, #8]
	cbz	x24, LBB0_5
; %bb.2:
	mov	x20, x3
	mov	x19, x2
	mov	x21, x0
	ldp	w25, w23, [x24]
	ldp	w27, w26, [x24, #8]
	bl	_rmb
Lloh0:
	adrp	x8, _HFI_CTRL_TO_HOST_MSG_Q@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HFI_CTRL_TO_HOST_MSG_Q@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w25
	cset	w25, ne
	cmp	w23, w27
	b.ne	LBB0_4
; %bb.3:
	str	w25, [x24, #16]
	str	wzr, [x20]
	bl	_wmb
Lloh3:
	adrp	x8, _ENODATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODATA@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	ldr	x8, [x22]
	lsl	w9, w23, #2
	add	x1, x8, w9, sxtw #2
	ldr	w8, [x1]
	cmp	w8, #3
	b.hi	LBB0_8
LBB0_5:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	mov	x0, x22
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_8:
	and	w2, w8, #0xfffffffc
Lloh7:
	adrp	x9, _IFACEQ_VAR_HUGE_PKT_SIZE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IFACEQ_VAR_HUGE_PKT_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w2, w9
	ccmp	w23, w26, #0, le
	b.le	LBB0_10
; %bb.9:
	ldr	w23, [x24, #8]
Lloh10:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_13
LBB0_10:
	asr	w8, w8, #2
	add	w23, w8, w23
	subs	w26, w23, w26
	b.ge	LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_memcpy
	mov	w22, #0
	b	LBB0_13
LBB0_12:
	sub	w8, w8, w26
	lsl	w23, w8, #2
	mov	x0, x19
	mov	x2, x23
	bl	_memcpy
	ldr	x1, [x22]
	lsl	w2, w26, #2
	add	x0, x19, w23, sxtw
	bl	_memcpy
	mov	w22, #0
	mov	x23, x26
LBB0_13:
	bl	_rmb
	str	w23, [x24, #4]
	bl	_wmb
	ldp	w23, w26, [x24, #4]
	bl	_rmb
	cmp	w23, w26
	csel	w8, w25, wzr, eq
	str	w8, [x24, #16]
	ldr	x8, [x24, #24]
	cmp	x8, #0
	cset	w8, ne
	str	w8, [x20]
	bl	_mb
	mov	x0, x21
	mov	x1, x19
	bl	_venus_dump_packet
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HFI_CTRL_TO_HOST_MSG_Q,4,2     ; @HFI_CTRL_TO_HOST_MSG_Q
	.comm	_ENODATA,4,2                    ; @ENODATA
	.comm	_IFACEQ_VAR_HUGE_PKT_SIZE,4,2   ; @IFACEQ_VAR_HUGE_PKT_SIZE
	.comm	_EBADMSG,4,2                    ; @EBADMSG
	.no_dead_strip	_venus_read_queue
.subsections_via_symbols
