	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath5k_hw_phy_calibrate         ## -- Begin function ath5k_hw_phy_calibrate
	.p2align	4, 0x90
_ath5k_hw_phy_calibrate:                ## @ath5k_hw_phy_calibrate
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_AR5K_RF5110@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.11:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_ath5k_hw_rf5110_calibrate      ## TAILCALL
LBB0_1:
	movq	%rbx, %rdi
	callq	_ath5k_hw_rf511x_iq_calibrate
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movq	_ATH5K_DEBUG_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r14), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_ATH5K_DBG_UNLIMIT
LBB0_3:
	movl	8(%rbx), %eax
	movq	_AR5K_CALIBRATION_FULL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.4:
	movq	(%rbx), %rcx
	movq	_AR5K_RF5111@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_6
## %bb.5:
	movq	_AR5K_RF5112@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_8
LBB0_6:
	movq	(%r14), %rcx
	movq	_AR5K_MODE_11B@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_ath5k_hw_request_rfgain_probe
	movl	8(%rbx), %eax
LBB0_8:
	movq	_AR5K_CALIBRATION_NF@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_ath5k_hw_update_noise_floor
LBB0_10:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR5K_RF5110,8,3                ## @AR5K_RF5110
	.comm	_ATH5K_DEBUG_CALIBRATE,4,2      ## @ATH5K_DEBUG_CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No I/Q correction performed (%uMHz)\n"

	.comm	_AR5K_CALIBRATION_FULL,4,2      ## @AR5K_CALIBRATION_FULL
	.comm	_AR5K_RF5111,8,3                ## @AR5K_RF5111
	.comm	_AR5K_RF5112,8,3                ## @AR5K_RF5112
	.comm	_AR5K_MODE_11B,8,3              ## @AR5K_MODE_11B
	.comm	_AR5K_CALIBRATION_NF,4,2        ## @AR5K_CALIBRATION_NF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath5k_hw_phy_calibrate         ; -- Begin function ath5k_hw_phy_calibrate
	.p2align	2
_ath5k_hw_phy_calibrate:                ; @ath5k_hw_phy_calibrate
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _AR5K_RF5110@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AR5K_RF5110@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ath5k_hw_rf5110_calibrate
LBB0_2:
	mov	x0, x19
	bl	_ath5k_hw_rf511x_iq_calibrate
	cbz	w0, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _ATH5K_DEBUG_CALIBRATE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATH5K_DEBUG_CALIBRATE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w3, [x20, #8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ATH5K_DBG_UNLIMIT
LBB0_4:
	ldr	w8, [x19, #8]
Lloh8:
	adrp	x9, _AR5K_CALIBRATION_FULL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _AR5K_CALIBRATION_FULL@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.5:
	ldr	x9, [x19]
Lloh11:
	adrp	x10, _AR5K_RF5111@GOTPAGE
Lloh12:
	ldr	x10, [x10, _AR5K_RF5111@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
Lloh14:
	adrp	x11, _AR5K_RF5112@GOTPAGE
Lloh15:
	ldr	x11, [x11, _AR5K_RF5112@GOTPAGEOFF]
Lloh16:
	ldr	x11, [x11]
	cmp	x9, x10
	ccmp	x9, x11, #4, ne
	b.ne	LBB0_8
; %bb.6:
	ldr	x9, [x20]
Lloh17:
	adrp	x10, _AR5K_MODE_11B@GOTPAGE
Lloh18:
	ldr	x10, [x10, _AR5K_MODE_11B@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_ath5k_hw_request_rfgain_probe
	ldr	w8, [x19, #8]
LBB0_8:
Lloh20:
	adrp	x9, _AR5K_CALIBRATION_NF@GOTPAGE
Lloh21:
	ldr	x9, [x9, _AR5K_CALIBRATION_NF@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_ath5k_hw_update_noise_floor
LBB0_10:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_AR5K_RF5110,8,3                ; @AR5K_RF5110
	.comm	_ATH5K_DEBUG_CALIBRATE,4,2      ; @ATH5K_DEBUG_CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No I/Q correction performed (%uMHz)\n"

	.comm	_AR5K_CALIBRATION_FULL,4,2      ; @AR5K_CALIBRATION_FULL
	.comm	_AR5K_RF5111,8,3                ; @AR5K_RF5111
	.comm	_AR5K_RF5112,8,3                ; @AR5K_RF5112
	.comm	_AR5K_MODE_11B,8,3              ; @AR5K_MODE_11B
	.comm	_AR5K_CALIBRATION_NF,4,2        ; @AR5K_CALIBRATION_NF
.subsections_via_symbols
