	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar9003_mci_start_reset         ## -- Begin function ar9003_mci_start_reset
	.p2align	4, 0x90
_ar9003_mci_start_reset:                ## @ar9003_mci_start_reset
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_ath9k_hw_common
	movq	%rax, %r14
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movq	%r15, %rdi
	callq	_IS_CHAN_2GHZ
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_ar9003_mci_2g5g_changed
	movq	(%rbx), %rax
	movq	_MCI_BT_CAL_START@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_MCI_BT_CAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	%rbx, %rdi
	callq	_ar9003_mci_disable_interrupt
	movq	_MCI_GPM_WLAN_CAL_GRANT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %r12
	movq	%r12, %rdi
	callq	_MCI_GPM_SET_CAL_TYPE
	movq	_MCI_GPM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$0, (%rsp)
	movl	$1, %r15d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	movq	%r12, %rcx
	movl	$16, %r8d
	movl	$1, %r9d
	callq	_ar9003_mci_send_message
	movq	_MCI_GPM_BT_CAL_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	movl	$25000, %ecx                    ## imm = 0x61A8
	callq	_ar9003_mci_wait_for_gpm
	testq	%rax, %rax
	movq	_MCI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rdx
	cmoveq	%rax, %rdx
	movq	%r14, %rdi
	callq	_ath_dbg
	movq	_MCI_BT_AWAKE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	%rbx, %rdi
	callq	_ar9003_mci_enable_interrupt
LBB0_2:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_4
## %bb.3:
	movl	%r15d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MCI_BT_CAL_START,8,3           ## @MCI_BT_CAL_START
	.comm	_MCI_BT_CAL,8,3                 ## @MCI_BT_CAL
	.comm	_MCI_GPM_WLAN_CAL_GRANT,4,2     ## @MCI_GPM_WLAN_CAL_GRANT
	.comm	_MCI_GPM,4,2                    ## @MCI_GPM
	.comm	_MCI_GPM_BT_CAL_DONE,4,2        ## @MCI_GPM_BT_CAL_DONE
	.comm	_MCI,4,2                        ## @MCI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MCI BT_CAL_DONE received\n"

L_.str.1:                               ## @.str.1
	.asciz	"MCI BT_CAL_DONE not received\n"

	.comm	_MCI_BT_AWAKE,8,3               ## @MCI_BT_AWAKE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar9003_mci_start_reset         ; -- Begin function ar9003_mci_start_reset
	.p2align	2
_ar9003_mci_start_reset:                ; @ar9003_mci_start_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_ath9k_hw_common
	mov	x20, x0
	stp	xzr, xzr, [sp, #8]
	mov	x0, x21
	bl	_IS_CHAN_2GHZ
	mov	x1, x0
	mov	x0, x19
	bl	_ar9003_mci_2g5g_changed
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _MCI_BT_CAL_START@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MCI_BT_CAL_START@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _MCI_BT_CAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MCI_BT_CAL@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x19
	bl	_ar9003_mci_disable_interrupt
Lloh9:
	adrp	x8, _MCI_GPM_WLAN_CAL_GRANT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MCI_GPM_WLAN_CAL_GRANT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_MCI_GPM_SET_CAL_TYPE
Lloh12:
	adrp	x8, _MCI_GPM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MCI_GPM@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w21, #1
	add	x3, sp, #8
	mov	x0, x19
	mov	w2, #0
	mov	w4, #16
	mov	w5, #1
	mov	w6, #0
	bl	_ar9003_mci_send_message
Lloh15:
	adrp	x8, _MCI_GPM_BT_CAL_DONE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MCI_GPM_BT_CAL_DONE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #25000
	bl	_ar9003_mci_wait_for_gpm
Lloh18:
	adrp	x8, _MCI@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MCI@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, l_.str@PAGE
Lloh22:
	add	x8, x8, l_.str@PAGEOFF
Lloh23:
	adrp	x9, l_.str.1@PAGE
Lloh24:
	add	x9, x9, l_.str.1@PAGEOFF
	cmp	x0, #0
	csel	x2, x9, x8, eq
	mov	x0, x20
	bl	_ath_dbg
Lloh25:
	adrp	x8, _MCI_BT_AWAKE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MCI_BT_AWAKE@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x19
	bl	_ar9003_mci_enable_interrupt
	b	LBB0_3
LBB0_2:
	mov	w21, #0
LBB0_3:
	ldr	x8, [sp, #24]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MCI_BT_CAL_START,8,3           ; @MCI_BT_CAL_START
	.comm	_MCI_BT_CAL,8,3                 ; @MCI_BT_CAL
	.comm	_MCI_GPM_WLAN_CAL_GRANT,4,2     ; @MCI_GPM_WLAN_CAL_GRANT
	.comm	_MCI_GPM,4,2                    ; @MCI_GPM
	.comm	_MCI_GPM_BT_CAL_DONE,4,2        ; @MCI_GPM_BT_CAL_DONE
	.comm	_MCI,4,2                        ; @MCI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MCI BT_CAL_DONE received\n"

l_.str.1:                               ; @.str.1
	.asciz	"MCI BT_CAL_DONE not received\n"

	.comm	_MCI_BT_AWAKE,8,3               ; @MCI_BT_AWAKE
.subsections_via_symbols
