	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxd2880_dvbt_tune
_cxd2880_dvbt_tune:                     ## @cxd2880_dvbt_tune
	.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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rsi, %r14
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.4:
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_CXD2880_TNRDMD_DIVERMODE_SUB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.5:
	movq	8(%rbx), %rax
	movq	_CXD2880_TNRDMD_STATE_SLEEP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_CXD2880_TNRDMD_STATE_ACTIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	leaq	16(%rbx), %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	movq	(%r14), %rax
	movq	_CXD2880_DTV_BW_5_MHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.8:
	movq	_CXD2880_DTV_BW_6_MHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.9:
	movq	_CXD2880_DTV_BW_7_MHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.10:
	movq	_CXD2880_DTV_BW_8_MHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.11:
	movq	_ENOTTY@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_12:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_cxd2880_tnrdmd_dvbt_tune1
	testl	%eax, %eax
	jne	LBB0_13
## %bb.14:
	movq	_CXD2880_TNRDMD_WAIT_AGC_STABLE@GOTPCREL(%rip), %rax
	imull	$10000, (%rax), %edi            ## imm = 0x2710
	leal	1000(%rdi), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_usleep_range
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_cxd2880_tnrdmd_dvbt_tune2      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CXD2880_TNRDMD_DIVERMODE_SUB,8,3 ## @CXD2880_TNRDMD_DIVERMODE_SUB
	.comm	_CXD2880_TNRDMD_STATE_SLEEP,8,3 ## @CXD2880_TNRDMD_STATE_SLEEP
	.comm	_CXD2880_TNRDMD_STATE_ACTIVE,8,3 ## @CXD2880_TNRDMD_STATE_ACTIVE
	.comm	_CXD2880_DTV_BW_5_MHZ,8,3       ## @CXD2880_DTV_BW_5_MHZ
	.comm	_CXD2880_DTV_BW_6_MHZ,8,3       ## @CXD2880_DTV_BW_6_MHZ
	.comm	_CXD2880_DTV_BW_7_MHZ,8,3       ## @CXD2880_DTV_BW_7_MHZ
	.comm	_CXD2880_DTV_BW_8_MHZ,8,3       ## @CXD2880_DTV_BW_8_MHZ
	.comm	_ENOTTY,4,2                     ## @ENOTTY
	.comm	_CXD2880_TNRDMD_WAIT_AGC_STABLE,4,2 ## @CXD2880_TNRDMD_WAIT_AGC_STABLE
	.no_dead_strip	_cxd2880_dvbt_tune
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxd2880_dvbt_tune
_cxd2880_dvbt_tune:                     ; @cxd2880_dvbt_tune
	.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
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x1
	cbz	x1, LBB0_7
; %bb.2:
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CXD2880_TNRDMD_DIVERMODE_SUB@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CXD2880_TNRDMD_DIVERMODE_SUB@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_7
; %bb.3:
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _CXD2880_TNRDMD_STATE_SLEEP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CXD2880_TNRDMD_STATE_SLEEP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _CXD2880_TNRDMD_STATE_ACTIVE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CXD2880_TNRDMD_STATE_ACTIVE@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_7
; %bb.4:
	add	x0, x20, #16
	mov	w1, #0
	bl	_atomic_set
	ldr	x8, [x19]
Lloh9:
	adrp	x9, _CXD2880_DTV_BW_5_MHZ@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CXD2880_DTV_BW_5_MHZ@GOTPAGEOFF]
Lloh11:
	adrp	x10, _CXD2880_DTV_BW_6_MHZ@GOTPAGE
Lloh12:
	ldr	x10, [x10, _CXD2880_DTV_BW_6_MHZ@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
Lloh14:
	ldr	x10, [x10]
Lloh15:
	adrp	x11, _CXD2880_DTV_BW_7_MHZ@GOTPAGE
Lloh16:
	ldr	x11, [x11, _CXD2880_DTV_BW_7_MHZ@GOTPAGEOFF]
Lloh17:
	adrp	x12, _CXD2880_DTV_BW_8_MHZ@GOTPAGE
Lloh18:
	ldr	x12, [x12, _CXD2880_DTV_BW_8_MHZ@GOTPAGEOFF]
Lloh19:
	ldr	x11, [x11]
Lloh20:
	ldr	x12, [x12]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	ccmp	x8, x12, #4, ne
	b.ne	LBB0_10
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_cxd2880_tnrdmd_dvbt_tune1
	cbnz	w0, LBB0_9
; %bb.6:
Lloh21:
	adrp	x8, _CXD2880_TNRDMD_WAIT_AGC_STABLE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CXD2880_TNRDMD_WAIT_AGC_STABLE@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	mov	w9, #10000
	mul	w0, w8, w9
	add	w1, w0, #1000
	bl	_usleep_range
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_cxd2880_tnrdmd_dvbt_tune2
LBB0_7:
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_10:
Lloh26:
	adrp	x8, _ENOTTY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOTTY@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CXD2880_TNRDMD_DIVERMODE_SUB,8,3 ; @CXD2880_TNRDMD_DIVERMODE_SUB
	.comm	_CXD2880_TNRDMD_STATE_SLEEP,8,3 ; @CXD2880_TNRDMD_STATE_SLEEP
	.comm	_CXD2880_TNRDMD_STATE_ACTIVE,8,3 ; @CXD2880_TNRDMD_STATE_ACTIVE
	.comm	_CXD2880_DTV_BW_5_MHZ,8,3       ; @CXD2880_DTV_BW_5_MHZ
	.comm	_CXD2880_DTV_BW_6_MHZ,8,3       ; @CXD2880_DTV_BW_6_MHZ
	.comm	_CXD2880_DTV_BW_7_MHZ,8,3       ; @CXD2880_DTV_BW_7_MHZ
	.comm	_CXD2880_DTV_BW_8_MHZ,8,3       ; @CXD2880_DTV_BW_8_MHZ
	.comm	_ENOTTY,4,2                     ; @ENOTTY
	.comm	_CXD2880_TNRDMD_WAIT_AGC_STABLE,4,2 ; @CXD2880_TNRDMD_WAIT_AGC_STABLE
	.no_dead_strip	_cxd2880_dvbt_tune
.subsections_via_symbols
