	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl88e_dm_antenna_diversity
_rtl88e_dm_antenna_diversity:           ## @rtl88e_dm_antenna_diversity
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_rtl_priv
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_rtl_priv
	movq	%rax, %rdi
	callq	_rtl_mac
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_rtl_priv
	movq	%rax, %rdi
	callq	_rtl_efuse
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_rtl_priv
	movq	%rax, %rdi
	callq	_rtl_dm
	movq	%rax, %r15
	movq	(%r14), %rax
	movq	_MAC80211_LINKED@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jge	LBB0_5
## %bb.1:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_COMP_DIG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_DBG_LOUD@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rcx
	movq	%r13, %rdi
	callq	_RT_TRACE
	cmpl	$0, (%r15)
	je	LBB0_12
## %bb.2:
	movl	(%r12), %esi
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rcx
	movq	%r13, %rdi
	callq	_RT_TRACE
	movq	_DM_REG_IGI_A_11N@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$7, %edi
	callq	_BIT
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_rtl_set_bbreg
	movq	_DM_REG_CCK_ANTDIV_PARA1_11N@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$15, %edi
	callq	_BIT
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_rtl_set_bbreg
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_CG_TRX_HW_ANTDIV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	_DM_REG_TX_ANT_CTRL_11N@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	$21, %edi
	callq	_BIT
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_rtl_set_bbreg
LBB0_4:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	xorl	%ecx, %ecx
	movq	_MAC80211_LINKED@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%cl
	movl	%ecx, (%r15)
	jmp	LBB0_12
LBB0_5:
	cmpl	$0, (%r15)
	jne	LBB0_9
## %bb.6:
	movq	_COMP_DIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DBG_LOUD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rcx
	movq	%r13, %rdi
	callq	_RT_TRACE
	movq	_DM_REG_IGI_A_11N@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$7, %edi
	callq	_BIT
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movl	$1, %ecx
	callq	_rtl_set_bbreg
	movq	_DM_REG_CCK_ANTDIV_PARA1_11N@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$15, %edi
	callq	_BIT
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movl	$1, %ecx
	callq	_rtl_set_bbreg
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_CG_TRX_HW_ANTDIV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	movq	_DM_REG_TX_ANT_CTRL_11N@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$21, %edi
	callq	_BIT
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movl	$1, %ecx
	callq	_rtl_set_bbreg
LBB0_8:
	movq	(%r14), %rax
	xorl	%ecx, %ecx
	cmpq	(%r12), %rax
	setge	%cl
	movl	%ecx, (%r15)
LBB0_9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_CG_TRX_HW_ANTDIV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.10:
	movq	_CGCS_RX_HW_ANTDIV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.11:
	movq	_CG_TRX_SMART_ANTDIV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.14:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rtl88e_dm_fast_ant_training    ## TAILCALL
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rtl88e_dm_hw_ant_div           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAC80211_LINKED,8,3            ## @MAC80211_LINKED
	.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"

L_.str.1:                               ## @.str.1
	.asciz	"need to turn off HW AntDiv\n"

	.comm	_DM_REG_IGI_A_11N,4,2           ## @DM_REG_IGI_A_11N
	.comm	_DM_REG_CCK_ANTDIV_PARA1_11N,4,2 ## @DM_REG_CCK_ANTDIV_PARA1_11N
	.comm	_CG_TRX_HW_ANTDIV,8,3           ## @CG_TRX_HW_ANTDIV
	.comm	_DM_REG_TX_ANT_CTRL_11N,4,2     ## @DM_REG_TX_ANT_CTRL_11N
L_.str.2:                               ## @.str.2
	.asciz	"Need to turn on HW AntDiv\n"

	.comm	_CGCS_RX_HW_ANTDIV,8,3          ## @CGCS_RX_HW_ANTDIV
	.comm	_CG_TRX_SMART_ANTDIV,8,3        ## @CG_TRX_SMART_ANTDIV
	.no_dead_strip	_rtl88e_dm_antenna_diversity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl88e_dm_antenna_diversity
_rtl88e_dm_antenna_diversity:           ; @rtl88e_dm_antenna_diversity
	.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	x19, x0
	bl	_rtl_priv
	mov	x23, x0
	mov	x0, x19
	bl	_rtl_priv
	bl	_rtl_mac
	mov	x20, x0
	mov	x0, x19
	bl	_rtl_priv
	bl	_rtl_efuse
	mov	x22, x0
	mov	x0, x19
	bl	_rtl_priv
	bl	_rtl_dm
	mov	x21, x0
	ldr	x8, [x20]
Lloh0:
	adrp	x24, _MAC80211_LINKED@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MAC80211_LINKED@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ge	LBB0_5
; %bb.1:
Lloh2:
	adrp	x25, _COMP_DIG@GOTPAGE
Lloh3:
	ldr	x25, [x25, _COMP_DIG@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh4:
	adrp	x26, _DBG_LOUD@GOTPAGE
Lloh5:
	ldr	x26, [x26, _DBG_LOUD@GOTPAGEOFF]
	ldr	w2, [x26]
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x23
	bl	_RT_TRACE
	ldr	w8, [x21]
	cbz	w8, LBB0_13
; %bb.2:
	ldr	w1, [x25]
	ldr	w2, [x26]
Lloh8:
	adrp	x3, l_.str.1@PAGE
Lloh9:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_RT_TRACE
Lloh10:
	adrp	x8, _DM_REG_IGI_A_11N@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DM_REG_IGI_A_11N@GOTPAGEOFF]
Lloh12:
	ldr	w23, [x8]
	mov	w0, #7
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	mov	w3, #0
	bl	_rtl_set_bbreg
Lloh13:
	adrp	x8, _DM_REG_CCK_ANTDIV_PARA1_11N@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DM_REG_CCK_ANTDIV_PARA1_11N@GOTPAGEOFF]
Lloh15:
	ldr	w23, [x8]
	mov	w0, #15
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	mov	w3, #0
	bl	_rtl_set_bbreg
	ldr	x8, [x22]
Lloh16:
	adrp	x9, _CG_TRX_HW_ANTDIV@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CG_TRX_HW_ANTDIV@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
Lloh19:
	adrp	x8, _DM_REG_TX_ANT_CTRL_11N@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DM_REG_TX_ANT_CTRL_11N@GOTPAGEOFF]
Lloh21:
	ldr	w22, [x8]
	mov	w0, #21
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x22
	mov	w3, #0
	bl	_rtl_set_bbreg
LBB0_4:
	ldr	x8, [x20]
	ldr	x9, [x24]
	cmp	x8, x9
	cset	w8, eq
	str	w8, [x21]
	b	LBB0_13
LBB0_5:
	ldr	w8, [x21]
Lloh22:
	adrp	x25, _CG_TRX_HW_ANTDIV@GOTPAGE
Lloh23:
	ldr	x25, [x25, _CG_TRX_HW_ANTDIV@GOTPAGEOFF]
	cbnz	w8, LBB0_9
; %bb.6:
Lloh24:
	adrp	x8, _COMP_DIG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _COMP_DIG@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x8, _DBG_LOUD@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DBG_LOUD@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
Lloh30:
	adrp	x3, l_.str.2@PAGE
Lloh31:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x23
	bl	_RT_TRACE
Lloh32:
	adrp	x8, _DM_REG_IGI_A_11N@GOTPAGE
Lloh33:
	ldr	x8, [x8, _DM_REG_IGI_A_11N@GOTPAGEOFF]
Lloh34:
	ldr	w23, [x8]
	mov	w0, #7
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	mov	w3, #1
	bl	_rtl_set_bbreg
Lloh35:
	adrp	x8, _DM_REG_CCK_ANTDIV_PARA1_11N@GOTPAGE
Lloh36:
	ldr	x8, [x8, _DM_REG_CCK_ANTDIV_PARA1_11N@GOTPAGEOFF]
Lloh37:
	ldr	w23, [x8]
	mov	w0, #15
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	mov	w3, #1
	bl	_rtl_set_bbreg
	ldr	x8, [x22]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
Lloh38:
	adrp	x8, _DM_REG_TX_ANT_CTRL_11N@GOTPAGE
Lloh39:
	ldr	x8, [x8, _DM_REG_TX_ANT_CTRL_11N@GOTPAGEOFF]
Lloh40:
	ldr	w23, [x8]
	mov	w0, #21
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	mov	w3, #1
	bl	_rtl_set_bbreg
LBB0_8:
	ldr	x8, [x20]
	ldr	x9, [x24]
	cmp	x8, x9
	cset	w8, ge
	str	w8, [x21]
LBB0_9:
	ldr	x8, [x22]
	ldr	x9, [x25]
Lloh41:
	adrp	x10, _CGCS_RX_HW_ANTDIV@GOTPAGE
Lloh42:
	ldr	x10, [x10, _CGCS_RX_HW_ANTDIV@GOTPAGEOFF]
Lloh43:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x19
	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
	b	_rtl88e_dm_hw_ant_div
LBB0_11:
Lloh44:
	adrp	x9, _CG_TRX_SMART_ANTDIV@GOTPAGE
Lloh45:
	ldr	x9, [x9, _CG_TRX_SMART_ANTDIV@GOTPAGEOFF]
Lloh46:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x19
	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
	b	_rtl88e_dm_fast_ant_training
LBB0_13:
	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	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_MAC80211_LINKED,8,3            ; @MAC80211_LINKED
	.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"

l_.str.1:                               ; @.str.1
	.asciz	"need to turn off HW AntDiv\n"

	.comm	_DM_REG_IGI_A_11N,4,2           ; @DM_REG_IGI_A_11N
	.comm	_DM_REG_CCK_ANTDIV_PARA1_11N,4,2 ; @DM_REG_CCK_ANTDIV_PARA1_11N
	.comm	_CG_TRX_HW_ANTDIV,8,3           ; @CG_TRX_HW_ANTDIV
	.comm	_DM_REG_TX_ANT_CTRL_11N,4,2     ; @DM_REG_TX_ANT_CTRL_11N
l_.str.2:                               ; @.str.2
	.asciz	"Need to turn on HW AntDiv\n"

	.comm	_CGCS_RX_HW_ANTDIV,8,3          ; @CGCS_RX_HW_ANTDIV
	.comm	_CG_TRX_SMART_ANTDIV,8,3        ; @CG_TRX_SMART_ANTDIV
	.no_dead_strip	_rtl88e_dm_antenna_diversity
.subsections_via_symbols
