	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2800_config_alc
_rt2800_config_alc:                     ## @rt2800_config_alc
	.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
	movl	%edx, %ebx
	addl	%edx, %ebx
	cmpl	$47, %ebx
	movl	$47, %eax
	cmovgel	%eax, %ebx
	movq	%rdi, %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %r15d
	addl	%r15d, %r15d
	cmpl	$47, %r15d
	cmovgel	%eax, %r15d
	movq	_TX_ALC_CFG_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movq	_TX_ALC_CFG_0_CH_INIT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %r13
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
	movq	_TX_ALC_CFG_0_CH_INIT_1@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
	movq	_TX_ALC_CFG_0_LIMIT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_rt2x00_set_field32
	movq	_TX_ALC_CFG_0_LIMIT_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_rt2x00_set_field32
	movq	_EEPROM_NIC_CONF1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2800_eeprom_read
	movq	_EEPROM_NIC_CONF1_INTERNAL_TX_ALC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field16
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EEPROM_TXPOWER_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2800_eeprom_read
	movl	%eax, %ebx
	movq	_TX_ALC_CFG_0_CH_INIT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %r15
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
	movl	(%r14), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
LBB0_2:
	movq	_TX_ALC_CFG_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2800_register_write
	movq	_TX_ALC_CFG_1@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movq	_TX_ALC_CFG_1_TX_TEMP_COMP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
	movl	(%rbx), %esi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2800_register_write
	movq	_MAC_SYS_CTRL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	movl	%eax, %r15d
	movl	(%r14), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_rt2800_register_write
	movl	$10000, %ebx                    ## imm = 0x2710
	movq	_MAC_STATUS_CFG@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	testb	$3, %al
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$50, %edi
	movl	$200, %esi
	callq	_usleep_range
	decl	%ebx
	jne	LBB0_3
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_rt2x00_warn
LBB0_6:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %ebx
	movq	%r12, %rdi
	movl	$30, %esi
	callq	_rt2800_bbp_read
	movq	%r12, %rdi
	movl	$30, %esi
	cmpl	$2458, %ebx                     ## imm = 0x99A
	jl	LBB0_8
## %bb.7:
	movl	$64, %edx
	callq	_rt2800_bbp_write
	movq	%r12, %rdi
	movl	$39, %esi
	xorl	%edx, %edx
	callq	_rt2800_rfcsr_write
	movq	%r12, %rdi
	callq	_rt2x00_has_cap_external_lna_bg
	xorl	%edx, %edx
	testq	%rax, %rax
	setne	%dl
	shll	$7, %edx
	orl	$123, %edx
	jmp	LBB0_9
LBB0_8:
	movl	$31, %edx
	callq	_rt2800_bbp_write
	movq	%r12, %rdi
	movl	$39, %esi
	movl	$128, %edx
	callq	_rt2800_rfcsr_write
	movq	%r12, %rdi
	callq	_rt2x00_has_cap_external_lna_bg
	xorl	%edx, %edx
	testq	%rax, %rax
	setne	%dl
	shll	$7, %edx
	orl	$91, %edx
LBB0_9:
	movq	%r12, %rdi
	movl	$42, %esi
	callq	_rt2800_rfcsr_write
	movl	(%r14), %esi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_rt2800_register_write
	movq	%r12, %rdi
	callq	_rt2800_vco_calibration
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TX_ALC_CFG_0,4,2               ## @TX_ALC_CFG_0
	.comm	_TX_ALC_CFG_0_CH_INIT_0,4,2     ## @TX_ALC_CFG_0_CH_INIT_0
	.comm	_TX_ALC_CFG_0_CH_INIT_1,4,2     ## @TX_ALC_CFG_0_CH_INIT_1
	.comm	_TX_ALC_CFG_0_LIMIT_0,4,2       ## @TX_ALC_CFG_0_LIMIT_0
	.comm	_TX_ALC_CFG_0_LIMIT_1,4,2       ## @TX_ALC_CFG_0_LIMIT_1
	.comm	_EEPROM_NIC_CONF1,4,2           ## @EEPROM_NIC_CONF1
	.comm	_EEPROM_NIC_CONF1_INTERNAL_TX_ALC,4,2 ## @EEPROM_NIC_CONF1_INTERNAL_TX_ALC
	.comm	_EEPROM_TXPOWER_INIT,4,2        ## @EEPROM_TXPOWER_INIT
	.comm	_TX_ALC_CFG_1,4,2               ## @TX_ALC_CFG_1
	.comm	_TX_ALC_CFG_1_TX_TEMP_COMP,4,2  ## @TX_ALC_CFG_1_TX_TEMP_COMP
	.comm	_MAC_SYS_CTRL,4,2               ## @MAC_SYS_CTRL
	.comm	_MAC_STATUS_CFG,4,2             ## @MAC_STATUS_CFG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wait MAC Status to MAX !!!\n"

	.no_dead_strip	_rt2800_config_alc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2800_config_alc
_rt2800_config_alc:                     ; @rt2800_config_alc
	.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	x20, x1
	mov	x19, x0
	lsl	w8, w2, #1
	mov	w9, #47
	cmp	w8, #47
	csel	w21, w8, w9, lt
	ldr	w8, [x1]
	lsl	w8, w8, #1
	cmp	w8, #47
	csel	w22, w8, w9, lt
Lloh0:
	adrp	x23, _TX_ALC_CFG_0@GOTPAGE
Lloh1:
	ldr	x23, [x23, _TX_ALC_CFG_0@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_rt2800_register_read
	str	w0, [sp, #12]
Lloh2:
	adrp	x24, _TX_ALC_CFG_0_CH_INIT_0@GOTPAGE
Lloh3:
	ldr	x24, [x24, _TX_ALC_CFG_0_CH_INIT_0@GOTPAGEOFF]
	ldr	w1, [x24]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field32
Lloh4:
	adrp	x25, _TX_ALC_CFG_0_CH_INIT_1@GOTPAGE
Lloh5:
	ldr	x25, [x25, _TX_ALC_CFG_0_CH_INIT_1@GOTPAGEOFF]
	ldr	w1, [x25]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field32
Lloh6:
	adrp	x8, _TX_ALC_CFG_0_LIMIT_0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TX_ALC_CFG_0_LIMIT_0@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x22
	bl	_rt2x00_set_field32
Lloh9:
	adrp	x8, _TX_ALC_CFG_0_LIMIT_1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TX_ALC_CFG_0_LIMIT_1@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x22
	bl	_rt2x00_set_field32
Lloh12:
	adrp	x8, _EEPROM_NIC_CONF1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EEPROM_NIC_CONF1@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2800_eeprom_read
Lloh15:
	adrp	x8, _EEPROM_NIC_CONF1_INTERNAL_TX_ALC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EEPROM_NIC_CONF1_INTERNAL_TX_ALC@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_rt2x00_get_field16
	cbz	x0, LBB0_2
; %bb.1:
Lloh18:
	adrp	x8, _EEPROM_TXPOWER_INIT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EEPROM_TXPOWER_INIT@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2800_eeprom_read
	mov	x21, x0
	ldr	w1, [x24]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field32
	ldr	w1, [x25]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field32
LBB0_2:
	ldr	w1, [x23]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rt2800_register_write
Lloh21:
	adrp	x21, _TX_ALC_CFG_1@GOTPAGE
Lloh22:
	ldr	x21, [x21, _TX_ALC_CFG_1@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rt2800_register_read
	str	w0, [sp, #12]
Lloh23:
	adrp	x8, _TX_ALC_CFG_1_TX_TEMP_COMP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TX_ALC_CFG_1_TX_TEMP_COMP@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #0
	bl	_rt2x00_set_field32
	ldr	w1, [x21]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rt2800_register_write
Lloh26:
	adrp	x22, _MAC_SYS_CTRL@GOTPAGE
Lloh27:
	ldr	x22, [x22, _MAC_SYS_CTRL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rt2800_register_read
	mov	x21, x0
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #0
	bl	_rt2800_register_write
	mov	w23, #10000
Lloh28:
	adrp	x24, _MAC_STATUS_CFG@GOTPAGE
Lloh29:
	ldr	x24, [x24, _MAC_STATUS_CFG@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	mov	x0, x19
	bl	_rt2800_register_read
	tst	w0, #0x3
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #50
	mov	w1, #200
	bl	_usleep_range
	subs	w23, w23, #1
	b.ne	LBB0_3
; %bb.5:
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_rt2x00_warn
LBB0_6:
	ldr	w20, [x20, #4]
	mov	x0, x19
	mov	w1, #30
	bl	_rt2800_bbp_read
	mov	x0, x19
	mov	w1, #30
	cmp	w20, #2458
	b.lt	LBB0_8
; %bb.7:
	mov	w2, #64
	bl	_rt2800_bbp_write
	mov	x0, x19
	mov	w1, #39
	mov	w2, #0
	bl	_rt2800_rfcsr_write
	mov	x0, x19
	bl	_rt2x00_has_cap_external_lna_bg
	cmp	x0, #0
	mov	w8, #251
	mov	w9, #123
	b	LBB0_9
LBB0_8:
	mov	w2, #31
	bl	_rt2800_bbp_write
	mov	x0, x19
	mov	w1, #39
	mov	w2, #128
	bl	_rt2800_rfcsr_write
	mov	x0, x19
	bl	_rt2x00_has_cap_external_lna_bg
	cmp	x0, #0
	mov	w8, #219
	mov	w9, #91
LBB0_9:
	csel	w2, w9, w8, eq
	mov	x0, x19
	mov	w1, #42
	bl	_rt2800_rfcsr_write
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_rt2800_register_write
	mov	x0, x19
	bl	_rt2800_vco_calibration
	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
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_TX_ALC_CFG_0,4,2               ; @TX_ALC_CFG_0
	.comm	_TX_ALC_CFG_0_CH_INIT_0,4,2     ; @TX_ALC_CFG_0_CH_INIT_0
	.comm	_TX_ALC_CFG_0_CH_INIT_1,4,2     ; @TX_ALC_CFG_0_CH_INIT_1
	.comm	_TX_ALC_CFG_0_LIMIT_0,4,2       ; @TX_ALC_CFG_0_LIMIT_0
	.comm	_TX_ALC_CFG_0_LIMIT_1,4,2       ; @TX_ALC_CFG_0_LIMIT_1
	.comm	_EEPROM_NIC_CONF1,4,2           ; @EEPROM_NIC_CONF1
	.comm	_EEPROM_NIC_CONF1_INTERNAL_TX_ALC,4,2 ; @EEPROM_NIC_CONF1_INTERNAL_TX_ALC
	.comm	_EEPROM_TXPOWER_INIT,4,2        ; @EEPROM_TXPOWER_INIT
	.comm	_TX_ALC_CFG_1,4,2               ; @TX_ALC_CFG_1
	.comm	_TX_ALC_CFG_1_TX_TEMP_COMP,4,2  ; @TX_ALC_CFG_1_TX_TEMP_COMP
	.comm	_MAC_SYS_CTRL,4,2               ; @MAC_SYS_CTRL
	.comm	_MAC_STATUS_CFG,4,2             ; @MAC_STATUS_CFG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wait MAC Status to MAX !!!\n"

	.no_dead_strip	_rt2800_config_alc
.subsections_via_symbols
