	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxd2880_tnrdmd_dvbt2_mon_spectrum_sense ## -- Begin function cxd2880_tnrdmd_dvbt2_mon_spectrum_sense
	.p2align	4, 0x90
_cxd2880_tnrdmd_dvbt2_mon_spectrum_sense: ## @cxd2880_tnrdmd_dvbt2_mon_spectrum_sense
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$0, -40(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -36(%rbp)
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rsi, %r14
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.4:
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	_CXD2880_TNRDMD_STATE_ACTIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.5:
	movq	8(%r15), %rax
	movq	_CXD2880_DTV_SYS_DVBT2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.6:
	movq	%r15, %rdi
	callq	_slvt_freeze_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.7:
	leaq	-40(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r15, %rdi
	callq	_cxd2880_tnrdmd_dvbt2_mon_sync_stat
	testl	%eax, %eax
	je	LBB0_9
LBB0_8:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_slvt_unfreeze_reg
	jmp	LBB0_19
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	cmpl	$6, -40(%rbp)
	jne	LBB0_10
## %bb.13:
	movq	24(%r15), %rdi
	movq	_CXD2880_IO_TGT_DMD@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	xorl	%edx, %edx
	movl	$11, %ecx
	callq	*(%rdi)
	testl	%eax, %eax
	jne	LBB0_8
## %bb.14:
	movq	24(%r15), %rdi
	movl	(%r12), %esi
	leaq	-36(%rbp), %rcx
	movl	$47, %edx
	movl	$4, %r8d
	callq	*8(%rdi)
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_slvt_unfreeze_reg
	testl	%ebx, %ebx
	jne	LBB0_19
## %bb.15:
	testb	$1, -36(%rbp)
	jne	LBB0_16
## %bb.17:
	movq	_CXD2880_TNRDMD_SPECTRUM_NORMAL@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_10:
	movq	%r15, %rdi
	callq	_slvt_unfreeze_reg
	movq	16(%r15), %rax
	movq	_CXD2880_TNRDMD_DIVERMODE_MAIN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.12:
	movq	32(%r15), %rdi
	movq	%r14, %rsi
	callq	_cxd2880_tnrdmd_dvbt2_mon_spectrum_sense
	movl	%eax, %ebx
	jmp	LBB0_19
LBB0_11:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_16:
	movq	_CXD2880_TNRDMD_SPECTRUM_INV@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %eax
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CXD2880_TNRDMD_STATE_ACTIVE,8,3 ## @CXD2880_TNRDMD_STATE_ACTIVE
	.comm	_CXD2880_DTV_SYS_DVBT2,8,3      ## @CXD2880_DTV_SYS_DVBT2
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_CXD2880_TNRDMD_DIVERMODE_MAIN,8,3 ## @CXD2880_TNRDMD_DIVERMODE_MAIN
	.comm	_CXD2880_IO_TGT_DMD,4,2         ## @CXD2880_IO_TGT_DMD
	.comm	_CXD2880_TNRDMD_SPECTRUM_INV,4,2 ## @CXD2880_TNRDMD_SPECTRUM_INV
	.comm	_CXD2880_TNRDMD_SPECTRUM_NORMAL,4,2 ## @CXD2880_TNRDMD_SPECTRUM_NORMAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxd2880_tnrdmd_dvbt2_mon_spectrum_sense ; -- Begin function cxd2880_tnrdmd_dvbt2_mon_spectrum_sense
	.p2align	2
_cxd2880_tnrdmd_dvbt2_mon_spectrum_sense: ; @cxd2880_tnrdmd_dvbt2_mon_spectrum_sense
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	stp	xzr, xzr, [sp]
	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_STATE_ACTIVE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CXD2880_TNRDMD_STATE_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.3:
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _CXD2880_DTV_SYS_DVBT2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CXD2880_DTV_SYS_DVBT2@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_slvt_freeze_reg
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.5:
	add	x1, sp, #12
	add	x2, sp, #8
	add	x3, sp, #4
	mov	x0, x20
	bl	_cxd2880_tnrdmd_dvbt2_mon_sync_stat
	cbz	w0, LBB0_10
LBB0_6:
	mov	x21, x0
	mov	x0, x20
	bl	_slvt_unfreeze_reg
	b	LBB0_9
LBB0_7:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_10:
	ldr	w8, [sp, #12]
	cmp	w8, #6
	b.ne	LBB0_14
; %bb.11:
	ldr	x0, [x20, #24]
	ldr	x8, [x0]
Lloh8:
	adrp	x22, _CXD2880_IO_TGT_DMD@GOTPAGE
Lloh9:
	ldr	x22, [x22, _CXD2880_IO_TGT_DMD@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w2, #0
	mov	w3, #11
	blr	x8
	cbnz	w0, LBB0_6
; %bb.12:
	ldr	x0, [x20, #24]
	ldr	x8, [x0, #8]
	ldr	w1, [x22]
	mov	x3, sp
	mov	w2, #47
	mov	w4, #4
	blr	x8
	mov	x21, x0
	mov	x0, x20
	bl	_slvt_unfreeze_reg
	cbnz	w21, LBB0_9
; %bb.13:
	ldr	w8, [sp]
Lloh10:
	adrp	x9, _CXD2880_TNRDMD_SPECTRUM_INV@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CXD2880_TNRDMD_SPECTRUM_INV@GOTPAGEOFF]
Lloh12:
	adrp	x10, _CXD2880_TNRDMD_SPECTRUM_NORMAL@GOTPAGE
Lloh13:
	ldr	x10, [x10, _CXD2880_TNRDMD_SPECTRUM_NORMAL@GOTPAGEOFF]
	tst	w8, #0x1
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_9
LBB0_14:
	mov	x0, x20
	bl	_slvt_unfreeze_reg
	ldr	x8, [x20, #16]
Lloh14:
	adrp	x9, _CXD2880_TNRDMD_DIVERMODE_MAIN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CXD2880_TNRDMD_DIVERMODE_MAIN@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.15:
	ldr	x0, [x20, #32]
	mov	x1, x19
	bl	_cxd2880_tnrdmd_dvbt2_mon_spectrum_sense
	mov	x21, x0
	b	LBB0_9
LBB0_16:
Lloh17:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CXD2880_TNRDMD_STATE_ACTIVE,8,3 ; @CXD2880_TNRDMD_STATE_ACTIVE
	.comm	_CXD2880_DTV_SYS_DVBT2,8,3      ; @CXD2880_DTV_SYS_DVBT2
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_CXD2880_TNRDMD_DIVERMODE_MAIN,8,3 ; @CXD2880_TNRDMD_DIVERMODE_MAIN
	.comm	_CXD2880_IO_TGT_DMD,4,2         ; @CXD2880_IO_TGT_DMD
	.comm	_CXD2880_TNRDMD_SPECTRUM_INV,4,2 ; @CXD2880_TNRDMD_SPECTRUM_INV
	.comm	_CXD2880_TNRDMD_SPECTRUM_NORMAL,4,2 ; @CXD2880_TNRDMD_SPECTRUM_NORMAL
.subsections_via_symbols
