	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_dvb_stream_end
_pvr2_dvb_stream_end:                   ## @pvr2_dvb_stream_end
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	32(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_kthread_stop
	movq	$0, 32(%r12)
LBB0_2:
	movq	24(%r12), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	(%rax), %r14
	testq	%r14, %r14
	je	LBB0_5
## %bb.4:
	leaq	16(%r12), %r15
	movl	(%r15), %edi
	xorl	%esi, %esi
	callq	_pvr2_hdw_set_streaming
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_pvr2_stream_set_callback
	movq	%r14, %rdi
	callq	_pvr2_stream_kill
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_pvr2_stream_set_buffer_count
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pvr2_channel_claim_stream
LBB0_5:
	cmpq	$0, (%r12)
	je	LBB0_12
## %bb.6:
	movq	_PVR2_DVB_BUFFER_COUNT@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, %eax
	je	LBB0_11
## %bb.7:
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%rbx
	movl	%eax, %ecx
	cmpq	%rcx, %rbx
	jae	LBB0_11
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rcx
	movq	(%rcx,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	callq	_kfree
	movq	8(%r12), %rax
	movq	$0, (%rax,%rbx,8)
	movl	(%r14), %eax
	jmp	LBB0_10
LBB0_11:
	movq	$0, (%r12)
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_DVB_BUFFER_COUNT,4,2      ## @PVR2_DVB_BUFFER_COUNT
	.no_dead_strip	_pvr2_dvb_stream_end
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_dvb_stream_end
_pvr2_dvb_stream_end:                   ; @pvr2_dvb_stream_end
	.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	x19, x0
	ldr	x0, [x0, #32]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_kthread_stop
	str	xzr, [x19, #32]
LBB0_2:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x20, [x8]
	cbz	x20, LBB0_5
; %bb.4:
	add	x21, x19, #16
	ldr	w0, [x21]
	mov	w1, #0
	bl	_pvr2_hdw_set_streaming
	mov	x0, x20
	mov	x1, #0
	mov	x2, #0
	bl	_pvr2_stream_set_callback
	mov	x0, x20
	bl	_pvr2_stream_kill
	mov	x0, x20
	mov	w1, #0
	bl	_pvr2_stream_set_buffer_count
	mov	x0, x21
	mov	x1, #0
	bl	_pvr2_channel_claim_stream
LBB0_5:
	ldr	x8, [x19]
	cbz	x8, LBB0_12
; %bb.6:
Lloh0:
	adrp	x20, _PVR2_DVB_BUFFER_COUNT@GOTPAGE
Lloh1:
	ldr	x20, [x20, _PVR2_DVB_BUFFER_COUNT@GOTPAGEOFF]
	ldr	w8, [x20]
	cbz	w8, LBB0_11
; %bb.7:
	mov	x21, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x21, x21, #1
	cmp	x21, w8, uxtw
	b.hs	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #8]
	ldr	x0, [x9, x21, lsl #3]
	cbz	x0, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	bl	_kfree
	ldr	x8, [x19, #8]
	str	xzr, [x8, x21, lsl #3]
	ldr	w8, [x20]
	b	LBB0_8
LBB0_11:
	str	xzr, [x19]
LBB0_12:
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_DVB_BUFFER_COUNT,4,2      ; @PVR2_DVB_BUFFER_COUNT
	.no_dead_strip	_pvr2_dvb_stream_end
.subsections_via_symbols
