	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_tea575x_s_hw_freq_seek     ## -- Begin function snd_tea575x_s_hw_freq_seek
	.p2align	4, 0x90
_snd_tea575x_s_hw_freq_seek:            ## @snd_tea575x_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
	cmpq	$0, 32(%rsi)
	je	LBB0_2
## %bb.1:
	movq	_ENOTTY@GOTPCREL(%rip), %rcx
	jmp	LBB0_39
LBB0_2:
	movq	%rdx, %r14
	cmpq	$0, 32(%rdx)
	jne	LBB0_4
## %bb.3:
	cmpq	$0, 24(%r14)
	je	LBB0_5
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_39:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_40:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_7
## %bb.6:
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rcx
	jmp	LBB0_39
LBB0_7:
	movq	%rsi, %r12
	cmpq	$0, (%r14)
	jne	LBB0_9
## %bb.8:
	cmpq	$0, 8(%r14)
	je	LBB0_24
LBB0_9:
	movq	_bands@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_10
## %bb.11:
	movl	$8, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_12 Depth=1
	cmpq	$0, 24(%r12)
	je	LBB0_14
LBB0_20:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$16, %r13
	cmpq	%rax, %rbx
	jge	LBB0_21
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	_BAND_FM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %rbx
	je	LBB0_13
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_BAND_FM_JAPAN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %rbx
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpq	$0, 24(%r12)
	je	LBB0_20
LBB0_16:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_BAND_AM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %rbx
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$0, 20(%r12)
	je	LBB0_20
LBB0_18:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	(%r15), %rax
	movq	-8(%rax,%r13), %rcx
	cmpq	(%r14), %rcx
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	(%rax,%r13), %rax
	cmpq	8(%r14), %rax
	jne	LBB0_20
	jmp	LBB0_21
LBB0_10:
	xorl	%ebx, %ebx
LBB0_21:
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	je	LBB0_4
## %bb.22:
	cmpl	(%r12), %ebx
	je	LBB0_24
## %bb.23:
	movl	%ebx, (%r12)
	movq	8(%r12), %rdi
	movq	(%r15), %rax
	movl	%ebx, %ecx
	shlq	$4, %rcx
	movq	(%rax,%rcx), %rsi
	movq	8(%rax,%rcx), %rdx
	callq	_clamp
	movq	%rax, 8(%r12)
	movq	%r12, %rdi
	callq	_snd_tea575x_set_freq
LBB0_24:
	movl	(%r12), %eax
	movq	_TEA575X_BIT_FREQ_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	16(%r12), %esi
	movq	_TEA575X_BIT_SEARCH@GOTPCREL(%rip), %rcx
	orl	(%rcx), %esi
	movq	_TEA575X_BIT_UPDOWN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	notl	%edx
	andl	%esi, %edx
	orl	%ecx, %esi
	cmpq	$0, 16(%r14)
	cmovel	%edx, %esi
	movq	_BAND_AM@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movl	%esi, 16(%r12)
	movl	$80, %eax
	movl	$800, %ecx                      ## imm = 0x320
	cmovel	%eax, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_snd_tea575x_write
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$10000, %edi                    ## imm = 0x2710
	callq	_msecs_to_jiffies
	movq	%rax, %r15
	addq	%rbx, %r15
LBB0_25:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_31 Depth 2
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r15, %rsi
	callq	_time_after
	testq	%rax, %rax
	jne	LBB0_38
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	$10, %edi
	callq	_msecs_to_jiffies
	movq	%rax, %rdi
	callq	_schedule_timeout_interruptible
	testq	%rax, %rax
	jne	LBB0_27
## %bb.28:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	%r12, %rdi
	callq	_snd_tea575x_read
	movq	_TEA575X_BIT_SEARCH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_25
## %bb.29:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	$100, %r13d
	.p2align	4, 0x90
LBB0_31:                                ##   Parent Loop BB0_25 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$10, %edi
	callq	_msleep
	movq	%r12, %rdi
	callq	_snd_tea575x_get_freq
	testq	%rax, %rax
	jne	LBB0_32
## %bb.30:                              ##   in Loop: Header=BB0_31 Depth=2
	decl	%r13d
	jne	LBB0_31
	jmp	LBB0_38
LBB0_32:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	%rax, %rbx
	movq	8(%r12), %rdi
	subq	%rax, %rdi
	callq	_abs
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jl	LBB0_35
## %bb.33:                              ##   in Loop: Header=BB0_25 Depth=1
	cmpq	$0, 16(%r14)
	movq	8(%r12), %rax
	je	LBB0_36
## %bb.34:                              ##   in Loop: Header=BB0_25 Depth=1
	cmpq	%rax, %rbx
	jl	LBB0_35
	jmp	LBB0_37
LBB0_36:                                ##   in Loop: Header=BB0_25 Depth=1
	cmpq	%rax, %rbx
	jle	LBB0_37
LBB0_35:                                ##   in Loop: Header=BB0_25 Depth=1
	movl	16(%r12), %esi
	movq	%r12, %rdi
	callq	_snd_tea575x_write
	jmp	LBB0_25
LBB0_38:
	movq	_TEA575X_BIT_SEARCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 16(%r12)
	movq	%r12, %rdi
	callq	_snd_tea575x_set_freq
	movq	_ENODATA@GOTPCREL(%rip), %rcx
	jmp	LBB0_39
LBB0_27:
	movq	_TEA575X_BIT_SEARCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 16(%r12)
	movq	%r12, %rdi
	callq	_snd_tea575x_set_freq
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
	jmp	LBB0_39
LBB0_37:
	movq	%rbx, 8(%r12)
	movq	_TEA575X_BIT_SEARCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 16(%r12)
	xorl	%eax, %eax
	jmp	LBB0_40
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOTTY,4,2                     ## @ENOTTY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_EWOULDBLOCK,4,2                ## @EWOULDBLOCK
	.comm	_bands,8,3                      ## @bands
	.comm	_BAND_FM,4,2                    ## @BAND_FM
	.comm	_BAND_FM_JAPAN,4,2              ## @BAND_FM_JAPAN
	.comm	_BAND_AM,4,2                    ## @BAND_AM
	.comm	_TEA575X_BIT_FREQ_MASK,4,2      ## @TEA575X_BIT_FREQ_MASK
	.comm	_TEA575X_BIT_SEARCH,4,2         ## @TEA575X_BIT_SEARCH
	.comm	_TEA575X_BIT_UPDOWN,4,2         ## @TEA575X_BIT_UPDOWN
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_ENODATA,4,2                    ## @ENODATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_tea575x_s_hw_freq_seek     ; -- Begin function snd_tea575x_s_hw_freq_seek
	.p2align	2
_snd_tea575x_s_hw_freq_seek:            ; @snd_tea575x_s_hw_freq_seek
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x1, #32]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENOTTY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOTTY@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
	mov	x20, x2
	ldr	x8, [x2, #32]
	cbnz	x8, LBB0_4
; %bb.3:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_7
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	w8, [x0]
Lloh4:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh5:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
Lloh7:
	adrp	x8, _EWOULDBLOCK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EWOULDBLOCK@GOTPAGEOFF]
	b	LBB0_5
LBB0_9:
	mov	x19, x1
	ldr	x8, [x20]
Lloh9:
	adrp	x21, _BAND_AM@GOTPAGE
Lloh10:
	ldr	x21, [x21, _BAND_AM@GOTPAGEOFF]
	cbnz	x8, LBB0_11
; %bb.10:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_26
LBB0_11:
Lloh11:
	adrp	x22, _bands@GOTPAGE
Lloh12:
	ldr	x22, [x22, _bands@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_22
; %bb.12:
	mov	x24, #0
	mov	x23, #0
Lloh13:
	adrp	x25, _BAND_FM@GOTPAGE
Lloh14:
	ldr	x25, [x25, _BAND_FM@GOTPAGEOFF]
Lloh15:
	adrp	x26, _BAND_FM_JAPAN@GOTPAGE
Lloh16:
	ldr	x26, [x26, _BAND_FM_JAPAN@GOTPAGEOFF]
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x23, x23, #1
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	add	x24, x24, #16
	cmp	x23, w0, sxtw
	b.ge	LBB0_23
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	cmp	x23, x8
	b.eq	LBB0_13
LBB0_16:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x26]
	cmp	x23, x8
	b.ne	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_14
LBB0_18:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x21]
	cmp	x23, x8
	b.ne	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_14
LBB0_20:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x22]
	ldr	x9, [x8, x24]
	ldr	x10, [x20]
	cmp	x9, x10
	b.ne	LBB0_14
; %bb.21:                               ;   in Loop: Header=BB0_15 Depth=1
	add	x8, x8, x24
	ldr	x8, [x8, #8]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	b.ne	LBB0_14
	b	LBB0_23
LBB0_22:
	mov	w23, #0
LBB0_23:
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w23, w0
	b.eq	LBB0_4
; %bb.24:
	ldr	w8, [x19]
	cmp	w23, w8
	b.eq	LBB0_26
; %bb.25:
	str	w23, [x19]
	ldr	x0, [x19, #8]
	ldr	x8, [x22]
	add	x8, x8, w23, uxtw #4
	ldp	x1, x2, [x8]
	bl	_clamp
	str	x0, [x19, #8]
	mov	x0, x19
	bl	_snd_tea575x_set_freq
LBB0_26:
	ldr	w22, [x19]
	ldr	w25, [x21]
Lloh17:
	adrp	x8, _TEA575X_BIT_FREQ_MASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TEA575X_BIT_FREQ_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
Lloh20:
	adrp	x23, _TEA575X_BIT_SEARCH@GOTPAGE
Lloh21:
	ldr	x23, [x23, _TEA575X_BIT_SEARCH@GOTPAGEOFF]
	bic	w8, w9, w8
	ldr	w9, [x23]
	orr	w8, w9, w8
	ldr	x9, [x20, #16]
Lloh22:
	adrp	x10, _TEA575X_BIT_UPDOWN@GOTPAGE
Lloh23:
	ldr	x10, [x10, _TEA575X_BIT_UPDOWN@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	bic	w11, w8, w10
	orr	w8, w10, w8
	cmp	x9, #0
	csel	w1, w11, w8, eq
	str	w1, [x19, #16]
	mov	x0, x19
	bl	_snd_tea575x_write
Lloh25:
	adrp	x24, _jiffies@GOTPAGE
Lloh26:
	ldr	x24, [x24, _jiffies@GOTPAGEOFF]
	ldr	x21, [x24]
	mov	w0, #10000
	bl	_msecs_to_jiffies
	add	x21, x0, x21
	mov	w8, #800
	mov	w9, #80
	cmp	w22, w25
	csel	w25, w9, w8, eq
LBB0_27:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_31 Depth 2
	ldr	x0, [x24]
	mov	x1, x21
	bl	_time_after
	cbnz	x0, LBB0_38
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=1
	mov	w0, #10
	bl	_msecs_to_jiffies
	bl	_schedule_timeout_interruptible
	cbnz	x0, LBB0_39
; %bb.29:                               ;   in Loop: Header=BB0_27 Depth=1
	mov	x0, x19
	bl	_snd_tea575x_read
	ldr	w8, [x23]
	tst	w8, w0
	b.ne	LBB0_27
; %bb.30:                               ;   in Loop: Header=BB0_27 Depth=1
	mov	w26, #100
LBB0_31:                                ;   Parent Loop BB0_27 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	w0, #10
	bl	_msleep
	mov	x0, x19
	bl	_snd_tea575x_get_freq
	cbnz	x0, LBB0_33
; %bb.32:                               ;   in Loop: Header=BB0_31 Depth=2
	subs	w26, w26, #1
	b.ne	LBB0_31
	b	LBB0_38
LBB0_33:                                ;   in Loop: Header=BB0_27 Depth=1
	mov	x22, x0
	ldr	x8, [x19, #8]
	sub	x0, x8, x0
	bl	_abs
	cmp	w0, w25
	b.lt	LBB0_37
; %bb.34:                               ;   in Loop: Header=BB0_27 Depth=1
	ldr	x9, [x20, #16]
	ldr	x8, [x19, #8]
	cmp	x22, x8
	cbz	x9, LBB0_36
; %bb.35:                               ;   in Loop: Header=BB0_27 Depth=1
	b.lt	LBB0_37
	b	LBB0_40
LBB0_36:                                ;   in Loop: Header=BB0_27 Depth=1
	b.le	LBB0_40
LBB0_37:                                ;   in Loop: Header=BB0_27 Depth=1
	ldr	w1, [x19, #16]
	mov	x0, x19
	bl	_snd_tea575x_write
	b	LBB0_27
LBB0_38:
	ldr	w8, [x23]
	ldr	w9, [x19, #16]
	bic	w8, w9, w8
	str	w8, [x19, #16]
	mov	x0, x19
	bl	_snd_tea575x_set_freq
Lloh27:
	adrp	x8, _ENODATA@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENODATA@GOTPAGEOFF]
	b	LBB0_5
LBB0_39:
	ldr	w8, [x23]
	ldr	w9, [x19, #16]
	bic	w8, w9, w8
	str	w8, [x19, #16]
	mov	x0, x19
	bl	_snd_tea575x_set_freq
Lloh29:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_5
LBB0_40:
	mov	w0, #0
	str	x22, [x19, #8]
	ldr	w8, [x23]
	ldr	w9, [x19, #16]
	bic	w8, w9, w8
	str	w8, [x19, #16]
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOTTY,4,2                     ; @ENOTTY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_EWOULDBLOCK,4,2                ; @EWOULDBLOCK
	.comm	_bands,8,3                      ; @bands
	.comm	_BAND_FM,4,2                    ; @BAND_FM
	.comm	_BAND_FM_JAPAN,4,2              ; @BAND_FM_JAPAN
	.comm	_BAND_AM,4,2                    ; @BAND_AM
	.comm	_TEA575X_BIT_FREQ_MASK,4,2      ; @TEA575X_BIT_FREQ_MASK
	.comm	_TEA575X_BIT_SEARCH,4,2         ; @TEA575X_BIT_SEARCH
	.comm	_TEA575X_BIT_UPDOWN,4,2         ; @TEA575X_BIT_UPDOWN
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_ENODATA,4,2                    ; @ENODATA
.subsections_via_symbols
