	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9003_hw_patch_rtt
_ar9003_hw_patch_rtt:                   ## @ar9003_hw_patch_rtt
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	_SW_PKDET_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rsi
	addq	$16, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_5
## %bb.1:
	cmpl	$5, %ebx
	jne	LBB0_5
## %bb.2:
	cmpl	$1, %r14d
	jg	LBB0_5
## %bb.3:
	movl	%r14d, %edi
	callq	_AR_PHY_65NM_RXRF_AGC
	movq	_AR_PHY_65NM_RXRF_AGC_AGC_OVERRIDE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_REG_READ_FIELD
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	(%r15), %rax
	movslq	%r14d, %rcx
	movq	(%rax), %rdx
	movq	8(%rax), %rax
	movq	(%rax,%rcx,8), %rax
	movl	$-64001, %esi                   ## imm = 0xFFFF05FF
	andl	20(%rax), %esi
	movl	(%rdx,%rcx,4), %ecx
	movl	%ecx, %edx
	andl	$32, %edx
	andl	$31, %ecx
	shll	$7, %ecx
	orl	%edx, %ecx
	shll	$4, %ecx
	orl	%esi, %ecx
	movl	%ecx, 20(%rax)
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SW_PKDET_DONE,4,2              ## @SW_PKDET_DONE
	.comm	_AR_PHY_65NM_RXRF_AGC_AGC_OVERRIDE,4,2 ## @AR_PHY_65NM_RXRF_AGC_AGC_OVERRIDE
	.no_dead_strip	_ar9003_hw_patch_rtt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9003_hw_patch_rtt
_ar9003_hw_patch_rtt:                   ; @ar9003_hw_patch_rtt
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _SW_PKDET_DONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SW_PKDET_DONE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	x8, [x20]
	add	x1, x8, #16
	bl	_test_bit
	cmp	w0, #0
	ccmp	w21, #5, #0, ne
	ccmp	w19, #1, #0, eq
	b.gt	LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_AR_PHY_65NM_RXRF_AGC
	mov	x1, x0
Lloh3:
	adrp	x8, _AR_PHY_65NM_RXRF_AGC_AGC_OVERRIDE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR_PHY_65NM_RXRF_AGC_AGC_OVERRIDE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_REG_READ_FIELD
	cbz	w0, LBB0_3
; %bb.2:
	ldr	x8, [x20]
	ldp	x9, x8, [x8]
	ldr	w9, [x9, w19, sxtw #2]
	ldr	x8, [x8, w19, sxtw #3]
	ldr	w10, [x8, #20]
	mov	w11, #-64001
	and	w10, w10, w11
	and	w11, w9, #0x20
	bfi	w11, w9, #7, #5
	orr	w9, w10, w11, lsl #4
	str	w9, [x8, #20]
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SW_PKDET_DONE,4,2              ; @SW_PKDET_DONE
	.comm	_AR_PHY_65NM_RXRF_AGC_AGC_OVERRIDE,4,2 ; @AR_PHY_65NM_RXRF_AGC_AGC_OVERRIDE
	.no_dead_strip	_ar9003_hw_patch_rtt
.subsections_via_symbols
