	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2500usb_config_ant
_rt2500usb_config_ant:                  ## @rt2500usb_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, %r14
	movq	%rdi, %r15
	movq	_ANTENNA_SW_DIVERSITY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %r12d
	movl	$1, %edi
	cmpl	%eax, (%rsi)
	je	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	cmpl	%eax, 4(%r14)
	sete	%dil
LBB0_2:
	callq	_BUG_ON
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_rt2500usb_bbp_read
	movl	%eax, -56(%rbp)
	movq	%r15, %rdi
	movl	$14, %esi
	callq	_rt2500usb_bbp_read
	movl	%eax, -52(%rbp)
	movq	_PHY_CSR5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rt2500usb_register_read
	movl	%eax, -48(%rbp)
	movq	_PHY_CSR6@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_rt2500usb_register_read
	movl	%eax, -44(%rbp)
	movl	4(%r14), %eax
	xorl	%ebx, %ebx
	cmpl	$130, %eax
	setne	%bl
	addl	%ebx, %ebx
	cmpl	$128, %eax
	cmovel	%r12d, %ebx
	movq	_BBP_R2_TX_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field8
	movq	_PHY_CSR5_CCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field16
	movq	_PHY_CSR6_OFDM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field16
	movl	(%r14), %eax
	xorl	%edx, %edx
	cmpl	$130, %eax
	setne	%dl
	addl	%edx, %edx
	cmpl	$128, %eax
	cmovel	%r12d, %edx
	movq	_BBP_R14_RX_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdi
	callq	_rt2x00_set_field8
	movq	_RF2525E@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_rt2x00_rf
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_RF5222@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %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	-56(%rbp), %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field8
	movq	_PHY_CSR5_CCK_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field16
	movq	_PHY_CSR6_OFDM_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field16
	movl	(%rbx), %esi
	movq	%r15, %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	_PHY_CSR5_CCK_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field16
	movq	_PHY_CSR6_OFDM_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field16
LBB0_7:
	movl	-56(%rbp), %edx
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_rt2500usb_bbp_write
	movl	-52(%rbp), %edx
	movq	%r15, %rdi
	movl	$14, %esi
	callq	_rt2500usb_bbp_write
	movq	_PHY_CSR5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-48(%rbp), %edx
	movq	%r15, %rdi
	callq	_rt2500usb_register_write
	movl	(%r13), %esi
	movl	-44(%rbp), %edx
	movq	%r15, %rdi
	callq	_rt2500usb_register_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	_PHY_CSR5,4,2                   ## @PHY_CSR5
	.comm	_PHY_CSR6,4,2                   ## @PHY_CSR6
	.comm	_BBP_R2_TX_ANTENNA,4,2          ## @BBP_R2_TX_ANTENNA
	.comm	_PHY_CSR5_CCK,4,2               ## @PHY_CSR5_CCK
	.comm	_PHY_CSR6_OFDM,4,2              ## @PHY_CSR6_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	_PHY_CSR5_CCK_FLIP,4,2          ## @PHY_CSR5_CCK_FLIP
	.comm	_PHY_CSR6_OFDM_FLIP,4,2         ## @PHY_CSR6_OFDM_FLIP
	.comm	_BBP_R14_RX_IQ_FLIP,4,2         ## @BBP_R14_RX_IQ_FLIP
	.no_dead_strip	_rt2500usb_config_ant
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2500usb_config_ant
_rt2500usb_config_ant:                  ; @rt2500usb_config_ant
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	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
	mov	x0, x19
	mov	w1, #2
	bl	_rt2500usb_bbp_read
	str	w0, [sp, #12]
	mov	x0, x19
	mov	w1, #14
	bl	_rt2500usb_bbp_read
	str	w0, [sp, #8]
Lloh3:
	adrp	x22, _PHY_CSR5@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PHY_CSR5@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rt2500usb_register_read
	str	w0, [sp, #4]
Lloh5:
	adrp	x23, _PHY_CSR6@GOTPAGE
Lloh6:
	ldr	x23, [x23, _PHY_CSR6@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_rt2500usb_register_read
	str	w0, [sp]
	ldr	w8, [x20, #4]
	cmp	w8, #130
	cset	w9, ne
	lsl	w9, w9, #1
	cmp	w8, #128
	csinc	w21, w9, wzr, ne
Lloh7:
	adrp	x8, _BBP_R2_TX_ANTENNA@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BBP_R2_TX_ANTENNA@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field8
Lloh10:
	adrp	x8, _PHY_CSR5_CCK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PHY_CSR5_CCK@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x0, sp, #4
	mov	x2, x21
	bl	_rt2x00_set_field16
Lloh13:
	adrp	x8, _PHY_CSR6_OFDM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PHY_CSR6_OFDM@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, sp
	mov	x2, x21
	bl	_rt2x00_set_field16
	ldr	w8, [x20]
	cmp	w8, #130
	cset	w9, ne
	lsl	w9, w9, #1
	cmp	w8, #128
	csinc	w2, w9, wzr, ne
Lloh16:
	adrp	x8, _BBP_R14_RX_ANTENNA@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BBP_R14_RX_ANTENNA@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_rt2x00_set_field8
Lloh19:
	adrp	x20, _RF2525E@GOTPAGE
Lloh20:
	ldr	x20, [x20, _RF2525E@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rt2x00_rf
	cbnz	x0, LBB0_5
; %bb.4:
Lloh21:
	adrp	x8, _RF5222@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RF5222@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbz	x0, LBB0_7
LBB0_5:
Lloh24:
	adrp	x8, _BBP_R2_TX_IQ_FLIP@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BBP_R2_TX_IQ_FLIP@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #1
	bl	_rt2x00_set_field8
Lloh27:
	adrp	x8, _PHY_CSR5_CCK_FLIP@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PHY_CSR5_CCK_FLIP@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	add	x0, sp, #4
	mov	w2, #1
	bl	_rt2x00_set_field16
Lloh30:
	adrp	x8, _PHY_CSR6_OFDM_FLIP@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PHY_CSR6_OFDM_FLIP@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, sp
	mov	w2, #1
	bl	_rt2x00_set_field16
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rt2x00_rf
	cbz	x0, LBB0_8
; %bb.6:
Lloh33:
	adrp	x8, _BBP_R14_RX_IQ_FLIP@GOTPAGE
Lloh34:
	ldr	x8, [x8, _BBP_R14_RX_IQ_FLIP@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_rt2x00_set_field8
	b	LBB0_8
LBB0_7:
Lloh36:
	adrp	x8, _PHY_CSR5_CCK_FLIP@GOTPAGE
Lloh37:
	ldr	x8, [x8, _PHY_CSR5_CCK_FLIP@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	add	x0, sp, #4
	mov	w2, #0
	bl	_rt2x00_set_field16
Lloh39:
	adrp	x8, _PHY_CSR6_OFDM_FLIP@GOTPAGE
Lloh40:
	ldr	x8, [x8, _PHY_CSR6_OFDM_FLIP@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, sp
	mov	w2, #0
	bl	_rt2x00_set_field16
LBB0_8:
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #2
	bl	_rt2500usb_bbp_write
	ldr	w2, [sp, #8]
	mov	x0, x19
	mov	w1, #14
	bl	_rt2500usb_bbp_write
	ldr	w1, [x22]
	ldr	w2, [sp, #4]
	mov	x0, x19
	bl	_rt2500usb_register_write
	ldr	w1, [x23]
	ldr	w2, [sp]
	mov	x0, x19
	bl	_rt2500usb_register_write
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_ANTENNA_SW_DIVERSITY,4,2       ; @ANTENNA_SW_DIVERSITY
	.comm	_PHY_CSR5,4,2                   ; @PHY_CSR5
	.comm	_PHY_CSR6,4,2                   ; @PHY_CSR6
	.comm	_BBP_R2_TX_ANTENNA,4,2          ; @BBP_R2_TX_ANTENNA
	.comm	_PHY_CSR5_CCK,4,2               ; @PHY_CSR5_CCK
	.comm	_PHY_CSR6_OFDM,4,2              ; @PHY_CSR6_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	_PHY_CSR5_CCK_FLIP,4,2          ; @PHY_CSR5_CCK_FLIP
	.comm	_PHY_CSR6_OFDM_FLIP,4,2         ; @PHY_CSR6_OFDM_FLIP
	.comm	_BBP_R14_RX_IQ_FLIP,4,2         ; @BBP_R14_RX_IQ_FLIP
	.no_dead_strip	_rt2500usb_config_ant
.subsections_via_symbols
