	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function venus_write_queue
_venus_write_queue:                     ## @venus_write_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_3
## %bb.1:
	movq	%rsi, %r12
	movq	8(%rsi), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.2:
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rdx, %rsi
	callq	_venus_dump_packet
	movl	(%r15), %ecx
	cmpl	$3, %ecx
	ja	LBB0_6
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_4:
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	%ecx, %r13d
	sarl	$2, %r13d
	movl	(%rbx), %r14d
	movl	4(%rbx), %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	8(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	callq	_rmb
	subl	-72(%rbp), %r14d                ## 4-byte Folded Reload
	movl	-44(%rbp), %eax                 ## 4-byte Reload
                                        ## kill: def $eax killed $eax def $rax
	cmovgl	%ebx, %eax
	addl	%r14d, %eax
	movq	%r13, %rcx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	cmpl	%r13d, %eax
	jle	LBB0_9
## %bb.7:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	$0, 12(%r14)
	xorl	%eax, %eax
	callq	_wmb
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leal	(%rcx,%rax), %r13d
	shll	$2, %ecx
	movslq	%ecx, %rdi
	shlq	$2, %rdi
	addq	(%r12), %rdi
	movl	%r13d, %ebx
	subl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	jge	LBB0_10
## %bb.8:
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	andl	$-4, %edx
	movq	%r15, %rsi
	callq	_memcpy
	jmp	LBB0_11
LBB0_9:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$1, 12(%rax)
	xorl	%eax, %eax
	callq	_wmb
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	subl	%ebx, %eax
	shll	$2, %eax
	movslq	%eax, %r13
	movq	%r15, %rsi
	movl	%r13d, %edx
	callq	_memcpy
	movq	(%r12), %rdi
	addq	%r13, %r15
	leal	(,%rbx,4), %edx
	movq	%r15, %rsi
	callq	_memcpy
	movl	%ebx, %r13d
LBB0_11:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_wmb
	movl	%r13d, 4(%r14)
	xorl	%eax, %eax
	cmpq	$0, 16(%r14)
	setne	%al
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_mb
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_venus_write_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function venus_write_queue
_venus_write_queue:                     ; @venus_write_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_3
; %bb.1:
	mov	x21, x1
	ldr	x23, [x1, #8]
	cbz	x23, LBB0_3
; %bb.2:
	mov	x19, x3
	mov	x20, x2
	mov	x1, x2
	bl	_venus_dump_packet
	ldr	w22, [x20]
	cmp	w22, #3
	b.hi	LBB0_6
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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_6:
	asr	w24, w22, #2
	ldp	w27, w26, [x23]
	ldr	w25, [x23, #8]
	bl	_rmb
	subs	w8, w27, w26
	csel	w9, wzr, w25, gt
	add	w8, w8, w9
	cmp	w8, w24
	b.le	LBB0_9
; %bb.7:
	str	wzr, [x23, #12]
	bl	_wmb
	ldr	x8, [x21]
	lsl	w9, w26, #2
	add	x0, x8, w9, sxtw #2
	add	w26, w26, w24
	subs	w25, w26, w25
	b.ge	LBB0_10
; %bb.8:
	and	w2, w22, #0xfffffffc
	mov	x1, x20
	bl	_memcpy
	b	LBB0_11
LBB0_9:
	mov	w8, #1
	str	w8, [x23, #12]
	bl	_wmb
Lloh2:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_4
LBB0_10:
	sub	w8, w24, w25
	lsl	w22, w8, #2
	mov	x1, x20
	mov	x2, x22
	bl	_memcpy
	ldr	x0, [x21]
	lsl	w2, w25, #2
	add	x1, x20, w22, sxtw
	bl	_memcpy
	mov	x26, x25
LBB0_11:
	bl	_wmb
	str	w26, [x23, #4]
	ldr	x8, [x23, #16]
	cmp	x8, #0
	cset	w8, ne
	str	w8, [x19]
	bl	_mb
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_venus_write_queue
.subsections_via_symbols
