	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dvb_dvr_release
_dvb_dvr_release:                       ## @dvb_dvr_release
	.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	%rsi, %rbx
	movq	8(%rsi), %r15
	movq	16(%r15), %r13
	leaq	4(%r13), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_O_ACCMODE@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	andl	(%rbx), %eax
	movq	_O_WRONLY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movq	48(%r13), %rdi
	callq	*8(%rdi)
	movq	48(%r13), %rdi
	movl	40(%r13), %esi
	callq	*(%rdi)
	movl	(%r12), %eax
	andl	(%rbx), %eax
LBB0_2:
	movq	_O_RDONLY@GOTPCREL(%rip), %rdx
	movq	32(%r13), %rcx
	cmpl	(%rdx), %eax
	jne	LBB0_3
## %bb.4:
	testq	%rcx, %rcx
	jne	LBB0_5
	jmp	LBB0_8
LBB0_3:
	testq	%rcx, %rcx
	je	LBB0_10
LBB0_5:
	leaq	24(%r13), %rbx
	movq	%rbx, %rdi
	callq	_dvb_vb2_is_streaming
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_dvb_vb2_stream_off
LBB0_7:
	movq	%rbx, %rdi
	callq	_dvb_vb2_release
LBB0_8:
	incl	8(%r15)
	movq	16(%r13), %r12
	testq	%r12, %r12
	je	LBB0_10
## %bb.9:
	xorl	%eax, %eax
	callq	_mb
	leaq	8(%r13), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	movq	$0, 16(%r13)
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	movq	%r12, %rdi
	callq	_vfree
LBB0_10:
	movl	(%r15), %eax
	decl	%eax
	movl	%eax, (%r15)
	cmpl	$1, %eax
	jne	LBB0_13
## %bb.11:
	cmpl	$1, (%r13)
	jne	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	callq	_mutex_unlock
	addq	$4, %r15
	movq	%r15, %rdi
	callq	_wake_up
	jmp	LBB0_14
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_14:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_ACCMODE,4,2                  ## @O_ACCMODE
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.no_dead_strip	_dvb_dvr_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dvb_dvr_release
_dvb_dvr_release:                       ; @dvb_dvr_release
	.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	x20, x1
	ldr	x22, [x1, #8]
	ldr	x23, [x22, #16]
	add	x19, x23, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
Lloh0:
	adrp	x21, _O_ACCMODE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _O_ACCMODE@GOTPAGEOFF]
	ldr	w9, [x21]
	and	w8, w9, w8
Lloh2:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ldr	x0, [x23, #48]
	ldr	x8, [x0, #8]
	blr	x8
	ldr	x0, [x23, #48]
	ldr	x8, [x0]
	ldr	w1, [x23, #40]
	blr	x8
	ldr	w8, [x20]
	ldr	w9, [x21]
	and	w8, w9, w8
LBB0_2:
Lloh5:
	adrp	x9, _O_RDONLY@GOTPAGE
Lloh6:
	ldr	x9, [x9, _O_RDONLY@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x9]
	ldr	x9, [x23, #32]
	cmp	w8, w10
	b.ne	LBB0_4
; %bb.3:
	cbnz	x9, LBB0_5
	b	LBB0_8
LBB0_4:
	cbz	x9, LBB0_10
LBB0_5:
	add	x20, x23, #24
	mov	x0, x20
	bl	_dvb_vb2_is_streaming
	cbz	x0, LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_dvb_vb2_stream_off
LBB0_7:
	mov	x0, x20
	bl	_dvb_vb2_release
LBB0_8:
	ldr	w8, [x22, #8]
	add	w8, w8, #1
	str	w8, [x22, #8]
	ldr	x20, [x23, #16]
	cbz	x20, LBB0_10
; %bb.9:
	bl	_mb
	add	x21, x23, #8
	mov	x0, x21
	bl	_spin_lock_irq
	str	xzr, [x23, #16]
	mov	x0, x21
	bl	_spin_unlock_irq
	mov	x0, x20
	bl	_vfree
LBB0_10:
	ldr	w8, [x22]
	sub	w8, w8, #1
	str	w8, [x22]
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.11:
	ldr	w8, [x23]
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_mutex_unlock
	add	x0, x22, #4
	bl	_wake_up
	b	LBB0_14
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_14:
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_O_ACCMODE,4,2                  ; @O_ACCMODE
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.no_dead_strip	_dvb_dvr_release
.subsections_via_symbols
