	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dvb_demux_open
_dvb_demux_open:                        ## @dvb_demux_open
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rsi), %r13
	movq	32(%r13), %rbx
	cmpq	$0, 16(%rbx)
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r15
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_4
## %bb.9:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movl	(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.10:
	movq	16(%rbx), %rdx
	movq	_DMXDEV_STATE_FREE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, (%rdx)
	je	LBB0_6
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rcx
	addq	$40, %rdx
	cmpq	%rcx, %rax
	jne	LBB0_11
	jmp	LBB0_13
LBB0_5:
	xorl	%ecx, %ecx
LBB0_6:
	cmpl	%eax, %ecx
	jne	LBB0_7
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_EMFILE@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	16(%rbx), %rdx
	movl	%ecx, %eax
	leaq	(%rax,%rax,4), %r12
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	leaq	(%rdx,%r12,8), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rdx,%r12,8), %rdi
	addq	$28, %rdi
	callq	_mutex_init
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r15)
	movl	$0, 4(%rbx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12,8), %rdi
	addq	$24, %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_dvb_ringbuffer_init
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12,8), %rdi
	addq	$20, %rdi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	(%r15), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dvb_vb2_init
	movq	_DMXDEV_TYPE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movl	%eax, 16(%r15,%r12,8)
	movq	_DMXDEV_STATE_ALLOCATED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dvb_dmxdev_filter_state_set
	leaq	(%r15,%r12,8), %rdi
	addq	$12, %rdi
	movq	_dvb_dmxdev_filter_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_timer_setup
	incl	8(%r13)
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_DMXDEV_STATE_FREE,8,3          ## @DMXDEV_STATE_FREE
	.comm	_EMFILE,4,2                     ## @EMFILE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"demux_filter"

	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_DMXDEV_TYPE_NONE,4,2           ## @DMXDEV_TYPE_NONE
	.comm	_DMXDEV_STATE_ALLOCATED,4,2     ## @DMXDEV_STATE_ALLOCATED
	.comm	_dvb_dmxdev_filter_timeout,4,2  ## @dvb_dmxdev_filter_timeout
	.no_dead_strip	_dvb_demux_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dvb_demux_open
_dvb_demux_open:                        ; @dvb_demux_open
	.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
	ldr	x22, [x1, #8]
	ldr	x23, [x22, #32]
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x20, x1
	add	x19, x23, #8
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_11
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x9, #0
	ldr	x10, [x23, #16]
Lloh4:
	adrp	x11, _DMXDEV_STATE_FREE@GOTPAGE
Lloh5:
	ldr	x11, [x11, _DMXDEV_STATE_FREE@GOTPAGEOFF]
Lloh6:
	ldr	x11, [x11]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x10]
	cmp	x12, x11
	b.eq	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x9, x9, #1
	add	x10, x10, #40
	cmp	x8, x9
	b.ne	LBB0_6
	b	LBB0_10
LBB0_8:
	mov	w9, #0
LBB0_9:
	cmp	w9, w8
	b.ne	LBB0_13
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
Lloh7:
	adrp	x8, _EMFILE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EMFILE@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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
LBB0_13:
	ldr	x8, [x23, #16]
	mov	w10, #40
	umaddl	x21, w9, w10, x8
	add	x0, x21, #28
	bl	_mutex_init
	str	x21, [x20, #8]
	str	wzr, [x23, #4]
	add	x0, x21, #24
	mov	x1, #0
	mov	w2, #8192
	bl	_dvb_ringbuffer_init
	add	x0, x21, #20
	ldr	w8, [x20]
Lloh9:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w2, w9, w8
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dvb_vb2_init
Lloh14:
	adrp	x8, _DMXDEV_TYPE_NONE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DMXDEV_TYPE_NONE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x21, #16]
Lloh17:
	adrp	x8, _DMXDEV_STATE_ALLOCATED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DMXDEV_STATE_ALLOCATED@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_dvb_dmxdev_filter_state_set
	add	x0, x21, #12
Lloh20:
	adrp	x8, _dvb_dmxdev_filter_timeout@GOTPAGE
Lloh21:
	ldr	x8, [x8, _dvb_dmxdev_filter_timeout@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_timer_setup
	ldr	w8, [x22, #8]
	add	w8, w8, #1
	str	w8, [x22, #8]
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_DMXDEV_STATE_FREE,8,3          ; @DMXDEV_STATE_FREE
	.comm	_EMFILE,4,2                     ; @EMFILE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"demux_filter"

	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_DMXDEV_TYPE_NONE,4,2           ; @DMXDEV_TYPE_NONE
	.comm	_DMXDEV_STATE_ALLOCATED,4,2     ; @DMXDEV_STATE_ALLOCATED
	.comm	_dvb_dmxdev_filter_timeout,4,2  ; @dvb_dmxdev_filter_timeout
	.no_dead_strip	_dvb_demux_open
.subsections_via_symbols
