	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function pvr2_ioread_get_buffer
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_pvr2_ioread_get_buffer:                ## @pvr2_ioread_get_buffer
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movl	$1, %r14d
	cmpq	8(%rdi), %rax
	jg	LBB0_13
## %bb.1:
	movq	%rdi, %rbx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	$0, 8(%rbx)
	movq	16(%rbx), %rdi
	movq	24(%rbx), %r15
	callq	_pvr2_buffer_get_id
	movq	(%r15,%rax,8), %rax
	movq	%rax, 32(%rbx)
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	jg	LBB0_13
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_pvr2_buffer_queue
	testl	%eax, %eax
	js	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	$0, 32(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	40(%rbx), %edi
	callq	_pvr2_stream_get_ready_buffer
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rdi
	callq	_pvr2_buffer_get_count
	movq	%rax, (%rbx)
	testq	%rax, %rax
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%rbx), %rdi
	callq	_pvr2_buffer_get_status
	testl	%eax, %eax
	jns	LBB0_12
## %bb.10:
	movq	_PVR2_TRACE_DATA_FLOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_4:
	movq	_PVR2_TRACE_DATA_FLOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
LBB0_5:
	movq	%rbx, %rdx
	movl	%eax, %ecx
	callq	_pvr2_trace
	movq	%rbx, %rdi
	callq	_pvr2_ioread_stop
	xorl	%r14d, %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_TRACE_DATA_FLOW,4,2       ## @PVR2_TRACE_DATA_FLOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/*---TRACE_READ---*/ pvr2_ioread_read id=%p queue_error=%d"

L_.str.1:                               ## @.str.1
	.asciz	"/*---TRACE_READ---*/ pvr2_ioread_read id=%p buffer_error=%d"

	.no_dead_strip	_pvr2_ioread_get_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_ioread_get_buffer
_pvr2_ioread_get_buffer:                ; @pvr2_ioread_get_buffer
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldp	x8, x9, [x0]
	cmp	x8, x9
	b.le	LBB0_3
LBB0_1:
	mov	w0, #1
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x19, x0
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	str	xzr, [x19, #8]
	ldp	x0, x20, [x19, #16]
	bl	_pvr2_buffer_get_id
	ldr	x8, [x20, x0, lsl #3]
	str	x8, [x19, #32]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldp	x8, x9, [x19]
	cmp	x8, x9
	b.gt	LBB0_1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	bl	_pvr2_buffer_queue
	tbnz	w0, #31, LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	str	xzr, [x19, #32]
	stp	xzr, xzr, [x19, #8]
	str	xzr, [x19]
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19, #40]
	bl	_pvr2_stream_get_ready_buffer
	str	x0, [x19, #16]
	cbz	x0, LBB0_1
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	bl	_pvr2_buffer_get_count
	str	x0, [x19]
	cbnz	x0, LBB0_4
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x19, #16]
	bl	_pvr2_buffer_get_status
	tbz	w0, #31, LBB0_5
; %bb.12:
	mov	x3, x0
Lloh0:
	adrp	x8, _PVR2_TRACE_DATA_FLOW@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_TRACE_DATA_FLOW@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_13:
	mov	x3, x0
Lloh5:
	adrp	x8, _PVR2_TRACE_DATA_FLOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PVR2_TRACE_DATA_FLOW@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
LBB0_14:
	mov	x2, x19
	bl	_pvr2_trace
	mov	x0, x19
	bl	_pvr2_ioread_stop
	mov	w0, #0
	b	LBB0_2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_TRACE_DATA_FLOW,4,2       ; @PVR2_TRACE_DATA_FLOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/*---TRACE_READ---*/ pvr2_ioread_read id=%p queue_error=%d"

l_.str.1:                               ; @.str.1
	.asciz	"/*---TRACE_READ---*/ pvr2_ioread_read id=%p buffer_error=%d"

	.no_dead_strip	_pvr2_ioread_get_buffer
.subsections_via_symbols
