	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt61pci_config_ant
_rt61pci_config_ant:                    ## @rt61pci_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	%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, %r13
	movq	_ANTENNA_SW_DIVERSITY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$1, %edi
	cmpq	%rax, (%rsi)
	je	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	cmpq	%rax, 8(%rsi)
	sete	%dil
LBB0_2:
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	callq	_BUG_ON
	movq	(%r13), %rax
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	_antenna_sel_a@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r13, %rdi
	callq	_rt2x00_has_cap_external_lna_a
	jmp	LBB0_5
LBB0_4:
	movq	_antenna_sel_bg@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r13, %rdi
	callq	_rt2x00_has_cap_external_lna_bg
LBB0_5:
	movl	%eax, %r15d
	movq	_antenna_sel_a@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%r15d, %r15d
	addq	$8, %rbx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	movq	-8(%rbx), %rax
	movl	(%rax,%r15,4), %edx
	movq	%r13, %rdi
	callq	_rt61pci_bbp_write
	incq	%r14
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$16, %rbx
	cmpq	%rax, %r14
	jb	LBB0_7
LBB0_8:
	movq	_PHY_CSR0@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_rt2x00mmio_register_read
	movl	%eax, -44(%rbp)
	movq	_PHY_CSR0_PA_PE_BG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r13), %rax
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	leaq	-44(%rbp), %r15
	movq	%r15, %rdi
	callq	_rt2x00_set_field32
	movq	_PHY_CSR0_PA_PE_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r13), %rax
	xorl	%edx, %edx
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%dl
	movq	%r15, %rdi
	callq	_rt2x00_set_field32
	movl	(%rbx), %esi
	movl	-44(%rbp), %edx
	movq	%r13, %rdi
	callq	_rt2x00mmio_register_write
	movq	_RF5225@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_rt2x00_rf
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	movq	_RF5325@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_rt2x00_rf
	testq	%rax, %rax
	je	LBB0_11
LBB0_10:
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_rt61pci_config_antenna_5x
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_RF2527@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_rt2x00_rf
	testq	%rax, %rax
	je	LBB0_13
LBB0_12:
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_rt61pci_config_antenna_2x
	jmp	LBB0_16
LBB0_13:
	movq	_RF2529@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_rt2x00_rf
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movq	%r13, %rdi
	callq	_rt2x00_has_cap_double_antenna
	testq	%rax, %rax
	jne	LBB0_12
## %bb.15:
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_rt61pci_config_antenna_2529
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_ANTENNA_SW_DIVERSITY,8,3       ## @ANTENNA_SW_DIVERSITY
	.comm	_NL80211_BAND_5GHZ,8,3          ## @NL80211_BAND_5GHZ
	.comm	_antenna_sel_a,8,3              ## @antenna_sel_a
	.comm	_antenna_sel_bg,8,3             ## @antenna_sel_bg
	.comm	_PHY_CSR0,4,2                   ## @PHY_CSR0
	.comm	_PHY_CSR0_PA_PE_BG,4,2          ## @PHY_CSR0_PA_PE_BG
	.comm	_NL80211_BAND_2GHZ,8,3          ## @NL80211_BAND_2GHZ
	.comm	_PHY_CSR0_PA_PE_A,4,2           ## @PHY_CSR0_PA_PE_A
	.comm	_RF5225,4,2                     ## @RF5225
	.comm	_RF5325,4,2                     ## @RF5325
	.comm	_RF2527,4,2                     ## @RF2527
	.comm	_RF2529,4,2                     ## @RF2529
	.no_dead_strip	_rt61pci_config_ant
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt61pci_config_ant
_rt61pci_config_ant:                    ; @rt61pci_config_ant
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x1
	mov	x20, x0
	ldr	x9, [x1]
Lloh0:
	adrp	x8, _ANTENNA_SW_DIVERSITY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ANTENNA_SW_DIVERSITY@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #1
	b	LBB0_3
LBB0_2:
	ldr	x9, [x19, #8]
	cmp	x9, x8
	cset	w0, eq
LBB0_3:
	bl	_BUG_ON
	ldr	x8, [x20]
Lloh3:
	adrp	x22, _NL80211_BAND_5GHZ@GOTPAGE
Lloh4:
	ldr	x22, [x22, _NL80211_BAND_5GHZ@GOTPAGEOFF]
	ldr	x9, [x22]
Lloh5:
	adrp	x23, _antenna_sel_a@GOTPAGE
Lloh6:
	ldr	x23, [x23, _antenna_sel_a@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	ldr	x25, [x23]
	mov	x0, x20
	bl	_rt2x00_has_cap_external_lna_a
	b	LBB0_6
LBB0_5:
Lloh7:
	adrp	x8, _antenna_sel_bg@GOTPAGE
Lloh8:
	ldr	x8, [x8, _antenna_sel_bg@GOTPAGEOFF]
Lloh9:
	ldr	x25, [x8]
	mov	x0, x20
	bl	_rt2x00_has_cap_external_lna_bg
LBB0_6:
	mov	x21, x0
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_9
; %bb.7:
	mov	x24, #0
	mov	w21, w21
	add	x25, x25, #8
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	ldur	x8, [x25, #-8]
	ldr	w2, [x8, x21, lsl #2]
	mov	x0, x20
	bl	_rt61pci_bbp_write
	add	x24, x24, #1
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	add	x25, x25, #16
	cmp	x24, w0, uxtw
	b.lo	LBB0_8
LBB0_9:
Lloh10:
	adrp	x21, _PHY_CSR0@GOTPAGE
Lloh11:
	ldr	x21, [x21, _PHY_CSR0@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_rt2x00mmio_register_read
	str	w0, [sp, #12]
Lloh12:
	adrp	x8, _PHY_CSR0_PA_PE_BG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PHY_CSR0_PA_PE_BG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	x8, [x20]
Lloh15:
	adrp	x9, _NL80211_BAND_2GHZ@GOTPAGE
Lloh16:
	ldr	x9, [x9, _NL80211_BAND_2GHZ@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w2, eq
	add	x0, sp, #12
	bl	_rt2x00_set_field32
Lloh18:
	adrp	x8, _PHY_CSR0_PA_PE_A@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PHY_CSR0_PA_PE_A@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	x8, [x20]
	ldr	x9, [x22]
	cmp	x8, x9
	cset	w2, eq
	add	x0, sp, #12
	bl	_rt2x00_set_field32
	ldr	w1, [x21]
	ldr	w2, [sp, #12]
	mov	x0, x20
	bl	_rt2x00mmio_register_write
Lloh21:
	adrp	x8, _RF5225@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RF5225@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_rf
	cbnz	x0, LBB0_11
; %bb.10:
Lloh24:
	adrp	x8, _RF5325@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RF5325@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_rf
	cbz	x0, LBB0_13
LBB0_11:
	mov	x0, x20
	mov	x1, x19
	bl	_rt61pci_config_antenna_5x
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_13:
Lloh27:
	adrp	x8, _RF2527@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RF2527@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_rf
	cbz	x0, LBB0_15
LBB0_14:
	mov	x0, x20
	mov	x1, x19
	bl	_rt61pci_config_antenna_2x
	b	LBB0_12
LBB0_15:
Lloh30:
	adrp	x8, _RF2529@GOTPAGE
Lloh31:
	ldr	x8, [x8, _RF2529@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_rf
	cbz	x0, LBB0_12
; %bb.16:
	mov	x0, x20
	bl	_rt2x00_has_cap_double_antenna
	cbnz	x0, LBB0_14
; %bb.17:
	mov	x0, x20
	mov	x1, x19
	bl	_rt61pci_config_antenna_2529
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_ANTENNA_SW_DIVERSITY,8,3       ; @ANTENNA_SW_DIVERSITY
	.comm	_NL80211_BAND_5GHZ,8,3          ; @NL80211_BAND_5GHZ
	.comm	_antenna_sel_a,8,3              ; @antenna_sel_a
	.comm	_antenna_sel_bg,8,3             ; @antenna_sel_bg
	.comm	_PHY_CSR0,4,2                   ; @PHY_CSR0
	.comm	_PHY_CSR0_PA_PE_BG,4,2          ; @PHY_CSR0_PA_PE_BG
	.comm	_NL80211_BAND_2GHZ,8,3          ; @NL80211_BAND_2GHZ
	.comm	_PHY_CSR0_PA_PE_A,4,2           ; @PHY_CSR0_PA_PE_A
	.comm	_RF5225,4,2                     ; @RF5225
	.comm	_RF5325,4,2                     ; @RF5325
	.comm	_RF2527,4,2                     ; @RF2527
	.comm	_RF2529,4,2                     ; @RF2529
	.no_dead_strip	_rt61pci_config_ant
.subsections_via_symbols
