	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib7000m_demod_reset
_dib7000m_demod_reset:                  ## @dib7000m_demod_reset
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_DIB7000M_POWER_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dib7000m_set_power_mode
	movq	_DIBX000_VBG_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dib7000m_set_adc_state
	movq	%rbx, %rdi
	movl	$898, %esi                      ## imm = 0x382
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_dib7000m_write_word
	movq	%rbx, %rdi
	movl	$899, %esi                      ## imm = 0x383
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_dib7000m_write_word
	movq	%rbx, %rdi
	movl	$900, %esi                      ## imm = 0x384
	movl	$65295, %edx                    ## imm = 0xFF0F
	callq	_dib7000m_write_word
	movq	%rbx, %rdi
	movl	$901, %esi                      ## imm = 0x385
	movl	$65532, %edx                    ## imm = 0xFFFC
	callq	_dib7000m_write_word
	movq	%rbx, %rdi
	movl	$898, %esi                      ## imm = 0x382
	xorl	%edx, %edx
	callq	_dib7000m_write_word
	movq	%rbx, %rdi
	movl	$899, %esi                      ## imm = 0x383
	xorl	%edx, %edx
	callq	_dib7000m_write_word
	movq	%rbx, %rdi
	movl	$900, %esi                      ## imm = 0x384
	xorl	%edx, %edx
	callq	_dib7000m_write_word
	movq	%rbx, %rdi
	movl	$901, %esi                      ## imm = 0x385
	xorl	%edx, %edx
	callq	_dib7000m_write_word
	cmpl	$16384, (%rbx)                  ## imm = 0x4000
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_dib7000m_reset_pll
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	callq	_dib7000mc_reset_pll
LBB0_3:
	movq	%rbx, %rdi
	callq	_dib7000m_reset_gpio
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
LBB0_5:
	movq	_OUTMODE_HIGH_Z@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dib7000m_set_output_mode
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_dprintk
LBB0_7:
	movq	%rbx, %rdi
	movl	$1794, %esi                     ## imm = 0x702
	callq	_dib7000m_read_word
	andl	$-3, %eax
	movq	%rbx, %rdi
	movl	$1794, %esi                     ## imm = 0x702
	movl	%eax, %edx
	callq	_dib7000m_write_word
	movq	%rbx, %rdi
	movl	$8000, %esi                     ## imm = 0x1F40
	callq	_dib7000m_set_bandwidth
	movq	_DIBX000_SLOW_ADC_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dib7000m_set_adc_state
	movq	%rbx, %rdi
	callq	_dib7000m_sad_calib
	movq	_DIBX000_SLOW_ADC_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dib7000m_set_adc_state
	cmpq	$0, 32(%rbx)
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	movl	$1796, %esi                     ## imm = 0x704
	xorl	%edx, %edx
	callq	_dib7000m_write_word
LBB0_9:
	xorl	%eax, %eax
	cmpq	$0, 24(%rbx)
	sete	%al
	movl	$224, %ecx
	movl	$261, %esi                      ## imm = 0x105
	cmovel	%ecx, %esi
	movl	$2, %edx
	subl	%eax, %edx
	addl	4(%rbx), %esi
	movq	%rbx, %rdi
	callq	_dib7000m_write_word
	cmpq	$0, 16(%rbx)
	movl	$8021, %eax                     ## imm = 0x1F55
	movl	$1877, %edx                     ## imm = 0x755
	cmovel	%eax, %edx
	movq	%rbx, %rdi
	movl	$36, %esi
	callq	_dib7000m_write_word
	cmpl	$16384, (%rbx)                  ## imm = 0x4000
	movl	$3136, %eax                     ## imm = 0xC40
	movl	$49, %edx
	cmovel	%eax, %edx
	movq	%rbx, %rdi
	movl	$909, %esi                      ## imm = 0x38D
	callq	_dib7000m_write_word
	movq	_dib7000m_defaults_common@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dib7000m_write_tab
	movq	_dib7000m_defaults@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dib7000m_write_tab
	movq	_DIB7000M_POWER_INTERFACE_ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dib7000m_set_power_mode
	movq	8(%rbx), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DIB7000M_POWER_ALL,4,2         ## @DIB7000M_POWER_ALL
	.comm	_DIBX000_VBG_ENABLE,4,2         ## @DIBX000_VBG_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPIO reset was not successful.\n"

	.comm	_OUTMODE_HIGH_Z,4,2             ## @OUTMODE_HIGH_Z
L_.str.1:                               ## @.str.1
	.asciz	"OUTPUT_MODE could not be reset.\n"

	.comm	_DIBX000_SLOW_ADC_ON,4,2        ## @DIBX000_SLOW_ADC_ON
	.comm	_DIBX000_SLOW_ADC_OFF,4,2       ## @DIBX000_SLOW_ADC_OFF
	.comm	_dib7000m_defaults_common,4,2   ## @dib7000m_defaults_common
	.comm	_dib7000m_defaults,4,2          ## @dib7000m_defaults
	.comm	_DIB7000M_POWER_INTERFACE_ONLY,4,2 ## @DIB7000M_POWER_INTERFACE_ONLY
	.no_dead_strip	_dib7000m_demod_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib7000m_demod_reset
_dib7000m_demod_reset:                  ; @dib7000m_demod_reset
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _DIB7000M_POWER_ALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DIB7000M_POWER_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_dib7000m_set_power_mode
Lloh3:
	adrp	x8, _DIBX000_VBG_ENABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DIBX000_VBG_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dib7000m_set_adc_state
	mov	x0, x19
	mov	w1, #898
	mov	w2, #65535
	bl	_dib7000m_write_word
	mov	x0, x19
	mov	w1, #899
	mov	w2, #65535
	bl	_dib7000m_write_word
	mov	x0, x19
	mov	w1, #900
	mov	w2, #65295
	bl	_dib7000m_write_word
	mov	x0, x19
	mov	w1, #901
	mov	w2, #65532
	bl	_dib7000m_write_word
	mov	x0, x19
	mov	w1, #898
	mov	w2, #0
	bl	_dib7000m_write_word
	mov	x0, x19
	mov	w1, #899
	mov	w2, #0
	bl	_dib7000m_write_word
	mov	x0, x19
	mov	w1, #900
	mov	w2, #0
	bl	_dib7000m_write_word
	mov	x0, x19
	mov	w1, #901
	mov	w2, #0
	bl	_dib7000m_write_word
	ldr	w8, [x19]
	mov	x0, x19
	cmp	w8, #4, lsl #12                 ; =16384
	b.ne	LBB0_2
; %bb.1:
	bl	_dib7000m_reset_pll
	b	LBB0_3
LBB0_2:
	bl	_dib7000mc_reset_pll
LBB0_3:
	mov	x0, x19
	bl	_dib7000m_reset_gpio
	cbz	x0, LBB0_5
; %bb.4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
LBB0_5:
Lloh8:
	adrp	x8, _OUTMODE_HIGH_Z@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OUTMODE_HIGH_Z@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dib7000m_set_output_mode
	cbz	x0, LBB0_7
; %bb.6:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintk
LBB0_7:
	mov	x0, x19
	mov	w1, #1794
	bl	_dib7000m_read_word
	and	w2, w0, #0xfffffffd
	mov	x0, x19
	mov	w1, #1794
	bl	_dib7000m_write_word
	mov	x0, x19
	mov	w1, #8000
	bl	_dib7000m_set_bandwidth
Lloh13:
	adrp	x8, _DIBX000_SLOW_ADC_ON@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DIBX000_SLOW_ADC_ON@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dib7000m_set_adc_state
	mov	x0, x19
	bl	_dib7000m_sad_calib
Lloh16:
	adrp	x8, _DIBX000_SLOW_ADC_OFF@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DIBX000_SLOW_ADC_OFF@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dib7000m_set_adc_state
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x19
	mov	w1, #1796
	mov	w2, #0
	bl	_dib7000m_write_word
LBB0_9:
	ldr	x8, [x19, #24]
	ldr	w9, [x19, #4]
	cmp	x8, #0
	mov	w8, #261
	mov	w10, #224
	csel	w8, w10, w8, eq
	mov	w10, #1
	cinc	w2, w10, ne
	add	w1, w9, w8
	mov	x0, x19
	bl	_dib7000m_write_word
	ldr	x8, [x19, #16]
	cmp	x8, #0
	mov	w8, #1877
	mov	w9, #8021
	csel	w2, w9, w8, eq
	mov	x0, x19
	mov	w1, #36
	bl	_dib7000m_write_word
	ldr	w8, [x19]
	mov	w9, #49
	mov	w10, #3136
	cmp	w8, #4, lsl #12                 ; =16384
	csel	w2, w10, w9, eq
	mov	x0, x19
	mov	w1, #909
	bl	_dib7000m_write_word
Lloh19:
	adrp	x8, _dib7000m_defaults_common@GOTPAGE
Lloh20:
	ldr	x8, [x8, _dib7000m_defaults_common@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dib7000m_write_tab
Lloh22:
	adrp	x8, _dib7000m_defaults@GOTPAGE
Lloh23:
	ldr	x8, [x8, _dib7000m_defaults@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dib7000m_write_tab
Lloh25:
	adrp	x8, _DIB7000M_POWER_INTERFACE_ONLY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DIB7000M_POWER_INTERFACE_ONLY@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dib7000m_set_power_mode
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	str	w8, [x19, #40]
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_DIB7000M_POWER_ALL,4,2         ; @DIB7000M_POWER_ALL
	.comm	_DIBX000_VBG_ENABLE,4,2         ; @DIBX000_VBG_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPIO reset was not successful.\n"

	.comm	_OUTMODE_HIGH_Z,4,2             ; @OUTMODE_HIGH_Z
l_.str.1:                               ; @.str.1
	.asciz	"OUTPUT_MODE could not be reset.\n"

	.comm	_DIBX000_SLOW_ADC_ON,4,2        ; @DIBX000_SLOW_ADC_ON
	.comm	_DIBX000_SLOW_ADC_OFF,4,2       ; @DIBX000_SLOW_ADC_OFF
	.comm	_dib7000m_defaults_common,4,2   ; @dib7000m_defaults_common
	.comm	_dib7000m_defaults,4,2          ; @dib7000m_defaults
	.comm	_DIB7000M_POWER_INTERFACE_ONLY,4,2 ; @DIB7000M_POWER_INTERFACE_ONLY
	.no_dead_strip	_dib7000m_demod_reset
.subsections_via_symbols
