	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_ar9003_agc_cal
_do_ar9003_agc_cal:                     ## @do_ar9003_agc_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	%rdi, %rbx
	callq	_ath9k_hw_common
	movq	%rax, %r14
	movq	_AR_PHY_AGC_CONTROL@GOTPCREL(%rip), %r12
	movl	(%r12), %r15d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_REG_READ
	movq	_AR_PHY_AGC_CONTROL_CAL@GOTPCREL(%rip), %r13
	orl	(%r13), %eax
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_REG_WRITE
	movl	(%r12), %esi
	movl	(%r13), %edx
	movq	_AH_WAIT_TIMEOUT@GOTPCREL(%rip), %r15
	movl	(%r15), %r8d
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_ath9k_hw_wait
	movl	%eax, %ecx
	movl	$1, %eax
	testl	%ecx, %ecx
	jne	LBB0_2
## %bb.1:
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	(%r15), %rax
	imulq	$274877907, %rax, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$38, %rcx
	addl	%eax, %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_ath_dbg
	xorl	%eax, %eax
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR_PHY_AGC_CONTROL,4,2         ## @AR_PHY_AGC_CONTROL
	.comm	_AR_PHY_AGC_CONTROL_CAL,4,2     ## @AR_PHY_AGC_CONTROL_CAL
	.comm	_AH_WAIT_TIMEOUT,4,2            ## @AH_WAIT_TIMEOUT
	.comm	_CALIBRATE,4,2                  ## @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"offset calibration failed to complete in %d ms,noisy environment?\n"

	.no_dead_strip	_do_ar9003_agc_cal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_ar9003_agc_cal
_do_ar9003_agc_cal:                     ; @do_ar9003_agc_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, x0
	bl	_ath9k_hw_common
	mov	x19, x0
Lloh0:
	adrp	x22, _AR_PHY_AGC_CONTROL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AR_PHY_AGC_CONTROL@GOTPAGEOFF]
	ldr	w21, [x22]
	mov	x0, x20
	mov	x1, x21
	bl	_REG_READ
Lloh2:
	adrp	x23, _AR_PHY_AGC_CONTROL_CAL@GOTPAGE
Lloh3:
	ldr	x23, [x23, _AR_PHY_AGC_CONTROL_CAL@GOTPAGEOFF]
	ldr	w8, [x23]
	orr	w2, w8, w0
	mov	x0, x20
	mov	x1, x21
	bl	_REG_WRITE
	ldr	w1, [x22]
	ldr	w2, [x23]
Lloh4:
	adrp	x21, _AH_WAIT_TIMEOUT@GOTPAGE
Lloh5:
	ldr	x21, [x21, _AH_WAIT_TIMEOUT@GOTPAGEOFF]
	ldr	w4, [x21]
	mov	x0, x20
	mov	w3, #0
	bl	_ath9k_hw_wait
	cbz	w0, LBB0_2
; %bb.1:
	mov	w0, #1
	b	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _CALIBRATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CALIBRATE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldrsw	x8, [x21]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w3, w8, w9
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ath_dbg
	mov	w0, #0
LBB0_3:
	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	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AR_PHY_AGC_CONTROL,4,2         ; @AR_PHY_AGC_CONTROL
	.comm	_AR_PHY_AGC_CONTROL_CAL,4,2     ; @AR_PHY_AGC_CONTROL_CAL
	.comm	_AH_WAIT_TIMEOUT,4,2            ; @AH_WAIT_TIMEOUT
	.comm	_CALIBRATE,4,2                  ; @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"offset calibration failed to complete in %d ms,noisy environment?\n"

	.no_dead_strip	_do_ar9003_agc_cal
.subsections_via_symbols
