	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function poseidon_fm_open
_poseidon_fm_open:                      ## @poseidon_fm_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	%rdi, %r15
	callq	_video_devdata
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_video_get_drvdata
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	4(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	movq	_POSEIDON_STATE_DISCONNECT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_15
LBB0_1:
	movl	$-1, %r12d
	jmp	LBB0_16
LBB0_5:
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movq	_POSEIDON_STATE_FM@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
LBB0_8:
	movl	32(%rbx), %edi
	callq	_usb_autopm_get_interface
	xorl	%r12d, %r12d
	cmpl	$0, (%rbx)
	jne	LBB0_14
## %bb.9:
	cmpq	$0, 16(%rbx)
	jne	LBB0_11
## %bb.10:
	movq	_TLG_TUNE_ASTD_FM_EUR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
LBB0_11:
	movq	_debug_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_set_debug_mode
	movq	%rbx, %rdi
	callq	_poseidon_check_mode_radio
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_12
## %bb.13:
	movq	_POSEIDON_STATE_FM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_14:
	incl	24(%rbx)
	movq	%rbx, %rdi
	addq	$8, %rdi
	callq	_kref_get
	movq	%rbx, (%r15)
LBB0_15:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_16:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_12:
	movl	32(%rbx), %edi
	callq	_usb_autopm_put_interface
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_POSEIDON_STATE_DISCONNECT,4,2  ## @POSEIDON_STATE_DISCONNECT
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_POSEIDON_STATE_FM,4,2          ## @POSEIDON_STATE_FM
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_TLG_TUNE_ASTD_FM_EUR,8,3       ## @TLG_TUNE_ASTD_FM_EUR
	.comm	_debug_mode,4,2                 ## @debug_mode
	.no_dead_strip	_poseidon_fm_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function poseidon_fm_open
_poseidon_fm_open:                      ; @poseidon_fm_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	x20, x0
	bl	_video_devdata
	mov	x22, x0
	bl	_video_get_drvdata
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _POSEIDON_STATE_DISCONNECT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _POSEIDON_STATE_DISCONNECT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_4:
	mov	w22, #-1
	b	LBB0_15
LBB0_5:
	cbz	w8, LBB0_7
; %bb.6:
Lloh5:
	adrp	x9, _POSEIDON_STATE_FM@GOTPAGE
Lloh6:
	ldr	x9, [x9, _POSEIDON_STATE_FM@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
LBB0_7:
	ldr	w0, [x21, #32]
	bl	_usb_autopm_get_interface
	ldr	w8, [x21]
	cbz	w8, LBB0_9
; %bb.8:
	mov	w22, #0
	b	LBB0_13
LBB0_9:
	ldr	x8, [x21, #16]
	cbnz	x8, LBB0_11
; %bb.10:
Lloh8:
	adrp	x8, _TLG_TUNE_ASTD_FM_EUR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TLG_TUNE_ASTD_FM_EUR@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	str	x8, [x21, #16]
LBB0_11:
Lloh11:
	adrp	x8, _debug_mode@GOTPAGE
Lloh12:
	ldr	x8, [x8, _debug_mode@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_set_debug_mode
	mov	x0, x21
	bl	_poseidon_check_mode_radio
	mov	x22, x0
	tbnz	w0, #31, LBB0_17
; %bb.12:
Lloh14:
	adrp	x8, _POSEIDON_STATE_FM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _POSEIDON_STATE_FM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
LBB0_13:
	ldr	w8, [x21, #24]
	add	w8, w8, #1
	str	w8, [x21, #24]
	add	x0, x21, #8
	bl	_kref_get
	str	x21, [x20]
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_15:
	mov	x0, x22
	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_16:
Lloh17:
	adrp	x8, _EBUSY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_3
LBB0_17:
	ldr	w0, [x21, #32]
	bl	_usb_autopm_put_interface
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_POSEIDON_STATE_DISCONNECT,4,2  ; @POSEIDON_STATE_DISCONNECT
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_POSEIDON_STATE_FM,4,2          ; @POSEIDON_STATE_FM
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_TLG_TUNE_ASTD_FM_EUR,8,3       ; @TLG_TUNE_ASTD_FM_EUR
	.comm	_debug_mode,4,2                 ; @debug_mode
	.no_dead_strip	_poseidon_fm_open
.subsections_via_symbols
