	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_serialized_open
_cx18_serialized_open:                  ## @cx18_serialized_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	16(%rdi), %r15
	movl	8(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_CX18_DEBUG_FILE
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%r15, 24(%rax)
	movq	(%r12), %rax
	movq	%rax, (%rbx)
	leaq	12(%r15), %rdi
	movq	%rbx, %rsi
	addq	$16, %rsi
	callq	_v4l2_prio_open
	movslq	8(%r15), %rax
	leal	1(%rax), %ecx
	movl	%ecx, 8(%r15)
	movq	%rax, 8(%rbx)
	movq	%rbx, (%r14)
	movq	(%rbx), %rsi
	movq	_CX18_ENC_STREAM_TYPE_RAD@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpq	(%rax), %rsi
	jne	LBB0_10
## %bb.4:
	movq	%rbx, %rdi
	callq	_cx18_claim_stream
	testq	%rax, %rax
	je	LBB0_6
LBB0_5:
	movq	%rbx, %rdi
	callq	_kfree
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	callq	_CX18_DEBUG_WARN
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_CX18_F_I_RADIO_USER@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_7
LBB0_9:
	movl	(%r13), %edi
	movq	%r15, %rsi
	callq	_set_bit
	movq	%r15, %rdi
	callq	_cx18_mute
	movq	_tuner@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_s_radio@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_cx18_call_all
	movq	%r15, %rdi
	callq	_cx18_audio_set_io
	movq	%r15, %rdi
	callq	_cx18_unmute
	jmp	LBB0_10
LBB0_7:
	leaq	4(%r15), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_9
## %bb.8:
	movq	%r12, %rdi
	callq	_cx18_release_stream
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open %s\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"nomem on v4l2 open\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CX18_ENC_STREAM_TYPE_RAD,8,3   ## @CX18_ENC_STREAM_TYPE_RAD
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_CX18_F_I_RADIO_USER,4,2        ## @CX18_F_I_RADIO_USER
	.comm	_tuner,4,2                      ## @tuner
	.comm	_s_radio,4,2                    ## @s_radio
	.no_dead_strip	_cx18_serialized_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_serialized_open
_cx18_serialized_open:                  ; @cx18_serialized_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
	mov	x22, x1
	mov	x20, x0
	ldr	x19, [x0, #16]
	ldr	w1, [x0, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_FILE
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kmalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	str	x19, [x0, #24]
	ldr	x8, [x20]
	str	x8, [x0]
	add	x0, x19, #12
	add	x1, x21, #16
	bl	_v4l2_prio_open
	ldrsw	x8, [x19, #8]
	add	w9, w8, #1
	str	w9, [x19, #8]
	str	x8, [x21, #8]
	str	x21, [x22]
	ldr	x1, [x21]
Lloh5:
	adrp	x8, _CX18_ENC_STREAM_TYPE_RAD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CX18_ENC_STREAM_TYPE_RAD@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_8
; %bb.2:
	mov	x0, x21
	bl	_cx18_claim_stream
	cbz	x0, LBB0_6
LBB0_3:
	mov	x0, x21
	bl	_kfree
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CX18_DEBUG_WARN
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_6:
Lloh14:
	adrp	x22, _CX18_F_I_RADIO_USER@GOTPAGE
Lloh15:
	ldr	x22, [x22, _CX18_F_I_RADIO_USER@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	x1, x19
	bl	_test_bit
	cbz	w0, LBB0_10
LBB0_7:
	ldr	w0, [x22]
	mov	x1, x19
	bl	_set_bit
	mov	x0, x19
	bl	_cx18_mute
Lloh16:
	adrp	x8, _tuner@GOTPAGE
Lloh17:
	ldr	x8, [x8, _tuner@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x8, _s_radio@GOTPAGE
Lloh20:
	ldr	x8, [x8, _s_radio@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_cx18_call_all
	mov	x0, x19
	bl	_cx18_audio_set_io
	mov	x0, x19
	bl	_cx18_unmute
LBB0_8:
	mov	w0, #0
LBB0_9:
	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_10:
	add	x0, x19, #4
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.11:
	mov	x0, x20
	bl	_cx18_release_stream
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open %s\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"nomem on v4l2 open\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CX18_ENC_STREAM_TYPE_RAD,8,3   ; @CX18_ENC_STREAM_TYPE_RAD
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_CX18_F_I_RADIO_USER,4,2        ; @CX18_F_I_RADIO_USER
	.comm	_tuner,4,2                      ; @tuner
	.comm	_s_radio,4,2                    ; @s_radio
	.no_dead_strip	_cx18_serialized_open
.subsections_via_symbols
