	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxd2820r_search
_cxd2820r_search:                       ## @cxd2820r_search
	.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	%rdi, %r12
	movq	8(%rdi), %r15
	movq	8(%r15), %rax
	movq	(%rax), %r14
	movl	$0, -44(%rbp)
	movl	(%rdi), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	cmpl	$0, (%r15)
	je	LBB0_8
## %bb.1:
	movl	4(%r15), %eax
	cmpl	$129, %eax
	je	LBB0_5
## %bb.2:
	cmpl	$130, %eax
	jne	LBB0_8
## %bb.3:
	movq	%r12, %rdi
	callq	_cxd2820r_sleep_t
	testl	%eax, %eax
	jne	LBB0_18
## %bb.4:
	movl	$129, %eax
	jmp	LBB0_7
LBB0_5:
	movq	%r12, %rdi
	callq	_cxd2820r_sleep_t2
	testl	%eax, %eax
	jne	LBB0_18
## %bb.6:
	movl	$130, %eax
LBB0_7:
	movl	%eax, (%r12)
LBB0_8:
	movq	%r12, %rdi
	callq	_cxd2820r_set_frontend
	testl	%eax, %eax
	je	LBB0_9
LBB0_18:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_dbg
	movq	_DVBFE_ALGO_SEARCH_ERROR@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	$-129, %eax
	addl	4(%r15), %eax
	cmpl	$3, %eax
	jae	LBB0_10
## %bb.11:
	cltq
	leaq	l_switch.table.cxd2820r_search(%rip), %rcx
	movl	(%rcx,%rax,4), %ebx
	leaq	-44(%rbp), %r13
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_dbg
	movl	$50, %edi
	callq	_msleep
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_cxd2820r_read_status
	testl	%eax, %eax
	jne	LBB0_18
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	-44(%rbp), %ecx
	movq	_FE_HAS_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%ecx, %eax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	leal	-1(%rbx), %edx
	cmpl	$1, %ebx
	movl	%edx, %ebx
	jg	LBB0_12
	jmp	LBB0_15
LBB0_10:
	movq	_FE_HAS_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
LBB0_15:
	testl	%ecx, %eax
	je	LBB0_17
## %bb.16:
	movl	$0, (%r15)
	movq	_DVBFE_ALGO_SEARCH_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_17:
	movl	$1, (%r15)
	movq	_DVBFE_ALGO_SEARCH_AGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"delivery_system=%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"loop=%d\n"

	.comm	_FE_HAS_LOCK,4,2                ## @FE_HAS_LOCK
	.comm	_DVBFE_ALGO_SEARCH_SUCCESS,4,2  ## @DVBFE_ALGO_SEARCH_SUCCESS
	.comm	_DVBFE_ALGO_SEARCH_AGAIN,4,2    ## @DVBFE_ALGO_SEARCH_AGAIN
L_.str.2:                               ## @.str.2
	.asciz	"failed=%d\n"

	.comm	_DVBFE_ALGO_SEARCH_ERROR,4,2    ## @DVBFE_ALGO_SEARCH_ERROR
	.no_dead_strip	_cxd2820r_search
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.cxd2820r_search
l_switch.table.cxd2820r_search:
	.long	40                              ## 0x28
	.long	20                              ## 0x14
	.long	20                              ## 0x14

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxd2820r_search
_cxd2820r_search:                       ; @cxd2820r_search
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x0
	ldr	x23, [x0, #8]
	ldr	x8, [x23, #8]
	ldr	x19, [x8]
	str	wzr, [sp, #12]
	ldr	w2, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldr	w8, [x23]
	cbz	w8, LBB0_8
; %bb.1:
	ldr	w8, [x23, #4]
	cmp	w8, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #130
	b.ne	LBB0_8
; %bb.3:
	mov	x0, x20
	bl	_cxd2820r_sleep_t
	mov	x2, x0
	cbnz	w0, LBB0_9
; %bb.4:
	mov	w8, #129
	b	LBB0_7
LBB0_5:
	mov	x0, x20
	bl	_cxd2820r_sleep_t2
	mov	x2, x0
	cbnz	w0, LBB0_9
; %bb.6:
	mov	w8, #130
LBB0_7:
	str	w8, [x20]
LBB0_8:
	mov	x0, x20
	bl	_cxd2820r_set_frontend
	mov	x2, x0
	cbz	w0, LBB0_11
LBB0_9:
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh4:
	adrp	x8, _DVBFE_ALGO_SEARCH_ERROR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DVBFE_ALGO_SEARCH_ERROR@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	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
	add	sp, sp, #80
	ret
LBB0_11:
	ldr	w8, [x23, #4]
	sub	w8, w8, #129
	cmp	w8, #3
	b.hs	LBB0_17
; %bb.12:
Lloh6:
	adrp	x9, l_switch.table.cxd2820r_search@PAGE
Lloh7:
	add	x9, x9, l_switch.table.cxd2820r_search@PAGEOFF
	ldr	w21, [x9, w8, sxtw #2]
Lloh8:
	adrp	x22, l_.str.1@PAGE
Lloh9:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh10:
	adrp	x24, _FE_HAS_LOCK@GOTPAGE
Lloh11:
	ldr	x24, [x24, _FE_HAS_LOCK@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_dev_dbg
	mov	w0, #50
	bl	_msleep
	add	x1, sp, #12
	mov	x0, x20
	bl	_cxd2820r_read_status
	cbnz	w0, LBB0_19
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x24]
	and	w10, w9, w8
	cmp	w10, #0
	ccmp	w21, #1, #4, eq
	sub	w21, w21, #1
	b.gt	LBB0_13
; %bb.15:
	tst	w9, w8
	b.eq	LBB0_18
LBB0_16:
	str	wzr, [x23]
Lloh12:
	adrp	x8, _DVBFE_ALGO_SEARCH_SUCCESS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DVBFE_ALGO_SEARCH_SUCCESS@GOTPAGEOFF]
	b	LBB0_10
LBB0_17:
	mov	w8, #0
Lloh14:
	adrp	x9, _FE_HAS_LOCK@GOTPAGE
Lloh15:
	ldr	x9, [x9, _FE_HAS_LOCK@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_16
LBB0_18:
	mov	w8, #1
	str	w8, [x23]
Lloh17:
	adrp	x8, _DVBFE_ALGO_SEARCH_AGAIN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DVBFE_ALGO_SEARCH_AGAIN@GOTPAGEOFF]
	b	LBB0_10
LBB0_19:
	mov	x2, x0
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"delivery_system=%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"loop=%d\n"

	.comm	_FE_HAS_LOCK,4,2                ; @FE_HAS_LOCK
	.comm	_DVBFE_ALGO_SEARCH_SUCCESS,4,2  ; @DVBFE_ALGO_SEARCH_SUCCESS
	.comm	_DVBFE_ALGO_SEARCH_AGAIN,4,2    ; @DVBFE_ALGO_SEARCH_AGAIN
l_.str.2:                               ; @.str.2
	.asciz	"failed=%d\n"

	.comm	_DVBFE_ALGO_SEARCH_ERROR,4,2    ; @DVBFE_ALGO_SEARCH_ERROR
	.no_dead_strip	_cxd2820r_search
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.cxd2820r_search
l_switch.table.cxd2820r_search:
	.long	40                              ; 0x28
	.long	20                              ; 0x14
	.long	20                              ; 0x14

.subsections_via_symbols
