	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8723be_dm_dig
_rtl8723be_dm_dig:                      ## @rtl8723be_dm_dig
	.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, %r14
	callq	_rtl_priv
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_rtl_priv
	movq	%rax, %rdi
	callq	_rtl_mac
	cmpq	$0, 8(%rax)
	jne	LBB0_41
## %bb.1:
	movq	%rax, %r15
	movl	16(%rbx), %r9d
	movq	(%rax), %rcx
	movq	_MAC80211_LINKED@GOTPCREL(%rip), %rdx
	movl	24(%rbx), %eax
	cmpq	(%rdx), %rcx
	jge	LBB0_2
## %bb.10:
	testl	%eax, %eax
	setne	%al
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_DM_DIG_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_DM_DIG_MAX_AP@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	$90, 32(%rbx)
	movq	_COMP_DIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DBG_LOUD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rcx
	movq	%rbx, %rdi
	movq	%r9, %r13
	callq	_RT_TRACE
	movq	%r13, %r9
	xorl	%r8d, %r8d
	jmp	LBB0_11
LBB0_2:
	testl	%eax, %eax
	sete	%r8b
	movq	_DM_DIG_MIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	movq	_DM_DIG_MAX_AP@GOTPCREL(%rip), %rdx
	movl	28(%rbx), %ecx
	cmpl	$81, %ecx
	jl	LBB0_4
## %bb.3:
	movl	$90, 32(%rbx)
	jmp	LBB0_7
LBB0_4:
	leal	10(%rcx), %esi
	cmpl	%eax, %esi
	jge	LBB0_6
## %bb.5:
	movl	%eax, 32(%rbx)
	jmp	LBB0_7
LBB0_6:
	movl	%esi, 32(%rbx)
LBB0_7:
	movl	(%rdx), %r12d
	cmpq	$0, 8(%rbx)
	je	LBB0_8
## %bb.9:
	addl	$-12, %ecx
	cmpl	%r12d, %ecx
	movl	%r12d, %edx
	cmovll	%ecx, %edx
	cmpl	%eax, %ecx
	cmovgel	%edx, %eax
LBB0_8:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
LBB0_11:
	movl	(%rbx), %ecx
	cmpl	$10001, %ecx                    ## imm = 0x2711
	jl	LBB0_18
## %bb.12:
	movl	36(%rbx), %esi
	cmpl	$3, %esi
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jne	LBB0_13
## %bb.16:
	movl	40(%rbx), %edx
	cmpl	%r9d, %edx
	jl	LBB0_17
	jmp	LBB0_15
LBB0_18:
	movl	48(%rbx), %edx
	testl	%edx, %edx
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_20
## %bb.19:
	decl	%edx
	movl	%edx, 48(%rbx)
	jmp	LBB0_25
LBB0_13:
	leal	1(%rsi), %edx
	movl	%edx, 36(%rbx)
	movl	40(%rbx), %edx
	cmpl	%r9d, %edx
	jge	LBB0_14
LBB0_17:
	movl	%r9d, 40(%rbx)
	movl	$1, 36(%rbx)
	jmp	LBB0_25
LBB0_20:
	cmpl	$2, 36(%rbx)
	jg	LBB0_24
## %bb.21:
	movl	40(%rbx), %edx
	cmpl	%r13d, %edx
	jle	LBB0_22
## %bb.23:
	leal	-1(%rdx), %esi
	movl	%esi, 40(%rbx)
	movl	%edx, 44(%rbx)
	jmp	LBB0_25
LBB0_14:
	cmpl	$2, %esi
	jl	LBB0_25
LBB0_15:
	movl	32(%rbx), %esi
	leal	1(%rdx), %edi
	cmpl	%esi, %edx
	cmovgel	%esi, %edi
	movl	%edi, 44(%rbx)
	movl	$3600, 48(%rbx)                 ## imm = 0xE10
	jmp	LBB0_25
LBB0_24:
	movl	$0, 36(%rbx)
	jmp	LBB0_25
LBB0_22:
	movl	%r13d, 40(%rbx)
	movl	%r13d, 44(%rbx)
LBB0_25:
	movl	32(%rbx), %edx
	movl	44(%rbx), %esi
	cmpl	%edx, %esi
	jle	LBB0_27
## %bb.26:
	movl	%edx, 44(%rbx)
	movl	%edx, %esi
LBB0_27:
	movq	(%r15), %rdi
	movq	_MAC80211_LINKED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jge	LBB0_28
## %bb.35:
	movl	%esi, %r12d
	cmpb	$0, -48(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_40
## %bb.36:
	cmpl	$10001, %ecx                    ## imm = 0x2711
	jge	LBB0_31
## %bb.37:
	cmpl	$8001, %ecx                     ## imm = 0x1F41
	jge	LBB0_33
## %bb.38:
	leal	-2(%r9), %r12d
	cmpl	$500, %ecx                      ## imm = 0x1F4
	jmp	LBB0_39
LBB0_28:
	testb	%r8b, %r8b
	je	LBB0_30
## %bb.29:
	movl	28(%rbx), %eax
	cmpl	%r12d, %eax
	cmovll	%eax, %r12d
	movl	$0, 36(%rbx)
	jmp	LBB0_40
LBB0_30:
	movq	_DM_DIG_FA_TH2@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jle	LBB0_32
LBB0_31:
	addl	$4, %r9d
	movl	%r9d, %r12d
	jmp	LBB0_40
LBB0_32:
	movq	_DM_DIG_FA_TH1@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jle	LBB0_34
LBB0_33:
	addl	$2, %r9d
	movl	%r9d, %r12d
	jmp	LBB0_40
LBB0_34:
	movq	_DM_DIG_FA_TH0@GOTPCREL(%rip), %rax
	leal	-2(%r9), %r12d
	cmpl	(%rax), %ecx
LBB0_39:
	cmovgel	%r9d, %r12d
LBB0_40:
	cmpl	%esi, %r12d
	cmovgl	%r12d, %esi
	cmpl	%edx, %r12d
	cmovgl	%edx, %esi
	movq	%r14, %rdi
	callq	_rtl8723be_dm_write_dig
	movq	(%r15), %rax
	xorl	%ecx, %ecx
	movq	_MAC80211_LINKED@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	setge	%cl
	movl	%ecx, 24(%rbx)
	movl	%r13d, 20(%rbx)
LBB0_41:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAC80211_LINKED,8,3            ## @MAC80211_LINKED
	.comm	_DM_DIG_MIN,4,2                 ## @DM_DIG_MIN
	.comm	_DM_DIG_MAX_AP,4,2              ## @DM_DIG_MAX_AP
	.comm	_COMP_DIG,4,2                   ## @COMP_DIG
	.comm	_DBG_LOUD,4,2                   ## @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no link\n"

	.comm	_DM_DIG_FA_TH2,4,2              ## @DM_DIG_FA_TH2
	.comm	_DM_DIG_FA_TH1,4,2              ## @DM_DIG_FA_TH1
	.comm	_DM_DIG_FA_TH0,4,2              ## @DM_DIG_FA_TH0
	.no_dead_strip	_rtl8723be_dm_dig
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8723be_dm_dig
_rtl8723be_dm_dig:                      ; @rtl8723be_dm_dig
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x0
	bl	_rtl_priv
	mov	x19, x0
	mov	x0, x20
	bl	_rtl_priv
	bl	_rtl_mac
	ldr	x8, [x0, #8]
	cbnz	x8, LBB0_35
; %bb.1:
	mov	x21, x0
	ldr	w23, [x19, #16]
	ldr	x11, [x0]
Lloh0:
	adrp	x22, _MAC80211_LINKED@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MAC80211_LINKED@GOTPAGEOFF]
	ldr	x12, [x22]
	ldr	w8, [x19, #24]
Lloh2:
	adrp	x9, _DM_DIG_MIN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DM_DIG_MIN@GOTPAGEOFF]
Lloh4:
	adrp	x10, _DM_DIG_MAX_AP@GOTPAGE
Lloh5:
	ldr	x10, [x10, _DM_DIG_MAX_AP@GOTPAGEOFF]
	cmp	x11, x12
	b.ge	LBB0_3
; %bb.2:
	cmp	w8, #0
	cset	w26, ne
	ldr	w24, [x9]
	ldr	w25, [x10]
	mov	w8, #90
	str	w8, [x19, #32]
Lloh6:
	adrp	x8, _COMP_DIG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _COMP_DIG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _DBG_LOUD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DBG_LOUD@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x3, l_.str@PAGE
Lloh13:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_RT_TRACE
	mov	w8, #0
	b	LBB0_9
LBB0_3:
	cmp	w8, #0
	cset	w8, eq
	ldr	w9, [x9]
	ldr	w25, [x10]
	ldr	w10, [x19, #28]
	cmp	w10, #81
	b.lt	LBB0_5
; %bb.4:
	mov	w11, #90
	b	LBB0_7
LBB0_5:
	add	w11, w10, #10
	cmp	w11, w9
	b.ge	LBB0_7
; %bb.6:
	str	w9, [x19, #32]
	b	LBB0_8
LBB0_7:
	str	w11, [x19, #32]
LBB0_8:
	ldr	x11, [x19, #8]
	sub	w10, w10, #12
	cmp	w10, w25
	csel	w12, w10, w25, lt
	cmp	w10, w9
	csel	w10, w9, w12, lt
	cmp	x11, #0
	csel	w26, wzr, wzr, eq
	csel	w24, w9, w10, eq
LBB0_9:
	ldr	w9, [x19]
	mov	w10, #10001
	cmp	w9, w10
	b.lt	LBB0_12
; %bb.10:
	ldr	w11, [x19, #36]
	cmp	w11, #3
	b.ne	LBB0_14
; %bb.11:
	ldr	w10, [x19, #40]
	cmp	w10, w23
	b.lt	LBB0_15
	b	LBB0_20
LBB0_12:
	ldr	w10, [x19, #48]
	cbz	w10, LBB0_16
; %bb.13:
	sub	w10, w10, #1
	str	w10, [x19, #48]
	b	LBB0_23
LBB0_14:
	add	w10, w11, #1
	str	w10, [x19, #36]
	ldr	w10, [x19, #40]
	cmp	w10, w23
	b.ge	LBB0_19
LBB0_15:
	mov	w10, #1
	stp	w10, w23, [x19, #36]
	b	LBB0_23
LBB0_16:
	ldr	w10, [x19, #36]
	cmp	w10, #2
	b.gt	LBB0_21
; %bb.17:
	ldr	w10, [x19, #40]
	cmp	w10, w24
	b.le	LBB0_22
; %bb.18:
	sub	w11, w10, #1
	stp	w11, w10, [x19, #40]
	b	LBB0_23
LBB0_19:
	cmp	w11, #2
	b.lt	LBB0_23
LBB0_20:
	ldr	w11, [x19, #32]
	cmp	w10, w11
	csinc	w10, w11, w10, ge
	mov	w11, #3600
	stp	w10, w11, [x19, #44]
	b	LBB0_23
LBB0_21:
	str	wzr, [x19, #36]
	b	LBB0_23
LBB0_22:
	stp	w24, w24, [x19, #40]
LBB0_23:
	ldr	w11, [x19, #44]
	ldr	w10, [x19, #32]
	cmp	w11, w10
	b.le	LBB0_25
; %bb.24:
	str	w10, [x19, #44]
	mov	x11, x10
LBB0_25:
	ldr	x12, [x21]
	ldr	x13, [x22]
	cmp	x12, x13
	b.ge	LBB0_27
; %bb.26:
	mov	w8, #10001
	mov	w12, #8001
	sub	w13, w23, #2
	cmp	w9, #500
	csel	w13, w13, w23, lt
	add	w14, w23, #2
	cmp	w9, w12
	csel	w12, w13, w14, lt
	add	w13, w23, #4
	cmp	w9, w8
	csel	w8, w12, w13, lt
	tst	w26, #0x1
	csel	w8, w11, w8, ne
	b	LBB0_34
LBB0_27:
	cbz	w8, LBB0_29
; %bb.28:
	ldr	w8, [x19, #28]
	cmp	w8, w25
	csel	w8, w8, w25, lt
	str	wzr, [x19, #36]
	b	LBB0_34
LBB0_29:
Lloh14:
	adrp	x8, _DM_DIG_FA_TH2@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DM_DIG_FA_TH2@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w9, w8
	b.le	LBB0_31
; %bb.30:
	add	w8, w23, #4
	b	LBB0_34
LBB0_31:
Lloh17:
	adrp	x8, _DM_DIG_FA_TH1@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DM_DIG_FA_TH1@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w9, w8
	b.le	LBB0_33
; %bb.32:
	add	w8, w23, #2
	b	LBB0_34
LBB0_33:
Lloh20:
	adrp	x8, _DM_DIG_FA_TH0@GOTPAGE
Lloh21:
	ldr	x8, [x8, _DM_DIG_FA_TH0@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	sub	w12, w23, #2
	cmp	w9, w8
	csel	w8, w12, w23, lt
LBB0_34:
	cmp	w8, w11
	csel	w9, w8, w11, gt
	cmp	w8, w10
	csel	w1, w10, w9, gt
	mov	x0, x20
	bl	_rtl8723be_dm_write_dig
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmp	x8, x9
	cset	w8, ge
	stp	w24, w8, [x19, #20]
LBB0_35:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MAC80211_LINKED,8,3            ; @MAC80211_LINKED
	.comm	_DM_DIG_MIN,4,2                 ; @DM_DIG_MIN
	.comm	_DM_DIG_MAX_AP,4,2              ; @DM_DIG_MAX_AP
	.comm	_COMP_DIG,4,2                   ; @COMP_DIG
	.comm	_DBG_LOUD,4,2                   ; @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no link\n"

	.comm	_DM_DIG_FA_TH2,4,2              ; @DM_DIG_FA_TH2
	.comm	_DM_DIG_FA_TH1,4,2              ; @DM_DIG_FA_TH1
	.comm	_DM_DIG_FA_TH0,4,2              ; @DM_DIG_FA_TH0
	.no_dead_strip	_rtl8723be_dm_dig
.subsections_via_symbols
