	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_hdw_set_streaming         ## -- Begin function pvr2_hdw_set_streaming
	.p2align	4, 0x90
_pvr2_hdw_set_streaming:                ## @pvr2_hdw_set_streaming
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_LOCK_TAKE
	movq	%rbx, %rdi
	callq	_pvr2_hdw_untrip_unlocked
	testl	%r14d, %r14d
	setne	%al
	cmpl	$0, (%rbx)
	sete	%cl
	xorb	%al, %cl
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	testl	%r14d, %r14d
	setne	%al
	movl	%eax, (%rbx)
	movq	_PVR2_TRACE_START_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmovneq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	callq	_pvr2_trace
LBB0_2:
	movq	%rbx, %rdi
	callq	_pvr2_hdw_state_sched
	movl	8(%rbx), %edi
	callq	_LOCK_GIVE
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_pvr2_hdw_wait
	movl	%eax, %ecx
	sarl	$31, %eax
	andl	%ecx, %eax
	testl	%r14d, %r14d
	je	LBB0_10
## %bb.3:
	testl	%ecx, %ecx
	js	LBB0_10
## %bb.4:
	movq	_PVR2_STATE_RUN@GOTPCREL(%rip), %r14
	movq	_PVR2_STATE_READY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%rbx), %esi
	cmpl	(%r14), %esi
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	(%r15), %esi
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_pvr2_hdw_wait
	testl	%eax, %eax
	jns	LBB0_5
	jmp	LBB0_10
LBB0_6:
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_TRACE_START_STOP,4,2      ## @PVR2_TRACE_START_STOP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/*--TRACE_STREAM--*/ %s"

L_.str.1:                               ## @.str.1
	.asciz	"enable"

L_.str.2:                               ## @.str.2
	.asciz	"disable"

	.comm	_PVR2_STATE_RUN,4,2             ## @PVR2_STATE_RUN
	.comm	_PVR2_STATE_READY,4,2           ## @PVR2_STATE_READY
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_hdw_set_streaming         ; -- Begin function pvr2_hdw_set_streaming
	.p2align	2
_pvr2_hdw_set_streaming:                ; @pvr2_hdw_set_streaming
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_LOCK_TAKE
	mov	x0, x19
	bl	_pvr2_hdw_untrip_unlocked
	cmp	w20, #0
	cset	w8, ne
	ldr	w9, [x19]
	cmp	w9, #0
	cset	w9, eq
	eor	w8, w8, w9
	tbnz	w8, #0, LBB0_2
; %bb.1:
	cmp	w20, #0
	cset	w8, ne
	str	w8, [x19]
Lloh0:
	adrp	x8, _PVR2_TRACE_START_STOP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_TRACE_START_STOP@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, l_.str.2@PAGE
Lloh4:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh5:
	adrp	x9, l_.str.1@PAGE
Lloh6:
	add	x9, x9, l_.str.1@PAGEOFF
	csel	x2, x9, x8, ne
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_pvr2_trace
LBB0_2:
	mov	x0, x19
	bl	_pvr2_hdw_state_sched
	ldr	w0, [x19, #8]
	bl	_LOCK_GIVE
	mov	x0, x19
	mov	w1, #0
	bl	_pvr2_hdw_wait
	mov	x8, x0
	cmp	w0, #0
	csel	w0, w0, wzr, lt
	cbz	w20, LBB0_10
; %bb.3:
	tbnz	w8, #31, LBB0_10
; %bb.4:
Lloh9:
	adrp	x20, _PVR2_STATE_RUN@GOTPAGE
Lloh10:
	ldr	x20, [x20, _PVR2_STATE_RUN@GOTPAGEOFF]
Lloh11:
	adrp	x21, _PVR2_STATE_READY@GOTPAGE
Lloh12:
	ldr	x21, [x21, _PVR2_STATE_READY@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x19, #4]
	ldr	w8, [x20]
	cmp	w1, w8
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x21]
	cmp	w1, w8
	b.ne	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_pvr2_hdw_wait
	tbz	w0, #31, LBB0_5
	b	LBB0_10
LBB0_8:
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh13:
	adrp	x8, _EIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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 AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_TRACE_START_STOP,4,2      ; @PVR2_TRACE_START_STOP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/*--TRACE_STREAM--*/ %s"

l_.str.1:                               ; @.str.1
	.asciz	"enable"

l_.str.2:                               ; @.str.2
	.asciz	"disable"

	.comm	_PVR2_STATE_RUN,4,2             ; @PVR2_STATE_RUN
	.comm	_PVR2_STATE_READY,4,2           ; @PVR2_STATE_READY
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
