	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2800_config_3572bt_ant
_rt2800_config_3572bt_ant:              ## @rt2800_config_3572bt_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_GPIO_SWITCH@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movq	(%r12), %rax
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	sete	%bl
	movq	_GPIO_SWITCH_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %r14
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
	movq	_GPIO_SWITCH_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
	movl	(%r15), %esi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2800_register_write
	movq	_LED_CFG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movq	_LED_CFG_LED_POLAR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field32
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setne	%cl
	leal	(%rcx,%rcx,2), %r14d
	movl	-44(%rbp), %edi
	movl	(%rbx), %esi
	callq	_rt2x00_get_field32
	xorl	%ecx, %ecx
	testl	%eax, %eax
	sete	%cl
	leal	(%rcx,%rcx,2), %r15d
	movl	-44(%rbp), %edi
	movq	_LED_CFG_G_LED_MODE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_rt2x00_get_field32
	cmpl	%eax, %r14d
	jne	LBB0_2
## %bb.1:
	movl	-44(%rbp), %edi
	movq	_LED_CFG_R_LED_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rt2x00_get_field32
	cmpl	%eax, %r15d
	je	LBB0_6
LBB0_2:
	movq	_EEPROM_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2800_eeprom_read
	movq	_EEPROM_FREQ_LED_MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field16
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	cmpl	$65, %eax
	jge	LBB0_4
## %bb.5:
	movq	_MCU_BAND_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$2, %r14d
	orl	%r14d, %r15d
	movq	%r12, %rdi
	movl	$255, %edx
	movl	%r15d, %ecx
	movl	$1, %r8d
	callq	_rt2800_mcu_request
	jmp	LBB0_6
LBB0_4:
	movl	(%rbx), %esi
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_rt2x00_set_field32
	movq	_LED_CFG_R_LED_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_rt2x00_set_field32
	movl	(%r13), %esi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2800_register_write
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GPIO_SWITCH,4,2                ## @GPIO_SWITCH
	.comm	_NL80211_BAND_5GHZ,8,3          ## @NL80211_BAND_5GHZ
	.comm	_GPIO_SWITCH_0,4,2              ## @GPIO_SWITCH_0
	.comm	_GPIO_SWITCH_1,4,2              ## @GPIO_SWITCH_1
	.comm	_LED_CFG,4,2                    ## @LED_CFG
	.comm	_LED_CFG_LED_POLAR,4,2          ## @LED_CFG_LED_POLAR
	.comm	_LED_CFG_G_LED_MODE,4,2         ## @LED_CFG_G_LED_MODE
	.comm	_LED_CFG_R_LED_MODE,4,2         ## @LED_CFG_R_LED_MODE
	.comm	_EEPROM_FREQ,4,2                ## @EEPROM_FREQ
	.comm	_EEPROM_FREQ_LED_MODE,4,2       ## @EEPROM_FREQ_LED_MODE
	.comm	_MCU_BAND_SELECT,4,2            ## @MCU_BAND_SELECT
	.no_dead_strip	_rt2800_config_3572bt_ant
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2800_config_3572bt_ant
_rt2800_config_3572bt_ant:              ; @rt2800_config_3572bt_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	x19, x0
Lloh0:
	adrp	x21, _GPIO_SWITCH@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GPIO_SWITCH@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_rt2800_register_read
	str	w0, [sp, #12]
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _NL80211_BAND_5GHZ@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NL80211_BAND_5GHZ@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w20, eq
Lloh5:
	adrp	x8, _GPIO_SWITCH_0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GPIO_SWITCH_0@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x20
	bl	_rt2x00_set_field32
Lloh8:
	adrp	x8, _GPIO_SWITCH_1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GPIO_SWITCH_1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x20
	bl	_rt2x00_set_field32
	ldr	w1, [x21]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rt2800_register_write
Lloh11:
	adrp	x22, _LED_CFG@GOTPAGE
Lloh12:
	ldr	x22, [x22, _LED_CFG@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rt2800_register_read
	str	w0, [sp, #12]
Lloh13:
	adrp	x20, _LED_CFG_LED_POLAR@GOTPAGE
Lloh14:
	ldr	x20, [x20, _LED_CFG_LED_POLAR@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_rt2x00_get_field32
	mov	w23, #3
	cmp	w0, #0
	csel	w21, wzr, w23, eq
	ldr	w0, [sp, #12]
	ldr	w1, [x20]
	bl	_rt2x00_get_field32
	cmp	w0, #0
	csel	w20, w23, wzr, eq
	ldr	w0, [sp, #12]
Lloh15:
	adrp	x23, _LED_CFG_G_LED_MODE@GOTPAGE
Lloh16:
	ldr	x23, [x23, _LED_CFG_G_LED_MODE@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_rt2x00_get_field32
	cmp	w21, w0
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [sp, #12]
Lloh17:
	adrp	x8, _LED_CFG_R_LED_MODE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LED_CFG_R_LED_MODE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_rt2x00_get_field32
	cmp	w20, w0
	b.eq	LBB0_6
LBB0_2:
Lloh20:
	adrp	x8, _EEPROM_FREQ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EEPROM_FREQ@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2800_eeprom_read
Lloh23:
	adrp	x8, _EEPROM_FREQ_LED_MODE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EEPROM_FREQ_LED_MODE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	bl	_rt2x00_get_field16
	cbz	w0, LBB0_5
; %bb.3:
	cmp	w0, #65
	b.ge	LBB0_5
; %bb.4:
Lloh26:
	adrp	x8, _MCU_BAND_SELECT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MCU_BAND_SELECT@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	bfi	w20, w21, #2, #2
	mov	x0, x19
	mov	w2, #255
	mov	x3, x20
	mov	w4, #1
	bl	_rt2800_mcu_request
	b	LBB0_6
LBB0_5:
	ldr	w1, [x23]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field32
Lloh29:
	adrp	x8, _LED_CFG_R_LED_MODE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _LED_CFG_R_LED_MODE@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x20
	bl	_rt2x00_set_field32
	ldr	w1, [x22]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rt2800_register_write
LBB0_6:
	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 AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_GPIO_SWITCH,4,2                ; @GPIO_SWITCH
	.comm	_NL80211_BAND_5GHZ,8,3          ; @NL80211_BAND_5GHZ
	.comm	_GPIO_SWITCH_0,4,2              ; @GPIO_SWITCH_0
	.comm	_GPIO_SWITCH_1,4,2              ; @GPIO_SWITCH_1
	.comm	_LED_CFG,4,2                    ; @LED_CFG
	.comm	_LED_CFG_LED_POLAR,4,2          ; @LED_CFG_LED_POLAR
	.comm	_LED_CFG_G_LED_MODE,4,2         ; @LED_CFG_G_LED_MODE
	.comm	_LED_CFG_R_LED_MODE,4,2         ; @LED_CFG_R_LED_MODE
	.comm	_EEPROM_FREQ,4,2                ; @EEPROM_FREQ
	.comm	_EEPROM_FREQ_LED_MODE,4,2       ; @EEPROM_FREQ_LED_MODE
	.comm	_MCU_BAND_SELECT,4,2            ; @MCU_BAND_SELECT
	.no_dead_strip	_rt2800_config_3572bt_ant
.subsections_via_symbols
