	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vivid_radio_rx_s_hw_freq_seek  ## -- Begin function vivid_radio_rx_s_hw_freq_seek
	.p2align	4, 0x90
_vivid_radio_rx_s_hw_freq_seek:         ## @vivid_radio_rx_s_hw_freq_seek
	.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	%rdx, %r13
	movq	%rdi, %rbx
	callq	_video_drvdata
	cmpq	$0, 24(%r13)
	jne	LBB0_1
## %bb.2:
	movq	%rax, %r14
	cmpq	$0, 8(%r13)
	movq	(%rax), %rax
	je	LBB0_37
## %bb.3:
	movq	_VIVID_HW_SEEK_BOUNDED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
	jmp	LBB0_1
LBB0_37:
	movq	_VIVID_HW_SEEK_WRAP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_1
LBB0_5:
	movl	(%r13), %r15d
	movl	4(%r13), %r12d
	testl	%r15d, %r15d
	sete	%al
	testl	%r12d, %r12d
	sete	%cl
	cmpb	%cl, %al
	je	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_35:
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
LBB0_36:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_8
## %bb.7:
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rax
	jmp	LBB0_35
LBB0_8:
	movq	_TOT_BANDS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%r15d, %r15d
	je	LBB0_19
## %bb.9:
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.23:
	movq	_vivid_radio_bands@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	xorl	%eax, %eax
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_24 Depth=1
	incq	%rax
	cmpq	%rax, %rcx
	je	LBB0_1
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	cmpl	(%rdx,%rax,8), %r15d
	jl	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=1
	cmpl	4(%rdx,%rax,8), %r12d
	ja	LBB0_26
	jmp	LBB0_11
LBB0_19:
	testq	%rcx, %rcx
	je	LBB0_20
## %bb.27:
	movl	8(%r14), %edx
	movq	_vivid_radio_bands@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	xorl	%eax, %eax
	jmp	LBB0_28
LBB0_30:                                ##   in Loop: Header=BB0_28 Depth=1
	incq	%rax
	cmpq	%rax, %rcx
	je	LBB0_1
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	cmpl	(%rsi,%rax,8), %edx
	jl	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_28 Depth=1
	cmpl	4(%rsi,%rax,8), %edx
	ja	LBB0_30
	jmp	LBB0_21
LBB0_10:
	xorl	%eax, %eax
LBB0_11:
	cmpl	%ecx, %eax
	je	LBB0_1
## %bb.12:
	cmpl	$0, 12(%r14)
	jne	LBB0_15
## %bb.13:
	movq	_vivid_radio_bands@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, %edx
	cmpl	(%rcx,%rdx,8), %r15d
	jne	LBB0_1
## %bb.14:
	cmpl	4(%rcx,%rdx,8), %r12d
	jne	LBB0_1
	jmp	LBB0_15
LBB0_20:
	xorl	%eax, %eax
LBB0_21:
	cmpl	%ecx, %eax
	je	LBB0_1
## %bb.22:
	movq	_vivid_radio_bands@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, %edx
	movl	(%rcx,%rdx,8), %r15d
	movl	4(%rcx,%rdx,8), %r12d
LBB0_15:
	movq	_BAND_AM@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movl	$-1600, %eax                    ## imm = 0xF9C0
	movl	$-16000, %ecx                   ## imm = 0xC180
	cmovel	%eax, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	$1600, %eax                     ## imm = 0x640
	movl	$16000, %ebx                    ## imm = 0x3E80
	cmovel	%eax, %ebx
	movl	8(%r14), %edi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_clamp
	movl	%eax, %esi
	cmpq	$0, 16(%r13)
	je	LBB0_31
## %bb.16:
	xorl	%ecx, %ecx
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ebx
	addl	%ebx, %esi
	subl	%edx, %esi
	cmpl	%r12d, %esi
	jbe	LBB0_36
## %bb.17:
	cmpq	$0, 8(%r13)
	je	LBB0_34
## %bb.18:
	xorl	%ecx, %ecx
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ebx
	addl	%r15d, %ebx
	subl	%edx, %ebx
	cmpl	8(%r14), %ebx
	jb	LBB0_36
	jmp	LBB0_34
LBB0_31:
	addl	%ebx, %esi
	decl	%esi
	xorl	%ecx, %ecx
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	addl	%edi, %esi
	subl	%edx, %esi
	cmpl	%r15d, %esi
	jae	LBB0_36
## %bb.32:
	cmpq	$0, 8(%r13)
	je	LBB0_34
## %bb.33:
	leal	-1(%rbx), %esi
	addl	%r12d, %esi
	xorl	%ecx, %ecx
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ebx
	addl	%edi, %esi
	subl	%edx, %esi
	cmpl	8(%r14), %esi
	ja	LBB0_36
LBB0_34:
	movq	_ENODATA@GOTPCREL(%rip), %rax
	jmp	LBB0_35
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VIVID_HW_SEEK_BOUNDED,8,3      ## @VIVID_HW_SEEK_BOUNDED
	.comm	_VIVID_HW_SEEK_WRAP,8,3         ## @VIVID_HW_SEEK_WRAP
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_EWOULDBLOCK,4,2                ## @EWOULDBLOCK
	.comm	_TOT_BANDS,4,2                  ## @TOT_BANDS
	.comm	_vivid_radio_bands,8,3          ## @vivid_radio_bands
	.comm	_BAND_AM,4,2                    ## @BAND_AM
	.comm	_ENODATA,4,2                    ## @ENODATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vivid_radio_rx_s_hw_freq_seek  ; -- Begin function vivid_radio_rx_s_hw_freq_seek
	.p2align	2
_vivid_radio_rx_s_hw_freq_seek:         ; @vivid_radio_rx_s_hw_freq_seek
	.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
	mov	x20, x2
	mov	x23, x0
	bl	_video_drvdata
	ldr	x8, [x20, #24]
	cbnz	x8, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	x9, [x20, #8]
	ldr	x8, [x0]
	cbz	x9, LBB0_3
; %bb.2:
Lloh0:
	adrp	x9, _VIVID_HW_SEEK_BOUNDED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VIVID_HW_SEEK_BOUNDED@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh2:
	adrp	x9, _VIVID_HW_SEEK_WRAP@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VIVID_HW_SEEK_WRAP@GOTPAGEOFF]
LBB0_4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.5:
	ldp	w21, w22, [x20]
	cmp	w21, #0
	cset	w8, eq
	cmp	w22, #0
	cset	w9, eq
	cmp	w8, w9
	b.eq	LBB0_9
LBB0_6:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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_9:
	ldr	w8, [x23]
Lloh6:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
Lloh9:
	adrp	x8, _EWOULDBLOCK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EWOULDBLOCK@GOTPAGEOFF]
	b	LBB0_7
LBB0_11:
Lloh11:
	adrp	x8, _TOT_BANDS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TOT_BANDS@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x8]
	cbz	w21, LBB0_17
; %bb.12:
	cbz	w9, LBB0_23
; %bb.13:
	mov	x8, #0
Lloh14:
	adrp	x10, _vivid_radio_bands@GOTPAGE
Lloh15:
	ldr	x10, [x10, _vivid_radio_bands@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
	add	x10, x10, #4
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x8, x8, #1
	add	x10, x10, #8
	cmp	x9, x8
	b.eq	LBB0_6
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldur	w11, [x10, #-4]
	cmp	w21, w11
	b.lt	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w11, [x10]
	cmp	w22, w11
	b.hi	LBB0_14
	b	LBB0_24
LBB0_17:
	cbz	w9, LBB0_28
; %bb.18:
	mov	x8, #0
	ldr	w10, [x19, #8]
Lloh17:
	adrp	x11, _vivid_radio_bands@GOTPAGE
Lloh18:
	ldr	x11, [x11, _vivid_radio_bands@GOTPAGEOFF]
Lloh19:
	ldr	x11, [x11]
	add	x11, x11, #4
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_20 Depth=1
	add	x8, x8, #1
	add	x11, x11, #8
	cmp	x9, x8
	b.eq	LBB0_6
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldur	w12, [x11, #-4]
	cmp	w10, w12
	b.lt	LBB0_19
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	w12, [x11]
	cmp	w10, w12
	b.hi	LBB0_19
; %bb.22:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	b	LBB0_29
LBB0_23:
	mov	w8, #0
LBB0_24:
	cmp	w8, w9
	b.eq	LBB0_6
; %bb.25:
	ldr	w9, [x19, #12]
	cbnz	w9, LBB0_31
; %bb.26:
Lloh20:
	adrp	x9, _vivid_radio_bands@GOTPAGE
Lloh21:
	ldr	x9, [x9, _vivid_radio_bands@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	mov	w10, w8
	lsl	x11, x10, #3
	ldr	w11, [x9, x11]
	cmp	w21, w11
	b.ne	LBB0_6
; %bb.27:
	add	x9, x9, x10, lsl #3
	ldr	w9, [x9, #4]
	cmp	w22, w9
	b.ne	LBB0_6
	b	LBB0_31
LBB0_28:
	mov	w8, #0
LBB0_29:
	cmp	w8, w9
	b.eq	LBB0_6
; %bb.30:
Lloh23:
	adrp	x9, _vivid_radio_bands@GOTPAGE
Lloh24:
	ldr	x9, [x9, _vivid_radio_bands@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	add	x9, x9, w8, uxtw #3
	ldp	w21, w22, [x9]
LBB0_31:
Lloh26:
	adrp	x9, _BAND_AM@GOTPAGE
Lloh27:
	ldr	x9, [x9, _BAND_AM@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	mov	w10, #-16000
	mov	w11, #-1600
	cmp	w8, w9
	csel	w24, w11, w10, eq
	mov	w8, #16000
	mov	w9, #1600
	csel	w23, w9, w8, eq
	ldr	w0, [x19, #8]
	mov	x1, x21
	mov	x2, x22
	bl	_clamp
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_35
; %bb.32:
	udiv	w8, w0, w23
	neg	w9, w0
	madd	w8, w8, w23, w9
	add	w9, w23, w0
	add	w8, w9, w8
	cmp	w8, w22
	b.ls	LBB0_38
; %bb.33:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_39
; %bb.34:
	udiv	w8, w21, w23
	neg	w9, w21
	madd	w8, w8, w23, w9
	add	w9, w23, w21
	add	w8, w9, w8
	ldr	w9, [x19, #8]
	cmp	w8, w9
	b.hs	LBB0_39
	b	LBB0_38
LBB0_35:
	sub	w8, w23, #1
	add	w9, w8, w0
	add	w10, w9, w24
	udiv	w11, w9, w23
	neg	w9, w9
	madd	w9, w11, w23, w9
	add	w9, w10, w9
	cmp	w9, w21
	b.hs	LBB0_38
; %bb.36:
	ldr	x9, [x20, #8]
	cbz	x9, LBB0_39
; %bb.37:
	add	w8, w8, w22
	add	w9, w8, w24
	udiv	w10, w8, w23
	neg	w8, w8
	madd	w8, w10, w23, w8
	ldr	w10, [x19, #8]
	add	w8, w9, w8
	cmp	w8, w10
	b.ls	LBB0_39
LBB0_38:
	mov	w0, #0
	b	LBB0_8
LBB0_39:
Lloh29:
	adrp	x8, _ENODATA@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENODATA@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VIVID_HW_SEEK_BOUNDED,8,3      ; @VIVID_HW_SEEK_BOUNDED
	.comm	_VIVID_HW_SEEK_WRAP,8,3         ; @VIVID_HW_SEEK_WRAP
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_EWOULDBLOCK,4,2                ; @EWOULDBLOCK
	.comm	_TOT_BANDS,4,2                  ; @TOT_BANDS
	.comm	_vivid_radio_bands,8,3          ; @vivid_radio_bands
	.comm	_BAND_AM,4,2                    ; @BAND_AM
	.comm	_ENODATA,4,2                    ; @ENODATA
.subsections_via_symbols
