	.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	(%rsi), %r12
	movq	32(%r12), %rbx
	cmpq	$0, 8(%rbx)
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r13
	leaq	4(%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	8(%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	8(%rbx), %rdx
	movl	%ecx, %eax
	leaq	(%rax,%rax,4), %r15
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	leaq	(%rdx,%r15,8), %rbx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rdx,%r15,8), %rdi
	addq	$24, %rdi
	callq	_mutex_init
	movq	%rbx, (%r13)
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	leaq	20(,%r15,8), %rdi
	addq	%r13, %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_dvb_ringbuffer_init
	movq	_DMXDEV_TYPE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r13,%r15,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	12(,%r15,8), %rdi
	addq	%r13, %rdi
	callq	_init_timer
	incl	8(%r12)
	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
	.comm	_DMXDEV_TYPE_NONE,4,2           ## @DMXDEV_TYPE_NONE
	.comm	_DMXDEV_STATE_ALLOCATED,4,2     ## @DMXDEV_STATE_ALLOCATED
	.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	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
	ldr	x22, [x1]
	ldr	x21, [x22, #32]
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x20, x1
	add	x19, x21, #4
	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, [x21]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x9, #0
	ldr	x10, [x21, #8]
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, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldr	x8, [x21, #8]
	mov	w10, #40
	umaddl	x21, w9, w10, x8
	add	x0, x21, #24
	bl	_mutex_init
	str	x21, [x20]
	add	x0, x21, #20
	mov	x1, #0
	mov	w2, #8192
	bl	_dvb_ringbuffer_init
Lloh9:
	adrp	x8, _DMXDEV_TYPE_NONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMXDEV_TYPE_NONE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x21, #16]
Lloh12:
	adrp	x8, _DMXDEV_STATE_ALLOCATED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMXDEV_STATE_ALLOCATED@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_dvb_dmxdev_filter_state_set
	add	x0, x21, #12
	bl	_init_timer
	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	Lloh12, Lloh13, Lloh14
	.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
	.comm	_DMXDEV_TYPE_NONE,4,2           ; @DMXDEV_TYPE_NONE
	.comm	_DMXDEV_STATE_ALLOCATED,4,2     ; @DMXDEV_STATE_ALLOCATED
	.no_dead_strip	_dvb_demux_open
.subsections_via_symbols
