	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_stream_achieve_buffer_count
_pvr2_stream_achieve_buffer_count:      ## @pvr2_stream_achieve_buffer_count
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movl	(%rdi), %ecx
	movl	4(%rdi), %r8d
	cmpl	%r8d, %ecx
	je	LBB0_9
## %bb.1:
	movq	%rdi, %rbx
	movq	_PVR2_TRACE_BUF_POOL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_pvr2_trace
	movl	(%rbx), %esi
	movl	4(%rbx), %r8d
	movl	%esi, %r9d
	subl	%r8d, %r9d
	jae	LBB0_2
## %bb.10:
	movq	%rbx, %rdi
	movl	%r8d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_pvr2_stream_buffer_count       ## TAILCALL
LBB0_2:
	movq	_pvr2_buffer_state_idle@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r10
	incl	%esi
	movq	%r9, %rcx
	negq	%rcx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rdi, %rcx
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%rbx), %rax
	leal	-2(%rsi), %edx
	movq	(%rax,%rdx,8), %rax
	decl	%esi
	decq	%rdi
	cmpq	%r10, (%rax)
	je	LBB0_3
## %bb.6:
	notl	%edi
	movl	%edi, %r9d
	testl	%r9d, %r9d
	jne	LBB0_8
	jmp	LBB0_9
LBB0_4:
	movl	%r8d, %esi
	testl	%r9d, %r9d
	je	LBB0_9
LBB0_8:
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_pvr2_stream_buffer_count
LBB0_9:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_TRACE_BUF_POOL,4,2        ## @PVR2_TRACE_BUF_POOL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/*---TRACE_FLOW---*/ poolCheck\tstream=%p cur=%d tgt=%d"

	.comm	_pvr2_buffer_state_idle,8,3     ## @pvr2_buffer_state_idle
	.no_dead_strip	_pvr2_stream_achieve_buffer_count
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_stream_achieve_buffer_count
_pvr2_stream_achieve_buffer_count:      ; @pvr2_stream_achieve_buffer_count
	.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	w3, w4, [x0]
	cmp	w3, w4
	b.eq	LBB0_8
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _PVR2_TRACE_BUF_POOL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_TRACE_BUF_POOL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_pvr2_trace
	ldp	w8, w1, [x19]
	subs	w9, w8, w1
	b.hs	LBB0_3
; %bb.2:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pvr2_stream_buffer_count
LBB0_3:
Lloh5:
	adrp	x10, _pvr2_buffer_state_idle@GOTPAGE
Lloh6:
	ldr	x10, [x10, _pvr2_buffer_state_idle@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x10]
	add	w8, w8, #1
	mov	w10, #-1
	mov	x12, x9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cbz	x12, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x13, [x19, #8]
	sub	w14, w8, #2
	ldr	x13, [x13, w14, uxtw #3]
	ldr	x13, [x13]
	sub	w8, w8, #1
	add	w10, w10, #1
	sub	x12, x12, #1
	cmp	x13, x11
	b.eq	LBB0_4
; %bb.6:
	cbz	w10, LBB0_8
LBB0_7:
	mov	x0, x19
	mov	x1, x8
	bl	_pvr2_stream_buffer_count
LBB0_8:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x10, x9
	mov	x8, x1
	cbnz	w10, LBB0_7
	b	LBB0_8
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_TRACE_BUF_POOL,4,2        ; @PVR2_TRACE_BUF_POOL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/*---TRACE_FLOW---*/ poolCheck\tstream=%p cur=%d tgt=%d"

	.comm	_pvr2_buffer_state_idle,8,3     ; @pvr2_buffer_state_idle
	.no_dead_strip	_pvr2_stream_achieve_buffer_count
.subsections_via_symbols
