	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_buffer_set_ready
_pvr2_buffer_set_ready:                 ## @pvr2_buffer_set_ready
	.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
	movq	%rdi, %rbx
	callq	_BUFFER_CHECK
	movq	24(%rbx), %r12
	movq	_PVR2_TRACE_BUF_FLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	(%rbx), %edi
	callq	_pvr2_buffer_state_decode
	movq	%rax, %r15
	movq	_pvr2_buffer_state_ready@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_pvr2_buffer_state_decode
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	movq	%rax, %r8
	callq	_pvr2_trace
	leaq	8(%r12), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	xorl	%r15d, %r15d
	cmpq	$0, (%r12)
	sete	%r15b
	movq	%rbx, %rdi
	callq	_pvr2_buffer_remove
	leaq	16(%rbx), %rdi
	leaq	24(%r12), %rsi
	callq	_list_add_tail
	movl	(%r13), %edi
	movl	%edi, (%rbx)
	incq	(%r12)
	movq	8(%rbx), %rax
	shlq	$5, %rax
	addq	%rax, 16(%r12)
	movq	_PVR2_TRACE_BUF_FLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	callq	_pvr2_buffer_state_decode
	movq	(%r12), %r8
	movq	16(%r12), %rcx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	callq	_pvr2_trace
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_TRACE_BUF_FLOW,4,2        ## @PVR2_TRACE_BUF_FLOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/*---TRACE_FLOW---*/ bufferState    %p %6s --> %6s"

	.comm	_pvr2_buffer_state_ready,4,2    ## @pvr2_buffer_state_ready
L_.str.1:                               ## @.str.1
	.asciz	"/*---TRACE_FLOW---*/ bufferPool\t%8s inc cap=%07d cnt=%02d"

	.no_dead_strip	_pvr2_buffer_set_ready
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_buffer_set_ready
_pvr2_buffer_set_ready:                 ; @pvr2_buffer_set_ready
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	bl	_BUFFER_CHECK
	ldr	x22, [x19, #24]
Lloh0:
	adrp	x23, _PVR2_TRACE_BUF_FLOW@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PVR2_TRACE_BUF_FLOW@GOTPAGEOFF]
	ldr	w20, [x23]
	ldr	w0, [x19]
	bl	_pvr2_buffer_state_decode
	mov	x21, x0
Lloh2:
	adrp	x24, _pvr2_buffer_state_ready@GOTPAGE
Lloh3:
	ldr	x24, [x24, _pvr2_buffer_state_ready@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_pvr2_buffer_state_decode
	mov	x4, x0
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	mov	x3, x21
	bl	_pvr2_trace
	add	x20, x22, #8
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x8, [x22]
	cmp	x8, #0
	cset	w21, eq
	mov	x0, x19
	bl	_pvr2_buffer_remove
	add	x0, x19, #16
	add	x1, x22, #24
	bl	_list_add_tail
	ldr	w0, [x24]
	str	w0, [x19]
	ldr	x8, [x22]
	add	x8, x8, #1
	str	x8, [x22]
	ldr	x8, [x19, #8]
	ldr	x9, [x22, #16]
	add	x8, x9, x8, lsl #5
	str	x8, [x22, #16]
	ldr	w19, [x23]
	bl	_pvr2_buffer_state_decode
	mov	x2, x0
	ldr	x3, [x22, #16]
	ldr	x4, [x22]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_pvr2_trace
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_TRACE_BUF_FLOW,4,2        ; @PVR2_TRACE_BUF_FLOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/*---TRACE_FLOW---*/ bufferState    %p %6s --> %6s"

	.comm	_pvr2_buffer_state_ready,4,2    ; @pvr2_buffer_state_ready
l_.str.1:                               ; @.str.1
	.asciz	"/*---TRACE_FLOW---*/ bufferPool\t%8s inc cap=%07d cnt=%02d"

	.no_dead_strip	_pvr2_buffer_set_ready
.subsections_via_symbols
