	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib9000_fw_tune
_dib9000_fw_tune:                       ## @dib9000_fw_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	%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), %rbx
	movq	16(%rbx), %r15
	movq	_CHANNEL_STATUS_PARAMETERS_UNKNOWN@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_6
## %bb.1:
	cmpl	$129, %eax
	jne	LBB0_16
## %bb.2:
	movq	%rdi, %r14
	movq	%rbx, %rdi
	callq	_dib9000_fw_set_channel_head
	movq	_FE_MM_W_CHANNEL_CONTEXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_fe_info@GOTPCREL(%rip), %r13
	movq	(%r13), %rdx
	movq	%rbx, %rdi
	callq	_dib9000_risc_mem_write
	movq	_FE_MM_W_FE_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r13), %rdx
	movq	%rbx, %rdi
	callq	_dib9000_risc_mem_write
	cmpq	%r12, %r15
	jne	LBB0_4
## %bb.3:
	movq	_OUT_MSG_FE_CHANNEL_SEARCH@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_6:
	cmpq	%r12, %r15
	jne	LBB0_7
## %bb.8:
	movq	_FE_MM_R_CHANNEL_SEARCH_STATE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_16:
	movq	_FE_CALLBACK_TIME_NEVER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_17
LBB0_4:
	movq	%r14, %rdi
	callq	_dib9000_fw_set_channel_union
	movq	_OUT_MSG_FE_CHANNEL_TUNE@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_dib9000_mbx_send
	movl	$128, (%rbx)
	movl	$10, %eax
	jmp	LBB0_17
LBB0_7:
	movq	_FE_MM_R_CHANNEL_TUNE_STATE@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %esi
	movq	8(%rbx), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_dib9000_risc_mem_read
	movq	8(%rbx), %rax
	movl	(%rax), %ecx
	movl	$10, %eax
	testl	%ecx, %ecx
	je	LBB0_17
## %bb.10:
	cmpl	$-2, %ecx
	jne	LBB0_15
## %bb.11:
	cmpq	%r12, %r15
	jne	LBB0_14
## %bb.12:
	movq	_FE_STATUS_DEMOD_SUCCESS@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_15:
	movq	_FE_STATUS_TUNE_FAILED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rbx)
	movq	_CT_DEMOD_STOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rbx)
	jmp	LBB0_17
LBB0_14:
	movq	_CT_DEMOD_STOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rbx)
	movq	_FE_STATUS_LOCKED@GOTPCREL(%rip), %rcx
LBB0_13:
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rbx)
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHANNEL_STATUS_PARAMETERS_UNKNOWN,8,3 ## @CHANNEL_STATUS_PARAMETERS_UNKNOWN
	.comm	_FE_MM_W_CHANNEL_CONTEXT,4,2    ## @FE_MM_W_CHANNEL_CONTEXT
	.comm	_fe_info,8,3                    ## @fe_info
	.comm	_FE_MM_W_FE_INFO,4,2            ## @FE_MM_W_FE_INFO
	.comm	_OUT_MSG_FE_CHANNEL_SEARCH,4,2  ## @OUT_MSG_FE_CHANNEL_SEARCH
	.comm	_OUT_MSG_FE_CHANNEL_TUNE,4,2    ## @OUT_MSG_FE_CHANNEL_TUNE
	.comm	_FE_MM_R_CHANNEL_SEARCH_STATE,4,2 ## @FE_MM_R_CHANNEL_SEARCH_STATE
	.comm	_FE_MM_R_CHANNEL_TUNE_STATE,4,2 ## @FE_MM_R_CHANNEL_TUNE_STATE
	.comm	_FE_STATUS_DEMOD_SUCCESS,4,2    ## @FE_STATUS_DEMOD_SUCCESS
	.comm	_CT_DEMOD_STOP,8,3              ## @CT_DEMOD_STOP
	.comm	_FE_STATUS_LOCKED,4,2           ## @FE_STATUS_LOCKED
	.comm	_FE_STATUS_TUNE_FAILED,4,2      ## @FE_STATUS_TUNE_FAILED
	.comm	_FE_CALLBACK_TIME_NEVER,4,2     ## @FE_CALLBACK_TIME_NEVER
	.no_dead_strip	_dib9000_fw_tune
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib9000_fw_tune
_dib9000_fw_tune:                       ; @dib9000_fw_tune
	.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
	ldr	x19, [x0]
	ldr	x21, [x19, #16]
Lloh0:
	adrp	x8, _CHANNEL_STATUS_PARAMETERS_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CHANNEL_STATUS_PARAMETERS_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #129
	b.ne	LBB0_8
; %bb.2:
	mov	x20, x0
	mov	x0, x19
	bl	_dib9000_fw_set_channel_head
Lloh3:
	adrp	x8, _FE_MM_W_CHANNEL_CONTEXT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FE_MM_W_CHANNEL_CONTEXT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x23, _fe_info@GOTPAGE
Lloh7:
	ldr	x23, [x23, _fe_info@GOTPAGEOFF]
	ldr	x2, [x23]
	mov	x0, x19
	bl	_dib9000_risc_mem_write
Lloh8:
	adrp	x8, _FE_MM_W_FE_INFO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FE_MM_W_FE_INFO@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	x2, [x23]
	mov	x0, x19
	bl	_dib9000_risc_mem_write
	cmp	x21, x22
	b.ne	LBB0_9
; %bb.3:
Lloh11:
	adrp	x8, _OUT_MSG_FE_CHANNEL_SEARCH@GOTPAGE
Lloh12:
	ldr	x8, [x8, _OUT_MSG_FE_CHANNEL_SEARCH@GOTPAGEOFF]
	b	LBB0_10
LBB0_4:
Lloh13:
	adrp	x8, _FE_MM_R_CHANNEL_SEARCH_STATE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FE_MM_R_CHANNEL_SEARCH_STATE@GOTPAGEOFF]
Lloh15:
	adrp	x9, _FE_MM_R_CHANNEL_TUNE_STATE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _FE_MM_R_CHANNEL_TUNE_STATE@GOTPAGEOFF]
	cmp	x21, x22
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	ldr	x2, [x19, #8]
	mov	x0, x19
	mov	w3, #1
	bl	_dib9000_risc_mem_read
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	cbz	w8, LBB0_14
; %bb.5:
	cmn	w8, #2
	b.ne	LBB0_11
; %bb.6:
	cmp	x21, x22
	b.ne	LBB0_12
; %bb.7:
Lloh17:
	adrp	x8, _FE_STATUS_DEMOD_SUCCESS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _FE_STATUS_DEMOD_SUCCESS@GOTPAGEOFF]
	b	LBB0_13
LBB0_8:
Lloh19:
	adrp	x8, _FE_CALLBACK_TIME_NEVER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _FE_CALLBACK_TIME_NEVER@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	b	LBB0_15
LBB0_9:
	mov	x0, x20
	bl	_dib9000_fw_set_channel_union
Lloh22:
	adrp	x8, _OUT_MSG_FE_CHANNEL_TUNE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _OUT_MSG_FE_CHANNEL_TUNE@GOTPAGEOFF]
LBB0_10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	bl	_dib9000_mbx_send
	mov	w8, #128
	str	w8, [x19]
	b	LBB0_14
LBB0_11:
Lloh24:
	adrp	x8, _FE_STATUS_TUNE_FAILED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FE_STATUS_TUNE_FAILED@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _CT_DEMOD_STOP@GOTPAGE
Lloh28:
	ldr	x9, [x9, _CT_DEMOD_STOP@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	stp	w9, w8, [x19]
	b	LBB0_14
LBB0_12:
Lloh30:
	adrp	x8, _CT_DEMOD_STOP@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CT_DEMOD_STOP@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	str	w8, [x19]
Lloh33:
	adrp	x8, _FE_STATUS_LOCKED@GOTPAGE
Lloh34:
	ldr	x8, [x8, _FE_STATUS_LOCKED@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	str	w8, [x19, #4]
LBB0_14:
	mov	w0, #10
LBB0_15:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_CHANNEL_STATUS_PARAMETERS_UNKNOWN,8,3 ; @CHANNEL_STATUS_PARAMETERS_UNKNOWN
	.comm	_FE_MM_W_CHANNEL_CONTEXT,4,2    ; @FE_MM_W_CHANNEL_CONTEXT
	.comm	_fe_info,8,3                    ; @fe_info
	.comm	_FE_MM_W_FE_INFO,4,2            ; @FE_MM_W_FE_INFO
	.comm	_OUT_MSG_FE_CHANNEL_SEARCH,4,2  ; @OUT_MSG_FE_CHANNEL_SEARCH
	.comm	_OUT_MSG_FE_CHANNEL_TUNE,4,2    ; @OUT_MSG_FE_CHANNEL_TUNE
	.comm	_FE_MM_R_CHANNEL_SEARCH_STATE,4,2 ; @FE_MM_R_CHANNEL_SEARCH_STATE
	.comm	_FE_MM_R_CHANNEL_TUNE_STATE,4,2 ; @FE_MM_R_CHANNEL_TUNE_STATE
	.comm	_FE_STATUS_DEMOD_SUCCESS,4,2    ; @FE_STATUS_DEMOD_SUCCESS
	.comm	_CT_DEMOD_STOP,8,3              ; @CT_DEMOD_STOP
	.comm	_FE_STATUS_LOCKED,4,2           ; @FE_STATUS_LOCKED
	.comm	_FE_STATUS_TUNE_FAILED,4,2      ; @FE_STATUS_TUNE_FAILED
	.comm	_FE_CALLBACK_TIME_NEVER,4,2     ; @FE_CALLBACK_TIME_NEVER
	.no_dead_strip	_dib9000_fw_tune
.subsections_via_symbols
