	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib0090_wbd_calibration
_dib0090_wbd_calibration:               ## @dib0090_wbd_calibration
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rsi), %eax
	xorl	%r15d, %r15d
	cmpl	$128, %eax
	je	LBB0_6
## %bb.1:
	cmpl	$129, %eax
	jne	LBB0_8
## %bb.2:
	movq	24(%rbx), %rax
	movslq	(%rbx), %rcx
	imulq	$274877907, %rcx, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdx
	addq	$8, %rax
	cmpl	(%rdx), %ecx
	jg	LBB0_3
## %bb.4:
	movl	-4(%rax), %eax
	testl	%eax, %eax
	movl	$4, %r12d
	cmovnel	%eax, %r12d
	cmpl	4(%rbx), %r12d
	je	LBB0_7
## %bb.5:
	movl	%r12d, %edx
	shll	$13, %edx
	orl	$8073, %edx                     ## imm = 0x1F89
	movq	%rbx, %rdi
	movl	$16, %esi
	callq	_dib0090_write_reg
	movq	_EN_UHF@GOTPCREL(%rip), %rax
	movl	$4093, %edx                     ## imm = 0xFFD
	andl	(%rax), %edx
	orl	$2, %edx
	movq	%rbx, %rdi
	movl	$36, %esi
	callq	_dib0090_write_reg
	movl	$128, (%r14)
	movl	%r12d, 4(%rbx)
	movl	$90, %r15d
	jmp	LBB0_8
LBB0_6:
	movq	%rbx, %rdi
	callq	_dib0090_get_slow_adc_val
	movl	%eax, 12(%rbx)
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_dprintk
LBB0_7:
	movl	$129, (%r14)
	movq	_WBD_CAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 8(%rbx)
LBB0_8:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WBD_CAL,4,2                    ## @WBD_CAL
	.comm	_EN_UHF,4,2                     ## @EN_UHF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WBD calibration offset = %d\n"

	.comm	_BAND_LBAND,4,2                 ## @BAND_LBAND
	.comm	_BAND_SBAND,4,2                 ## @BAND_SBAND
	.no_dead_strip	_dib0090_wbd_calibration
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib0090_wbd_calibration
_dib0090_wbd_calibration:               ; @dib0090_wbd_calibration
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x1]
	cmp	w8, #128
	b.eq	LBB0_6
; %bb.1:
	cmp	w8, #129
	b.ne	LBB0_8
; %bb.2:
	ldr	x8, [x19, #24]
	ldrsw	x9, [x19]
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8], #8
	cmp	w9, w10
	b.gt	LBB0_3
; %bb.4:
	ldur	w8, [x8, #-4]
	mov	w9, #4
	cmp	w8, #0
	csel	w21, w9, w8, eq
	ldr	w8, [x19, #4]
	cmp	w21, w8
	b.eq	LBB0_7
; %bb.5:
	mov	w2, #8073
	bfi	w2, w21, #13, #19
	mov	x0, x19
	mov	w1, #16
	bl	_dib0090_write_reg
Lloh0:
	adrp	x8, _EN_UHF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EN_UHF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, #0xfff
	orr	w2, w8, #0x2
	mov	x0, x19
	mov	w1, #36
	bl	_dib0090_write_reg
	mov	w8, #128
	str	w8, [x20]
	str	w21, [x19, #4]
	mov	w0, #90
	b	LBB0_9
LBB0_6:
	mov	x0, x19
	bl	_dib0090_get_slow_adc_val
	mov	x1, x0
	str	w0, [x19, #12]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
LBB0_7:
	mov	w0, #0
	mov	w8, #129
	str	w8, [x20]
Lloh5:
	adrp	x8, _WBD_CAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WBD_CAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	bic	w8, w9, w8
	str	w8, [x19, #8]
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_WBD_CAL,4,2                    ; @WBD_CAL
	.comm	_EN_UHF,4,2                     ; @EN_UHF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WBD calibration offset = %d\n"

	.comm	_BAND_LBAND,4,2                 ; @BAND_LBAND
	.comm	_BAND_SBAND,4,2                 ; @BAND_SBAND
	.no_dead_strip	_dib0090_wbd_calibration
.subsections_via_symbols
