	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_config_ant              ## -- Begin function rt2800_config_ant
	.p2align	4, 0x90
_rt2800_config_ant:                     ## @rt2800_config_ant
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	$1, %esi
	callq	_rt2800_bbp_read
	movl	%eax, -32(%rbp)
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_rt2800_bbp_read
	movl	%eax, -28(%rbp)
	movq	_RT3572@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_rt2x00_has_cap_bt_coexist
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_rt2800_config_3572bt_ant
LBB0_3:
	movl	(%r14), %eax
	cmpl	$1, %eax
	je	LBB0_4
## %bb.5:
	cmpl	$3, %eax
	je	LBB0_9
## %bb.6:
	cmpl	$2, %eax
	jne	LBB0_11
## %bb.7:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_rt2x00_has_cap_bt_coexist
	movl	$1, %edx
	testq	%rax, %rax
	jne	LBB0_10
LBB0_9:
	movl	$2, %edx
	jmp	LBB0_10
LBB0_4:
	xorl	%edx, %edx
LBB0_10:
	movq	_BBP1_TX_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdi
	callq	_rt2x00_set_field8
LBB0_11:
	movl	4(%r14), %eax
	cmpl	$3, %eax
	je	LBB0_25
## %bb.12:
	cmpl	$2, %eax
	je	LBB0_21
## %bb.13:
	cmpl	$1, %eax
	jne	LBB0_27
## %bb.14:
	movq	_RT3070@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_18
## %bb.15:
	movq	_RT3090@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_18
## %bb.16:
	movq	_RT3352@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_18
## %bb.17:
	movq	_RT3390@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	je	LBB0_20
LBB0_18:
	movq	_EEPROM_NIC_CONF1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2800_eeprom_read
	movq	_EEPROM_NIC_CONF1_ANT_DIVERSITY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field16
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:
	movl	4(%rbx), %esi
	movq	%rbx, %rdi
	callq	_rt2800_set_ant_diversity
LBB0_20:
	movq	_BBP3_RX_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdi
	xorl	%edx, %edx
	jmp	LBB0_26
LBB0_25:
	movq	_BBP3_RX_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdi
	movl	$2, %edx
	jmp	LBB0_26
LBB0_21:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	je	LBB0_24
## %bb.22:
	movq	%rbx, %rdi
	callq	_rt2x00_has_cap_bt_coexist
	testq	%rax, %rax
	je	LBB0_24
## %bb.23:
	movq	_BBP3_RX_ADC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %r15
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field8
	movq	_BBP3_RX_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %eax
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpl	(%rcx), %eax
	sete	%dl
	movq	%r15, %rdi
	callq	_rt2x00_set_field8
	movq	_ANTENNA_B@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2800_set_ant_diversity
	jmp	LBB0_27
LBB0_24:
	movq	_BBP3_RX_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdi
	movl	$1, %edx
LBB0_26:
	callq	_rt2x00_set_field8
LBB0_27:
	movl	-28(%rbp), %edx
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_rt2800_bbp_write
	movl	-32(%rbp), %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_rt2800_bbp_write
	movq	_RT3593@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_29
## %bb.28:
	movq	_RT3883@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	je	LBB0_30
LBB0_29:
	xorl	%eax, %eax
	cmpl	$1, 4(%r14)
	movl	$70, %edx
	cmovel	%eax, %edx
	movq	%rbx, %rdi
	movl	$86, %esi
	callq	_rt2800_bbp_write
LBB0_30:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RT3572,4,2                     ## @RT3572
	.comm	_BBP1_TX_ANTENNA,4,2            ## @BBP1_TX_ANTENNA
	.comm	_RT3070,4,2                     ## @RT3070
	.comm	_RT3090,4,2                     ## @RT3090
	.comm	_RT3352,4,2                     ## @RT3352
	.comm	_RT3390,4,2                     ## @RT3390
	.comm	_EEPROM_NIC_CONF1,4,2           ## @EEPROM_NIC_CONF1
	.comm	_EEPROM_NIC_CONF1_ANT_DIVERSITY,4,2 ## @EEPROM_NIC_CONF1_ANT_DIVERSITY
	.comm	_BBP3_RX_ANTENNA,4,2            ## @BBP3_RX_ANTENNA
	.comm	_BBP3_RX_ADC,4,2                ## @BBP3_RX_ADC
	.comm	_NL80211_BAND_5GHZ,4,2          ## @NL80211_BAND_5GHZ
	.comm	_ANTENNA_B,4,2                  ## @ANTENNA_B
	.comm	_RT3593,4,2                     ## @RT3593
	.comm	_RT3883,4,2                     ## @RT3883
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_config_ant              ; -- Begin function rt2800_config_ant
	.p2align	2
_rt2800_config_ant:                     ; @rt2800_config_ant
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	mov	w1, #1
	bl	_rt2800_bbp_read
	str	w0, [sp, #12]
	mov	x0, x19
	mov	w1, #3
	bl	_rt2800_bbp_read
	str	w0, [sp, #8]
Lloh0:
	adrp	x21, _RT3572@GOTPAGE
Lloh1:
	ldr	x21, [x21, _RT3572@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rt2x00_rt
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_rt2x00_has_cap_bt_coexist
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_rt2800_config_3572bt_ant
LBB0_3:
	ldr	w8, [x20]
	cmp	w8, #1
	b.eq	LBB0_10
; %bb.4:
	cmp	w8, #3
	b.eq	LBB0_9
; %bb.5:
	cmp	w8, #2
	b.ne	LBB0_12
; %bb.6:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rt2x00_rt
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x19
	bl	_rt2x00_has_cap_bt_coexist
	cbz	x0, LBB0_9
; %bb.8:
	mov	w2, #1
	b	LBB0_11
LBB0_9:
	mov	w2, #2
	b	LBB0_11
LBB0_10:
	mov	w2, #0
LBB0_11:
Lloh2:
	adrp	x8, _BBP1_TX_ANTENNA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BBP1_TX_ANTENNA@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x0, sp, #12
	bl	_rt2x00_set_field8
LBB0_12:
	ldr	w8, [x20, #4]
	cmp	w8, #3
	b.eq	LBB0_22
; %bb.13:
	cmp	w8, #2
	b.eq	LBB0_23
; %bb.14:
	cmp	w8, #1
	b.ne	LBB0_28
; %bb.15:
Lloh5:
	adrp	x8, _RT3070@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RT3070@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cbnz	x0, LBB0_19
; %bb.16:
Lloh8:
	adrp	x8, _RT3090@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RT3090@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cbnz	x0, LBB0_19
; %bb.17:
Lloh11:
	adrp	x8, _RT3352@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RT3352@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cbnz	x0, LBB0_19
; %bb.18:
Lloh14:
	adrp	x8, _RT3390@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RT3390@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cbz	x0, LBB0_21
LBB0_19:
Lloh17:
	adrp	x8, _EEPROM_NIC_CONF1@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EEPROM_NIC_CONF1@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2800_eeprom_read
Lloh20:
	adrp	x8, _EEPROM_NIC_CONF1_ANT_DIVERSITY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EEPROM_NIC_CONF1_ANT_DIVERSITY@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_rt2x00_get_field16
	cbz	w0, LBB0_21
; %bb.20:
	ldr	w1, [x19, #4]
	mov	x0, x19
	bl	_rt2800_set_ant_diversity
LBB0_21:
Lloh23:
	adrp	x8, _BBP3_RX_ANTENNA@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BBP3_RX_ANTENNA@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	b	LBB0_27
LBB0_22:
Lloh26:
	adrp	x8, _BBP3_RX_ANTENNA@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BBP3_RX_ANTENNA@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #2
	b	LBB0_27
LBB0_23:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rt2x00_rt
	cbz	x0, LBB0_26
; %bb.24:
	mov	x0, x19
	bl	_rt2x00_has_cap_bt_coexist
	cbz	x0, LBB0_26
; %bb.25:
Lloh29:
	adrp	x8, _BBP3_RX_ADC@GOTPAGE
Lloh30:
	ldr	x8, [x8, _BBP3_RX_ADC@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #1
	bl	_rt2x00_set_field8
Lloh32:
	adrp	x8, _BBP3_RX_ANTENNA@GOTPAGE
Lloh33:
	ldr	x8, [x8, _BBP3_RX_ANTENNA@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	ldr	w8, [x19]
Lloh35:
	adrp	x9, _NL80211_BAND_5GHZ@GOTPAGE
Lloh36:
	ldr	x9, [x9, _NL80211_BAND_5GHZ@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w2, eq
	add	x0, sp, #8
	bl	_rt2x00_set_field8
Lloh38:
	adrp	x8, _ANTENNA_B@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ANTENNA_B@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2800_set_ant_diversity
	b	LBB0_28
LBB0_26:
Lloh41:
	adrp	x8, _BBP3_RX_ANTENNA@GOTPAGE
Lloh42:
	ldr	x8, [x8, _BBP3_RX_ANTENNA@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #1
LBB0_27:
	bl	_rt2x00_set_field8
LBB0_28:
	ldr	w2, [sp, #8]
	mov	x0, x19
	mov	w1, #3
	bl	_rt2800_bbp_write
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #1
	bl	_rt2800_bbp_write
Lloh44:
	adrp	x8, _RT3593@GOTPAGE
Lloh45:
	ldr	x8, [x8, _RT3593@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cbnz	x0, LBB0_30
; %bb.29:
Lloh47:
	adrp	x8, _RT3883@GOTPAGE
Lloh48:
	ldr	x8, [x8, _RT3883@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cbz	x0, LBB0_31
LBB0_30:
	ldr	w8, [x20, #4]
	mov	w9, #70
	cmp	w8, #1
	csel	w2, wzr, w9, eq
	mov	x0, x19
	mov	w1, #86
	bl	_rt2800_bbp_write
LBB0_31:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_RT3572,4,2                     ; @RT3572
	.comm	_BBP1_TX_ANTENNA,4,2            ; @BBP1_TX_ANTENNA
	.comm	_RT3070,4,2                     ; @RT3070
	.comm	_RT3090,4,2                     ; @RT3090
	.comm	_RT3352,4,2                     ; @RT3352
	.comm	_RT3390,4,2                     ; @RT3390
	.comm	_EEPROM_NIC_CONF1,4,2           ; @EEPROM_NIC_CONF1
	.comm	_EEPROM_NIC_CONF1_ANT_DIVERSITY,4,2 ; @EEPROM_NIC_CONF1_ANT_DIVERSITY
	.comm	_BBP3_RX_ANTENNA,4,2            ; @BBP3_RX_ANTENNA
	.comm	_BBP3_RX_ADC,4,2                ; @BBP3_RX_ADC
	.comm	_NL80211_BAND_5GHZ,4,2          ; @NL80211_BAND_5GHZ
	.comm	_ANTENNA_B,4,2                  ; @ANTENNA_B
	.comm	_RT3593,4,2                     ; @RT3593
	.comm	_RT3883,4,2                     ; @RT3883
.subsections_via_symbols
