	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_buffer_queue              ## -- Begin function pvr2_buffer_queue
	.p2align	4, 0x90
_pvr2_buffer_queue:                     ## @pvr2_buffer_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	32(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_pvr2_buffer_wipe
	cmpl	$0, 8(%r14)
	je	LBB0_3
## %bb.4:
	movq	%rbx, %rdi
	callq	_pvr2_buffer_set_queued
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 24(%rbx)
	movl	8(%rbx), %r12d
	movl	4(%r14), %esi
	movl	8(%r14), %r13d
	movl	%r13d, %edi
	callq	_usb_rcvbulkpipe
	movq	16(%rbx), %rcx
	movl	(%rbx), %r8d
	movq	_buffer_complete@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	movq	%rbx, (%rsp)
	movl	%r12d, %edi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_usb_fill_bulk_urb
	movl	8(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_usb_submit_urb
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_5:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.comm	_buffer_complete,4,2            ## @buffer_complete
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_buffer_queue              ; -- Begin function pvr2_buffer_queue
	.p2align	2
_pvr2_buffer_queue:                     ; @pvr2_buffer_queue
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x19, [x0, #32]
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_pvr2_buffer_wipe
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_pvr2_buffer_set_queued
Lloh0:
	adrp	x8, _EINPROGRESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINPROGRESS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x20, #24]
	ldr	w21, [x20, #8]
	ldp	w1, w22, [x19, #4]
	mov	x0, x22
	bl	_usb_rcvbulkpipe
	mov	x2, x0
	ldr	x3, [x20, #16]
	ldr	w4, [x20]
Lloh3:
	adrp	x8, _buffer_complete@GOTPAGE
Lloh4:
	ldr	x8, [x8, _buffer_complete@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
	mov	x0, x21
	mov	x1, x22
	mov	x6, x20
	bl	_usb_fill_bulk_urb
	ldr	w0, [x20, #8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_usb_submit_urb
	mov	w20, #0
	b	LBB0_5
LBB0_3:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_6
LBB0_4:
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.comm	_buffer_complete,4,2            ; @buffer_complete
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
.subsections_via_symbols
