	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _rtl8821ae_phy_get_txpower_by_rate
__rtl8821ae_phy_get_txpower_by_rate:    ## @_rtl8821ae_phy_get_txpower_by_rate
	.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	%ecx, %ebx
	movl	%edx, %r15d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_rtl_priv
	movq	%rax, %r14
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	__rtl8821ae_phy_get_ratesection_intxpower_byrate
	leal	-149(%rbx), %ecx
	cmpl	$8, %ecx
	jae	LBB0_1
## %bb.2:
	movq	_RF_2TX@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movq	_RF_1TX@GOTPCREL(%rip), %rcx
LBB0_3:
	movl	(%rcx), %r12d
	leal	-128(%rbx), %r13d
	cmpl	$48, %r13d
	jae	LBB0_4
## %bb.5:
	movslq	%r13d, %rdx
	leaq	l_switch.table._rtl8821ae_phy_get_txpower_by_rate(%rip), %rcx
	movl	(%rcx,%rdx,4), %ecx
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %r14d
	movl	$1, %edi
	callq	_WARN_ONCE
	movl	%r14d, %eax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	xorl	%ecx, %ecx
LBB0_6:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	8(%r14), %rdi
	movslq	%esi, %rdx
	movq	(%rdi,%rdx,8), %rdi
	movslq	%r15d, %rdx
	movq	(%rdi,%rdx,8), %rdi
	movslq	%r12d, %rdx
	movq	(%rdi,%rdx,8), %rdi
	movslq	%eax, %rdx
	movl	(%rdi,%rdx,4), %eax
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	movzbl	%al, %r12d
	cmpl	$2, (%r14)
	je	LBB0_13
## %bb.7:
	movl	16(%r14), %r9d
	movl	20(%r14), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %ecx
	movl	%ebx, %r8d
	callq	__rtl8812ae_phy_get_txpower_limit
	cmpl	$11, %r13d
	ja	LBB0_11
## %bb.8:
	movl	$3075, %ecx                     ## imm = 0xC03
	btl	%r13d, %ecx
	jae	LBB0_11
## %bb.9:
	testl	%eax, %eax
	jns	LBB0_12
## %bb.10:
	movl	%eax, %ecx
	negl	%ecx
	cmpl	%ecx, %r12d
	cmovbel	%ecx, %r12d
	jmp	LBB0_12
LBB0_11:
	cmpl	%eax, %r12d
	cmovgel	%eax, %r12d
	testl	%eax, %eax
	cmovsl	%eax, %r12d
LBB0_12:
	movq	_COMP_POWER_TRACKING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_DBG_LOUD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	L_.str.1(%rip), %rcx
	movq	%r14, %rdi
	movl	%eax, %r8d
	movl	%r12d, %r9d
	callq	_RT_TRACE
LBB0_13:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RF_TX_NUM_NONIMPLEMENT,4,2     ## @RF_TX_NUM_NONIMPLEMENT
	.comm	_RF_2TX,4,2                     ## @RF_2TX
	.comm	_RF_1TX,4,2                     ## @RF_1TX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rtl8821ae: Rate_Section is Illegal\n"

	.comm	_COMP_POWER_TRACKING,4,2        ## @COMP_POWER_TRACKING
	.comm	_DBG_LOUD,4,2                   ## @DBG_LOUD
L_.str.1:                               ## @.str.1
	.asciz	"Maximum power by rate %d, final power by rate %d\n"

	.no_dead_strip	__rtl8821ae_phy_get_txpower_by_rate
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table._rtl8821ae_phy_get_txpower_by_rate
l_switch.table._rtl8821ae_phy_get_txpower_by_rate:
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	16                              ## 0x10
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	8                               ## 0x8
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	24                              ## 0x18
	.long	16                              ## 0x10
	.long	24                              ## 0x18

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _rtl8821ae_phy_get_txpower_by_rate
__rtl8821ae_phy_get_txpower_by_rate:    ; @_rtl8821ae_phy_get_txpower_by_rate
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x21, x2
	mov	x23, x1
	mov	x24, x0
	bl	_rtl_priv
	mov	x19, x0
	mov	x0, x21
	mov	x1, x20
	bl	__rtl8821ae_phy_get_ratesection_intxpower_byrate
	mov	x22, x0
Lloh0:
	adrp	x8, _RF_2TX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RF_2TX@GOTPAGEOFF]
Lloh2:
	adrp	x9, _RF_1TX@GOTPAGE
Lloh3:
	ldr	x9, [x9, _RF_1TX@GOTPAGEOFF]
	sub	w10, w20, #149
	cmp	w10, #8
	csel	x8, x8, x9, lo
	ldr	w26, [x8]
	sub	w25, w20, #128
	cmp	w25, #48
	b.hs	LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, l_switch.table._rtl8821ae_phy_get_txpower_by_rate@PAGE
Lloh5:
	add	x8, x8, l_switch.table._rtl8821ae_phy_get_txpower_by_rate@PAGEOFF
	ldr	w8, [x8, w25, sxtw #2]
	b	LBB0_3
LBB0_2:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_WARN_ONCE
	mov	w8, #0
LBB0_3:
	ldr	x9, [x19, #8]
	ldr	x9, [x9, w23, sxtw #3]
	ldr	x9, [x9, w21, sxtw #3]
	ldr	x9, [x9, w26, sxtw #3]
	ldr	w9, [x9, w22, sxtw #2]
	asr	w8, w9, w8
	and	w22, w8, #0xff
	ldr	w8, [x19]
	cmp	w8, #2
	b.eq	LBB0_9
; %bb.4:
	ldp	w5, w2, [x19, #16]
	mov	x0, x24
	mov	x1, x23
	mov	x3, x21
	mov	x4, x20
	bl	__rtl8812ae_phy_get_txpower_limit
	mov	x4, x0
	cmp	w25, #11
	b.hi	LBB0_7
; %bb.5:
	mov	w8, #1
	lsl	w8, w8, w25
	mov	w9, #3075
	tst	w8, w9
	b.eq	LBB0_7
; %bb.6:
	neg	w8, w4
	cmp	w22, w8
	csneg	w8, w22, w4, hi
	tst	w4, #0x80000000
	csel	w22, w22, w8, eq
	b	LBB0_8
LBB0_7:
	cmp	w22, w4
	csel	w8, w22, w4, lt
	cmp	w4, #0
	csel	w22, w4, w8, lt
LBB0_8:
Lloh8:
	adrp	x8, _COMP_POWER_TRACKING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _COMP_POWER_TRACKING@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _DBG_LOUD@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DBG_LOUD@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x3, l_.str.1@PAGE
Lloh15:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x5, x22
	bl	_RT_TRACE
LBB0_9:
	mov	x0, x22
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_RF_TX_NUM_NONIMPLEMENT,4,2     ; @RF_TX_NUM_NONIMPLEMENT
	.comm	_RF_2TX,4,2                     ; @RF_2TX
	.comm	_RF_1TX,4,2                     ; @RF_1TX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rtl8821ae: Rate_Section is Illegal\n"

	.comm	_COMP_POWER_TRACKING,4,2        ; @COMP_POWER_TRACKING
	.comm	_DBG_LOUD,4,2                   ; @DBG_LOUD
l_.str.1:                               ; @.str.1
	.asciz	"Maximum power by rate %d, final power by rate %d\n"

	.no_dead_strip	__rtl8821ae_phy_get_txpower_by_rate
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table._rtl8821ae_phy_get_txpower_by_rate
l_switch.table._rtl8821ae_phy_get_txpower_by_rate:
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	16                              ; 0x10
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	8                               ; 0x8
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	24                              ; 0x18
	.long	16                              ; 0x10
	.long	24                              ; 0x18

.subsections_via_symbols
