	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2500pci_config_ant
_rt2500pci_config_ant:                  ## @rt2500pci_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	%rsi, %r15
	movq	%rdi, %r14
	movq	_ANTENNA_SW_DIVERSITY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %edi
	cmpl	%eax, (%rsi)
	je	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	cmpl	%eax, 4(%r15)
	sete	%dil
LBB0_2:
	callq	_BUG_ON
	movq	_BBPCSR1@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_rt2x00mmio_register_read
	movl	%eax, -44(%rbp)
	movq	%r14, %rdi
	movl	$14, %esi
	callq	_rt2500pci_bbp_read
	movl	%eax, -52(%rbp)
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_rt2500pci_bbp_read
	movl	%eax, -48(%rbp)
	xorl	%ebx, %ebx
	cmpl	$129, 4(%r15)
	setne	%bl
	movq	_BBP_R2_TX_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%ebx, %ebx
	leaq	-48(%rbp), %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field8
	movq	_BBPCSR1_CCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %r12
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
	movq	_BBPCSR1_OFDM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
	xorl	%edx, %edx
	cmpl	$129, (%r15)
	setne	%dl
	addl	%edx, %edx
	movq	_BBP_R14_RX_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdi
	callq	_rt2x00_set_field8
	movq	_RF2525E@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_rt2x00_rf
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_RF5222@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_rf
	testq	%rax, %rax
	je	LBB0_6
LBB0_4:
	movq	_BBP_R2_TX_IQ_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field8
	movq	_BBPCSR1_CCK_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movq	_BBPCSR1_OFDM_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_rt2x00_rf
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	_BBP_R14_RX_IQ_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field8
	jmp	LBB0_7
LBB0_6:
	movq	_BBPCSR1_CCK_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
	movq	_BBPCSR1_OFDM_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
LBB0_7:
	movl	(%r13), %esi
	movl	-44(%rbp), %edx
	movq	%r14, %rdi
	callq	_rt2x00mmio_register_write
	movl	-52(%rbp), %edx
	movq	%r14, %rdi
	movl	$14, %esi
	callq	_rt2500pci_bbp_write
	movl	-48(%rbp), %edx
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_rt2500pci_bbp_write
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ANTENNA_SW_DIVERSITY,4,2       ## @ANTENNA_SW_DIVERSITY
	.comm	_BBPCSR1,4,2                    ## @BBPCSR1
	.comm	_BBP_R2_TX_ANTENNA,4,2          ## @BBP_R2_TX_ANTENNA
	.comm	_BBPCSR1_CCK,4,2                ## @BBPCSR1_CCK
	.comm	_BBPCSR1_OFDM,4,2               ## @BBPCSR1_OFDM
	.comm	_BBP_R14_RX_ANTENNA,4,2         ## @BBP_R14_RX_ANTENNA
	.comm	_RF2525E,4,2                    ## @RF2525E
	.comm	_RF5222,4,2                     ## @RF5222
	.comm	_BBP_R2_TX_IQ_FLIP,4,2          ## @BBP_R2_TX_IQ_FLIP
	.comm	_BBPCSR1_CCK_FLIP,4,2           ## @BBPCSR1_CCK_FLIP
	.comm	_BBPCSR1_OFDM_FLIP,4,2          ## @BBPCSR1_OFDM_FLIP
	.comm	_BBP_R14_RX_IQ_FLIP,4,2         ## @BBP_R14_RX_IQ_FLIP
	.no_dead_strip	_rt2500pci_config_ant
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2500pci_config_ant
_rt2500pci_config_ant:                  ; @rt2500pci_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
	ldr	w9, [x1]
Lloh0:
	adrp	x8, _ANTENNA_SW_DIVERSITY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ANTENNA_SW_DIVERSITY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w9, w8
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #1
	b	LBB0_3
LBB0_2:
	ldr	w9, [x20, #4]
	cmp	w9, w8
	cset	w0, eq
LBB0_3:
	bl	_BUG_ON
Lloh3:
	adrp	x22, _BBPCSR1@GOTPAGE
Lloh4:
	ldr	x22, [x22, _BBPCSR1@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rt2x00mmio_register_read
	str	w0, [sp, #12]
	mov	x0, x19
	mov	w1, #14
	bl	_rt2500pci_bbp_read
	str	w0, [sp, #8]
	mov	x0, x19
	mov	w1, #2
	bl	_rt2500pci_bbp_read
	str	w0, [sp, #4]
	ldr	w8, [x20, #4]
	cmp	w8, #129
	cset	w8, ne
Lloh5:
	adrp	x9, _BBP_R2_TX_ANTENNA@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BBP_R2_TX_ANTENNA@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x9]
	lsl	w21, w8, #1
	add	x0, sp, #4
	mov	x2, x21
	bl	_rt2x00_set_field8
Lloh8:
	adrp	x8, _BBPCSR1_CCK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BBPCSR1_CCK@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field32
Lloh11:
	adrp	x8, _BBPCSR1_OFDM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BBPCSR1_OFDM@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field32
	ldr	w8, [x20]
	cmp	w8, #129
	cset	w8, ne
	lsl	w2, w8, #1
Lloh14:
	adrp	x8, _BBP_R14_RX_ANTENNA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BBP_R14_RX_ANTENNA@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_rt2x00_set_field8
Lloh17:
	adrp	x20, _RF2525E@GOTPAGE
Lloh18:
	ldr	x20, [x20, _RF2525E@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rt2x00_rf
	cbnz	x0, LBB0_5
; %bb.4:
Lloh19:
	adrp	x8, _RF5222@GOTPAGE
Lloh20:
	ldr	x8, [x8, _RF5222@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbz	x0, LBB0_7
LBB0_5:
Lloh22:
	adrp	x8, _BBP_R2_TX_IQ_FLIP@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BBP_R2_TX_IQ_FLIP@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	add	x0, sp, #4
	mov	w2, #1
	bl	_rt2x00_set_field8
Lloh25:
	adrp	x8, _BBPCSR1_CCK_FLIP@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BBPCSR1_CCK_FLIP@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #1
	bl	_rt2x00_set_field32
Lloh28:
	adrp	x8, _BBPCSR1_OFDM_FLIP@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BBPCSR1_OFDM_FLIP@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #1
	bl	_rt2x00_set_field32
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rt2x00_rf
	cbz	x0, LBB0_8
; %bb.6:
Lloh31:
	adrp	x8, _BBP_R14_RX_IQ_FLIP@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BBP_R14_RX_IQ_FLIP@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_rt2x00_set_field8
	b	LBB0_8
LBB0_7:
Lloh34:
	adrp	x8, _BBPCSR1_CCK_FLIP@GOTPAGE
Lloh35:
	ldr	x8, [x8, _BBPCSR1_CCK_FLIP@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #0
	bl	_rt2x00_set_field32
Lloh37:
	adrp	x8, _BBPCSR1_OFDM_FLIP@GOTPAGE
Lloh38:
	ldr	x8, [x8, _BBPCSR1_OFDM_FLIP@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #0
	bl	_rt2x00_set_field32
LBB0_8:
	ldr	w1, [x22]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rt2x00mmio_register_write
	ldr	w2, [sp, #8]
	mov	x0, x19
	mov	w1, #14
	bl	_rt2500pci_bbp_write
	ldr	w2, [sp, #4]
	mov	x0, x19
	mov	w1, #2
	bl	_rt2500pci_bbp_write
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_ANTENNA_SW_DIVERSITY,4,2       ; @ANTENNA_SW_DIVERSITY
	.comm	_BBPCSR1,4,2                    ; @BBPCSR1
	.comm	_BBP_R2_TX_ANTENNA,4,2          ; @BBP_R2_TX_ANTENNA
	.comm	_BBPCSR1_CCK,4,2                ; @BBPCSR1_CCK
	.comm	_BBPCSR1_OFDM,4,2               ; @BBPCSR1_OFDM
	.comm	_BBP_R14_RX_ANTENNA,4,2         ; @BBP_R14_RX_ANTENNA
	.comm	_RF2525E,4,2                    ; @RF2525E
	.comm	_RF5222,4,2                     ; @RF5222
	.comm	_BBP_R2_TX_IQ_FLIP,4,2          ; @BBP_R2_TX_IQ_FLIP
	.comm	_BBPCSR1_CCK_FLIP,4,2           ; @BBPCSR1_CCK_FLIP
	.comm	_BBPCSR1_OFDM_FLIP,4,2          ; @BBPCSR1_OFDM_FLIP
	.comm	_BBP_R14_RX_IQ_FLIP,4,2         ; @BBP_R14_RX_IQ_FLIP
	.no_dead_strip	_rt2500pci_config_ant
.subsections_via_symbols
