	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9003_get_training_power_2g
_ar9003_get_training_power_2g:          ## @ar9003_get_training_power_2g
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rsi
	callq	_ar9003_get_paprd_scale_factor
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_AR_SREV_9330
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movq	%rbx, %rdi
	callq	_AR_SREV_9340
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_AR_SREV_9462
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_AR_SREV_9565
	testq	%rax, %rax
	je	LBB0_5
LBB0_4:
	movl	(%rbx), %ecx
	addl	$2, %ecx
LBB0_9:
	movl	%ecx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	movq	%rbx, %rdi
	callq	_AR_SREV_9485
	movl	$25, %ecx
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:
	movq	_AR_PHY_POWERTX_RATE5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_PHY_POWERTX_RATE5_POWERTXHT20_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_REG_READ_FIELD
                                        ## kill: def $eax killed $eax def $rax
	movl	(%rbx), %ecx
	subl	%eax, %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovsl	%ecx, %edx
	movl	$-1, %ecx
	cmpl	%r14d, %edx
	ja	LBB0_9
## %bb.7:
	movl	%eax, %ecx
	cmpl	$3, %edx
	ja	LBB0_9
## %bb.8:
	leal	(%rax,%rdx), %ecx
	addl	$-4, %ecx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_AR_PHY_POWERTX_RATE5,4,2       ## @AR_PHY_POWERTX_RATE5
	.comm	_AR_PHY_POWERTX_RATE5_POWERTXHT20_0,4,2 ## @AR_PHY_POWERTX_RATE5_POWERTXHT20_0
	.no_dead_strip	_ar9003_get_training_power_2g
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9003_get_training_power_2g
_ar9003_get_training_power_2g:          ; @ar9003_get_training_power_2g
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x1, [x0, #8]
	bl	_ar9003_get_paprd_scale_factor
	mov	x20, x0
	mov	x0, x19
	bl	_AR_SREV_9330
	cbnz	x0, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_AR_SREV_9340
	cbnz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_AR_SREV_9462
	cbnz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_AR_SREV_9565
	cbz	x0, LBB0_6
LBB0_4:
	ldr	w8, [x19]
	add	w0, w8, #2
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x19
	bl	_AR_SREV_9485
	cbz	x0, LBB0_8
; %bb.7:
	mov	w0, #25
	b	LBB0_5
LBB0_8:
Lloh0:
	adrp	x8, _AR_PHY_POWERTX_RATE5@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR_PHY_POWERTX_RATE5@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _AR_PHY_POWERTX_RATE5_POWERTXHT20_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR_PHY_POWERTX_RATE5_POWERTXHT20_0@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_READ_FIELD
	ldr	w8, [x19]
	subs	w8, w8, w0
	cneg	w8, w8, mi
	cmp	w8, w20
	b.ls	LBB0_10
; %bb.9:
	mov	w0, #-1
	b	LBB0_5
LBB0_10:
	cmp	w8, #3
	b.hi	LBB0_5
; %bb.11:
	add	w8, w0, w8
	sub	w0, w8, #4
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AR_PHY_POWERTX_RATE5,4,2       ; @AR_PHY_POWERTX_RATE5
	.comm	_AR_PHY_POWERTX_RATE5_POWERTXHT20_0,4,2 ; @AR_PHY_POWERTX_RATE5_POWERTXHT20_0
	.no_dead_strip	_ar9003_get_training_power_2g
.subsections_via_symbols
