	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar9003_mci_init_cal_req        ## -- Begin function ar9003_mci_init_cal_req
	.p2align	4, 0x90
_ar9003_mci_init_cal_req:               ## @ar9003_mci_init_cal_req
	.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	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_ath9k_hw_common
	movq	%rax, %r15
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -80(%rbp)
	movq	(%rbx), %rax
	movq	_MCI_BT_AWAKE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.1:
	movq	_ATH_MCI_CONFIG_DISABLE_MCI_CAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	jne	LBB0_6
## %bb.2:
	movq	_MCI_GPM_WLAN_CAL_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %r12
	movq	%r12, %rdi
	callq	_MCI_GPM_SET_CAL_TYPE
	movslq	12(%rbx), %rax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rbx)
	movq	_MCI_GPM_WLAN_CAL_W_SEQUENCE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, -80(%rbp,%rcx,8)
	movq	_MCI_GPM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$0, (%rsp)
	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_GRANT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	movl	$50000, %ecx                    ## imm = 0xC350
	callq	_ar9003_mci_wait_for_gpm
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_5
LBB0_4:
	movl	$0, (%r14)
	leaq	L_.str.1(%rip), %rdx
LBB0_5:
	movq	_MCI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ath_dbg
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MCI_BT_AWAKE,8,3               ## @MCI_BT_AWAKE
	.comm	_ATH_MCI_CONFIG_DISABLE_MCI_CAL,4,2 ## @ATH_MCI_CONFIG_DISABLE_MCI_CAL
	.comm	_MCI_GPM_WLAN_CAL_REQ,4,2       ## @MCI_GPM_WLAN_CAL_REQ
	.comm	_MCI_GPM_WLAN_CAL_W_SEQUENCE,8,3 ## @MCI_GPM_WLAN_CAL_W_SEQUENCE
	.comm	_MCI_GPM,4,2                    ## @MCI_GPM
	.comm	_MCI_GPM_BT_CAL_GRANT,4,2       ## @MCI_GPM_BT_CAL_GRANT
	.comm	_MCI,4,2                        ## @MCI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MCI BT_CAL_GRANT received\n"

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar9003_mci_init_cal_req        ; -- Begin function ar9003_mci_init_cal_req
	.p2align	2
_ar9003_mci_init_cal_req:               ; @ar9003_mci_init_cal_req
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_ath9k_hw_common
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	ldr	x8, [x21]
Lloh3:
	adrp	x9, _MCI_BT_AWAKE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MCI_BT_AWAKE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
	ldr	w8, [x21, #8]
Lloh6:
	adrp	x9, _ATH_MCI_CONFIG_DISABLE_MCI_CAL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ATH_MCI_CONFIG_DISABLE_MCI_CAL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.2:
	mov	x19, x0
Lloh9:
	adrp	x8, _MCI_GPM_WLAN_CAL_REQ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MCI_GPM_WLAN_CAL_REQ@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x22, sp
	mov	x0, sp
	bl	_MCI_GPM_SET_CAL_TYPE
	ldrsw	x8, [x21, #12]
	add	w9, w8, #1
	str	w9, [x21, #12]
Lloh12:
	adrp	x9, _MCI_GPM_WLAN_CAL_W_SEQUENCE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MCI_GPM_WLAN_CAL_W_SEQUENCE@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	str	x8, [x22, x9, lsl #3]
Lloh15:
	adrp	x8, _MCI_GPM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MCI_GPM@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x3, sp
	mov	x0, x21
	mov	w2, #0
	mov	w4, #16
	mov	w5, #1
	mov	w6, #0
	bl	_ar9003_mci_send_message
Lloh18:
	adrp	x8, _MCI_GPM_BT_CAL_GRANT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MCI_GPM_BT_CAL_GRANT@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	mov	w3, #50000
	bl	_ar9003_mci_wait_for_gpm
	cbz	x0, LBB0_4
; %bb.3:
Lloh21:
	adrp	x2, l_.str@PAGE
Lloh22:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_5
LBB0_4:
	str	wzr, [x20]
Lloh23:
	adrp	x2, l_.str.1@PAGE
Lloh24:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_5:
Lloh25:
	adrp	x8, _MCI@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MCI@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ath_dbg
LBB0_6:
	ldr	x8, [sp, #40]
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_8
; %bb.7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MCI_BT_AWAKE,8,3               ; @MCI_BT_AWAKE
	.comm	_ATH_MCI_CONFIG_DISABLE_MCI_CAL,4,2 ; @ATH_MCI_CONFIG_DISABLE_MCI_CAL
	.comm	_MCI_GPM_WLAN_CAL_REQ,4,2       ; @MCI_GPM_WLAN_CAL_REQ
	.comm	_MCI_GPM_WLAN_CAL_W_SEQUENCE,8,3 ; @MCI_GPM_WLAN_CAL_W_SEQUENCE
	.comm	_MCI_GPM,4,2                    ; @MCI_GPM
	.comm	_MCI_GPM_BT_CAL_GRANT,4,2       ; @MCI_GPM_BT_CAL_GRANT
	.comm	_MCI,4,2                        ; @MCI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MCI BT_CAL_GRANT received\n"

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

.subsections_via_symbols
