	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9003_hw_do_pcoem_manual_peak_cal
_ar9003_hw_do_pcoem_manual_peak_cal:    ## @ar9003_hw_do_pcoem_manual_peak_cal
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movq	_ATH9K_HW_CAP_RTT@GOTPCREL(%rip), %rax
	testl	%edx, %edx
	jne	LBB0_2
## %bb.1:
	movl	(%rax), %eax
	andl	4(%r15), %eax
	jne	LBB0_13
LBB0_2:
	movq	_AR9300_MAX_CHAINS@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	cmpl	%eax, %ebx
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %ecx
	btl	%ebx, %ecx
	jae	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_IS_CHAN_2GHZ
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%rax, %rdx
	callq	_ar9003_hw_manual_peak_cal
	movl	(%r13), %eax
	jmp	LBB0_6
LBB0_7:
	testq	%r12, %r12
	movq	_ATH9K_HW_CAP_RTT@GOTPCREL(%rip), %rbx
	je	LBB0_13
## %bb.8:
	movq	_SW_PKDET_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%r12), %rsi
	callq	_set_bit
	movl	(%rbx), %eax
	testl	%eax, 4(%r15)
	je	LBB0_13
## %bb.9:
	movq	%r14, %rdi
	callq	_IS_CHAN_2GHZ
	movq	%rax, %rbx
	xorl	%edi, %edi
	callq	_AR_PHY_65NM_RXRF_AGC
	testq	%rbx, %rbx
	jne	LBB0_10
## %bb.11:
	movq	_AR_PHY_65NM_RXRF_AGC_AGC5G_CALDAC_OVR@GOTPCREL(%rip), %rbx
	jmp	LBB0_12
LBB0_10:
	movq	_AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR@GOTPCREL(%rip), %rbx
LBB0_12:
	movl	(%rbx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_REG_READ_FIELD
	movq	(%r12), %rcx
	movq	%rax, (%rcx)
	movl	$1, %edi
	callq	_AR_PHY_65NM_RXRF_AGC
	movl	(%rbx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_REG_READ_FIELD
	movq	(%r12), %rcx
	movq	%rax, 8(%rcx)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH9K_HW_CAP_RTT,4,2           ## @ATH9K_HW_CAP_RTT
	.comm	_AR9300_MAX_CHAINS,4,2          ## @AR9300_MAX_CHAINS
	.comm	_SW_PKDET_DONE,4,2              ## @SW_PKDET_DONE
	.comm	_AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR,4,2 ## @AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR
	.comm	_AR_PHY_65NM_RXRF_AGC_AGC5G_CALDAC_OVR,4,2 ## @AR_PHY_65NM_RXRF_AGC_AGC5G_CALDAC_OVR
	.no_dead_strip	_ar9003_hw_do_pcoem_manual_peak_cal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9003_hw_do_pcoem_manual_peak_cal
_ar9003_hw_do_pcoem_manual_peak_cal:    ; @ar9003_hw_do_pcoem_manual_peak_cal
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
Lloh0:
	adrp	x23, _ATH9K_HW_CAP_RTT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _ATH9K_HW_CAP_RTT@GOTPAGEOFF]
	cbnz	w2, LBB0_2
; %bb.1:
	ldr	w8, [x19, #4]
	ldr	w9, [x23]
	and	w8, w9, w8
	cbnz	w8, LBB0_10
LBB0_2:
Lloh2:
	adrp	x24, _AR9300_MAX_CHAINS@GOTPAGE
Lloh3:
	ldr	x24, [x24, _AR9300_MAX_CHAINS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	w21, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w21, #1
	cmp	w21, w8
	b.ge	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x19]
	lsr	w9, w9, w21
	tbz	w9, #0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_IS_CHAN_2GHZ
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_ar9003_hw_manual_peak_cal
	ldr	w8, [x24]
	b	LBB0_4
LBB0_7:
	cbz	x22, LBB0_10
; %bb.8:
Lloh4:
	adrp	x8, _SW_PKDET_DONE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SW_PKDET_DONE@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	add	x1, x22, #8
	bl	_set_bit
	ldr	w8, [x19, #4]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_IS_CHAN_2GHZ
	mov	x20, x0
	mov	w0, #0
	bl	_AR_PHY_65NM_RXRF_AGC
	mov	x1, x0
Lloh7:
	adrp	x8, _AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR@GOTPAGEOFF]
Lloh9:
	adrp	x9, _AR_PHY_65NM_RXRF_AGC_AGC5G_CALDAC_OVR@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AR_PHY_65NM_RXRF_AGC_AGC5G_CALDAC_OVR@GOTPAGEOFF]
	cmp	x20, #0
	csel	x20, x9, x8, eq
	ldr	w2, [x20]
	mov	x0, x19
	bl	_REG_READ_FIELD
	ldr	x8, [x22]
	str	x0, [x8]
	mov	w0, #1
	bl	_AR_PHY_65NM_RXRF_AGC
	mov	x1, x0
	ldr	w2, [x20]
	mov	x0, x19
	bl	_REG_READ_FIELD
	ldr	x8, [x22]
	str	x0, [x8, #8]
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH9K_HW_CAP_RTT,4,2           ; @ATH9K_HW_CAP_RTT
	.comm	_AR9300_MAX_CHAINS,4,2          ; @AR9300_MAX_CHAINS
	.comm	_SW_PKDET_DONE,4,2              ; @SW_PKDET_DONE
	.comm	_AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR,4,2 ; @AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR
	.comm	_AR_PHY_65NM_RXRF_AGC_AGC5G_CALDAC_OVR,4,2 ; @AR_PHY_65NM_RXRF_AGC_AGC5G_CALDAC_OVR
	.no_dead_strip	_ar9003_hw_do_pcoem_manual_peak_cal
.subsections_via_symbols
