	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2800_config_txpower_rt6352
_rt2800_config_txpower_rt6352:          ## @rt2800_config_txpower_rt6352
	.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, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %esi
	callq	_rt2800_get_txpower_bw_comp
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_rt2x00_warn
LBB0_2:
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %eax
	andl	$63, %eax
	cmpl	$32, %eax
	movl	$33, %ecx
	cmovel	%ecx, %eax
	shrl	$8, %r14d
	andl	$63, %r14d
	movl	%r14d, %ecx
	shll	$8, %ecx
	cmpl	$32, %r14d
	movl	$8448, %edx                     ## imm = 0x2100
	cmovel	%edx, %ecx
	orl	%eax, %ecx
	movl	%ebx, %eax
	andl	$63, %eax
	movl	%eax, %edx
	shll	$16, %edx
	cmpl	$32, %eax
	movl	$2162688, %eax                  ## imm = 0x210000
	cmovel	%eax, %edx
	orl	%ecx, %edx
	shrl	$8, %ebx
	andl	$63, %ebx
	movl	%ebx, %eax
	shll	$24, %eax
	cmpl	$32, %ebx
	movl	$553648128, %ecx                ## imm = 0x21000000
	cmovel	%ecx, %eax
	orl	%edx, %eax
	movl	%eax, %ebx
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_TX_PWR_CFG_0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r15, %rsi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_rt2800_register_write
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	addq	$2, %r13
	addq	$4, %r15
	cmpq	$10, %r13
	je	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_EEPROM_TXPOWER_BYRATE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	_rt2800_eeprom_read_from_array
	movl	%eax, %r14d
	movl	(%rbx), %esi
	leal	1(%r13), %edx
	movq	%r12, %rdi
	callq	_rt2800_eeprom_read_from_array
	movl	%eax, %ebx
	movq	_CONFIG_CHANNEL_HT40@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	shll	$16, %ebx
	orl	%r14d, %ebx
	cmpl	$-1, %ebx
	jne	LBB0_6
	jmp	LBB0_7
LBB0_8:
	movl	$0, -44(%rbp)
	movq	_TX_PWR_CFG_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	movq	_TX_PWR_CFG_1B_48MBS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field32
	movq	_TX_PWR_CFG_7B_54MBS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_rt2x00_set_field32
	movq	_TX_PWR_CFG_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	movq	_TX_PWR_CFG_2B_MCS6_MCS7@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field32
	movq	_TX_PWR_CFG_7B_MCS7@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_rt2x00_set_field32
	movq	_TX_PWR_CFG_7@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2800_register_write
	movl	$0, -44(%rbp)
	movq	_TX_PWR_CFG_3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	movq	_TX_PWR_CFG_3B_MCS14@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field32
	movq	_TX_PWR_CFG_8B_MCS15@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_rt2x00_set_field32
	movq	_TX_PWR_CFG_8@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2800_register_write
	movl	$0, -44(%rbp)
	movq	_TX_PWR_CFG_4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	movq	_TX_PWR_CFG_4B_STBC_MCS6@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field32
	movq	_TX_PWR_CFG_9B_STBC_MCS7@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_rt2x00_set_field32
	movq	_TX_PWR_CFG_9@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2800_register_write
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_rt2800_config_alc
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ignoring EEPROM HT40 power delta: %d\n"

	.comm	_EEPROM_TXPOWER_BYRATE,4,2      ## @EEPROM_TXPOWER_BYRATE
	.comm	_CONFIG_CHANNEL_HT40,4,2        ## @CONFIG_CHANNEL_HT40
	.comm	_TX_PWR_CFG_0,8,3               ## @TX_PWR_CFG_0
	.comm	_TX_PWR_CFG_1,4,2               ## @TX_PWR_CFG_1
	.comm	_TX_PWR_CFG_1B_48MBS,4,2        ## @TX_PWR_CFG_1B_48MBS
	.comm	_TX_PWR_CFG_7B_54MBS,4,2        ## @TX_PWR_CFG_7B_54MBS
	.comm	_TX_PWR_CFG_2,4,2               ## @TX_PWR_CFG_2
	.comm	_TX_PWR_CFG_2B_MCS6_MCS7,4,2    ## @TX_PWR_CFG_2B_MCS6_MCS7
	.comm	_TX_PWR_CFG_7B_MCS7,4,2         ## @TX_PWR_CFG_7B_MCS7
	.comm	_TX_PWR_CFG_7,8,3               ## @TX_PWR_CFG_7
	.comm	_TX_PWR_CFG_3,4,2               ## @TX_PWR_CFG_3
	.comm	_TX_PWR_CFG_3B_MCS14,4,2        ## @TX_PWR_CFG_3B_MCS14
	.comm	_TX_PWR_CFG_8B_MCS15,4,2        ## @TX_PWR_CFG_8B_MCS15
	.comm	_TX_PWR_CFG_8,8,3               ## @TX_PWR_CFG_8
	.comm	_TX_PWR_CFG_4,4,2               ## @TX_PWR_CFG_4
	.comm	_TX_PWR_CFG_4B_STBC_MCS6,4,2    ## @TX_PWR_CFG_4B_STBC_MCS6
	.comm	_TX_PWR_CFG_9B_STBC_MCS7,4,2    ## @TX_PWR_CFG_9B_STBC_MCS7
	.comm	_TX_PWR_CFG_9,8,3               ## @TX_PWR_CFG_9
	.no_dead_strip	_rt2800_config_txpower_rt6352
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2800_config_txpower_rt6352
_rt2800_config_txpower_rt6352:          ; @rt2800_config_txpower_rt6352
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	w2, [sp, #8]                    ; 4-byte Folded Spill
	mov	x21, x0
	str	x1, [sp]                        ; 8-byte Folded Spill
	ldr	w1, [x1]
	bl	_rt2800_get_txpower_bw_comp
	cbz	w0, LBB0_2
; %bb.1:
	mov	x2, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_rt2x00_warn
LBB0_2:
	mov	x25, #0
	mov	x22, #0
Lloh2:
	adrp	x26, _EEPROM_TXPOWER_BYRATE@GOTPAGE
Lloh3:
	ldr	x26, [x26, _EEPROM_TXPOWER_BYRATE@GOTPAGEOFF]
Lloh4:
	adrp	x27, _CONFIG_CHANNEL_HT40@GOTPAGE
Lloh5:
	ldr	x27, [x27, _CONFIG_CHANNEL_HT40@GOTPAGEOFF]
Lloh6:
	adrp	x28, _TX_PWR_CFG_0@GOTPAGE
Lloh7:
	ldr	x28, [x28, _TX_PWR_CFG_0@GOTPAGEOFF]
	mov	w19, #2162688
	mov	w20, #553648128
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	and	w8, w24, #0x3f
	cmp	w8, #32
	mov	w9, #33
	csel	w8, w9, w8, eq
	ubfx	w9, w24, #8, #6
	lsl	w10, w9, #8
	cmp	w9, #32
	mov	w9, #8448
	csel	w9, w9, w10, eq
	orr	w8, w9, w8
	and	w9, w23, #0x3f
	lsl	w10, w9, #16
	cmp	w9, #32
	csel	w9, w19, w10, eq
	orr	w8, w8, w9
	ubfx	w9, w23, #8, #6
	lsl	w10, w9, #24
	cmp	w9, #32
	csel	w9, w20, w10, eq
	orr	w2, w8, w9
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x28]
	add	x1, x25, x8
	mov	x0, x21
	bl	_rt2800_register_write
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x22, x22, #2
	add	x25, x25, #4
	cmp	x22, #10
	b.eq	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x21
	mov	x2, x22
	bl	_rt2800_eeprom_read_from_array
	mov	x24, x0
	ldr	w1, [x26]
	add	w2, w22, #1
	mov	x0, x21
	bl	_rt2800_eeprom_read_from_array
	mov	x23, x0
	ldr	w0, [x27]
	mov	x1, x21
	bl	_test_bit
	cbnz	w0, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	orr	w2, w24, w23, lsl #16
	cmn	w2, #1
	b.ne	LBB0_4
	b	LBB0_5
LBB0_8:
	str	wzr, [sp, #12]
Lloh8:
	adrp	x8, _TX_PWR_CFG_1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TX_PWR_CFG_1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_rt2800_register_read
Lloh11:
	adrp	x8, _TX_PWR_CFG_1B_48MBS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TX_PWR_CFG_1B_48MBS@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_rt2x00_get_field32
	mov	x2, x0
Lloh14:
	adrp	x8, _TX_PWR_CFG_7B_54MBS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TX_PWR_CFG_7B_54MBS@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x0, sp, #12
	bl	_rt2x00_set_field32
Lloh17:
	adrp	x8, _TX_PWR_CFG_2@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TX_PWR_CFG_2@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_rt2800_register_read
Lloh20:
	adrp	x8, _TX_PWR_CFG_2B_MCS6_MCS7@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TX_PWR_CFG_2B_MCS6_MCS7@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_rt2x00_get_field32
	mov	x2, x0
Lloh23:
	adrp	x8, _TX_PWR_CFG_7B_MCS7@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TX_PWR_CFG_7B_MCS7@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	add	x0, sp, #12
	bl	_rt2x00_set_field32
Lloh26:
	adrp	x8, _TX_PWR_CFG_7@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TX_PWR_CFG_7@GOTPAGEOFF]
Lloh28:
	ldr	x1, [x8]
	ldr	w2, [sp, #12]
	mov	x0, x21
	bl	_rt2800_register_write
	str	wzr, [sp, #12]
Lloh29:
	adrp	x8, _TX_PWR_CFG_3@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TX_PWR_CFG_3@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_rt2800_register_read
Lloh32:
	adrp	x8, _TX_PWR_CFG_3B_MCS14@GOTPAGE
Lloh33:
	ldr	x8, [x8, _TX_PWR_CFG_3B_MCS14@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	bl	_rt2x00_get_field32
	mov	x2, x0
Lloh35:
	adrp	x8, _TX_PWR_CFG_8B_MCS15@GOTPAGE
Lloh36:
	ldr	x8, [x8, _TX_PWR_CFG_8B_MCS15@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	add	x0, sp, #12
	bl	_rt2x00_set_field32
Lloh38:
	adrp	x8, _TX_PWR_CFG_8@GOTPAGE
Lloh39:
	ldr	x8, [x8, _TX_PWR_CFG_8@GOTPAGEOFF]
Lloh40:
	ldr	x1, [x8]
	ldr	w2, [sp, #12]
	mov	x0, x21
	bl	_rt2800_register_write
	str	wzr, [sp, #12]
Lloh41:
	adrp	x8, _TX_PWR_CFG_4@GOTPAGE
Lloh42:
	ldr	x8, [x8, _TX_PWR_CFG_4@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_rt2800_register_read
Lloh44:
	adrp	x8, _TX_PWR_CFG_4B_STBC_MCS6@GOTPAGE
Lloh45:
	ldr	x8, [x8, _TX_PWR_CFG_4B_STBC_MCS6@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	bl	_rt2x00_get_field32
	mov	x2, x0
Lloh47:
	adrp	x8, _TX_PWR_CFG_9B_STBC_MCS7@GOTPAGE
Lloh48:
	ldr	x8, [x8, _TX_PWR_CFG_9B_STBC_MCS7@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	add	x0, sp, #12
	bl	_rt2x00_set_field32
Lloh50:
	adrp	x8, _TX_PWR_CFG_9@GOTPAGE
Lloh51:
	ldr	x8, [x8, _TX_PWR_CFG_9@GOTPAGEOFF]
Lloh52:
	ldr	x1, [x8]
	ldr	w2, [sp, #12]
	mov	x0, x21
	bl	_rt2800_register_write
	mov	x0, x21
	ldr	x1, [sp]                        ; 8-byte Folded Reload
	ldr	w2, [sp, #8]                    ; 4-byte Folded Reload
	bl	_rt2800_config_alc
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ignoring EEPROM HT40 power delta: %d\n"

	.comm	_EEPROM_TXPOWER_BYRATE,4,2      ; @EEPROM_TXPOWER_BYRATE
	.comm	_CONFIG_CHANNEL_HT40,4,2        ; @CONFIG_CHANNEL_HT40
	.comm	_TX_PWR_CFG_0,8,3               ; @TX_PWR_CFG_0
	.comm	_TX_PWR_CFG_1,4,2               ; @TX_PWR_CFG_1
	.comm	_TX_PWR_CFG_1B_48MBS,4,2        ; @TX_PWR_CFG_1B_48MBS
	.comm	_TX_PWR_CFG_7B_54MBS,4,2        ; @TX_PWR_CFG_7B_54MBS
	.comm	_TX_PWR_CFG_2,4,2               ; @TX_PWR_CFG_2
	.comm	_TX_PWR_CFG_2B_MCS6_MCS7,4,2    ; @TX_PWR_CFG_2B_MCS6_MCS7
	.comm	_TX_PWR_CFG_7B_MCS7,4,2         ; @TX_PWR_CFG_7B_MCS7
	.comm	_TX_PWR_CFG_7,8,3               ; @TX_PWR_CFG_7
	.comm	_TX_PWR_CFG_3,4,2               ; @TX_PWR_CFG_3
	.comm	_TX_PWR_CFG_3B_MCS14,4,2        ; @TX_PWR_CFG_3B_MCS14
	.comm	_TX_PWR_CFG_8B_MCS15,4,2        ; @TX_PWR_CFG_8B_MCS15
	.comm	_TX_PWR_CFG_8,8,3               ; @TX_PWR_CFG_8
	.comm	_TX_PWR_CFG_4,4,2               ; @TX_PWR_CFG_4
	.comm	_TX_PWR_CFG_4B_STBC_MCS6,4,2    ; @TX_PWR_CFG_4B_STBC_MCS6
	.comm	_TX_PWR_CFG_9B_STBC_MCS7,4,2    ; @TX_PWR_CFG_9B_STBC_MCS7
	.comm	_TX_PWR_CFG_9,8,3               ; @TX_PWR_CFG_9
	.no_dead_strip	_rt2800_config_txpower_rt6352
.subsections_via_symbols
