	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vivid_radio_rx_g_tuner         ## -- Begin function vivid_radio_rx_g_tuner
	.p2align	4, 0x90
_vivid_radio_rx_g_tuner:                ## @vivid_radio_rx_g_tuner
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	callq	_video_drvdata
	cmpq	$0, (%rbx)
	jle	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_32
LBB0_2:
	movq	%rax, %r14
	movl	36(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	$4, %edx
	callq	_strscpy
	movq	_V4L2_TUNER_CAP_LOW@GOTPCREL(%rip), %rax
	movq	_V4L2_TUNER_CAP_STEREO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_V4L2_TUNER_CAP_FREQ_BANDS@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_V4L2_TUNER_CAP_RDS@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	24(%r14), %rax
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:
	movq	_V4L2_TUNER_CAP_RDS_BLOCK_IO@GOTPCREL(%rip), %rdx
	jmp	LBB0_5
LBB0_3:
	movq	_V4L2_TUNER_CAP_RDS_CONTROLS@GOTPCREL(%rip), %rdx
LBB0_5:
	orl	(%rdx), %ecx
	xorl	%edx, %edx
	cmpq	$0, 48(%r14)
	je	LBB0_7
## %bb.6:
	movq	_V4L2_TUNER_CAP_HWSEEK_PROG_LIM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_7:
	orl	%edx, %ecx
	movl	%ecx, 8(%rbx)
	movl	(%r14), %edx
	cmpl	$128, %edx
	je	LBB0_11
## %bb.8:
	cmpl	$130, %edx
	je	LBB0_12
## %bb.9:
	cmpl	$129, %edx
	jne	LBB0_14
## %bb.10:
	movq	_V4L2_TUNER_CAP_HWSEEK_BOUNDED@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	jmp	LBB0_13
LBB0_11:
	movq	_V4L2_TUNER_CAP_HWSEEK_WRAP@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	jmp	LBB0_13
LBB0_12:
	movq	_V4L2_TUNER_CAP_HWSEEK_WRAP@GOTPCREL(%rip), %rdx
	movq	_V4L2_TUNER_CAP_HWSEEK_BOUNDED@GOTPCREL(%rip), %rsi
	orl	(%rdx), %ecx
	orl	(%rsi), %ecx
LBB0_13:
	movl	%ecx, 8(%rbx)
LBB0_14:
	movq	_AM_FREQ_RANGE_LOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%rbx)
	movq	_FM_FREQ_RANGE_HIGH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rbx)
	movl	4(%r14), %esi
	movl	%esi, %ecx
	negl	%ecx
	cmovsl	%esi, %ecx
	cmpl	$801, %ecx                      ## imm = 0x321
	jb	LBB0_16
## %bb.15:
	movl	$0, 12(%rbx)
	xorl	%edx, %edx
	cmpl	$801, %esi                      ## imm = 0x321
	cmovgel	%edx, %esi
	movl	%esi, 16(%rbx)
	xorl	%ecx, %ecx
	jmp	LBB0_23
LBB0_16:
	movl	%ecx, %edx
	shll	$16, %edx
	subl	%ecx, %edx
	imulq	$1374389535, %rdx, %rdi         ## imm = 0x51EB851F
	shrq	$40, %rdi
	movl	$65535, %ecx                    ## imm = 0xFFFF
	subl	%edi, %ecx
	movl	%ecx, 12(%rbx)
	xorl	%edi, %edi
	cmpl	$801, %esi                      ## imm = 0x321
	cmovll	%esi, %edi
	movl	%edi, 16(%rbx)
	movq	8(%r14), %rsi
	movq	_FM_FREQ_RANGE_LOW@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rsi
	jl	LBB0_21
## %bb.17:
	cmpl	$26214400, %edx                 ## imm = 0x1900000
	jae	LBB0_21
## %bb.18:
	cmpq	$0, 32(%r14)
	je	LBB0_19
## %bb.20:
	movq	_V4L2_TUNER_SUB_STEREO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 16(%r14)
	jne	LBB0_23
LBB0_21:
	movq	_V4L2_TUNER_SUB_MONO@GOTPCREL(%rip), %rdx
	jmp	LBB0_22
LBB0_19:
	movq	_V4L2_TUNER_SUB_STEREO@GOTPCREL(%rip), %rdx
LBB0_22:
	movl	(%rdx), %edx
LBB0_23:
	movl	%edx, 20(%rbx)
	cmpq	$0, 40(%r14)
	je	LBB0_29
## %bb.24:
	cmpq	$0, 32(%r14)
	je	LBB0_26
## %bb.25:
	movq	_V4L2_TUNER_SUB_RDS@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, 16(%r14)
	je	LBB0_29
LBB0_26:
	movq	8(%r14), %rsi
	movq	_FM_FREQ_RANGE_LOW@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rsi
	jl	LBB0_29
## %bb.27:
	cmpl	$49152, %ecx                    ## imm = 0xC000
	jb	LBB0_29
## %bb.28:
	movq	_V4L2_TUNER_SUB_RDS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	%edx, 20(%rbx)
LBB0_29:
	testq	%rax, %rax
	je	LBB0_31
## %bb.30:
	movq	%r14, %rdi
	callq	_vivid_radio_rds_init
LBB0_31:
	movl	20(%r14), %eax
	movl	%eax, 24(%rbx)
	xorl	%eax, %eax
LBB0_32:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AM/FM/SW Receiver"

	.comm	_V4L2_TUNER_CAP_LOW,4,2         ## @V4L2_TUNER_CAP_LOW
	.comm	_V4L2_TUNER_CAP_STEREO,4,2      ## @V4L2_TUNER_CAP_STEREO
	.comm	_V4L2_TUNER_CAP_FREQ_BANDS,4,2  ## @V4L2_TUNER_CAP_FREQ_BANDS
	.comm	_V4L2_TUNER_CAP_RDS,4,2         ## @V4L2_TUNER_CAP_RDS
	.comm	_V4L2_TUNER_CAP_RDS_CONTROLS,4,2 ## @V4L2_TUNER_CAP_RDS_CONTROLS
	.comm	_V4L2_TUNER_CAP_RDS_BLOCK_IO,4,2 ## @V4L2_TUNER_CAP_RDS_BLOCK_IO
	.comm	_V4L2_TUNER_CAP_HWSEEK_PROG_LIM,4,2 ## @V4L2_TUNER_CAP_HWSEEK_PROG_LIM
	.comm	_V4L2_TUNER_CAP_HWSEEK_BOUNDED,4,2 ## @V4L2_TUNER_CAP_HWSEEK_BOUNDED
	.comm	_V4L2_TUNER_CAP_HWSEEK_WRAP,4,2 ## @V4L2_TUNER_CAP_HWSEEK_WRAP
	.comm	_AM_FREQ_RANGE_LOW,4,2          ## @AM_FREQ_RANGE_LOW
	.comm	_FM_FREQ_RANGE_HIGH,4,2         ## @FM_FREQ_RANGE_HIGH
	.comm	_FM_FREQ_RANGE_LOW,8,3          ## @FM_FREQ_RANGE_LOW
	.comm	_V4L2_TUNER_SUB_MONO,8,3        ## @V4L2_TUNER_SUB_MONO
	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ## @V4L2_TUNER_SUB_STEREO
	.comm	_V4L2_TUNER_SUB_RDS,4,2         ## @V4L2_TUNER_SUB_RDS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vivid_radio_rx_g_tuner         ; -- Begin function vivid_radio_rx_g_tuner
	.p2align	2
_vivid_radio_rx_g_tuner:                ; @vivid_radio_rx_g_tuner
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	bl	_video_drvdata
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_28
LBB0_2:
	mov	x20, x0
	ldr	w0, [x19, #36]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #4
	bl	_strscpy
Lloh5:
	adrp	x8, _V4L2_TUNER_CAP_LOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _V4L2_TUNER_CAP_LOW@GOTPAGEOFF]
Lloh7:
	adrp	x9, _V4L2_TUNER_CAP_STEREO@GOTPAGE
Lloh8:
	ldr	x9, [x9, _V4L2_TUNER_CAP_STEREO@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh11:
	adrp	x9, _V4L2_TUNER_CAP_FREQ_BANDS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _V4L2_TUNER_CAP_FREQ_BANDS@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh14:
	adrp	x9, _V4L2_TUNER_CAP_RDS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _V4L2_TUNER_CAP_RDS@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w9, w8, w9
	ldr	x8, [x20, #24]
Lloh17:
	adrp	x10, _V4L2_TUNER_CAP_RDS_CONTROLS@GOTPAGE
Lloh18:
	ldr	x10, [x10, _V4L2_TUNER_CAP_RDS_CONTROLS@GOTPAGEOFF]
Lloh19:
	adrp	x11, _V4L2_TUNER_CAP_RDS_BLOCK_IO@GOTPAGE
Lloh20:
	ldr	x11, [x11, _V4L2_TUNER_CAP_RDS_BLOCK_IO@GOTPAGEOFF]
	cmp	x8, #0
	csel	x10, x11, x10, eq
	ldr	w10, [x10]
	orr	w9, w9, w10
	ldr	x10, [x20, #48]
Lloh21:
	adrp	x11, _V4L2_TUNER_CAP_HWSEEK_PROG_LIM@GOTPAGE
Lloh22:
	ldr	x11, [x11, _V4L2_TUNER_CAP_HWSEEK_PROG_LIM@GOTPAGEOFF]
Lloh23:
	ldr	w11, [x11]
	cmp	x10, #0
	csel	w10, wzr, w11, eq
	orr	w9, w9, w10
	str	w9, [x19, #8]
	ldr	w10, [x20]
	cmp	w10, #128
	b.eq	LBB0_6
; %bb.3:
	cmp	w10, #130
	b.eq	LBB0_8
; %bb.4:
	cmp	w10, #129
	b.ne	LBB0_10
; %bb.5:
Lloh24:
	adrp	x10, _V4L2_TUNER_CAP_HWSEEK_BOUNDED@GOTPAGE
Lloh25:
	ldr	x10, [x10, _V4L2_TUNER_CAP_HWSEEK_BOUNDED@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh26:
	adrp	x10, _V4L2_TUNER_CAP_HWSEEK_WRAP@GOTPAGE
Lloh27:
	ldr	x10, [x10, _V4L2_TUNER_CAP_HWSEEK_WRAP@GOTPAGEOFF]
LBB0_7:
	ldr	w10, [x10]
	orr	w9, w10, w9
	b	LBB0_9
LBB0_8:
Lloh28:
	adrp	x10, _V4L2_TUNER_CAP_HWSEEK_WRAP@GOTPAGE
Lloh29:
	ldr	x10, [x10, _V4L2_TUNER_CAP_HWSEEK_WRAP@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
Lloh31:
	adrp	x11, _V4L2_TUNER_CAP_HWSEEK_BOUNDED@GOTPAGE
Lloh32:
	ldr	x11, [x11, _V4L2_TUNER_CAP_HWSEEK_BOUNDED@GOTPAGEOFF]
Lloh33:
	ldr	w11, [x11]
	orr	w9, w10, w9
	orr	w9, w9, w11
LBB0_9:
	str	w9, [x19, #8]
LBB0_10:
Lloh34:
	adrp	x9, _AM_FREQ_RANGE_LOW@GOTPAGE
Lloh35:
	ldr	x9, [x9, _AM_FREQ_RANGE_LOW@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
Lloh37:
	adrp	x10, _FM_FREQ_RANGE_HIGH@GOTPAGE
Lloh38:
	ldr	x10, [x10, _FM_FREQ_RANGE_HIGH@GOTPAGEOFF]
Lloh39:
	ldr	w10, [x10]
	stp	w10, w9, [x19, #28]
	ldr	w11, [x20, #4]
	cmp	w11, #0
	cneg	w9, w11, mi
	cmp	w9, #801
	b.lo	LBB0_12
; %bb.11:
	mov	w10, #0
	mov	w9, #0
	cmp	w11, #800
	csel	w11, wzr, w11, gt
	stp	wzr, w11, [x19, #12]
	b	LBB0_19
LBB0_12:
	lsl	w10, w9, #16
	sub	w10, w10, w9
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	umull	x9, w10, w9
	lsr	x9, x9, #40
	mov	w12, #65535
	sub	w9, w12, w9
	cmp	w11, #800
	csel	w11, wzr, w11, gt
	stp	w9, w11, [x19, #12]
	ldr	x11, [x20, #8]
Lloh40:
	adrp	x12, _FM_FREQ_RANGE_LOW@GOTPAGE
Lloh41:
	ldr	x12, [x12, _FM_FREQ_RANGE_LOW@GOTPAGEOFF]
Lloh42:
	ldr	x12, [x12]
	cmp	x11, x12
	b.lt	LBB0_16
; %bb.13:
	lsr	w10, w10, #20
	cmp	w10, #25
	b.hs	LBB0_16
; %bb.14:
	ldr	x10, [x20, #32]
	cbz	x10, LBB0_17
; %bb.15:
	ldr	w11, [x20, #16]
Lloh43:
	adrp	x10, _V4L2_TUNER_SUB_STEREO@GOTPAGE
Lloh44:
	ldr	x10, [x10, _V4L2_TUNER_SUB_STEREO@GOTPAGEOFF]
Lloh45:
	ldr	w10, [x10]
	tst	w10, w11
	b.ne	LBB0_19
LBB0_16:
Lloh46:
	adrp	x10, _V4L2_TUNER_SUB_MONO@GOTPAGE
Lloh47:
	ldr	x10, [x10, _V4L2_TUNER_SUB_MONO@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
Lloh48:
	adrp	x10, _V4L2_TUNER_SUB_STEREO@GOTPAGE
Lloh49:
	ldr	x10, [x10, _V4L2_TUNER_SUB_STEREO@GOTPAGEOFF]
LBB0_18:
	ldr	w10, [x10]
LBB0_19:
	str	w10, [x19, #20]
	ldr	x11, [x20, #40]
	cbz	x11, LBB0_25
; %bb.20:
	ldr	x12, [x20, #32]
Lloh50:
	adrp	x11, _V4L2_TUNER_SUB_RDS@GOTPAGE
Lloh51:
	ldr	x11, [x11, _V4L2_TUNER_SUB_RDS@GOTPAGEOFF]
	cbz	x12, LBB0_22
; %bb.21:
	ldr	w12, [x20, #16]
	ldr	w13, [x11]
	tst	w13, w12
	b.eq	LBB0_25
LBB0_22:
	ldr	x12, [x20, #8]
Lloh52:
	adrp	x13, _FM_FREQ_RANGE_LOW@GOTPAGE
Lloh53:
	ldr	x13, [x13, _FM_FREQ_RANGE_LOW@GOTPAGEOFF]
Lloh54:
	ldr	x13, [x13]
	cmp	x12, x13
	b.lt	LBB0_25
; %bb.23:
	cmp	w9, #12, lsl #12                ; =49152
	b.lo	LBB0_25
; %bb.24:
	ldr	w9, [x11]
	orr	w9, w10, w9
	str	w9, [x19, #20]
LBB0_25:
	cbz	x8, LBB0_27
; %bb.26:
	mov	x0, x20
	bl	_vivid_radio_rds_init
LBB0_27:
	mov	w0, #0
	ldr	w8, [x20, #20]
	str	w8, [x19, #24]
LBB0_28:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AM/FM/SW Receiver"

	.comm	_V4L2_TUNER_CAP_LOW,4,2         ; @V4L2_TUNER_CAP_LOW
	.comm	_V4L2_TUNER_CAP_STEREO,4,2      ; @V4L2_TUNER_CAP_STEREO
	.comm	_V4L2_TUNER_CAP_FREQ_BANDS,4,2  ; @V4L2_TUNER_CAP_FREQ_BANDS
	.comm	_V4L2_TUNER_CAP_RDS,4,2         ; @V4L2_TUNER_CAP_RDS
	.comm	_V4L2_TUNER_CAP_RDS_CONTROLS,4,2 ; @V4L2_TUNER_CAP_RDS_CONTROLS
	.comm	_V4L2_TUNER_CAP_RDS_BLOCK_IO,4,2 ; @V4L2_TUNER_CAP_RDS_BLOCK_IO
	.comm	_V4L2_TUNER_CAP_HWSEEK_PROG_LIM,4,2 ; @V4L2_TUNER_CAP_HWSEEK_PROG_LIM
	.comm	_V4L2_TUNER_CAP_HWSEEK_BOUNDED,4,2 ; @V4L2_TUNER_CAP_HWSEEK_BOUNDED
	.comm	_V4L2_TUNER_CAP_HWSEEK_WRAP,4,2 ; @V4L2_TUNER_CAP_HWSEEK_WRAP
	.comm	_AM_FREQ_RANGE_LOW,4,2          ; @AM_FREQ_RANGE_LOW
	.comm	_FM_FREQ_RANGE_HIGH,4,2         ; @FM_FREQ_RANGE_HIGH
	.comm	_FM_FREQ_RANGE_LOW,8,3          ; @FM_FREQ_RANGE_LOW
	.comm	_V4L2_TUNER_SUB_MONO,8,3        ; @V4L2_TUNER_SUB_MONO
	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ; @V4L2_TUNER_SUB_STEREO
	.comm	_V4L2_TUNER_SUB_RDS,4,2         ; @V4L2_TUNER_SUB_RDS
.subsections_via_symbols
